评论组件增加查看原评论功能

This commit is contained in:
x ronger 2020-09-29 18:27:30 +08:00
parent ae5978bba5
commit 65a30ed420
2 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,8 @@ public class CommentDTO {
private String commentOriginalAuthorThumbnailURL; private String commentOriginalAuthorThumbnailURL;
/** 父评论作者昵称 */ /** 父评论作者昵称 */
private String commentOriginalAuthorNickname; private String commentOriginalAuthorNickname;
/** 父评论作者昵称 */
private String commentOriginalContent;
/** 状态 */ /** 状态 */
private String commentStatus; private String commentStatus;
/** 0公开回帖1匿名回帖 */ /** 0公开回帖1匿名回帖 */

View File

@ -44,12 +44,14 @@ public class CommentServiceImpl extends AbstractService<Comment> implements Comm
commentDTO.setCommenter(author); commentDTO.setCommenter(author);
} }
} }
if (commentDTO.getCommentOriginalCommentId() != null) { if (commentDTO.getCommentOriginalCommentId() != null && commentDTO.getCommentOriginalCommentId() > 0) {
Author commentOriginalAuthor = commentMapper.selectCommentOriginalAuthor(commentDTO.getCommentOriginalCommentId()); Author commentOriginalAuthor = commentMapper.selectCommentOriginalAuthor(commentDTO.getCommentOriginalCommentId());
if (commentOriginalAuthor != null) { if (commentOriginalAuthor != null) {
commentDTO.setCommentOriginalAuthorThumbnailURL(commentOriginalAuthor.getUserAvatarURL()); commentDTO.setCommentOriginalAuthorThumbnailURL(commentOriginalAuthor.getUserAvatarURL());
commentDTO.setCommentOriginalAuthorNickname(commentOriginalAuthor.getUserNickname()); commentDTO.setCommentOriginalAuthorNickname(commentOriginalAuthor.getUserNickname());
} }
Comment comment = commentMapper.selectByPrimaryKey(commentDTO.getCommentOriginalCommentId());
commentDTO.setCommentOriginalContent(comment.getCommentContent());
} }
}); });
return commentDTOList; return commentDTOList;