From 8c5bab19e1d981954bdd858715eac8df50698b79 Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Wed, 24 Jul 2024 16:29:04 +0800 Subject: [PATCH] =?UTF-8?q?release:=20=E4=BF=AE=E6=94=B9=E6=98=B5=E7=A7=B0?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/constants/TaskPointIdConstants.java | 2 +- .../java/com/luoo/user/controller/MyController.java | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/luoo_common/src/main/java/constants/TaskPointIdConstants.java b/luoo_common/src/main/java/constants/TaskPointIdConstants.java index 758d7b7..b3f1a1e 100644 --- a/luoo_common/src/main/java/constants/TaskPointIdConstants.java +++ b/luoo_common/src/main/java/constants/TaskPointIdConstants.java @@ -12,7 +12,7 @@ public class TaskPointIdConstants { public static final String NEW_USER_WELCOME_AWARD = "1"; // 修改头像 public static final String MODIFY_AVATAR = "2"; - // 修改昵称 todo + // 修改昵称 public static final String MODIFY_NICKNAME = "3"; // 完善个人信息 todo public static final String COMPLETE_PERSONAL_INFORMATION = "4"; diff --git a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java index 2857323..05c388c 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java @@ -132,6 +132,12 @@ public class MyController extends BaseController { } } + boolean isChangeNickName = false; + if(!Objects.equals(nickName, user.getNickName())) { + // 修改了昵称 + isChangeNickName = true; + } + if (!StringTools.isEmpty(nickName)) { user.setNickName(nickName); rabbitTemplate.convertAndSend("userInfoCommentCache", userLoginDto.getUserId()); @@ -152,6 +158,11 @@ public class MyController extends BaseController { } user.setModifyTime(new Date()); userInfoService.update(user); + + if(isChangeNickName) { + // 修改了昵称 + userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_NICKNAME, user.getNickName()); + } return Result.success(); }