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;