From 520bcd83208acfc04eca97d1949e12ddc5754108 Mon Sep 17 00:00:00 2001 From: huangyawei Date: Wed, 29 May 2024 21:38:51 +0800 Subject: [PATCH] =?UTF-8?q?release-=20=E4=BF=AE=E6=94=B9=E9=9F=B3=E4=B9=90?= =?UTF-8?q?=E4=BA=BA=E5=AE=A1=E6=A0=B8=E7=AB=99=E5=86=85=E4=BF=A1=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/luoo/user/controller/ArtistController.java | 3 +-- .../java/com/luoo/user/service/ArtistService.java | 14 +++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/luoo_user/src/main/java/com/luoo/user/controller/ArtistController.java b/luoo_user/src/main/java/com/luoo/user/controller/ArtistController.java index c9ef17a..bb8d63e 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/ArtistController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/ArtistController.java @@ -8,7 +8,6 @@ import com.luoo.user.dto.artist.ArtistSearchDto; import com.luoo.user.dto.artist.ArtistUserBindDto; import com.luoo.user.pojo.ArtistInfo; import com.luoo.user.pojo.ArtistRegister; -import com.luoo.user.pojo.UserProcess; import com.luoo.user.service.ArtistService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -54,7 +53,7 @@ public class ArtistController { public Result approve( @RequestHeader(value = "Authorization", required = true) String authorization, @ApiParam(value = "音乐人审核对象", required = true) @Validated @RequestBody UserProcessApproveDto userProcessApproveDto) { - artistService.approve(userProcessApproveDto); + artistService.approve(authorization, userProcessApproveDto); return Result.success(); } diff --git a/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java b/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java index 3cfe175..aea121b 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/ArtistService.java @@ -148,10 +148,11 @@ public class ArtistService { /** * 音乐人审核 * + * @param token 当前登录信息 * @param userProcessApproveDto 审核实体类 */ @Transactional(rollbackFor = Exception.class) - public void approve(UserProcessApproveDto userProcessApproveDto) { + public void approve(String token, UserProcessApproveDto userProcessApproveDto) { String title = ObjectUtils.equals(UserProcessStatusEnum.SUCCESS.getCode(), userProcessApproveDto.getStatus()) ? "音乐人审核通过" : "音乐人审核失败"; @@ -196,16 +197,19 @@ public class ArtistService { .build(); artistInfoDao.save(artistInfo); } - UserInfo sendUser = userInfoDao.findById(artistRegister.getCreateUser()).get(); + // 发送审核成功、失败的站内信 + // 发送人是当前登录用户 + // 接收人是音乐人注册人 + UserLoginDto currentUser = jwtUtil.getUserLoginDto(token); UserMessageDto userMessageDto = new UserMessageDto(); userMessageDto.setType(MessageTypeEnum.PRIVATE_MESSAGE.getType()); - userMessageDto.setSendUserId(sendUser.getId()); + userMessageDto.setSendUserId(currentUser.getUserId()); userMessageDto.setTitle(title); userMessageDto.setContent(content); userMessageDto.setUserId(artistRegister.getCreateUser()); - userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX + sendUser.getAvatar()); - userMessageDto.setSendUserNickName(sendUser.getNickName()); + userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX + currentUser.getAvatar()); + userMessageDto.setSendUserNickName(currentUser.getNickName()); userMessageService.sendUserMessage(userMessageDto); }