|
|
@ -194,16 +194,20 @@ public class CommentController extends BaseController {
|
|
|
|
comment.setHaveThumbup(isExists); //
|
|
|
|
comment.setHaveThumbup(isExists); //
|
|
|
|
|
|
|
|
|
|
|
|
UserInfo commentUserInfo = userInfoService.findById(comment.getUserId());
|
|
|
|
UserInfo commentUserInfo = userInfoService.findById(comment.getUserId());
|
|
|
|
|
|
|
|
CommentResp commentResp = new CommentResp();
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(comment,commentResp);
|
|
|
|
|
|
|
|
commentResp.setNickName("已注销");
|
|
|
|
|
|
|
|
commentResp.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
|
|
|
|
if(null != commentUserInfo) {
|
|
|
|
if(null != commentUserInfo) {
|
|
|
|
comment.setNickName(commentUserInfo.getNickName());
|
|
|
|
commentResp.setNickName(commentUserInfo.getNickName());
|
|
|
|
comment.setAvatar(getAvatar(commentUserInfo));
|
|
|
|
commentResp.setAvatar(getAvatar(commentUserInfo));
|
|
|
|
if(StringUtils.isNotEmpty(comment.getReplyToUserId())){
|
|
|
|
if(StringUtils.isNotEmpty(comment.getReplyToUserId())){
|
|
|
|
UserInfo replyToUserInfo = userInfoService.findById(comment.getReplyToUserId());
|
|
|
|
UserInfo replyToUserInfo = userInfoService.findById(comment.getReplyToUserId());
|
|
|
|
comment.setReplyToNickname(replyToUserInfo.getNickName());
|
|
|
|
commentResp.setReplyToNickname(replyToUserInfo.getNickName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CommentResp commentResp = new CommentResp();
|
|
|
|
|
|
|
|
if (null!= commentUserInfo) {
|
|
|
|
if (null!= commentUserInfo) {
|
|
|
|
if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){
|
|
|
|
if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){
|
|
|
|
Set<Integer> badgeSet = new HashSet<>();
|
|
|
|
Set<Integer> badgeSet = new HashSet<>();
|
|
|
@ -215,13 +219,17 @@ public class CommentController extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(comment,commentResp);
|
|
|
|
|
|
|
|
if(comment.getCommentCount()>0){
|
|
|
|
if(comment.getCommentCount()>0){
|
|
|
|
|
|
|
|
|
|
|
|
Comment topComment = commentService.findByParentId(comment.get_id(),1,1).getContent().get(0);
|
|
|
|
Comment topComment = commentService.findByParentId(comment.get_id(),1,1).getContent().get(0);
|
|
|
|
UserInfo topCommentUserInfo = userInfoService.findById(topComment.getUserId());
|
|
|
|
UserInfo topCommentUserInfo = userInfoService.findById(topComment.getUserId());
|
|
|
|
topComment.setNickName(topCommentUserInfo.getNickName());
|
|
|
|
topComment.setNickName("已注销");
|
|
|
|
topComment.setAvatar(getAvatar(topCommentUserInfo));
|
|
|
|
topComment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
|
|
|
|
|
|
|
|
if(null != topCommentUserInfo) {
|
|
|
|
|
|
|
|
topComment.setNickName(topCommentUserInfo.getNickName());
|
|
|
|
|
|
|
|
topComment.setAvatar(getAvatar(topCommentUserInfo));
|
|
|
|
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotEmpty(topComment.getReplyToUserId())){
|
|
|
|
if(StringUtils.isNotEmpty(topComment.getReplyToUserId())){
|
|
|
|
UserInfo topReplyUserInfo = userInfoService.findById(topComment.getReplyToUserId());
|
|
|
|
UserInfo topReplyUserInfo = userInfoService.findById(topComment.getReplyToUserId());
|
|
|
|
topComment.setReplyToNickname(topReplyUserInfo.getNickName());
|
|
|
|
topComment.setReplyToNickname(topReplyUserInfo.getNickName());
|
|
|
@ -259,6 +267,8 @@ public class CommentController extends BaseController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CommentResp commentResp = new CommentResp();
|
|
|
|
CommentResp commentResp = new CommentResp();
|
|
|
|
BeanUtils.copyProperties(comment,commentResp);
|
|
|
|
BeanUtils.copyProperties(comment,commentResp);
|
|
|
|
|
|
|
|
commentResp.setNickName("已注销");
|
|
|
|
|
|
|
|
commentResp.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
|
|
|
|
if (null != commentUserInfo) {
|
|
|
|
if (null != commentUserInfo) {
|
|
|
|
commentResp.setNickName(commentUserInfo.getNickName());
|
|
|
|
commentResp.setNickName(commentUserInfo.getNickName());
|
|
|
|
commentResp.setAvatar(getAvatar(commentUserInfo));
|
|
|
|
commentResp.setAvatar(getAvatar(commentUserInfo));
|
|
|
@ -276,6 +286,8 @@ public class CommentController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
Comment topComment = commentService.findByParentId(comment.get_id(),1,1).getContent().get(0);
|
|
|
|
Comment topComment = commentService.findByParentId(comment.get_id(),1,1).getContent().get(0);
|
|
|
|
UserInfo topCommentUserInfo = userInfoService.findById(topComment.getUserId());
|
|
|
|
UserInfo topCommentUserInfo = userInfoService.findById(topComment.getUserId());
|
|
|
|
|
|
|
|
topComment.setNickName("已注销");
|
|
|
|
|
|
|
|
topComment.setAvatar(Constants.RESOURCE_PREFIX + Constants.DEFAULT_USER_THUMBNAIL);
|
|
|
|
if(null != topCommentUserInfo) {
|
|
|
|
if(null != topCommentUserInfo) {
|
|
|
|
topComment.setNickName(topCommentUserInfo.getNickName());
|
|
|
|
topComment.setNickName(topCommentUserInfo.getNickName());
|
|
|
|
topComment.setAvatar(getAvatar(topCommentUserInfo));
|
|
|
|
topComment.setAvatar(getAvatar(topCommentUserInfo));
|
|
|
|