release- 修改音乐人审核站内信设置

release-2024-08-08
huangyawei 6 months ago
parent 92997c4a67
commit 520bcd8320

@ -8,7 +8,6 @@ import com.luoo.user.dto.artist.ArtistSearchDto;
import com.luoo.user.dto.artist.ArtistUserBindDto; import com.luoo.user.dto.artist.ArtistUserBindDto;
import com.luoo.user.pojo.ArtistInfo; import com.luoo.user.pojo.ArtistInfo;
import com.luoo.user.pojo.ArtistRegister; import com.luoo.user.pojo.ArtistRegister;
import com.luoo.user.pojo.UserProcess;
import com.luoo.user.service.ArtistService; import com.luoo.user.service.ArtistService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -54,7 +53,7 @@ public class ArtistController {
public Result<Void> approve( public Result<Void> approve(
@RequestHeader(value = "Authorization", required = true) String authorization, @RequestHeader(value = "Authorization", required = true) String authorization,
@ApiParam(value = "音乐人审核对象", required = true) @Validated @RequestBody UserProcessApproveDto userProcessApproveDto) { @ApiParam(value = "音乐人审核对象", required = true) @Validated @RequestBody UserProcessApproveDto userProcessApproveDto) {
artistService.approve(userProcessApproveDto); artistService.approve(authorization, userProcessApproveDto);
return Result.success(); return Result.success();
} }

@ -148,10 +148,11 @@ public class ArtistService {
/** /**
* *
* *
* @param token
* @param userProcessApproveDto * @param userProcessApproveDto
*/ */
@Transactional(rollbackFor = Exception.class) @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()) ? String title = ObjectUtils.equals(UserProcessStatusEnum.SUCCESS.getCode(), userProcessApproveDto.getStatus()) ?
"音乐人审核通过" : "音乐人审核失败"; "音乐人审核通过" : "音乐人审核失败";
@ -196,16 +197,19 @@ public class ArtistService {
.build(); .build();
artistInfoDao.save(artistInfo); artistInfoDao.save(artistInfo);
} }
UserInfo sendUser = userInfoDao.findById(artistRegister.getCreateUser()).get();
// 发送审核成功、失败的站内信
// 发送人是当前登录用户
// 接收人是音乐人注册人
UserLoginDto currentUser = jwtUtil.getUserLoginDto(token);
UserMessageDto userMessageDto = new UserMessageDto(); UserMessageDto userMessageDto = new UserMessageDto();
userMessageDto.setType(MessageTypeEnum.PRIVATE_MESSAGE.getType()); userMessageDto.setType(MessageTypeEnum.PRIVATE_MESSAGE.getType());
userMessageDto.setSendUserId(sendUser.getId()); userMessageDto.setSendUserId(currentUser.getUserId());
userMessageDto.setTitle(title); userMessageDto.setTitle(title);
userMessageDto.setContent(content); userMessageDto.setContent(content);
userMessageDto.setUserId(artistRegister.getCreateUser()); userMessageDto.setUserId(artistRegister.getCreateUser());
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX + sendUser.getAvatar()); userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX + currentUser.getAvatar());
userMessageDto.setSendUserNickName(sendUser.getNickName()); userMessageDto.setSendUserNickName(currentUser.getNickName());
userMessageService.sendUserMessage(userMessageDto); userMessageService.sendUserMessage(userMessageDto);
} }

Loading…
Cancel
Save