czh 2 лет назад
Родитель
Сommit
bfcdf3dc12
1 измененных файлов с 32 добавлено и 59 удалено
  1. 32 59
      sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java

+ 32 - 59
sckw-auth/src/main/java/com/sckw/auth/controller/AuthController.java

@@ -4,7 +4,6 @@ import com.sckw.auth.model.vo.req.*;
 import com.sckw.auth.service.IAuthService;
 import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.exception.SystemException;
-import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.LoginMethodEnum;
 import com.sckw.core.model.enums.SystemTypeEnum;
 import com.sckw.core.utils.RegularUtils;
@@ -141,55 +140,43 @@ public class AuthController {
     public HttpResult login(@Valid @RequestBody LoginReqVo reqVo,
                             @RequestHeader(name = "Client-Type", required = true) String clientType,
                             @RequestHeader(name = "System-Type", required = true) int systemType) throws SystemException {
+//        reqVo.setSystemType(systemType);
+//        reqVo.setClientType(clientType);
+//        LoginBase loginBase = new LoginBase();
+//        loginBase.setAccount(reqVo.getAccount());
+//        loginBase.setPassword(reqVo.getPassword());
+//        loginBase.setCaptcha(reqVo.getCaptcha());
+//        loginBase.setSystemType(systemType);
+//        loginBase.setClientType(clientType);
+//
+//        loginBase.setLoginMethod(LoginMethodEnum.ORDINARY.getValue());
+//        if (StringUtils.isNotBlank(loginBase.getCaptcha())) {
+//            loginBase.setLoginMethod(LoginMethodEnum.SMS.getValue());
+//        }
+//
+//        /**参数校验**/
+//        HttpResult result = checkParams(loginBase);
+//        if (result.getCode() != HttpStatus.SUCCESS_CODE) {
+//            return result;
+//        }
+//
+//        /**运营端/企业端登录(PC/APP)**/
+//        if (loginBase.getSystemType() == SystemTypeEnum.MANAGE.getCode()
+//                || loginBase.getSystemType() == SystemTypeEnum.COMPANY.getCode()) {
+//            return authService.commonAuth(loginBase);
+//        }
+//
+//        /**司机端**/
+//        if (loginBase.getSystemType() == SystemTypeEnum.DRIVER.getCode()) {
+//            return authService.driverAuth(loginBase);
+//        }
+//
+//        return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
         reqVo.setSystemType(systemType);
         reqVo.setClientType(clientType);
         return HttpResult.ok(authService.login(reqVo));
     }
 
-    /**
-     * @param reqVo 注册
-     * @return HttpResult
-     * @desc: 用户注册
-     * @author: czh
-     * @date: 2023/6/16
-     */
-    @PostMapping("/register")
-    public HttpResult register(@Valid @RequestBody RegisterReqVo reqVo,
-                               @RequestHeader(name = "System-Type", required = true) int systemType) throws SystemException {
-        reqVo.setSystemType(systemType);
-        authService.register(reqVo);
-        return HttpResult.ok(HttpStatus.MSG_007);
-    }
-
-    /**
-     * @param reqVo 忘记密码入参
-     * @return HttpResult
-     * @desc: 忘记密码
-     * @author: czh
-     * @date: 2023/6/19
-     */
-    @PostMapping("/forgetPassword")
-    public HttpResult forgetPassword(@Valid @RequestBody ForgetPasswordReqVo reqVo,
-                                     @RequestHeader(name = "System-Type", required = true) int systemType) throws SystemException {
-        reqVo.setSystemType(systemType);
-        authService.forgetPassword(reqVo);
-        return HttpResult.ok(HttpStatus.MSG_002);
-    }
-
-    /**
-     * @param {password 旧密码、newPassword 新密码、account 账号}
-     * @description 修改密码
-     * @author zk
-     * @date 2023/06/02
-     **/
-    @PostMapping("/updatePassword")
-    public HttpResult updatePassword(@Valid @RequestBody UpdatePasswordReqVo reqVo,
-                                     @RequestHeader(name = "System-Type", required = true) int systemType) {
-        reqVo.setSystemType(systemType);
-        authService.updatePassword(reqVo);
-        return HttpResult.ok(HttpStatus.MSG_002);
-    }
-
     /**
      * @param id 主键ID
      * @description 重置密码
@@ -202,18 +189,4 @@ public class AuthController {
         return HttpResult.ok(HttpStatus.MSG_001);
     }
 
-    /**
-     * @desc: 获取验证码
-     * @param: reqVo 入参
-     * @author: czh
-     * @date 2023/7/23
-     * @return HttpResult
-     */
-    @PostMapping("getRegisterSms")
-    public HttpResult getRegisterSms(@Valid @RequestBody GetRegisterSmsReqVo reqVo,
-                                   @RequestHeader(name = "System-Type", required = true) int systemType) {
-        reqVo.setSystemType(systemType);
-        return HttpResult.ok(authService.getRegisterSms(reqVo));
-    }
-
 }