Browse Source

feat:项目亮点

wrj 1 year ago
parent
commit
d7c6e91d05

+ 1 - 7
README.md

@@ -2,7 +2,7 @@
 
 ## 平台简介
 
-若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
+夜来香
 
 
 ## 内置功能
@@ -26,13 +26,7 @@
 17. 在线构建器:拖动表单元素生成相应的HTML代码。
 18. 连接池监视:监视当前系统数据库连接池状态,可进行分析SQL找出系统性能瓶颈。
 
-## 在线体验
 
-- admin/admin123  
-- 陆陆续续收到一些打赏,为了更好的体验已用于演示服务器升级。谢谢各位小伙伴。
-
-演示地址:http://vue.ruoyi.vip  
-文档地址:http://doc.ruoyi.vip
 
 ## 演示图
 

+ 15 - 18
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/TJsController.java

@@ -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("系统异常");
+        }
+
     }
 
     /**

+ 1 - 1
nightFragrance-admin/src/main/resources/application-dev.yml

@@ -122,7 +122,7 @@ spring:
   devtools:
     restart:
       # 热部署开关
-      enabled: true
+      enabled: false
   # redis 配置
   redis:
     # 地址

+ 2 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/TJsService.java

@@ -12,4 +12,6 @@ import java.util.List;
  */
 public interface TJsService extends IService<TJs> {
     public List<TJs> getAll(TJsVo param);
+
+    boolean addJs(TJs js);
 }

+ 31 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/TJsServiceImpl.java

@@ -2,14 +2,19 @@ package com.ylx.massage.service.impl;
 
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ylx.common.constant.MassageConstants;
+import com.ylx.common.exception.ServiceException;
+import com.ylx.common.utils.StringUtils;
 import com.ylx.massage.domain.TJs;
 import com.ylx.massage.domain.vo.TJsVo;
+import com.ylx.massage.enums.JsStatusEnum;
 import com.ylx.massage.mapper.TJsMapper;
 import com.ylx.massage.service.TJsService;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -24,4 +29,30 @@ public class TJsServiceImpl extends ServiceImpl<TJsMapper, TJs> implements TJsSe
     public List<TJs> getAll(TJsVo param) {
         return mapper.getAll(param);
     }
+
+    @Override
+    public boolean addJs(TJs js) {
+
+        if(StringUtils.isBlank(js.getcPhone())){
+            throw new ServiceException("手机号不能为空");
+        }
+
+        // 评分默认最高
+        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 this.save(js);
+    }
 }