release: 修改昵称积分任务

release-2024-08-08
huangyw 4 months ago
parent ed2fba61ca
commit 8c5bab19e1

@ -12,7 +12,7 @@ public class TaskPointIdConstants {
public static final String NEW_USER_WELCOME_AWARD = "1"; public static final String NEW_USER_WELCOME_AWARD = "1";
// 修改头像 // 修改头像
public static final String MODIFY_AVATAR = "2"; public static final String MODIFY_AVATAR = "2";
// 修改昵称 todo // 修改昵称
public static final String MODIFY_NICKNAME = "3"; public static final String MODIFY_NICKNAME = "3";
// 完善个人信息 todo // 完善个人信息 todo
public static final String COMPLETE_PERSONAL_INFORMATION = "4"; public static final String COMPLETE_PERSONAL_INFORMATION = "4";

@ -132,6 +132,12 @@ public class MyController extends BaseController {
} }
} }
boolean isChangeNickName = false;
if(!Objects.equals(nickName, user.getNickName())) {
// 修改了昵称
isChangeNickName = true;
}
if (!StringTools.isEmpty(nickName)) { if (!StringTools.isEmpty(nickName)) {
user.setNickName(nickName); user.setNickName(nickName);
rabbitTemplate.convertAndSend("userInfoCommentCache", userLoginDto.getUserId()); rabbitTemplate.convertAndSend("userInfoCommentCache", userLoginDto.getUserId());
@ -152,6 +158,11 @@ public class MyController extends BaseController {
} }
user.setModifyTime(new Date()); user.setModifyTime(new Date());
userInfoService.update(user); userInfoService.update(user);
if(isChangeNickName) {
// 修改了昵称
userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_NICKNAME, user.getNickName());
}
return Result.success(); return Result.success();
} }

Loading…
Cancel
Save