From 65a30ed420db4c3bddfeb221424d5de71b8fb6bd Mon Sep 17 00:00:00 2001 From: x ronger Date: Tue, 29 Sep 2020 18:27:30 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=AF=84=E8=AE=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=A2=9E=E5=8A=A0=E6=9F=A5=E7=9C=8B=E5=8E=9F=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/rymcu/vertical/dto/CommentDTO.java | 2 ++ .../com/rymcu/vertical/service/impl/CommentServiceImpl.java | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rymcu/vertical/dto/CommentDTO.java b/src/main/java/com/rymcu/vertical/dto/CommentDTO.java index a3d2563..3ffb30d 100644 --- a/src/main/java/com/rymcu/vertical/dto/CommentDTO.java +++ b/src/main/java/com/rymcu/vertical/dto/CommentDTO.java @@ -24,6 +24,8 @@ public class CommentDTO { private String commentOriginalAuthorThumbnailURL; /** 父评论作者昵称 */ private String commentOriginalAuthorNickname; + /** 父评论作者昵称 */ + private String commentOriginalContent; /** 状态 */ private String commentStatus; /** 0:公开回帖,1:匿名回帖 */ diff --git a/src/main/java/com/rymcu/vertical/service/impl/CommentServiceImpl.java b/src/main/java/com/rymcu/vertical/service/impl/CommentServiceImpl.java index b6aab70..378c37b 100644 --- a/src/main/java/com/rymcu/vertical/service/impl/CommentServiceImpl.java +++ b/src/main/java/com/rymcu/vertical/service/impl/CommentServiceImpl.java @@ -44,12 +44,14 @@ public class CommentServiceImpl extends AbstractService implements Comm commentDTO.setCommenter(author); } } - if (commentDTO.getCommentOriginalCommentId() != null) { + if (commentDTO.getCommentOriginalCommentId() != null && commentDTO.getCommentOriginalCommentId() > 0) { Author commentOriginalAuthor = commentMapper.selectCommentOriginalAuthor(commentDTO.getCommentOriginalCommentId()); if (commentOriginalAuthor != null) { commentDTO.setCommentOriginalAuthorThumbnailURL(commentOriginalAuthor.getUserAvatarURL()); commentDTO.setCommentOriginalAuthorNickname(commentOriginalAuthor.getUserNickname()); } + Comment comment = commentMapper.selectByPrimaryKey(commentDTO.getCommentOriginalCommentId()); + commentDTO.setCommentOriginalContent(comment.getCommentContent()); } }); return commentDTOList;