提交 6ab85f80 作者: xiaowang

返回列表评论用户信息

上级 4750a89d
......@@ -241,7 +241,24 @@ public class DynamicServiceImpl implements DynamicService {
if (commentMap != null) {
List<ForumDynamicDO> comment = commentMap.get(d.getId().toString());
if (CollectionUtils.isNotEmpty(comment)) {
dynamicVO.setCommentAndReplyVO(comment.stream().limit(2).map(ForumDynamicDO::buildDynamicVO).collect(Collectors.toList()));
List<Integer> commentUserIds = comment.stream().map(ForumDynamicDO::getUserAccountId).collect(Collectors.toList());
bUserAccountQO.setUserIds(commentUserIds);
List<UserAccountSimpleDTO> commentUserAccountSimple =
userAppApi.feignListAppUserAccount(bUserAccountQO, request.getHeader(TokenConstant.TOKEN));
List<DynamicVO> commentAndReply = comment.stream().limit(2).map(ForumDynamicDO::buildDynamicVO).collect(Collectors.toList());
for (DynamicVO vo : commentAndReply) {
for (UserAccountSimpleDTO userAccountSimpleDTO : commentUserAccountSimple) {
if (vo.getUserAccountId().equals(userAccountSimpleDTO.getId())) {
UserBaseInfoVO userBaseInfoVO = new UserBaseInfoVO();
userBaseInfoVO.setUserImg(userAccountSimpleDTO.getUserImg());
userBaseInfoVO.setUserName(userAccountSimpleDTO.getUserName());
userBaseInfoVO.setNickName(userAccountSimpleDTO.getNickName());
vo.setUserBaseInfo(userBaseInfoVO);
break;
}
}
}
dynamicVO.setCommentAndReplyVO(commentAndReply);
}
}
UserAccountSimpleDTO userAccountSimpleDTO =
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论