From 815b97b862b65031a8941f60425e2dd7cf382c07 Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Thu, 19 Sep 2024 09:52:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?release:=20=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E6=9B=B4=E6=96=B0=E8=8E=B7=E5=BE=97=E7=A7=AF=E5=88=86?= =?UTF-8?q?=E5=9B=9E=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/luoo/user/controller/MyController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 e9a436e..fbd8602 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 @@ -134,7 +134,7 @@ public class MyController extends BaseController { @ApiOperation(value = "2.更新个人信息", notes = "游客无法编辑个人信息") @PutMapping("/userInfo") @GlobalInterceptor(checkAppUserLogin = true) - public Result> updateUserInfo(@RequestHeader(value = "Authorization", required = true) String authorization, + public Result updateUserInfo(@RequestHeader(value = "Authorization", required = true) String authorization, @VerifyParam(required = true) @RequestBody UserInfoUpdateDto userInfoUpdateDto) { UserLoginDto userLoginDto = getUserLoginDto(authorization); UserInfo user = userInfoService.findById(userLoginDto.getUserId()); @@ -151,13 +151,14 @@ public class MyController extends BaseController { } } + Integer point = 0; // 信息是否已完善 if (StringUtils.isNotBlank(userInfoUpdateDto.getBirthDay()) && StringUtils.isNotBlank(userInfoUpdateDto.getNickName()) && !Objects.isNull(userInfoUpdateDto.getSex()) && StringUtils.isNotBlank(userInfoUpdateDto.getBirthDay()) ) { - userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_INFORMATION, authorization); + point = userPointLogService.addByTaskNew(TaskPointIdConstants.MODIFY_INFORMATION, authorization); } if (StringUtils.isNotBlank(userInfoUpdateDto.getInvitationCode()) && StringUtils.isBlank(user.getInvitationUserId())) { @@ -186,8 +187,8 @@ public class MyController extends BaseController { user.setModifyTime(new Date()); userInfoService.update(user); - List resultList = new ArrayList<>(); - return Result.success(resultList); + + return Result.success(point > 0 ? "更新成功,获得" + point + "积分" : "更新成功"); } @ApiOperation(value = "3.上传个人头像", notes = "图片存入S3,桶为indie,目录为 user/avatar/, 缩略图大小为200X200") From a5988fc59b058bd8a160a904447b2f6ba92dc519 Mon Sep 17 00:00:00 2001 From: huangyw <1207046171@qq.com> Date: Fri, 20 Sep 2024 08:43:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?release:=20=E6=9F=A5=E8=AF=A2=E6=97=B6?= =?UTF-8?q?=E8=B5=8B=E4=BA=88redis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/luoo/user/service/TaskPointService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/luoo_user/src/main/java/com/luoo/user/service/TaskPointService.java b/luoo_user/src/main/java/com/luoo/user/service/TaskPointService.java index 629d826..be450e0 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/TaskPointService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/TaskPointService.java @@ -202,6 +202,7 @@ public class TaskPointService { TaskPoint taskPoint = (TaskPoint) redisTemplate.opsForValue().get(TASK_POINT + id); if(taskPoint == null) { taskPoint = taskPointDao.findById(id).get(); + redisTemplate.opsForValue().set(TASK_POINT + id, taskPoint); } return taskPoint; }