refactor(auth):重构认证服务,分离用户逻辑到独立服务
- 将用户相关业务迁移至用户模块,通过OpenFeign远程调用。
This commit is contained in:
@@ -4,7 +4,7 @@ import com.hanserwei.framework.biz.operationlog.aspect.ApiOperationLog;
|
||||
import com.hanserwei.framework.common.response.Response;
|
||||
import com.hanserwei.hannote.auth.model.vo.user.UpdatePasswordReqVO;
|
||||
import com.hanserwei.hannote.auth.model.vo.user.UserLoginReqVO;
|
||||
import com.hanserwei.hannote.auth.service.UserService;
|
||||
import com.hanserwei.hannote.auth.service.AuthService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -16,26 +16,26 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class UserController {
|
||||
public class AuthController {
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
private AuthService authService;
|
||||
|
||||
@PostMapping("/login")
|
||||
@ApiOperationLog(description = "用户登录/注册")
|
||||
public Response<String> loginAndRegister(@Validated @RequestBody UserLoginReqVO userLoginReqVO) {
|
||||
return userService.loginAndRegister(userLoginReqVO);
|
||||
return authService.loginAndRegister(userLoginReqVO);
|
||||
}
|
||||
|
||||
@PostMapping("/logout")
|
||||
@ApiOperationLog(description = "账号登出")
|
||||
public Response<?> logout() {
|
||||
return userService.logout();
|
||||
return authService.logout();
|
||||
}
|
||||
|
||||
@PostMapping("/password/update")
|
||||
@ApiOperationLog(description = "修改密码")
|
||||
public Response<?> updatePassword(@Validated @RequestBody UpdatePasswordReqVO updatePasswordReqVO) {
|
||||
return userService.updatePassword(updatePasswordReqVO);
|
||||
return authService.updatePassword(updatePasswordReqVO);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user