release: 个人信息更新获得积分回传

release-2024-04-25
huangyw 2 months ago
parent e5dc9bf48b
commit 815b97b862

@ -134,7 +134,7 @@ public class MyController extends BaseController {
@ApiOperation(value = "2.更新个人信息", notes = "游客无法编辑个人信息") @ApiOperation(value = "2.更新个人信息", notes = "游客无法编辑个人信息")
@PutMapping("/userInfo") @PutMapping("/userInfo")
@GlobalInterceptor(checkAppUserLogin = true) @GlobalInterceptor(checkAppUserLogin = true)
public Result<List<String>> updateUserInfo(@RequestHeader(value = "Authorization", required = true) String authorization, public Result<String> updateUserInfo(@RequestHeader(value = "Authorization", required = true) String authorization,
@VerifyParam(required = true) @RequestBody UserInfoUpdateDto userInfoUpdateDto) { @VerifyParam(required = true) @RequestBody UserInfoUpdateDto userInfoUpdateDto) {
UserLoginDto userLoginDto = getUserLoginDto(authorization); UserLoginDto userLoginDto = getUserLoginDto(authorization);
UserInfo user = userInfoService.findById(userLoginDto.getUserId()); UserInfo user = userInfoService.findById(userLoginDto.getUserId());
@ -151,13 +151,14 @@ public class MyController extends BaseController {
} }
} }
Integer point = 0;
// 信息是否已完善 // 信息是否已完善
if (StringUtils.isNotBlank(userInfoUpdateDto.getBirthDay()) if (StringUtils.isNotBlank(userInfoUpdateDto.getBirthDay())
&& StringUtils.isNotBlank(userInfoUpdateDto.getNickName()) && StringUtils.isNotBlank(userInfoUpdateDto.getNickName())
&& !Objects.isNull(userInfoUpdateDto.getSex()) && !Objects.isNull(userInfoUpdateDto.getSex())
&& StringUtils.isNotBlank(userInfoUpdateDto.getBirthDay()) && 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())) { if (StringUtils.isNotBlank(userInfoUpdateDto.getInvitationCode()) && StringUtils.isBlank(user.getInvitationUserId())) {
@ -186,8 +187,8 @@ public class MyController extends BaseController {
user.setModifyTime(new Date()); user.setModifyTime(new Date());
userInfoService.update(user); userInfoService.update(user);
List<String> resultList = new ArrayList<>();
return Result.success(resultList); return Result.success(point > 0 ? "更新成功,获得" + point + "积分" : "更新成功");
} }
@ApiOperation(value = "3.上传个人头像", notes = "图片存入S3桶为indie目录为 user/avatar/, 缩略图大小为200X200") @ApiOperation(value = "3.上传个人头像", notes = "图片存入S3桶为indie目录为 user/avatar/, 缩略图大小为200X200")

Loading…
Cancel
Save