|
|
@ -106,7 +106,12 @@ public class CommentService {
|
|
|
|
commentHis.setJournalId(parentComment.getJournalId());
|
|
|
|
commentHis.setJournalId(parentComment.getJournalId());
|
|
|
|
commentHis.setJournalImage(parentComment.getJournalImage());
|
|
|
|
commentHis.setJournalImage(parentComment.getJournalImage());
|
|
|
|
commentHis.setCreateTime(new Date());
|
|
|
|
commentHis.setCreateTime(new Date());
|
|
|
|
|
|
|
|
UserInfo parentCommentUser =userInfoService.findById(parentComment.getUserId());
|
|
|
|
|
|
|
|
if (0 != parentCommentUser.getEnableNotice()) {
|
|
|
|
commentHisDao.save(commentHis);
|
|
|
|
commentHisDao.save(commentHis);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comment.setJournalId("");//如果有父节点,将期刊号置为空
|
|
|
|
comment.setJournalId("");//如果有父节点,将期刊号置为空
|
|
|
|
// 将parentComment的rootID值带过来
|
|
|
|
// 将parentComment的rootID值带过来
|
|
|
@ -134,7 +139,10 @@ public class CommentService {
|
|
|
|
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX+userLoginDto.getAvatar());
|
|
|
|
userMessageDto.setSendUserAvatar(Constants.RESOURCE_PREFIX+userLoginDto.getAvatar());
|
|
|
|
userMessageDto.setSendUserId(userLoginDto.getUserId());
|
|
|
|
userMessageDto.setSendUserId(userLoginDto.getUserId());
|
|
|
|
userMessageDto.setSendUserNickName(userLoginDto.getNickName());
|
|
|
|
userMessageDto.setSendUserNickName(userLoginDto.getNickName());
|
|
|
|
|
|
|
|
if (0 != parentCommentUser.getEnableNotice()) {
|
|
|
|
rabbitTemplate.convertAndSend("userMessage",userMessageDto);
|
|
|
|
rabbitTemplate.convertAndSend("userMessage",userMessageDto);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -232,6 +240,8 @@ public class CommentService {
|
|
|
|
mongoTemplate.updateFirst(query,update,"comment");
|
|
|
|
mongoTemplate.updateFirst(query,update,"comment");
|
|
|
|
|
|
|
|
|
|
|
|
Comment parentComment = commentDao.findById(commentId).get();
|
|
|
|
Comment parentComment = commentDao.findById(commentId).get();
|
|
|
|
|
|
|
|
UserInfo parentCommentUser =userInfoService.findById(parentComment.getUserId());
|
|
|
|
|
|
|
|
if (0 != parentCommentUser.getEnableNotice()) {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 向被点赞者发消息
|
|
|
|
* 向被点赞者发消息
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -246,6 +256,8 @@ public class CommentService {
|
|
|
|
rabbitTemplate.convertAndSend("userMessage",userMessageDto);
|
|
|
|
rabbitTemplate.convertAndSend("userMessage",userMessageDto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Page<Comment> search(int page, int size) {
|
|
|
|
public Page<Comment> search(int page, int size) {
|
|
|
|
Pageable pageable = PageRequest.of(page-1,size);
|
|
|
|
Pageable pageable = PageRequest.of(page-1,size);
|
|
|
|
return commentDao.findAllByOrderByPublishTimeDesc(pageable);
|
|
|
|
return commentDao.findAllByOrderByPublishTimeDesc(pageable);
|
|
|
|