|
|
|
@ -106,7 +106,12 @@ public class CommentService {
|
|
|
|
|
commentHis.setJournalId(parentComment.getJournalId());
|
|
|
|
|
commentHis.setJournalImage(parentComment.getJournalImage());
|
|
|
|
|
commentHis.setCreateTime(new Date());
|
|
|
|
|
commentHisDao.save(commentHis);
|
|
|
|
|
UserInfo parentCommentUser =userInfoService.findById(parentComment.getUserId());
|
|
|
|
|
if (0 != parentCommentUser.getEnableNotice()) {
|
|
|
|
|
commentHisDao.save(commentHis);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comment.setJournalId("");//如果有父节点,将期刊号置为空
|
|
|
|
|
// 将parentComment的rootID值带过来
|
|
|
|
@ -134,7 +139,10 @@ public class CommentService {
|
|
|
|
|
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX+userLoginDto.getAvatar());
|
|
|
|
|
userMessageDto.setSendUserId(userLoginDto.getUserId());
|
|
|
|
|
userMessageDto.setSendUserNickName(userLoginDto.getNickName());
|
|
|
|
|
rabbitTemplate.convertAndSend("userMessage",userMessageDto);
|
|
|
|
|
if (0 != parentCommentUser.getEnableNotice()) {
|
|
|
|
|
rabbitTemplate.convertAndSend("userMessage",userMessageDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -232,18 +240,22 @@ public class CommentService {
|
|
|
|
|
mongoTemplate.updateFirst(query,update,"comment");
|
|
|
|
|
|
|
|
|
|
Comment parentComment = commentDao.findById(commentId).get();
|
|
|
|
|
/**
|
|
|
|
|
* 向被点赞者发消息
|
|
|
|
|
*/
|
|
|
|
|
UserMessageDto userMessageDto = new UserMessageDto();
|
|
|
|
|
userMessageDto.setType(MessageTypeEnum.THUMB_UP.getType()); //消息类型 1私信 ,2新赞,3新关注, 4新评论 5.系统消息
|
|
|
|
|
userMessageDto.setUserId(parentComment.getUserId());
|
|
|
|
|
userMessageDto.setContent(userLoginDto.getNickName()+" 点赞了你的评论");
|
|
|
|
|
userMessageDto.setTitle("您有新的点赞");
|
|
|
|
|
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX+userLoginDto.getAvatar());
|
|
|
|
|
userMessageDto.setSendUserId(userLoginDto.getUserId());
|
|
|
|
|
userMessageDto.setSendUserNickName(userLoginDto.getNickName());
|
|
|
|
|
rabbitTemplate.convertAndSend("userMessage",userMessageDto);
|
|
|
|
|
UserInfo parentCommentUser =userInfoService.findById(parentComment.getUserId());
|
|
|
|
|
if (0 != parentCommentUser.getEnableNotice()) {
|
|
|
|
|
/**
|
|
|
|
|
* 向被点赞者发消息
|
|
|
|
|
*/
|
|
|
|
|
UserMessageDto userMessageDto = new UserMessageDto();
|
|
|
|
|
userMessageDto.setType(MessageTypeEnum.THUMB_UP.getType()); //消息类型 1私信 ,2新赞,3新关注, 4新评论 5.系统消息
|
|
|
|
|
userMessageDto.setUserId(parentComment.getUserId());
|
|
|
|
|
userMessageDto.setContent(userLoginDto.getNickName()+" 点赞了你的评论");
|
|
|
|
|
userMessageDto.setTitle("您有新的点赞");
|
|
|
|
|
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX+userLoginDto.getAvatar());
|
|
|
|
|
userMessageDto.setSendUserId(userLoginDto.getUserId());
|
|
|
|
|
userMessageDto.setSendUserNickName(userLoginDto.getNickName());
|
|
|
|
|
rabbitTemplate.convertAndSend("userMessage",userMessageDto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Page<Comment> search(int page, int size) {
|
|
|
|
|