|
|
|
@ -310,7 +310,15 @@ public class CommentController extends BaseController {
|
|
|
|
|
comment.setAvatar(Constants.RESOURCE_PREFIX+userLoginDto.getAvatar());
|
|
|
|
|
comment.setLocation(IpUtil.getIpLocation(getIpAddr(request)));
|
|
|
|
|
Comment commentResp = commentService.save(comment,userLoginDto);
|
|
|
|
|
|
|
|
|
|
UserInfo commentUserInfo = userInfoService.findById(comment.getUserId());
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
return Result.success(commentResp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|