Browse Source

model结构调整

chao 4 years ago
parent
commit
40c605da41
22 changed files with 439 additions and 369 deletions
  1. 5 5
      src/main/java/com/caimei365/user/components/WeChatService.java
  2. 1 1
      src/main/java/com/caimei365/user/controller/AllApi.txt
  3. 3 3
      src/main/java/com/caimei365/user/controller/BaseApi.java
  4. 5 5
      src/main/java/com/caimei365/user/controller/LoginApi.java
  5. 13 13
      src/main/java/com/caimei365/user/controller/RegisterApi.java
  6. 42 42
      src/main/java/com/caimei365/user/controller/ShopApi.java
  7. 0 77
      src/main/java/com/caimei365/user/model/BaseUser.java
  8. 51 4
      src/main/java/com/caimei365/user/model/ClubPo.java
  9. 0 81
      src/main/java/com/caimei365/user/model/JsonModel.java
  10. 52 3
      src/main/java/com/caimei365/user/model/OperationPo.java
  11. 81 0
      src/main/java/com/caimei365/user/model/ResponseJsonVo.java
  12. 16 4
      src/main/java/com/caimei365/user/model/ShopPo.java
  13. 54 12
      src/main/java/com/caimei365/user/model/UserPo.java
  14. 3 3
      src/main/java/com/caimei365/user/service/BaseService.java
  15. 5 5
      src/main/java/com/caimei365/user/service/LoginService.java
  16. 3 3
      src/main/java/com/caimei365/user/service/RegisterService.java
  17. 3 3
      src/main/java/com/caimei365/user/service/ShopService.java
  18. 13 13
      src/main/java/com/caimei365/user/service/impl/BaseServiceImpl.java
  19. 26 27
      src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java
  20. 8 9
      src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java
  21. 24 25
      src/main/java/com/caimei365/user/service/impl/ShopServiceImpl.java
  22. 31 31
      src/main/java/com/caimei365/user/utils/ValidateUtil.java

+ 5 - 5
src/main/java/com/caimei365/user/components/WeChatService.java

@@ -2,7 +2,7 @@ package com.caimei365.user.components;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.utils.RequestUtil;
 import com.caimei365.user.utils.RequestUtil;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.binary.Base64;
@@ -147,7 +147,7 @@ public class WeChatService {
      * @param serverWebExchange ServerWebExchange
      * @param serverWebExchange ServerWebExchange
      * @return HashMap
      * @return HashMap
      */
      */
-    public JsonModel<Map<String, Object>> getInfoMapByApplets(String code, ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo<Map<String, Object>> getInfoMapByApplets(String code, ServerWebExchange serverWebExchange) {
         log.info("Start get SessionKey");
         log.info("Start get SessionKey");
         Map<String, Object> returnMap = new HashMap<>(4);
         Map<String, Object> returnMap = new HashMap<>(4);
         // 获取当前微信小程序的环境
         // 获取当前微信小程序的环境
@@ -172,7 +172,7 @@ public class WeChatService {
         try {
         try {
             infos = RequestUtil.sendPost(requestUrl, requestUrlParam);
             infos = RequestUtil.sendPost(requestUrl, requestUrlParam);
         } catch (Exception e) {
         } catch (Exception e) {
-            return JsonModel.error("服务器内部异常", returnMap);
+            return ResponseJsonVo.error("服务器内部异常", returnMap);
         }
         }
         // 解析相应内容(转换成json对象)
         // 解析相应内容(转换成json对象)
         JSONObject jsonObject = JSON.parseObject(infos);
         JSONObject jsonObject = JSON.parseObject(infos);
@@ -187,9 +187,9 @@ public class WeChatService {
         returnMap.put("sessionKey", sessionKey);
         returnMap.put("sessionKey", sessionKey);
         boolean errFlag = StringUtils.isNotEmpty(errCode) && ("-1".equals(errCode) || "40029".equals(errCode) || "45011".equals(errCode));
         boolean errFlag = StringUtils.isNotEmpty(errCode) && ("-1".equals(errCode) || "40029".equals(errCode) || "45011".equals(errCode));
         if (errFlag) {
         if (errFlag) {
-            return JsonModel.error(-1, errMsg, returnMap);
+            return ResponseJsonVo.error(-1, errMsg, returnMap);
         }
         }
-        return JsonModel.success(returnMap);
+        return ResponseJsonVo.success(returnMap);
     }
     }
 
 
     /**
     /**

+ 1 - 1
src/main/java/com/caimei365/user/controller/AllApi.txt

@@ -2,7 +2,7 @@ package com.caimei365.user.controller;
 
 
 import com.caimei365.user.idempotent.Idempotent;
 import com.caimei365.user.idempotent.Idempotent;
 import com.caimei365.user.model.ClubVo;
 import com.caimei365.user.model.ClubVo;
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.model.OperationVo;
 import com.caimei365.user.model.OperationVo;
 import com.caimei365.user.utils.ValidateUtil;
 import com.caimei365.user.utils.ValidateUtil;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;

+ 3 - 3
src/main/java/com/caimei365/user/controller/BaseApi.java

@@ -1,6 +1,6 @@
 package com.caimei365.user.controller;
 package com.caimei365.user.controller;
 
 
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.service.BaseService;
 import com.caimei365.user.service.BaseService;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -30,7 +30,7 @@ public class BaseApi {
      * @param platformType 0:www,1:crm/h5,2:小程序
      * @param platformType 0:www,1:crm/h5,2:小程序
      */
      */
     @GetMapping("/captcha")
     @GetMapping("/captcha")
-    public JsonModel<Map<String, Object>> getCaptchaImage(Integer platformType) {
+    public ResponseJsonVo<Map<String, Object>> getCaptchaImage(Integer platformType) {
         return baseService.getCaptchaImage(platformType);
         return baseService.getCaptchaImage(platformType);
     }
     }
 
 
@@ -46,7 +46,7 @@ public class BaseApi {
      * @param platformType     0:www,1:crm/h5,2:小程序
      * @param platformType     0:www,1:crm/h5,2:小程序
      */
      */
     @GetMapping("/sms/code")
     @GetMapping("/sms/code")
-    public JsonModel getSmsCode(String mobile, String activateCodeType, String imgCode, String token, Integer platformType) {
+    public ResponseJsonVo getSmsCode(String mobile, String activateCodeType, String imgCode, String token, Integer platformType) {
         return baseService.getSmsCode(mobile, activateCodeType, imgCode, token, platformType);
         return baseService.getSmsCode(mobile, activateCodeType, imgCode, token, platformType);
     }
     }
 
 

+ 5 - 5
src/main/java/com/caimei365/user/controller/LoginApi.java

@@ -1,6 +1,6 @@
 package com.caimei365.user.controller;
 package com.caimei365.user.controller;
 
 
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.model.UserLoginVo;
 import com.caimei365.user.model.UserLoginVo;
 import com.caimei365.user.service.LoginService;
 import com.caimei365.user.service.LoginService;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
@@ -33,7 +33,7 @@ public class LoginApi {
      * @return BaseUser
      * @return BaseUser
      */
      */
     @PostMapping("/password")
     @PostMapping("/password")
-    public JsonModel<UserLoginVo> passwordLogin(String mobileOrEmail, String password) {
+    public ResponseJsonVo<UserLoginVo> passwordLogin(String mobileOrEmail, String password) {
         return loginService.passwordLogin(mobileOrEmail, password);
         return loginService.passwordLogin(mobileOrEmail, password);
     }
     }
 
 
@@ -47,7 +47,7 @@ public class LoginApi {
      * @param iv            加密算法的初始向量
      * @param iv            加密算法的初始向量
      */
      */
     @PostMapping("/auth/applets")
     @PostMapping("/auth/applets")
-    public JsonModel<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, ServerWebExchange serverWebExchange) {
         return loginService.appletsAuthorization(code, encryptedData, iv, serverWebExchange);
         return loginService.appletsAuthorization(code, encryptedData, iv, serverWebExchange);
     }
     }
 
 
@@ -60,7 +60,7 @@ public class LoginApi {
      * @param mode        授权方式:1静默授权,其他手动同意授权
      * @param mode        授权方式:1静默授权,其他手动同意授权
      */
      */
     @GetMapping("/auth/link")
     @GetMapping("/auth/link")
-    public JsonModel<String> getAuthorizationLink(String redirectUri, Integer mode) {
+    public ResponseJsonVo<String> getAuthorizationLink(String redirectUri, Integer mode) {
         return loginService.getAuthorizationLink(redirectUri, mode);
         return loginService.getAuthorizationLink(redirectUri, mode);
     }
     }
 
 
@@ -74,7 +74,7 @@ public class LoginApi {
      * @param mode  1:静默授权,2:用户手动授权
      * @param mode  1:静默授权,2:用户手动授权
      */
      */
     @GetMapping("/auth/website")
     @GetMapping("/auth/website")
-    public JsonModel<UserLoginVo>  websiteAuthorization(String code, String state, Integer mode, ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo<UserLoginVo> websiteAuthorization(String code, String state, Integer mode, ServerWebExchange serverWebExchange) {
         return loginService.websiteAuthorization(code, state, mode, serverWebExchange);
         return loginService.websiteAuthorization(code, state, mode, serverWebExchange);
     }
     }
 
 

+ 13 - 13
src/main/java/com/caimei365/user/controller/RegisterApi.java

@@ -1,8 +1,8 @@
 package com.caimei365.user.controller;
 package com.caimei365.user.controller;
 
 
 import com.caimei365.user.idempotent.Idempotent;
 import com.caimei365.user.idempotent.Idempotent;
-import com.caimei365.user.model.JsonModel;
-import com.caimei365.user.model.UserPo;
+import com.caimei365.user.model.ClubPo;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.service.RegisterService;
 import com.caimei365.user.service.RegisterService;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -40,17 +40,17 @@ public class RegisterApi {
      */
      */
     @Idempotent(prefix="idempotent_club", keys={"#baseUser"}, expire=5)
     @Idempotent(prefix="idempotent_club", keys={"#baseUser"}, expire=5)
     @PostMapping("/club")
     @PostMapping("/club")
-    public JsonModel<UserPo> clubRegister(Integer source,
-                                      String userName,
-                                      String bindMobile,
-                                      String password,
-                                      String passWordConfirm,
-                                      String smsCode,
-                                      Integer isAgreed,
-                                      String unionId,
-                                      String nickName,
-                                      String avatarUrl,
-                                      ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo<ClubPo> clubRegister(Integer source,
+                                               String userName,
+                                               String bindMobile,
+                                               String password,
+                                               String passWordConfirm,
+                                               String smsCode,
+                                               Integer isAgreed,
+                                               String unionId,
+                                               String nickName,
+                                               String avatarUrl,
+                                               ServerWebExchange serverWebExchange) {
         return registerService.clubRegister(source, userName, bindMobile, password, passWordConfirm, smsCode, isAgreed, unionId, nickName, avatarUrl, serverWebExchange);
         return registerService.clubRegister(source, userName, bindMobile, password, passWordConfirm, smsCode, isAgreed, unionId, nickName, avatarUrl, serverWebExchange);
     }
     }
 
 

+ 42 - 42
src/main/java/com/caimei365/user/controller/ShopApi.java

@@ -1,7 +1,7 @@
 package com.caimei365.user.controller;
 package com.caimei365.user.controller;
 
 
 import com.caimei365.user.idempotent.Idempotent;
 import com.caimei365.user.idempotent.Idempotent;
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.service.ShopService;
 import com.caimei365.user.service.ShopService;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
@@ -50,26 +50,26 @@ public class ShopApi {
      */
      */
     @Idempotent(prefix="idempotent_club", keys={"#baseUser"}, expire=5)
     @Idempotent(prefix="idempotent_club", keys={"#baseUser"}, expire=5)
     @PostMapping("/pc/register")
     @PostMapping("/pc/register")
-    public JsonModel pcRegister(Integer source,
-                                        String name,
-                                        String sName,
-                                        String bindMobile,
-                                        String email,
-                                        String smsCode,
-                                        String password,
-                                        String passWordConfirm,
-                                        String linkMan,
-                                        Integer provinceId,
-                                        Integer cityId,
-                                        Integer townId,
-                                        String address,
-                                        String socialCreditCode,
-                                        String businessLicenseImage,
-                                        String firstShopType,
-                                        String secondShopType,
-                                        String mainPro,
-                                        Integer isAgreed,
-                                        ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo pcRegister(Integer source,
+                                     String name,
+                                     String sName,
+                                     String bindMobile,
+                                     String email,
+                                     String smsCode,
+                                     String password,
+                                     String passWordConfirm,
+                                     String linkMan,
+                                     Integer provinceId,
+                                     Integer cityId,
+                                     Integer townId,
+                                     String address,
+                                     String socialCreditCode,
+                                     String businessLicenseImage,
+                                     String firstShopType,
+                                     String secondShopType,
+                                     String mainPro,
+                                     Integer isAgreed,
+                                     ServerWebExchange serverWebExchange) {
         return shopService.register(source, name, sName, bindMobile, email, smsCode, password, passWordConfirm, linkMan, provinceId, cityId, townId, address, socialCreditCode, businessLicenseImage, firstShopType, secondShopType, mainPro, isAgreed, serverWebExchange);
         return shopService.register(source, name, sName, bindMobile, email, smsCode, password, passWordConfirm, linkMan, provinceId, cityId, townId, address, socialCreditCode, businessLicenseImage, firstShopType, secondShopType, mainPro, isAgreed, serverWebExchange);
     }
     }
 
 
@@ -102,27 +102,27 @@ public class ShopApi {
     @ApiOperation("小程序端分步供应商注册")
     @ApiOperation("小程序端分步供应商注册")
     @ApiImplicitParam(name = "name", value = "供应商名称", required = true, dataType = "String")
     @ApiImplicitParam(name = "name", value = "供应商名称", required = true, dataType = "String")
     @PostMapping("/applets/register")
     @PostMapping("/applets/register")
-    public JsonModel appletsRegister(Integer source,
-                                     String name,
-                                     String sName,
-                                     String bindMobile,
-                                     String email,
-                                     String smsCode,
-                                     String password,
-                                     String passWordConfirm,
-                                     String linkMan,
-                                     Integer provinceId,
-                                     Integer cityId,
-                                     Integer townId,
-                                     String address,
-                                     String socialCreditCode,
-                                     String businessLicenseImage,
-                                     String firstShopType,
-                                     String secondShopType,
-                                     String mainPro,
-                                     Integer isAgreed,
-                                     ServerWebExchange serverWebExchange,
-                                     Integer whichStep) {
+    public ResponseJsonVo appletsRegister(Integer source,
+                                          String name,
+                                          String sName,
+                                          String bindMobile,
+                                          String email,
+                                          String smsCode,
+                                          String password,
+                                          String passWordConfirm,
+                                          String linkMan,
+                                          Integer provinceId,
+                                          Integer cityId,
+                                          Integer townId,
+                                          String address,
+                                          String socialCreditCode,
+                                          String businessLicenseImage,
+                                          String firstShopType,
+                                          String secondShopType,
+                                          String mainPro,
+                                          Integer isAgreed,
+                                          ServerWebExchange serverWebExchange,
+                                          Integer whichStep) {
         return shopService.appletsRegister(source, name, sName, bindMobile, email, smsCode, password, passWordConfirm, linkMan, provinceId, cityId, townId, address, socialCreditCode, businessLicenseImage, firstShopType, secondShopType, mainPro, isAgreed, serverWebExchange, whichStep);
         return shopService.appletsRegister(source, name, sName, bindMobile, email, smsCode, password, passWordConfirm, linkMan, provinceId, cityId, townId, address, socialCreditCode, businessLicenseImage, firstShopType, secondShopType, mainPro, isAgreed, serverWebExchange, whichStep);
     }
     }
 
 

+ 0 - 77
src/main/java/com/caimei365/user/model/BaseUser.java

@@ -1,77 +0,0 @@
-package com.caimei365.user.model;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * Description
- *
- * @author : Charles
- * @date : 2021/3/2
- */
-@Data
-public class BaseUser implements Serializable {
-    /**
-     * 用户ID
-     */
-    private Integer userId;
-    /**
-     * 机构ID
-     */
-    private Integer clubId;
-    /**
-     * 供应商ID
-     */
-    private Integer shopId;
-    /**
-     * 注册来源: 0网站 1小程序
-     */
-    private Integer source;
-    /**
-     * 用户名
-     */
-    private String userName;
-    /**
-     * 邮箱
-     */
-    private String email;
-    /**
-     * 手机号码
-     */
-    private String mobile;
-    /**
-     * 企业绑定手机号
-     */
-    private String bindMobile;
-    /**
-     * 用户身份: 1协销 2会员机构 3供应商 4普通机构
-     */
-    private Integer userIdentity;
-    /**
-     * 用户权限: 2会员机构 3供应商 4协销 5普通机构
-     */
-    private Integer userPermission;
-    /**
-     * 用户状态:
-     * 机构:90:已上线,91:已冻结,92:审查资料未通过,待补充资料,1:待审查资料,2:电话预约,3:已预约,20:待确认,21:待拜访,30:待员工推荐,40:已完成第一次采购
-     * 供应商:90:已上线,91:已下线,92:审核不通过,3:待审核
-     */
-    private Integer status;
-    /**
-     * 密码
-     */
-    private String password;
-    /**
-     * token
-     */
-    private String token;
-    /**
-     * 微信unionId
-     */
-    private String unionId;
-    /**
-     * 微信openId
-     */
-    private String openId;
-}

+ 51 - 4
src/main/java/com/caimei365/user/model/ClubPo.java

@@ -1,7 +1,9 @@
 package com.caimei365.user.model;
 package com.caimei365.user.model;
 
 
 import lombok.Data;
 import lombok.Data;
-import lombok.EqualsAndHashCode;
+
+import java.io.Serializable;
+
 
 
 /**
 /**
  * Description
  * Description
@@ -9,13 +11,16 @@ import lombok.EqualsAndHashCode;
  * @author : Charles
  * @author : Charles
  * @date : 2021/3/5
  * @date : 2021/3/5
  */
  */
-@EqualsAndHashCode(callSuper = true)
 @Data
 @Data
-public class ClubPo extends BaseUser {
+public class ClubPo implements Serializable {
     /**
     /**
      * 机构ID
      * 机构ID
      */
      */
     private Integer clubId;
     private Integer clubId;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
     /**
     /**
      * 机构名称
      * 机构名称
      */
      */
@@ -40,7 +45,49 @@ public class ClubPo extends BaseUser {
      * 注册时间
      * 注册时间
      */
      */
     private String addTime;
     private String addTime;
-
+    /**
+     * 状态:90:已上线,91:已冻结,92:审查资料未通过,待补充资料,1:待审查资料,2:电话预约,3:已预约,20:待确认,21:待拜访,30:待员工推荐,40:已完成第一次采购
+     */
+    private Integer status;
 
 
 
 
 }
 }
+//`clubID` int NOT NULL AUTO_INCREMENT COMMENT '会所ID',
+//  `userID` int DEFAULT NULL COMMENT '用户ID',
+//  `name` varchar(50) DEFAULT NULL COMMENT '机构名称',
+//  `sname` varchar(20) DEFAULT NULL COMMENT '机构简称',
+//  `logo` varchar(200) DEFAULT NULL COMMENT 'logo',
+//  `legalPerson` varchar(20) DEFAULT NULL COMMENT '法人',
+//  `provinceID` int DEFAULT NULL COMMENT '省',
+//  `cityID` int DEFAULT NULL COMMENT '市',
+//  `townID` int DEFAULT NULL COMMENT '地址ID',
+//  `flag` varchar(100) DEFAULT NULL COMMENT '拉会所上线的用户的cmBindId,以逗号结尾',
+//  `inviterBindID` int DEFAULT NULL COMMENT '邀请者cmBindId',
+//  `inviterName` varchar(255) DEFAULT NULL COMMENT '邀请者名称',
+//  `spID` int DEFAULT NULL COMMENT '协销Id',
+//  `mainServiceProviderID` int DEFAULT NULL COMMENT '协销经理Id',
+//  `scanTime` varchar(19) DEFAULT NULL COMMENT '扫描时间',
+//  `address` varchar(100) DEFAULT NULL COMMENT '详细地址',
+//  `linkMan` varchar(50) DEFAULT NULL COMMENT '联系人',
+//  `contractPhone` varchar(50) DEFAULT NULL COMMENT '联系电话',
+//  `contractMobile` varchar(20) DEFAULT NULL COMMENT '联系手机',
+//  `fax` varchar(50) DEFAULT NULL COMMENT '传真',
+//  `duty1` varchar(50) DEFAULT NULL COMMENT '职务',
+//  `info` varchar(500) DEFAULT NULL COMMENT '公司简介',
+//  `addTime` varchar(19) DEFAULT NULL COMMENT '注册时间',
+//  `auditTime` varchar(19) DEFAULT NULL COMMENT '审核时间',
+//  `auditNote` varchar(100) DEFAULT NULL COMMENT '审核备注',
+//  `status` int DEFAULT NULL COMMENT '状态',
+//  `businessLicenseImage` varchar(200) DEFAULT NULL COMMENT '营业执照',
+//  `defaultServiceProviderID` int DEFAULT NULL COMMENT '默认的创客',
+//  `defaultServiceProviderUpdTime` varchar(19) DEFAULT NULL COMMENT '创客更新时间',
+//  `mainpro` varchar(200) DEFAULT NULL COMMENT '主打项目',
+//  `scanFlag` char(2) DEFAULT '0' COMMENT '扫描状态 0待扫描 1 已扫描 2已上线',
+//  `headpic` varchar(200) DEFAULT NULL COMMENT '门头照',
+//  `lastModify` varchar(19) DEFAULT NULL COMMENT '最后更新时间',
+//  `lastCheckOrderDate` datetime DEFAULT NULL COMMENT '最后查看订单时间(用于协销统计历史订单未查看数量)',
+//  `socialCreditCode` varchar(18) DEFAULT NULL COMMENT '统一社会信用代码',
+//  `firstClubType` char(10) DEFAULT NULL COMMENT '一级分类为医美=1和生美=2',
+//  `secondClubType` char(10) DEFAULT NULL COMMENT '医美的二级分类为诊所=1、门诊=2、医院=3。  生美没有二级分类',
+//  `department` varchar(200) DEFAULT NULL COMMENT '若为医美分类下的门诊和医院则需要填写科室。',
+//  `medicalPracticeLicenseImg` varchar(200) DEFAULT NULL COMMENT '医美分类必须上传医疗执业许可证',

+ 0 - 81
src/main/java/com/caimei365/user/model/JsonModel.java

@@ -1,81 +0,0 @@
-package com.caimei365.user.model;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * 全局API返回值
- *
- * @author : Charles
- * @date : 2021/3/4
- */
-@Data
-public class JsonModel<T> implements Serializable {
-    /** 状态码 */
-    private int code;
-    /** 提示信息 */
-    private String msg;
-    /** 返回的数据 */
-    private T data;
-
-    private JsonModel() {}
-
-    private JsonModel(int code, String msg) {
-        this.code = code;
-        this.msg = msg;
-    }
-
-    private JsonModel(int code, String msg, T data) {
-        this.code = code;
-        this.msg = msg;
-        this.data = data;
-    }
-
-    public static JsonModel success() {
-        return new JsonModel<>(0, "操作成功");
-    }
-
-    public static<T> JsonModel<T> success(T data) {
-        return new JsonModel<>(0, "操作成功", data);
-    }
-
-    public static<T> JsonModel<T> success(String msg, T data) {
-        return new JsonModel<>(0, msg, data);
-    }
-
-    public static<T> JsonModel<T> success(int code, String msg, T data) {
-        return new JsonModel<>(code, msg, data);
-    }
-
-    public static JsonModel error() {
-        return new JsonModel<>(-1, "操作失败");
-    }
-
-    public static JsonModel error(String msg) {
-        return new JsonModel<>(-1, msg);
-    }
-
-    public static JsonModel error(int code, String msg) {
-        return new JsonModel<>(code, msg);
-    }
-
-    public static<T> JsonModel<T> error(T data) {
-        return new JsonModel<>(-1, "操作失败", data);
-    }
-
-    public static<T> JsonModel<T> error(String msg, T data) {
-        return new JsonModel<>(-1, msg, data);
-    }
-
-    public static<T> JsonModel<T> error(int code, String msg, T data) {
-        return new JsonModel<>(code, msg, data);
-    }
-
-    @Override
-    public String toString() {
-        return "JsonModel{" + "code=" + code + ", msg='" + msg + '\'' + ", data=" + data + '}';
-    }
-
-    private static final long serialVersionUID = 1L;
-}

+ 52 - 3
src/main/java/com/caimei365/user/model/OperationPo.java

@@ -2,8 +2,8 @@ package com.caimei365.user.model;
 
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.Data;
-import lombok.EqualsAndHashCode;
 
 
+import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
 
 
 /**
 /**
@@ -12,13 +12,24 @@ import java.util.Date;
  * @author : Charles
  * @author : Charles
  * @date : 2021/3/8
  * @date : 2021/3/8
  */
  */
-@EqualsAndHashCode(callSuper = true)
 @Data
 @Data
-public class OperationPo extends BaseUser {
+public class OperationPo implements Serializable {
+    /**
+     * 运营人员Id
+     */
+    private Integer id;
+    /**
+     * 用户ID
+     */
+    private Integer userId;
     /**
     /**
      * 用户类型,1:机构类型,2供应商类型
      * 用户类型,1:机构类型,2供应商类型
      */
      */
     private Integer userType;
     private Integer userType;
+    /**
+     * 组织Id
+     */
+    private Integer organizeId;
     /**
     /**
      * 会所ID:隶属于哪个会所的运营人员
      * 会所ID:隶属于哪个会所的运营人员
      */
      */
@@ -43,6 +54,22 @@ public class OperationPo extends BaseUser {
      * 联系人,对应用户的userName
      * 联系人,对应用户的userName
      */
      */
     private String linkName;
     private String linkName;
+    /**
+     * 1未绑定,2已绑定
+     */
+    private Integer status;
+    /**
+     * token
+     */
+    private String token;
+    /**
+     * 微信unionId
+     */
+    private String unionId;
+    /**
+     * 微信openId
+     */
+    private String openId;
     /**
     /**
      * 添加时间
      * 添加时间
      */
      */
@@ -63,3 +90,25 @@ public class OperationPo extends BaseUser {
      */
      */
     private Integer delFlag;
     private Integer delFlag;
 }
 }
+//  `id` int(11) NOT NULL AUTO_INCREMENT,
+//  `userOrganizeID` int(11) DEFAULT NULL COMMENT '用户组织ID,具体对应cm_mall_organize表ID【采美小程序为空或为2】',
+//  `userType` int(11) DEFAULT NULL COMMENT '用户类型,1:机构类型,2供应商类型',
+//  `userID` int(11) DEFAULT NULL COMMENT '用户ID:隶属于哪个用户的运营人员',
+//  `clubID` int(11) DEFAULT NULL COMMENT '机构ID:隶属于哪个会所的运营人员[用户类型为机构时有效数据]',
+//  `shopID` int(11) DEFAULT NULL COMMENT '供应商ID:隶属于哪个供应商的运营人员[用户类型为供应商时有效数据]',
+//  `account` varchar(20) DEFAULT NULL COMMENT '运营人账号名【产品预留字段暂时不启用】',
+//  `mobile` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '手机号码',
+//  `linkName` varchar(50) DEFAULT NULL COMMENT '联系人',
+//  `invitationCode` varchar(50) DEFAULT NULL COMMENT '邀请码',
+//  `status` char(2) DEFAULT NULL COMMENT '1未绑定,2已绑定',
+//  `nickName` varchar(32) DEFAULT NULL COMMENT '微信昵称',
+//  `headimgurl` varchar(256) DEFAULT NULL COMMENT '头像',
+//  `unionId` varchar(32) DEFAULT NULL COMMENT '微信unionId',
+//  `openid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '小程序openid',
+//  `crmOpenid` varchar(32) DEFAULT NULL COMMENT 'crm公众openid',
+//  `pcOpenid` varchar(32) DEFAULT NULL COMMENT 'www商城openid',
+//  `invitationCodeTime` datetime DEFAULT NULL COMMENT '邀请码生成时间(此时间起48小时有效)',
+//  `bindTime` datetime DEFAULT NULL COMMENT '绑定时间',
+//  `updateTime` datetime DEFAULT NULL COMMENT '更新时间',
+//  `addTime` datetime DEFAULT NULL COMMENT '添加时间',
+//  `delFlag` char(32) DEFAULT '0' COMMENT ' 0 有效  其它无效',

+ 81 - 0
src/main/java/com/caimei365/user/model/ResponseJsonVo.java

@@ -0,0 +1,81 @@
+package com.caimei365.user.model;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 全局API返回值
+ *
+ * @author : Charles
+ * @date : 2021/3/4
+ */
+@Data
+public class ResponseJsonVo<T> implements Serializable {
+    /** 状态码 */
+    private int code;
+    /** 提示信息 */
+    private String msg;
+    /** 返回的数据 */
+    private T data;
+
+    private ResponseJsonVo() {}
+
+    private ResponseJsonVo(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    private ResponseJsonVo(int code, String msg, T data) {
+        this.code = code;
+        this.msg = msg;
+        this.data = data;
+    }
+
+    public static ResponseJsonVo success() {
+        return new ResponseJsonVo<>(0, "操作成功");
+    }
+
+    public static<T> ResponseJsonVo<T> success(T data) {
+        return new ResponseJsonVo<>(0, "操作成功", data);
+    }
+
+    public static<T> ResponseJsonVo<T> success(String msg, T data) {
+        return new ResponseJsonVo<>(0, msg, data);
+    }
+
+    public static<T> ResponseJsonVo<T> success(int code, String msg, T data) {
+        return new ResponseJsonVo<>(code, msg, data);
+    }
+
+    public static ResponseJsonVo error() {
+        return new ResponseJsonVo<>(-1, "操作失败");
+    }
+
+    public static ResponseJsonVo error(String msg) {
+        return new ResponseJsonVo<>(-1, msg);
+    }
+
+    public static ResponseJsonVo error(int code, String msg) {
+        return new ResponseJsonVo<>(code, msg);
+    }
+
+    public static<T> ResponseJsonVo<T> error(T data) {
+        return new ResponseJsonVo<>(-1, "操作失败", data);
+    }
+
+    public static<T> ResponseJsonVo<T> error(String msg, T data) {
+        return new ResponseJsonVo<>(-1, msg, data);
+    }
+
+    public static<T> ResponseJsonVo<T> error(int code, String msg, T data) {
+        return new ResponseJsonVo<>(code, msg, data);
+    }
+
+    @Override
+    public String toString() {
+        return "JsonModel{" + "code=" + code + ", msg='" + msg + '\'' + ", data=" + data + '}';
+    }
+
+    private static final long serialVersionUID = 1L;
+}

+ 16 - 4
src/main/java/com/caimei365/user/model/ShopPo.java

@@ -1,8 +1,8 @@
 package com.caimei365.user.model;
 package com.caimei365.user.model;
 
 
 import lombok.Data;
 import lombok.Data;
-import lombok.EqualsAndHashCode;
 
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 
 
 /**
 /**
@@ -11,9 +11,17 @@ import java.math.BigDecimal;
  * @author : Aslee
  * @author : Aslee
  * @date : 2021/3/9
  * @date : 2021/3/9
  */
  */
-@EqualsAndHashCode(callSuper = true)
+/*@EqualsAndHashCode(callSuper = true)*/
 @Data
 @Data
-public class ShopPo extends BaseUser {
+public class ShopPo implements Serializable {
+    /**
+     * 用户ID
+     */
+    private Integer userId;
+    /**
+     * 供应商ID
+     */
+    private Integer shopId;
     /**
     /**
      * 供应商公司名称
      * 供应商公司名称
      */
      */
@@ -21,7 +29,7 @@ public class ShopPo extends BaseUser {
     /**
     /**
      * 供应商公司简称
      * 供应商公司简称
      */
      */
-    private String sname;
+    private String sName;
     /**
     /**
      * 联系人
      * 联系人
      */
      */
@@ -102,6 +110,10 @@ public class ShopPo extends BaseUser {
      * 添加时间
      * 添加时间
      */
      */
     private String addTime;
     private String addTime;
+    /**
+     * 供应商状态: 90:已上线,91:已下线,92:审核不通过,3:待审核
+     */
+    private Integer status;
     /**
     /**
      * 是否可用,1可用
      * 是否可用,1可用
      */
      */

+ 54 - 12
src/main/java/com/caimei365/user/model/UserPo.java

@@ -1,9 +1,8 @@
 package com.caimei365.user.model;
 package com.caimei365.user.model;
 
 
 import lombok.Data;
 import lombok.Data;
-import lombok.EqualsAndHashCode;
 
 
-import java.math.BigDecimal;
+import java.io.Serializable;
 
 
 /**
 /**
  * Description
  * Description
@@ -11,13 +10,60 @@ import java.math.BigDecimal;
  * @author : Charles
  * @author : Charles
  * @date : 2021/3/8
  * @date : 2021/3/8
  */
  */
-@EqualsAndHashCode(callSuper = true)
 @Data
 @Data
-public class UserPo extends BaseUser {
+public class UserPo implements Serializable {
+    /**
+     * 用户ID
+     */
+    private Integer userId;
     /**
     /**
      * 用户类型,供应商1,会员机构3,普通机构4
      * 用户类型,供应商1,会员机构3,普通机构4
      */
      */
     private Integer registerUserTypeId;
     private Integer registerUserTypeId;
+    /**
+     * 注册来源: 0网站 1小程序
+     */
+    private Integer source;
+    /**
+     * 机构ID
+     */
+    private Integer clubId;
+    /**
+     * 供应商ID
+     */
+    private Integer shopId;
+    /**
+     * 协销Id
+     */
+    private Integer serviceProviderId;
+    /**
+     * 用户名
+     */
+    private String userName;
+    /**
+     * 邮箱
+     */
+    private String email;
+    /**
+     * 手机号码
+     */
+    private String mobile;
+    /**
+     * 企业绑定手机号
+     */
+    private String bindMobile;
+    /**
+     * 密码
+     */
+    private String password;
+    /**
+     * 用户身份: 1协销 2会员机构 3供应商 4普通机构
+     */
+    private Integer userIdentity;
+    /**
+     * 用户权限: 2会员机构 3供应商 4协销 5普通机构
+     */
+    private Integer userPermission;
     /**
     /**
      * 组织名称
      * 组织名称
      */
      */
@@ -30,6 +76,10 @@ public class UserPo extends BaseUser {
      * 供应商状态:90:已上线,91:已下线,92:审核不通过,3:待审核
      * 供应商状态:90:已上线,91:已下线,92:审核不通过,3:待审核
      */
      */
     private Integer manufacturerStatus;
     private Integer manufacturerStatus;
+    /**
+     * 协销状态:90:已上线
+     */
+    private Integer serviceProviderStatus;
     /**
     /**
      * 同意协议标志
      * 同意协议标志
      */
      */
@@ -46,13 +96,5 @@ public class UserPo extends BaseUser {
      * 用户状态,1正常,0冻结
      * 用户状态,1正常,0冻结
      */
      */
     private Integer validFlag;
     private Integer validFlag;
-    /**
-     * 协销Id
-     */
-    private Integer serviceProviderId;
-    /**
-     * 协销状态
-     */
-    private Integer serviceProviderStatus;
 
 
 }
 }

+ 3 - 3
src/main/java/com/caimei365/user/service/BaseService.java

@@ -1,6 +1,6 @@
 package com.caimei365.user.service;
 package com.caimei365.user.service;
 
 
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 
 
 import java.util.Map;
 import java.util.Map;
 
 
@@ -17,7 +17,7 @@ public interface BaseService {
      * @param platformType 0:www,1:crm/h5,2:小程序
      * @param platformType 0:www,1:crm/h5,2:小程序
      * @return Map<String, Object>
      * @return Map<String, Object>
      */
      */
-    JsonModel<Map<String, Object>> getCaptchaImage(Integer platformType);
+    ResponseJsonVo<Map<String, Object>> getCaptchaImage(Integer platformType);
 
 
     /**
     /**
      * 校验图片验证码
      * 校验图片验证码
@@ -39,5 +39,5 @@ public interface BaseService {
      * @param platformType     0:www,1:crm/h5,2:小程序
      * @param platformType     0:www,1:crm/h5,2:小程序
      * @return void
      * @return void
      */
      */
-    JsonModel getSmsCode(String mobile, String activateCodeType, String imgCode, String token, Integer platformType);
+    ResponseJsonVo getSmsCode(String mobile, String activateCodeType, String imgCode, String token, Integer platformType);
 }
 }

+ 5 - 5
src/main/java/com/caimei365/user/service/LoginService.java

@@ -1,6 +1,6 @@
 package com.caimei365.user.service;
 package com.caimei365.user.service;
 
 
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.model.UserLoginVo;
 import com.caimei365.user.model.UserLoginVo;
 import org.springframework.web.server.ServerWebExchange;
 import org.springframework.web.server.ServerWebExchange;
 
 
@@ -19,7 +19,7 @@ public interface LoginService {
      * @param password      密码
      * @param password      密码
      * @return BaseUser
      * @return BaseUser
      */
      */
-    JsonModel<UserLoginVo> passwordLogin(String mobileOrEmail, String password);
+    ResponseJsonVo<UserLoginVo> passwordLogin(String mobileOrEmail, String password);
 
 
     /**
     /**
      * 微信授权登录(小程序)
      * 微信授权登录(小程序)
@@ -30,7 +30,7 @@ public interface LoginService {
      * @param serverWebExchange ServerWebExchange
      * @param serverWebExchange ServerWebExchange
      * @return BaseUser
      * @return BaseUser
      */
      */
-    JsonModel<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, ServerWebExchange serverWebExchange);
+    ResponseJsonVo<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, ServerWebExchange serverWebExchange);
 
 
     /**
     /**
      * 微信公众号授权链接(www)
      * 微信公众号授权链接(www)
@@ -38,7 +38,7 @@ public interface LoginService {
      * @param redirectUri 用于微信授权的中间页面
      * @param redirectUri 用于微信授权的中间页面
      * @param mode        授权方式:1静默授权,其他手动同意授权
      * @param mode        授权方式:1静默授权,其他手动同意授权
      */
      */
-    JsonModel<String> getAuthorizationLink(String redirectUri, Integer mode);
+    ResponseJsonVo<String> getAuthorizationLink(String redirectUri, Integer mode);
 
 
     /**
     /**
      * 微信公众号授权登录(www)
      * 微信公众号授权登录(www)
@@ -49,5 +49,5 @@ public interface LoginService {
      * @param state 安全认证
      * @param state 安全认证
      * @param mode  1:静默授权,2:用户手动授权
      * @param mode  1:静默授权,2:用户手动授权
      */
      */
-    JsonModel<UserLoginVo> websiteAuthorization(String code, String state, Integer mode, ServerWebExchange serverWebExchange);
+    ResponseJsonVo<UserLoginVo> websiteAuthorization(String code, String state, Integer mode, ServerWebExchange serverWebExchange);
 }
 }

+ 3 - 3
src/main/java/com/caimei365/user/service/RegisterService.java

@@ -1,7 +1,7 @@
 package com.caimei365.user.service;
 package com.caimei365.user.service;
 
 
-import com.caimei365.user.model.JsonModel;
-import com.caimei365.user.model.UserPo;
+import com.caimei365.user.model.ClubPo;
+import com.caimei365.user.model.ResponseJsonVo;
 import org.springframework.web.server.ServerWebExchange;
 import org.springframework.web.server.ServerWebExchange;
 
 
 /**
 /**
@@ -27,6 +27,6 @@ public interface RegisterService {
      * @param serverWebExchange ServerWebExchange
      * @param serverWebExchange ServerWebExchange
      * @return BaseUser
      * @return BaseUser
      */
      */
-    JsonModel<UserPo> clubRegister(Integer source, String userName, String bindMobile, String password, String passWordConfirm, String smsCode, Integer isAgreed, String unionId, String nickName, String avatarUrl, ServerWebExchange serverWebExchange);
+    ResponseJsonVo<ClubPo> clubRegister(Integer source, String userName, String bindMobile, String password, String passWordConfirm, String smsCode, Integer isAgreed, String unionId, String nickName, String avatarUrl, ServerWebExchange serverWebExchange);
 
 
 }
 }

+ 3 - 3
src/main/java/com/caimei365/user/service/ShopService.java

@@ -1,6 +1,6 @@
 package com.caimei365.user.service;
 package com.caimei365.user.service;
 
 
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import org.springframework.web.server.ServerWebExchange;
 import org.springframework.web.server.ServerWebExchange;
 
 
 /**
 /**
@@ -35,7 +35,7 @@ public interface ShopService {
      * @param serverWebExchange     ServerWebExchange(新参数)
      * @param serverWebExchange     ServerWebExchange(新参数)
      * @return BaseUser
      * @return BaseUser
      */
      */
-    JsonModel register(Integer source, String name, String sName, String bindMobile, String email, String smsCode, String password, String passWordConfirm, String linkMan, Integer provinceId, Integer cityId, Integer townId, String address, String socialCreditCode, String businessLicenseImage, String firstShopType, String secondShopType, String mainPro, Integer isAgreed, ServerWebExchange serverWebExchange);
+    ResponseJsonVo register(Integer source, String name, String sName, String bindMobile, String email, String smsCode, String password, String passWordConfirm, String linkMan, Integer provinceId, Integer cityId, Integer townId, String address, String socialCreditCode, String businessLicenseImage, String firstShopType, String secondShopType, String mainPro, Integer isAgreed, ServerWebExchange serverWebExchange);
 
 
     /**
     /**
      * 小程序端分步供应商注册
      * 小程序端分步供应商注册
@@ -63,5 +63,5 @@ public interface ShopService {
      * @param whichStep             注册步数
      * @param whichStep             注册步数
      * @return BaseUser
      * @return BaseUser
      */
      */
-    JsonModel appletsRegister(Integer source, String name, String sName, String bindMobile, String email, String smsCode, String password, String passWordConfirm, String linkMan, Integer provinceId, Integer cityId, Integer townId, String address, String socialCreditCode, String businessLicenseImage, String firstShopType, String secondShopType, String mainPro, Integer isAgreed, ServerWebExchange serverWebExchange, Integer whichStep);
+    ResponseJsonVo appletsRegister(Integer source, String name, String sName, String bindMobile, String email, String smsCode, String password, String passWordConfirm, String linkMan, Integer provinceId, Integer cityId, Integer townId, String address, String socialCreditCode, String businessLicenseImage, String firstShopType, String secondShopType, String mainPro, Integer isAgreed, ServerWebExchange serverWebExchange, Integer whichStep);
 }
 }

+ 13 - 13
src/main/java/com/caimei365/user/service/impl/BaseServiceImpl.java

@@ -1,7 +1,7 @@
 package com.caimei365.user.service.impl;
 package com.caimei365.user.service.impl;
 
 
 import com.caimei365.user.mapper.BaseMapper;
 import com.caimei365.user.mapper.BaseMapper;
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.service.BaseService;
 import com.caimei365.user.service.BaseService;
 import com.caimei365.user.utils.AliyunSmsUtil;
 import com.caimei365.user.utils.AliyunSmsUtil;
@@ -38,7 +38,7 @@ public class BaseServiceImpl implements BaseService {
      * @param platformType 0:www,1:crm/h5,2:小程序
      * @param platformType 0:www,1:crm/h5,2:小程序
      */
      */
     @Override
     @Override
-    public JsonModel<Map<String, Object>> getCaptchaImage(Integer platformType) {
+    public ResponseJsonVo<Map<String, Object>> getCaptchaImage(Integer platformType) {
         Map<String, Object> result = new HashMap<>(2);
         Map<String, Object> result = new HashMap<>(2);
         try {
         try {
             ImageCaptchaUtil.Captcha captcha = null;
             ImageCaptchaUtil.Captcha captcha = null;
@@ -56,9 +56,9 @@ public class BaseServiceImpl implements BaseService {
             }
             }
             result.put("baseImage", captcha.getBase64Image());
             result.put("baseImage", captcha.getBase64Image());
             result.put("token", captcha.getMd5Code());
             result.put("token", captcha.getMd5Code());
-            return JsonModel.success(result);
+            return ResponseJsonVo.success(result);
         } catch (Exception e) {
         } catch (Exception e) {
-            return JsonModel.error("获取图片验证码异常", null);
+            return ResponseJsonVo.error("获取图片验证码异常", null);
         }
         }
     }
     }
 
 
@@ -96,11 +96,11 @@ public class BaseServiceImpl implements BaseService {
      * @param platformType     0:www,1:crm/h5,2:小程序
      * @param platformType     0:www,1:crm/h5,2:小程序
      */
      */
     @Override
     @Override
-    public JsonModel getSmsCode(String mobile, String activateCodeType, String imgCode, String token, Integer platformType) {
+    public ResponseJsonVo getSmsCode(String mobile, String activateCodeType, String imgCode, String token, Integer platformType) {
         Boolean checkFlag = checkCaptchaImage(token, imgCode, platformType);
         Boolean checkFlag = checkCaptchaImage(token, imgCode, platformType);
         if (checkFlag) {
         if (checkFlag) {
             // 验证手机号
             // 验证手机号
-            JsonModel mobileModel = ValidateUtil.validateMobile(mobile);
+            ResponseJsonVo mobileModel = ValidateUtil.validateMobile(mobile);
             if (mobileModel.getCode() == -1) {
             if (mobileModel.getCode() == -1) {
                 return mobileModel;
                 return mobileModel;
             }
             }
@@ -110,14 +110,14 @@ public class BaseServiceImpl implements BaseService {
             // 根据手机号查询用户Id
             // 根据手机号查询用户Id
             Integer userId = baseMapper.getUserIdByMobile(mobile);
             Integer userId = baseMapper.getUserIdByMobile(mobile);
             if ("1".equals(activateCodeType)) {
             if ("1".equals(activateCodeType)) {
-                if (null == userId || userId <= 0) {
-                    return JsonModel.error("该手机号尚未注册");
+                if (null == userId || userId < 1) {
+                    return ResponseJsonVo.error("该手机号尚未注册");
                 }
                 }
                 // 找回密码
                 // 找回密码
                 sendFlag = AliyunSmsUtil.sendSms(mobile, 1, "{code:" + randomCode + "}");
                 sendFlag = AliyunSmsUtil.sendSms(mobile, 1, "{code:" + randomCode + "}");
             } else {
             } else {
                 if (userId > 0) {
                 if (userId > 0) {
-                    return JsonModel.error("该手机号已被使用");
+                    return ResponseJsonVo.error("该手机号已被使用");
                 }
                 }
                 if ("2".equals(activateCodeType)) {
                 if ("2".equals(activateCodeType)) {
                     // 机构用户(自主)注册
                     // 机构用户(自主)注册
@@ -126,18 +126,18 @@ public class BaseServiceImpl implements BaseService {
                     // 供应商(自主)注册
                     // 供应商(自主)注册
                     sendFlag = AliyunSmsUtil.sendSms(mobile, 9, "{code:"+ randomCode +"}");
                     sendFlag = AliyunSmsUtil.sendSms(mobile, 9, "{code:"+ randomCode +"}");
                 } else {
                 } else {
-                    return JsonModel.error("参数错误:activateCodeType");
+                    return ResponseJsonVo.error("参数错误:activateCodeType");
                 }
                 }
             }
             }
             if (sendFlag) {
             if (sendFlag) {
                 redisService.set("code:"+mobile, randomCode, 1800L);
                 redisService.set("code:"+mobile, randomCode, 1800L);
                 log.info("你发送的手机验证码: " + randomCode);
                 log.info("你发送的手机验证码: " + randomCode);
             } else {
             } else {
-                return JsonModel.error("验证码发送失败!请稍后重试");
+                return ResponseJsonVo.error("验证码发送失败!请稍后重试");
             }
             }
         } else {
         } else {
-            return JsonModel.error("图片验证码错误");
+            return ResponseJsonVo.error("图片验证码错误");
         }
         }
-        return JsonModel.success("发送验证码成功");
+        return ResponseJsonVo.success("发送验证码成功");
     }
     }
 }
 }

+ 26 - 27
src/main/java/com/caimei365/user/service/impl/LoginServiceImpl.java

@@ -3,8 +3,7 @@ package com.caimei365.user.service.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.caimei365.user.components.WeChatService;
 import com.caimei365.user.components.WeChatService;
 import com.caimei365.user.mapper.LoginMapper;
 import com.caimei365.user.mapper.LoginMapper;
-import com.caimei365.user.model.BaseUser;
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.model.UserLoginVo;
 import com.caimei365.user.model.UserLoginVo;
 import com.caimei365.user.service.LoginService;
 import com.caimei365.user.service.LoginService;
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.RedisService;
@@ -44,12 +43,12 @@ public class LoginServiceImpl implements LoginService {
      * @return BaseUser
      * @return BaseUser
      */
      */
     @Override
     @Override
-    public JsonModel<UserLoginVo> passwordLogin(String mobileOrEmail, String password) {
+    public ResponseJsonVo<UserLoginVo> passwordLogin(String mobileOrEmail, String password) {
         if (mobileOrEmail.isEmpty()) {
         if (mobileOrEmail.isEmpty()) {
-            return JsonModel.error("请填写账户名", null);
+            return ResponseJsonVo.error("请填写账户名", null);
         }
         }
         if (password.isEmpty()) {
         if (password.isEmpty()) {
-            return JsonModel.error("请填写密码", null);
+            return ResponseJsonVo.error("请填写密码", null);
         }
         }
         //处理比对密码
         //处理比对密码
         UserLoginVo baseUser = loginMapper.getLoginUserByMobileOrEmail(mobileOrEmail);
         UserLoginVo baseUser = loginMapper.getLoginUserByMobileOrEmail(mobileOrEmail);
@@ -59,14 +58,14 @@ public class LoginServiceImpl implements LoginService {
             if (md5Password.equals(dbPassword)) {
             if (md5Password.equals(dbPassword)) {
                 if (baseUser.getUserIdentity() == 1) {
                 if (baseUser.getUserIdentity() == 1) {
                     // 协销登录
                     // 协销登录
-                    return JsonModel.success(baseUser);
+                    return ResponseJsonVo.success(baseUser);
                 } else {
                 } else {
                     // 返回登录校验结果
                     // 返回登录校验结果
                     return logonVerify(baseUser);
                     return logonVerify(baseUser);
                 }
                 }
             }
             }
         }
         }
-        return JsonModel.error("输入的密码和账户名不匹配", null);
+        return ResponseJsonVo.error("输入的密码和账户名不匹配", null);
     }
     }
 
 
     /**
     /**
@@ -78,14 +77,14 @@ public class LoginServiceImpl implements LoginService {
      * @param serverWebExchange ServerWebExchange
      * @param serverWebExchange ServerWebExchange
      */
      */
     @Override
     @Override
-    public JsonModel<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo<UserLoginVo> appletsAuthorization(String code, String encryptedData, String iv, ServerWebExchange serverWebExchange) {
         if (StringUtils.isBlank(code)) {
         if (StringUtils.isBlank(code)) {
-            return JsonModel.error("没有获取到微信授权code", null);
+            return ResponseJsonVo.error("没有获取到微信授权code", null);
         }
         }
         // 小程序微信授权获取登录信息
         // 小程序微信授权获取登录信息
-        JsonModel<Map<String, Object>> appletsInfo = weChatService.getInfoMapByApplets(code, serverWebExchange);
+        ResponseJsonVo<Map<String, Object>> appletsInfo = weChatService.getInfoMapByApplets(code, serverWebExchange);
         if (appletsInfo.getCode() == -1) {
         if (appletsInfo.getCode() == -1) {
-            return JsonModel.error(appletsInfo.getMsg(), null);
+            return ResponseJsonVo.error(appletsInfo.getMsg(), null);
         }
         }
         Map<String, Object> infoData = appletsInfo.getData();
         Map<String, Object> infoData = appletsInfo.getData();
         String openId = (String) infoData.get("openId");
         String openId = (String) infoData.get("openId");
@@ -102,7 +101,7 @@ public class LoginServiceImpl implements LoginService {
             }
             }
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
-            return JsonModel.error("微信解密失败", null);
+            return ResponseJsonVo.error("微信解密失败", null);
         }
         }
         // 用户数据存入Redis,key前缀:wxInfo:applets:
         // 用户数据存入Redis,key前缀:wxInfo:applets:
         redisService.setMap("wxInfo:applets:" + unionId, infoData);
         redisService.setMap("wxInfo:applets:" + unionId, infoData);
@@ -115,7 +114,7 @@ public class LoginServiceImpl implements LoginService {
             seller.setToken(token);
             seller.setToken(token);
             seller.setUnionId(unionId);
             seller.setUnionId(unionId);
             seller.setOpenId(openId);
             seller.setOpenId(openId);
-            return JsonModel.success(seller);
+            return ResponseJsonVo.success(seller);
         }
         }
         // 运营人员授权登录
         // 运营人员授权登录
         return operationAuthLogin(openId, unionId, "mini");
         return operationAuthLogin(openId, unionId, "mini");
@@ -128,12 +127,12 @@ public class LoginServiceImpl implements LoginService {
      * @param mode        授权方式:1静默授权,其他手动同意授权
      * @param mode        授权方式:1静默授权,其他手动同意授权
      */
      */
     @Override
     @Override
-    public JsonModel<String> getAuthorizationLink(String redirectUri, Integer mode) {
+    public ResponseJsonVo<String> getAuthorizationLink(String redirectUri, Integer mode) {
         String link = weChatService.getAuthorizationLink(redirectUri, mode);
         String link = weChatService.getAuthorizationLink(redirectUri, mode);
         String state = UUID.randomUUID().toString();
         String state = UUID.randomUUID().toString();
         redisService.set(state, state, 1800L);
         redisService.set(state, state, 1800L);
         link = link.replace("STATE", state);
         link = link.replace("STATE", state);
-        return JsonModel.success(link);
+        return ResponseJsonVo.success(link);
     }
     }
 
 
     /**
     /**
@@ -147,9 +146,9 @@ public class LoginServiceImpl implements LoginService {
      * @param serverWebExchange ServerWebExchange
      * @param serverWebExchange ServerWebExchange
      */
      */
     @Override
     @Override
-    public JsonModel<UserLoginVo> websiteAuthorization(String code, String state, Integer mode, ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo<UserLoginVo> websiteAuthorization(String code, String state, Integer mode, ServerWebExchange serverWebExchange) {
         if (StringUtils.isBlank(code) || StringUtils.isBlank(state)) {
         if (StringUtils.isBlank(code) || StringUtils.isBlank(state)) {
-            return JsonModel.error("参数异常", null);
+            return ResponseJsonVo.error("参数异常", null);
         }
         }
         String wxState = (String) redisService.get(state);
         String wxState = (String) redisService.get(state);
         log.info("微信code>>>" + code + "state>>>" + wxState + "----" + state + "mode>>>" + mode);
         log.info("微信code>>>" + code + "state>>>" + wxState + "----" + state + "mode>>>" + mode);
@@ -166,7 +165,7 @@ public class LoginServiceImpl implements LoginService {
                         // 返回登录用户
                         // 返回登录用户
                         return logonVerify(user);
                         return logonVerify(user);
                     } else {
                     } else {
-                        return JsonModel.error(-4, "您的微信尚未绑定任何机构", null);
+                        return ResponseJsonVo.error(-4, "您的微信尚未绑定任何机构", null);
                     }
                     }
                 } else {
                 } else {
                     // 获取access_token
                     // 获取access_token
@@ -182,10 +181,10 @@ public class LoginServiceImpl implements LoginService {
                 }
                 }
             } catch (Exception e) {
             } catch (Exception e) {
                 e.printStackTrace();
                 e.printStackTrace();
-                return JsonModel.error("获取微信信息异常", null);
+                return ResponseJsonVo.error("获取微信信息异常", null);
             }
             }
         }
         }
-        return JsonModel.error("请从正确的途径打开链接", null);
+        return ResponseJsonVo.error("请从正确的途径打开链接", null);
     }
     }
 
 
     /**
     /**
@@ -195,7 +194,7 @@ public class LoginServiceImpl implements LoginService {
      * @param source 来源:www网站, mini小程序
      * @param source 来源:www网站, mini小程序
      * @return BaseUser
      * @return BaseUser
      */
      */
-    private JsonModel<UserLoginVo> operationAuthLogin(String openId, String unionId, String source) {
+    private ResponseJsonVo<UserLoginVo> operationAuthLogin(String openId, String unionId, String source) {
         UserLoginVo operation = loginMapper.getOperationUserByUnionId(unionId, source);
         UserLoginVo operation = loginMapper.getOperationUserByUnionId(unionId, source);
         if (null == operation) {
         if (null == operation) {
             operation = loginMapper.getOperationUserByOpenId(openId, source);
             operation = loginMapper.getOperationUserByOpenId(openId, source);
@@ -203,7 +202,7 @@ public class LoginServiceImpl implements LoginService {
                 operation = new UserLoginVo();
                 operation = new UserLoginVo();
                 operation.setOpenId(openId);
                 operation.setOpenId(openId);
                 operation.setUnionId(unionId);
                 operation.setUnionId(unionId);
-                return JsonModel.error("您的微信尚未绑定任何机构", operation);
+                return ResponseJsonVo.error("您的微信尚未绑定任何机构", operation);
             } else {
             } else {
                 // 表示 openId存在, unionId不存在
                 // 表示 openId存在, unionId不存在
                 loginMapper.updateOperationUnionId(operation.getUserId(), unionId);
                 loginMapper.updateOperationUnionId(operation.getUserId(), unionId);
@@ -223,7 +222,7 @@ public class LoginServiceImpl implements LoginService {
      * @param baseUser 用户信息
      * @param baseUser 用户信息
      * @return BaseUser
      * @return BaseUser
      */
      */
-    private JsonModel<UserLoginVo> logonVerify(UserLoginVo baseUser) {
+    private ResponseJsonVo<UserLoginVo> logonVerify(UserLoginVo baseUser) {
         // 生成token给用户
         // 生成token给用户
         String token = JwtUtil.createToken(baseUser.getUserId());
         String token = JwtUtil.createToken(baseUser.getUserId());
         // 为了过期续签,将token存入redis,并设置超时时间
         // 为了过期续签,将token存入redis,并设置超时时间
@@ -231,18 +230,18 @@ public class LoginServiceImpl implements LoginService {
         baseUser.setToken(token);
         baseUser.setToken(token);
         if (baseUser.getStatus() == 91) {
         if (baseUser.getStatus() == 91) {
             //机构 / 供应商
             //机构 / 供应商
-            return JsonModel.error(-2, "您的企业账号已被冻结,请联系客服处理", null);
+            return ResponseJsonVo.error(-2, "您的企业账号已被冻结,请联系客服处理", null);
         }
         }
         // 供应商
         // 供应商
         if (baseUser.getUserIdentity() == 3) {
         if (baseUser.getUserIdentity() == 3) {
             if (baseUser.getStatus() == 3) {
             if (baseUser.getStatus() == 3) {
-                return JsonModel.error(-2, "您的企业账号正在加速审核中,审核通过后即可登录", null);
+                return ResponseJsonVo.error(-2, "您的企业账号正在加速审核中,审核通过后即可登录", null);
             }
             }
             if (baseUser.getStatus() == 92) {
             if (baseUser.getStatus() == 92) {
-                return JsonModel.error(-3, "您的企业账号审核未通过", baseUser);
+                return ResponseJsonVo.error(-3, "您的企业账号审核未通过", baseUser);
             }
             }
         }
         }
-        return JsonModel.success("登录成功", baseUser);
+        return ResponseJsonVo.success("登录成功", baseUser);
     }
     }
 
 
 }
 }

+ 8 - 9
src/main/java/com/caimei365/user/service/impl/RegisterServiceImpl.java

@@ -1,7 +1,6 @@
 package com.caimei365.user.service.impl;
 package com.caimei365.user.service.impl;
 
 
 import com.caimei365.user.mapper.BaseMapper;
 import com.caimei365.user.mapper.BaseMapper;
-import com.caimei365.user.mapper.LoginMapper;
 import com.caimei365.user.mapper.RegisterMapper;
 import com.caimei365.user.mapper.RegisterMapper;
 import com.caimei365.user.model.*;
 import com.caimei365.user.model.*;
 import com.caimei365.user.service.RegisterService;
 import com.caimei365.user.service.RegisterService;
@@ -55,7 +54,7 @@ public class RegisterServiceImpl implements RegisterService {
      */
      */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
-    public JsonModel<UserPo> clubRegister(Integer source, String userName, String bindMobile, String password, String passWordConfirm, String smsCode, Integer isAgreed, String unionId, String nickName, String avatarUrl, ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo<ClubPo> clubRegister(Integer source, String userName, String bindMobile, String password, String passWordConfirm, String smsCode, Integer isAgreed, String unionId, String nickName, String avatarUrl, ServerWebExchange serverWebExchange) {
         // 打印IP
         // 打印IP
         String ip = RequestUtil.getIp(serverWebExchange);
         String ip = RequestUtil.getIp(serverWebExchange);
         log.info("X-Forwarded-For:" + ip);
         log.info("X-Forwarded-For:" + ip);
@@ -63,27 +62,27 @@ public class RegisterServiceImpl implements RegisterService {
         if (StringUtils.isBlank(userName) || StringUtils.isBlank(bindMobile)
         if (StringUtils.isBlank(userName) || StringUtils.isBlank(bindMobile)
             || StringUtils.isBlank(password) || StringUtils.isBlank(passWordConfirm) ||
             || StringUtils.isBlank(password) || StringUtils.isBlank(passWordConfirm) ||
             StringUtils.isBlank(smsCode)) {
             StringUtils.isBlank(smsCode)) {
-            return JsonModel.error("参数异常", null);
+            return ResponseJsonVo.error("参数异常", null);
         }
         }
         if (!password.equals(passWordConfirm)) {
         if (!password.equals(passWordConfirm)) {
-            return JsonModel.error("输入的密码不一致", null);
+            return ResponseJsonVo.error("输入的密码不一致", null);
         }
         }
         String redisSmsCode = (String) redisService.get("code:" + bindMobile);
         String redisSmsCode = (String) redisService.get("code:" + bindMobile);
         if (redisSmsCode.equals(smsCode)) {
         if (redisSmsCode.equals(smsCode)) {
-            return JsonModel.error("手机验证码错误", null);
+            return ResponseJsonVo.error("手机验证码错误", null);
         }
         }
         if (1 != isAgreed) {
         if (1 != isAgreed) {
-            return JsonModel.error("请勾选同意协议", null);
+            return ResponseJsonVo.error("请勾选同意协议", null);
         }
         }
         // 查找用户表是否存在
         // 查找用户表是否存在
         Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
         Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
         if (dbUserId > 0) {
         if (dbUserId > 0) {
-            return JsonModel.error("该手机号已被使用", null);
+            return ResponseJsonVo.error("该手机号已被使用", null);
         }
         }
         // 查找运营人员表是否存在
         // 查找运营人员表是否存在
         Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
         Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
         if (dbOperationId > 0) {
         if (dbOperationId > 0) {
-            return JsonModel.error("您已是机构运营人员,无需再注册机构", null);
+            return ResponseJsonVo.error("您已是机构运营人员,无需再注册机构", null);
         }
         }
         /*
         /*
             组装用户数据 user
             组装用户数据 user
@@ -210,7 +209,7 @@ public class RegisterServiceImpl implements RegisterService {
             }
             }
             log.info("注册普通机构,默认绑定为机构运营人员");
             log.info("注册普通机构,默认绑定为机构运营人员");
         }
         }
-        return JsonModel.success(user);
+        return ResponseJsonVo.success(club);
     }
     }
 }
 }
 
 

+ 24 - 25
src/main/java/com/caimei365/user/service/impl/ShopServiceImpl.java

@@ -2,9 +2,8 @@ package com.caimei365.user.service.impl;
 
 
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.components.RedisService;
 import com.caimei365.user.mapper.BaseMapper;
 import com.caimei365.user.mapper.BaseMapper;
-import com.caimei365.user.mapper.LoginMapper;
 import com.caimei365.user.mapper.RegisterMapper;
 import com.caimei365.user.mapper.RegisterMapper;
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import com.caimei365.user.model.ShopPo;
 import com.caimei365.user.model.ShopPo;
 import com.caimei365.user.model.UserPo;
 import com.caimei365.user.model.UserPo;
 import com.caimei365.user.service.ShopService;
 import com.caimei365.user.service.ShopService;
@@ -63,7 +62,7 @@ public class ShopServiceImpl implements ShopService {
      * @return BaseUser
      * @return BaseUser
      */
      */
     @Override
     @Override
-    public JsonModel register(Integer source, String name, String sName, String bindMobile, String email, String smsCode, String password, String passWordConfirm, String linkMan, Integer provinceId, Integer cityId, Integer townId, String address, String socialCreditCode, String businessLicenseImage, String firstShopType, String secondShopType, String mainPro, Integer isAgreed, ServerWebExchange serverWebExchange) {
+    public ResponseJsonVo register(Integer source, String name, String sName, String bindMobile, String email, String smsCode, String password, String passWordConfirm, String linkMan, Integer provinceId, Integer cityId, Integer townId, String address, String socialCreditCode, String businessLicenseImage, String firstShopType, String secondShopType, String mainPro, Integer isAgreed, ServerWebExchange serverWebExchange) {
         // 打印IP
         // 打印IP
         String ip = RequestUtil.getIp(serverWebExchange);
         String ip = RequestUtil.getIp(serverWebExchange);
         log.info("X-Forwarded-For:" + ip);
         log.info("X-Forwarded-For:" + ip);
@@ -71,36 +70,36 @@ public class ShopServiceImpl implements ShopService {
         if (StringUtils.isBlank(name) || StringUtils.isBlank(bindMobile)
         if (StringUtils.isBlank(name) || StringUtils.isBlank(bindMobile)
                 || StringUtils.isBlank(password) || StringUtils.isBlank(passWordConfirm)
                 || StringUtils.isBlank(password) || StringUtils.isBlank(passWordConfirm)
                 || StringUtils.isBlank(smsCode) || StringUtils.isBlank(linkMan)) {
                 || StringUtils.isBlank(smsCode) || StringUtils.isBlank(linkMan)) {
-            return JsonModel.error("参数异常", null);
+            return ResponseJsonVo.error("参数异常", null);
         }
         }
-        JsonModel model = ValidateUtil.validateMobile(bindMobile);
+        ResponseJsonVo model = ValidateUtil.validateMobile(bindMobile);
         if (model.getCode() == -1) {
         if (model.getCode() == -1) {
             return model;
             return model;
         }
         }
         if (!password.equals(passWordConfirm)) {
         if (!password.equals(passWordConfirm)) {
-            return JsonModel.error("输入的密码不一致", null);
+            return ResponseJsonVo.error("输入的密码不一致", null);
         }
         }
         if (1 != isAgreed) {
         if (1 != isAgreed) {
-            return JsonModel.error("请勾选同意协议", null);
+            return ResponseJsonVo.error("请勾选同意协议", null);
         }
         }
         // 查找用户表是否存在
         // 查找用户表是否存在
         Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
         Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
         if (dbUserId > 0) {
         if (dbUserId > 0) {
-            return JsonModel.error("该手机号已被使用", null);
+            return ResponseJsonVo.error("该手机号已被使用", null);
         }
         }
         // 查找运营人员表是否存在
         // 查找运营人员表是否存在
         Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
         Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
         if (dbOperationId > 0) {
         if (dbOperationId > 0) {
-            return JsonModel.error("您已是机构运营人员,无需再注册机构", null);
+            return ResponseJsonVo.error("您已是机构运营人员,无需再注册机构", null);
         }
         }
         String redisSmsCode = (String) redisService.get("code:" + bindMobile);
         String redisSmsCode = (String) redisService.get("code:" + bindMobile);
         if (redisSmsCode.equals(smsCode)) {
         if (redisSmsCode.equals(smsCode)) {
-            return JsonModel.error("手机验证码错误", null);
+            return ResponseJsonVo.error("手机验证码错误", null);
         }
         }
         if (StringUtils.isNotBlank(email)) {
         if (StringUtils.isNotBlank(email)) {
             dbUserId = baseMapper.getUserIdByEmail(email);
             dbUserId = baseMapper.getUserIdByEmail(email);
             if (dbUserId > 0) {
             if (dbUserId > 0) {
-                return JsonModel.error("该邮箱已被使用", null);
+                return ResponseJsonVo.error("该邮箱已被使用", null);
             }
             }
         }
         }
         /*
         /*
@@ -147,7 +146,7 @@ public class ShopServiceImpl implements ShopService {
         // 供应商公司名称
         // 供应商公司名称
         shop.setName(name);
         shop.setName(name);
         // 供应商公司简称
         // 供应商公司简称
-        shop.setSname(sName);
+        shop.setSName(sName);
         // 联系人
         // 联系人
         shop.setLinkMan(linkMan);
         shop.setLinkMan(linkMan);
         shop.setLinkMan1(linkMan);
         shop.setLinkMan1(linkMan);
@@ -186,13 +185,13 @@ public class ShopServiceImpl implements ShopService {
         int insertShopFlag = registerMapper.insertShop(shop);
         int insertShopFlag = registerMapper.insertShop(shop);
         if (insertShopFlag < 1) {
         if (insertShopFlag < 1) {
             log.info(shop.getUserId() + " 插入数据库异常shop:" + shop.toString());
             log.info(shop.getUserId() + " 插入数据库异常shop:" + shop.toString());
-            return JsonModel.error("插入数据库异常", null);
+            return ResponseJsonVo.error("插入数据库异常", null);
         }
         }
         // user更新shopId
         // user更新shopId
         user.setShopId(shop.getShopId());
         user.setShopId(shop.getShopId());
         registerMapper.updateUserShopId(user.getUserId(), shop.getShopId());
         registerMapper.updateUserShopId(user.getUserId(), shop.getShopId());
         log.info("注册供应商---------userID:" + user.getUserId());
         log.info("注册供应商---------userID:" + user.getUserId());
-        return JsonModel.success();
+        return ResponseJsonVo.success();
     }
     }
 
 
     /**
     /**
@@ -222,46 +221,46 @@ public class ShopServiceImpl implements ShopService {
      * @return BaseUser
      * @return BaseUser
      */
      */
     @Override
     @Override
-    public JsonModel appletsRegister(Integer source, String name, String sName, String bindMobile, String email, String smsCode, String password, String passWordConfirm, String linkMan, Integer provinceId, Integer cityId, Integer townId, String address, String socialCreditCode, String businessLicenseImage, String firstShopType, String secondShopType, String mainPro, Integer isAgreed, ServerWebExchange serverWebExchange, Integer whichStep) {
+    public ResponseJsonVo appletsRegister(Integer source, String name, String sName, String bindMobile, String email, String smsCode, String password, String passWordConfirm, String linkMan, Integer provinceId, Integer cityId, Integer townId, String address, String socialCreditCode, String businessLicenseImage, String firstShopType, String secondShopType, String mainPro, Integer isAgreed, ServerWebExchange serverWebExchange, Integer whichStep) {
         // 参数校验
         // 参数校验
         if (1 == whichStep) {
         if (1 == whichStep) {
             if (StringUtils.isBlank(bindMobile) || StringUtils.isBlank(password)
             if (StringUtils.isBlank(bindMobile) || StringUtils.isBlank(password)
                     || StringUtils.isBlank(smsCode) || StringUtils.isBlank(password)
                     || StringUtils.isBlank(smsCode) || StringUtils.isBlank(password)
                     || StringUtils.isBlank(passWordConfirm)) {
                     || StringUtils.isBlank(passWordConfirm)) {
-                return JsonModel.error("参数异常");
+                return ResponseJsonVo.error("参数异常");
             }
             }
             if (!password.equals(passWordConfirm)) {
             if (!password.equals(passWordConfirm)) {
-                return JsonModel.error("两次输入的密码不一致");
+                return ResponseJsonVo.error("两次输入的密码不一致");
             }
             }
             // 查找用户表是否存在
             // 查找用户表是否存在
             Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
             Integer dbUserId = baseMapper.getUserIdByMobile(bindMobile);
             if (dbUserId > 0) {
             if (dbUserId > 0) {
-                return JsonModel.error("该手机号已被使用", null);
+                return ResponseJsonVo.error("该手机号已被使用", null);
             }
             }
             // 查找运营人员表是否存在
             // 查找运营人员表是否存在
             Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
             Integer dbOperationId = baseMapper.getOperationIdByMobile(bindMobile);
             if (dbOperationId > 0) {
             if (dbOperationId > 0) {
-                return JsonModel.error("您已是机构运营人员,无需再注册机构", null);
+                return ResponseJsonVo.error("您已是机构运营人员,无需再注册机构", null);
             }
             }
             String redisSmsCode = (String) redisService.get("code:" + bindMobile);
             String redisSmsCode = (String) redisService.get("code:" + bindMobile);
             if (redisSmsCode.equals(smsCode)) {
             if (redisSmsCode.equals(smsCode)) {
-                return JsonModel.error("手机验证码错误", null);
+                return ResponseJsonVo.error("手机验证码错误", null);
             }
             }
-            return JsonModel.success();
+            return ResponseJsonVo.success();
         } else if (2 == whichStep) {
         } else if (2 == whichStep) {
             if (StringUtils.isBlank(name) || StringUtils.isBlank(linkMan)) {
             if (StringUtils.isBlank(name) || StringUtils.isBlank(linkMan)) {
-                return JsonModel.error("参数异常");
+                return ResponseJsonVo.error("参数异常");
             }
             }
             if (StringUtils.isNotBlank(email)) {
             if (StringUtils.isNotBlank(email)) {
                 // 查找用户表是否存在相同邮箱
                 // 查找用户表是否存在相同邮箱
                 Integer dbUserId = baseMapper.getUserIdByEmail(email);
                 Integer dbUserId = baseMapper.getUserIdByEmail(email);
                 if (dbUserId > 0) {
                 if (dbUserId > 0) {
-                    return JsonModel.error("该邮箱已被使用", null);
+                    return ResponseJsonVo.error("该邮箱已被使用", null);
                 }
                 }
             }
             }
-            return JsonModel.success();
+            return ResponseJsonVo.success();
         } else if (1 != isAgreed) {
         } else if (1 != isAgreed) {
-            return JsonModel.error("请勾选同意协议");
+            return ResponseJsonVo.error("请勾选同意协议");
         }
         }
         return register(source, name, sName, bindMobile, email, smsCode, password, passWordConfirm, linkMan, provinceId, cityId, townId, address, socialCreditCode, businessLicenseImage, firstShopType, secondShopType, mainPro, isAgreed, serverWebExchange);
         return register(source, name, sName, bindMobile, email, smsCode, password, passWordConfirm, linkMan, provinceId, cityId, townId, address, socialCreditCode, businessLicenseImage, firstShopType, secondShopType, mainPro, isAgreed, serverWebExchange);
     }
     }

+ 31 - 31
src/main/java/com/caimei365/user/utils/ValidateUtil.java

@@ -1,6 +1,6 @@
 package com.caimei365.user.utils;
 package com.caimei365.user.utils;
 
 
-import com.caimei365.user.model.JsonModel;
+import com.caimei365.user.model.ResponseJsonVo;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.StringUtils;
 
 
 import java.util.regex.Matcher;
 import java.util.regex.Matcher;
@@ -32,16 +32,16 @@ public class ValidateUtil {
      *
      *
      * @param mobile 手机号
      * @param mobile 手机号
      */
      */
-    public static JsonModel validateMobile(String mobile) {
+    public static ResponseJsonVo validateMobile(String mobile) {
         if (StringUtils.isEmpty(mobile) || StringUtils.isBlank(mobile)) {
         if (StringUtils.isEmpty(mobile) || StringUtils.isBlank(mobile)) {
-            return JsonModel.error("手机号不可为空");
+            return ResponseJsonVo.error("手机号不可为空");
         } else {
         } else {
             Pattern pattern = Pattern.compile(MOBILE_PATTERN);
             Pattern pattern = Pattern.compile(MOBILE_PATTERN);
             Matcher matcher = pattern.matcher(mobile);
             Matcher matcher = pattern.matcher(mobile);
             if (matcher.matches()) {
             if (matcher.matches()) {
-                return JsonModel.success();
+                return ResponseJsonVo.success();
             } else {
             } else {
-                return JsonModel.error("手机号码格式不正确");
+                return ResponseJsonVo.error("手机号码格式不正确");
             }
             }
         }
         }
     }
     }
@@ -64,48 +64,48 @@ public class ValidateUtil {
     /**
     /**
      * 密码验证
      * 密码验证
      */
      */
-    public static JsonModel validatePassWord(String password) {
+    public static ResponseJsonVo validatePassWord(String password) {
         if (StringUtils.isEmpty(password) || StringUtils.isBlank(password)) {
         if (StringUtils.isEmpty(password) || StringUtils.isBlank(password)) {
-            return JsonModel.error("密码不可为空");
+            return ResponseJsonVo.error("密码不可为空");
         }
         }
         if (password.length() > 16 || password.length() < 8) {
         if (password.length() > 16 || password.length() < 8) {
-            return JsonModel.error("密码长度不正确(8-16)");
+            return ResponseJsonVo.error("密码长度不正确(8-16)");
         }
         }
         Pattern pattern = Pattern.compile(PASSWORD_PATTERN);
         Pattern pattern = Pattern.compile(PASSWORD_PATTERN);
         Matcher matcher = pattern.matcher(password);
         Matcher matcher = pattern.matcher(password);
         if (matcher.matches()) {
         if (matcher.matches()) {
-            return JsonModel.success();
+            return ResponseJsonVo.success();
         } else {
         } else {
-            return JsonModel.error("请输入8-16位字符,需字母数字组合。");
+            return ResponseJsonVo.error("请输入8-16位字符,需字母数字组合。");
         }
         }
     }
     }
 
 
     /**
     /**
      * 确认密码验证
      * 确认密码验证
      */
      */
-    public static JsonModel validatePassWordConfirm(String password, String passWordConfirm) {
+    public static ResponseJsonVo validatePassWordConfirm(String password, String passWordConfirm) {
         if (StringUtils.isEmpty(passWordConfirm) || StringUtils.isBlank(passWordConfirm)) {
         if (StringUtils.isEmpty(passWordConfirm) || StringUtils.isBlank(passWordConfirm)) {
-            return JsonModel.error("确认密码不可为空");
+            return ResponseJsonVo.error("确认密码不可为空");
         }
         }
         if (!password.equals(passWordConfirm)) {
         if (!password.equals(passWordConfirm)) {
-            return JsonModel.error("确认密码与登录密码不一致");
+            return ResponseJsonVo.error("确认密码与登录密码不一致");
         }
         }
-        return JsonModel.success();
+        return ResponseJsonVo.success();
     }
     }
 
 
     /**
     /**
      * 验证机构名称
      * 验证机构名称
      */
      */
-    public static JsonModel validateClubName(String name) {
+    public static ResponseJsonVo validateClubName(String name) {
         if (StringUtils.isEmpty(name) || StringUtils.isBlank(name)) {
         if (StringUtils.isEmpty(name) || StringUtils.isBlank(name)) {
-            return JsonModel.error("请填写美容机构名称");
+            return ResponseJsonVo.error("请填写美容机构名称");
         } else {
         } else {
             Pattern pattern = Pattern.compile(CLUB_NAME_PATTERN);
             Pattern pattern = Pattern.compile(CLUB_NAME_PATTERN);
             Matcher matcher = pattern.matcher(name);
             Matcher matcher = pattern.matcher(name);
             if (matcher.matches()) {
             if (matcher.matches()) {
-                return JsonModel.success();
+                return ResponseJsonVo.success();
             } else {
             } else {
-                return JsonModel.error("机构名称格式不正确");
+                return ResponseJsonVo.error("机构名称格式不正确");
             }
             }
         }
         }
     }
     }
@@ -113,23 +113,23 @@ public class ValidateUtil {
     /**
     /**
      * 验证姓名为中文:匹配2-8个中文字或不超过16位的英文
      * 验证姓名为中文:匹配2-8个中文字或不超过16位的英文
      */
      */
-    public static JsonModel validateUserName(String name) {
+    public static ResponseJsonVo validateUserName(String name) {
         if (StringUtils.isEmpty(name) || StringUtils.isBlank(name) || name.length() < 2) {
         if (StringUtils.isEmpty(name) || StringUtils.isBlank(name) || name.length() < 2) {
-            return JsonModel.error("请输入真实名称");
+            return ResponseJsonVo.error("请输入真实名称");
         } else {
         } else {
             // 判断中文名
             // 判断中文名
             Pattern pattern = Pattern.compile(USER_CN_NAME_PATTERN);
             Pattern pattern = Pattern.compile(USER_CN_NAME_PATTERN);
             Matcher matcher = pattern.matcher(name);
             Matcher matcher = pattern.matcher(name);
             if (matcher.find()) {
             if (matcher.find()) {
-                return JsonModel.success();
+                return ResponseJsonVo.success();
             } else {
             } else {
                 // 判断英文名
                 // 判断英文名
                 pattern = Pattern.compile(USER_EN_NAME_PATTERN);
                 pattern = Pattern.compile(USER_EN_NAME_PATTERN);
                 matcher = pattern.matcher(name);
                 matcher = pattern.matcher(name);
                 if (matcher.matches()) {
                 if (matcher.matches()) {
-                    return JsonModel.success();
+                    return ResponseJsonVo.success();
                 } else {
                 } else {
-                    return JsonModel.error("名称格式不正确");
+                    return ResponseJsonVo.error("名称格式不正确");
                 }
                 }
             }
             }
         }
         }
@@ -141,29 +141,29 @@ public class ValidateUtil {
      * @param address
      * @param address
      * @return JsonForm验证信息
      * @return JsonForm验证信息
      */
      */
-    public static JsonModel validateAddress(String address) {
+    public static ResponseJsonVo validateAddress(String address) {
         if (StringUtils.isEmpty(address) || StringUtils.isBlank(address)) {
         if (StringUtils.isEmpty(address) || StringUtils.isBlank(address)) {
-            return JsonModel.error("请输入您的详细街道地址");
+            return ResponseJsonVo.error("请输入您的详细街道地址");
         }
         }
         if (address.length() > 50) {
         if (address.length() > 50) {
-            return JsonModel.error("地址过长");
+            return ResponseJsonVo.error("地址过长");
         }
         }
-        return JsonModel.success();
+        return ResponseJsonVo.success();
     }
     }
 
 
     /**
     /**
      * 统一社会信用代码验证
      * 统一社会信用代码验证
      */
      */
-    public static JsonModel validateSocialCreditCode(String socialCreditCode) {
+    public static ResponseJsonVo validateSocialCreditCode(String socialCreditCode) {
         if (StringUtils.isEmpty(socialCreditCode) || StringUtils.isBlank(socialCreditCode)) {
         if (StringUtils.isEmpty(socialCreditCode) || StringUtils.isBlank(socialCreditCode)) {
-            return JsonModel.error("请输入您的统一社会信用代码");
+            return ResponseJsonVo.error("请输入您的统一社会信用代码");
         } else {
         } else {
             Pattern pattern = Pattern.compile(SOCIAL_CREDIT_CODE_PATTERN);
             Pattern pattern = Pattern.compile(SOCIAL_CREDIT_CODE_PATTERN);
             Matcher matcher = pattern.matcher(socialCreditCode);
             Matcher matcher = pattern.matcher(socialCreditCode);
             if (matcher.matches()) {
             if (matcher.matches()) {
-                return JsonModel.success();
+                return ResponseJsonVo.success();
             } else {
             } else {
-                return JsonModel.error("统一社会信用代码格式不正确");
+                return ResponseJsonVo.error("统一社会信用代码格式不正确");
             }
             }
         }
         }
     }
     }