fix commentList avatar errors

main
wangqing 8 months ago
parent 942f2a3296
commit 89a53aa006

@ -194,13 +194,17 @@ public class CommentController extends BaseController {
comment.setHaveThumbup(isExists); //
UserInfo commentUserInfo = userInfoService.findById(comment.getUserId());
if(null != commentUserInfo) {
comment.setNickName(commentUserInfo.getNickName());
comment.setAvatar(getAvatar(commentUserInfo));
if(StringUtils.isNotEmpty(comment.getReplyToUserId())){
UserInfo replyToUserInfo = userInfoService.findById(comment.getReplyToUserId());
comment.setReplyToNickname(replyToUserInfo.getNickName());
}
}
CommentResp commentResp = new CommentResp();
if (null!= commentUserInfo) {
if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){
Set<Integer> badgeSet = new HashSet<>();
Arrays.stream(commentUserInfo.getBadges().split(",")).forEach(b->{
@ -209,6 +213,8 @@ public class CommentController extends BaseController {
});
commentResp.setBadgeList(new ArrayList<>(badgeSet));
}
}
BeanUtils.copyProperties(comment,commentResp);
if(comment.getCommentCount()>0){
@ -254,8 +260,8 @@ public class CommentController extends BaseController {
CommentResp commentResp = new CommentResp();
BeanUtils.copyProperties(comment,commentResp);
if (null != commentUserInfo) {
comment.setNickName(commentUserInfo.getNickName());
comment.setAvatar(getAvatar(commentUserInfo));
commentResp.setNickName(commentUserInfo.getNickName());
commentResp.setAvatar(getAvatar(commentUserInfo));
if (StringUtils.isNotEmpty(commentUserInfo.getBadges())){
Set<Integer> badgeSet = new HashSet<>();
Arrays.stream(commentUserInfo.getBadges().split(",")).forEach(b->{

Loading…
Cancel
Save