Commit b8030743 authored by 刘基明's avatar 刘基明

点赞评论消息通知 fix

parent 7015eb81
...@@ -126,6 +126,9 @@ public class NotificationManager { ...@@ -126,6 +126,9 @@ public class NotificationManager {
if (NotificationTypeEnum.COMMENT_LIKE.getCode().equals(themeNotifyQo.getMessageType())) { if (NotificationTypeEnum.COMMENT_LIKE.getCode().equals(themeNotifyQo.getMessageType())) {
CommentEntity commentEntity = commentService.queryByCommentId(themeNotifyQo.getCommentId()); CommentEntity commentEntity = commentService.queryByCommentId(themeNotifyQo.getCommentId());
if (commentEntity!=null){
themeNotifyQo.setContent(null);
}else {
themeNotifyQo.setFormerThemeId(commentEntity.getThemeId()); themeNotifyQo.setFormerThemeId(commentEntity.getThemeId());
themeNotifyQo.setContent(commentEntity.getContent()); themeNotifyQo.setContent(commentEntity.getContent());
ThemeEntity themeEntity = themeService.queryByThemeId(commentEntity.getThemeId()); ThemeEntity themeEntity = themeService.queryByThemeId(commentEntity.getThemeId());
...@@ -141,6 +144,8 @@ public class NotificationManager { ...@@ -141,6 +144,8 @@ public class NotificationManager {
} }
} }
} }
}
// 外部话题 // 外部话题
if (StringUtils.isNotBlank(themeNotifyQo.getTopicId())) { if (StringUtils.isNotBlank(themeNotifyQo.getTopicId())) {
themeNotifyQo.setTopicTitle(topicService.queryTitleById(themeNotifyQo.getTopicId())); themeNotifyQo.setTopicTitle(topicService.queryTitleById(themeNotifyQo.getTopicId()));
......
...@@ -226,10 +226,12 @@ public class NotificationService { ...@@ -226,10 +226,12 @@ public class NotificationService {
} }
// 删除评论及缓存 // 删除评论及缓存,并更新
public void deleteCommentNotify(String notifyUserId, String operatorId, String commentId, LocalDateTime commentTime) { public void deleteCommentNotify(String notifyUserId, String operatorId, String commentId, LocalDateTime commentTime) {
// 物理删除 // 物理删除
NotificationEntity commentNotify = notificationMapper.selectOne(new LambdaQueryWrapper<NotificationEntity>().eq(NotificationEntity::getTargetId, commentId)); NotificationEntity commentNotify = notificationMapper.selectOne(new LambdaQueryWrapper<NotificationEntity>()
.eq(NotificationEntity::getTargetId, commentId)
.eq(NotificationEntity::getMessageType, NotificationTypeEnum.COMMENT.getType()));
NotificationEntity last = notificationMapper.selectOne(new LambdaQueryWrapper<NotificationEntity>().eq(NotificationEntity::getNotifiedUserId, notifyUserId) NotificationEntity last = notificationMapper.selectOne(new LambdaQueryWrapper<NotificationEntity>().eq(NotificationEntity::getNotifiedUserId, notifyUserId)
.orderByDesc(NotificationEntity::getUpdateTime) .orderByDesc(NotificationEntity::getUpdateTime)
.last("limit 1")); .last("limit 1"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment