|
@@ -3,12 +3,15 @@ package com.ylx.web.controller.massage;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ylx.common.constant.MassageConstants;
|
|
|
+import com.ylx.common.core.domain.R;
|
|
|
+import com.ylx.common.exception.ServiceException;
|
|
|
import com.ylx.massage.domain.TJs;
|
|
|
import com.ylx.massage.domain.vo.TJsVo;
|
|
|
import com.ylx.massage.enums.JsStatusEnum;
|
|
|
import com.ylx.massage.service.TJsService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -29,6 +32,7 @@ import java.util.List;
|
|
|
@RestController
|
|
|
@RequestMapping("api/js/v1")
|
|
|
@Api(tags = {"技师管理"})
|
|
|
+@Slf4j
|
|
|
public class TJsController {
|
|
|
@Resource
|
|
|
private TJsService jsService;
|
|
@@ -41,24 +45,17 @@ public class TJsController {
|
|
|
*/
|
|
|
@RequestMapping(value = "wx/add", method = RequestMethod.POST)
|
|
|
@ApiOperation("添加技师申请")
|
|
|
- public Boolean add(@RequestBody TJs js) {
|
|
|
- // 评分默认最高
|
|
|
- js.setnStar(MassageConstants.INTEGER_FIVE);
|
|
|
- // 已服务数量 0
|
|
|
- js.setnNum(MassageConstants.INTEGER_ZERO);
|
|
|
- // 佣金比例 10
|
|
|
- js.setnBili(MassageConstants.INTEGER_TEN);
|
|
|
- // 服务状态
|
|
|
- js.setnStatus(JsStatusEnum.JS_SERVICEABLE.getCode());
|
|
|
- // 上岗状态
|
|
|
- js.setnStatus2(JsStatusEnum.POST_NOT_ON_DUTY.getCode());
|
|
|
- // 审核状态
|
|
|
- js.setnTong(JsStatusEnum.JS_NOT_PASS.getCode());
|
|
|
- js.setnB1(MassageConstants.INTEGER_ZERO);
|
|
|
- js.setnB2(MassageConstants.INTEGER_ZERO);
|
|
|
- js.setnB3(MassageConstants.INTEGER_ZERO);
|
|
|
- js.setDtCreateTime(LocalDateTime.now());
|
|
|
- return jsService.save(js);
|
|
|
+ public R add(@RequestBody TJs js) {
|
|
|
+ try {
|
|
|
+ return R.ok(jsService.addJs(js));
|
|
|
+ } catch (ServiceException s) {
|
|
|
+ log.error(s.toString());
|
|
|
+ return R.fail(s.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.toString());
|
|
|
+ return R.fail("系统异常");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|