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