|
|
@ -197,6 +197,14 @@ public class CommentController extends BaseController {
|
|
|
|
comment.setReplyToNickname(replyToUserInfo.getNickName());
|
|
|
|
comment.setReplyToNickname(replyToUserInfo.getNickName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CommentResp commentResp = new CommentResp();
|
|
|
|
CommentResp commentResp = new CommentResp();
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){
|
|
|
|
|
|
|
|
Set<Integer> badgeSet = new HashSet<>();
|
|
|
|
|
|
|
|
Arrays.stream(commentUserInfo.getBadges().split(",")).forEach(b->{
|
|
|
|
|
|
|
|
int code=Integer.valueOf(b.substring(0, 1));
|
|
|
|
|
|
|
|
badgeSet.add(code);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
commentResp.setBadgeList(new ArrayList<>(badgeSet));
|
|
|
|
|
|
|
|
}
|
|
|
|
BeanUtils.copyProperties(comment,commentResp);
|
|
|
|
BeanUtils.copyProperties(comment,commentResp);
|
|
|
|
if(comment.getCommentCount()>0){
|
|
|
|
if(comment.getCommentCount()>0){
|
|
|
|
|
|
|
|
|
|
|
@ -227,12 +235,21 @@ public class CommentController extends BaseController {
|
|
|
|
UserInfo commentUserInfo = userInfoService.findById(comment.getUserId());
|
|
|
|
UserInfo commentUserInfo = userInfoService.findById(comment.getUserId());
|
|
|
|
comment.setNickName(commentUserInfo.getNickName());
|
|
|
|
comment.setNickName(commentUserInfo.getNickName());
|
|
|
|
comment.setAvatar(Constants.RESOURCE_PREFIX+commentUserInfo.getAvatar());
|
|
|
|
comment.setAvatar(Constants.RESOURCE_PREFIX+commentUserInfo.getAvatar());
|
|
|
|
|
|
|
|
|
|
|
|
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());
|
|
|
|
comment.setReplyToNickname(replyToUserInfo.getNickName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CommentResp commentResp = new CommentResp();
|
|
|
|
CommentResp commentResp = new CommentResp();
|
|
|
|
BeanUtils.copyProperties(comment,commentResp);
|
|
|
|
BeanUtils.copyProperties(comment,commentResp);
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){
|
|
|
|
|
|
|
|
Set<Integer> badgeSet = new HashSet<>();
|
|
|
|
|
|
|
|
Arrays.stream(commentUserInfo.getBadges().split(",")).forEach(b->{
|
|
|
|
|
|
|
|
int code=Integer.valueOf(b.substring(0, 1));
|
|
|
|
|
|
|
|
badgeSet.add(code);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
commentResp.setBadgeList(new ArrayList<>(badgeSet));
|
|
|
|
|
|
|
|
}
|
|
|
|
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);
|
|
|
|