Commit c5f9c9f2 authored by 李健华's avatar 李健华

保存用户昵称和头像提供给kdsp

parent 1cb0f26d
...@@ -125,6 +125,34 @@ public class UserCenterController { ...@@ -125,6 +125,34 @@ public class UserCenterController {
return JsonResult.buildSuccessResult(null, userAttached.getNick()); return JsonResult.buildSuccessResult(null, userAttached.getNick());
} }
@RequestMapping("/kdsp/saveNick")
@ApiOperation(value = "保存昵称", notes = "保存用户昵称", httpMethod = "POST")
public JsonResult saveUserNickForKdsp(Long userId, String nick) {
if (null == userId || userId == 0L) {
return JsonResult.buildErrorStateResult("该用户不存在", null);
}
UserAttached userAttached = userCenterService.saveUserNick(userId, nick);
return JsonResult.buildSuccessResult(null, userAttached.getNick());
}
@RequestMapping("/kdsp/save/avatar")
@ApiOperation(value = "保存头像", notes = "保存用户头像", httpMethod = "POST")
public JsonResult saveUserAvatarAddrForKdsp(Long userId, String avatarUrl) {
if (StringUtils.isBlank(avatarUrl)) {
log.error("参数不合法:avatarUrl:{}}", avatarUrl );
return JsonResult.buildErrorStateResult("参数不合法", null);
}
if (null == userId || userId == 0L) {
return JsonResult.buildErrorStateResult("该用户不存在", null);
}
UserAttached userAttached = userCenterService.saveUserAvatar(userId, avatarUrl);
if (null == userAttached) {
log.error("保存用户头像昵称失败.");
return JsonResult.buildErrorStateResult("信息保存失败,请稍后再试.", null);
}
return JsonResult.buildSuccessResult("保存成功", userAttached);
}
/** /**
* 上传后调用该接口保存用户头像 * 上传后调用该接口保存用户头像
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment