From 6e0ddd530144536cc1e085d50a6452da64e58bd3 Mon Sep 17 00:00:00 2001 From: x ronger Date: Tue, 4 Aug 2020 23:03:47 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=B6=88=E6=81=AF=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E6=96=B9=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/NotificationServiceImpl.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/rymcu/vertical/service/impl/NotificationServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/NotificationServiceImpl.java index f4ae200..45d68cd 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/NotificationServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/NotificationServiceImpl.java @@ -68,19 +68,13 @@ public class NotificationServiceImpl extends AbstractService imple notificationDTO.setAuthor(genAuthor(user)); break; case "1": - // 评论 - comment = commentService.findById(notification.getDataId().toString()); - article = articleService.findArticleDTOById(comment.getCommentArticleId(), 0); - notificationDTO.setDataTitle(article.getArticleTitle()); - notificationDTO.setDataUrl(comment.getCommentSharpUrl()); - user = userService.findById(comment.getCommentAuthorId().toString()); - notificationDTO.setAuthor(genAuthor(user)); + // 关注 break; case "2": // 回帖 comment = commentService.findById(notification.getDataId().toString()); - Comment originalComment = commentService.findById(comment.getCommentOriginalCommentId().toString()); - notificationDTO.setDataTitle(originalComment.getCommentContent()); + article = articleService.findArticleDTOById(comment.getCommentArticleId(), 0); + notificationDTO.setDataTitle(article.getArticleTitle()); notificationDTO.setDataUrl(comment.getCommentSharpUrl()); user = userService.findById(comment.getCommentAuthorId().toString()); notificationDTO.setAuthor(genAuthor(user));