|
|
@ -77,20 +77,21 @@ public class MyController {
|
|
|
|
@ApiImplicitParam(name = "birthDay", value = "生日,格式为: yyyy.MM.dd", required = false),
|
|
|
|
@ApiImplicitParam(name = "birthDay", value = "生日,格式为: yyyy.MM.dd", required = false),
|
|
|
|
@ApiImplicitParam(name = "sex", value = "性别,4个值,0为男,1 为女,2为保密,不填为空", required = false)
|
|
|
|
@ApiImplicitParam(name = "sex", value = "性别,4个值,0为男,1 为女,2为保密,不填为空", required = false)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@PutMapping("/updateUserInfo")
|
|
|
|
@PostMapping("/updateUserInfo/{nickName}/{signature}/{birthDay}/{sex}")
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
@GlobalInterceptor(checkAppUserLogin = true)
|
|
|
|
public Result<Void> updateUserInfo(@RequestHeader(value = "token", required = false) String token,
|
|
|
|
public Result<Void> updateUserInfo(@RequestHeader(value = "token", required = false) String token,
|
|
|
|
@VerifyParam(max = 12) String nickName,
|
|
|
|
@PathVariable @VerifyParam(max = 12) String nickName,
|
|
|
|
@VerifyParam(max = 50) String signature,
|
|
|
|
@PathVariable @VerifyParam(max = 50) String signature,
|
|
|
|
String birthDay,
|
|
|
|
@PathVariable String birthDay,
|
|
|
|
String sex) {
|
|
|
|
@PathVariable String sex) {
|
|
|
|
UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token);
|
|
|
|
|
|
|
|
if(!StringTools.isEmpty(nickName)) {
|
|
|
|
if(!StringTools.isEmpty(nickName)) {
|
|
|
|
long count = userService.countByNickName(nickName);
|
|
|
|
long count = userService.countByNickName(nickName);
|
|
|
|
if (count > 0) {
|
|
|
|
if (count > 0) {
|
|
|
|
return Result.failed(StatusCode.USER_NICK_NAME_HAS_BEEN_EXIST);
|
|
|
|
return Result.failed(StatusCode.USER_NICK_NAME_HAS_BEEN_EXIST);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
UserLoginDto userLoginDto = jwtUtil.getUserLoginDto(token);
|
|
|
|
User user = userService.findById(userLoginDto.getUserId());
|
|
|
|
User user = userService.findById(userLoginDto.getUserId());
|
|
|
|
if(!StringTools.isEmpty(nickName)) {
|
|
|
|
if(!StringTools.isEmpty(nickName)) {
|
|
|
|
user.setNickname(nickName);
|
|
|
|
user.setNickname(nickName);
|
|
|
|