代码调整

This commit is contained in:
2023-06-15 16:01:50 +08:00
parent d9468d2c5e
commit 4350a2c342
22 changed files with 720 additions and 42 deletions

View File

@@ -31,6 +31,15 @@ public interface UserFeignClient {
@GetMapping("/getUserByName/{loginName}")
HttpResult<UserDTO> getUserByName(@PathVariable("loginName") String loginName);
/**
* 根据手机号查询用户信息
*
* @param phone 登录名
* @return 用户基本信息
*/
@GetMapping("/getUserByPhone/{phone}")
HttpResult<UserDTO> getUserByPhone(@PathVariable("phone")String phone);
/**
* 认证后根据用户名判断用户状态
* @param loginName 登录名
@@ -55,4 +64,6 @@ public interface UserFeignClient {
*/
@PostMapping("/userByIdList")
HttpResult<List<User>> getUserByIdList(@RequestBody List<String> ids);
}

View File

@@ -43,6 +43,12 @@ public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeign
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<UserDTO> getUserByPhone(String phone) {
log.error("{}异常,降级处理,异常为:{}","根据手机号查询用户信息",cause.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<Boolean> judgeUserStatus(String loginName) {
log.error("{}异常,降级处理,异常为:{}","认证后根据用户名判断用户状态",cause.toString());

View File

@@ -24,6 +24,7 @@ public enum UserResponseEnum {
LOGIN_USERNAME_INVALID("A0101", "用户名非法"),
LOGIN_USER_INDEX_INVALID("A0101", "用户索引非法"),
LOGIN_PHONE_NOT_FOUND("A0101", "手机号不存在"),
LOGIN_PHONE_NOT_REGISTER("A0101", "手机号未注册"),
KEY_WRONG("A0101","登录密码/验证码为空"),
LOGIN_WRONG_PWD("A0101", "用户名密码错误"),
LOGIN_WRONG_PHONE_CODE("A0101", "短信验证码错误"),

View File

@@ -58,12 +58,12 @@ public class AuthClient {
private String authorities;
/**
* 认证令牌时效
* 认证令牌时效 单位:秒
*/
private Integer accessTokenValidity;
/**
* 刷新令牌时效
* 刷新令牌时效 单位:秒
*/
private Integer refreshTokenValidity;