Commit 83cec606 by zhiwj

咨询建议

parent 465761e2
......@@ -39,7 +39,8 @@ public class ProblemReplyServiceImpl implements ProblemReplyService {
}
List<ProblemReplyDTO> problemReplyDTOList = EntityUtil.changeEntityListByJSON(ProblemReplyDTO.class, replyList);
List<TabProblemImg> imgList = problemImgService.listImageByProblemId(problemId);
Map<Integer, List<String>> map = Optional.of(imgList).orElse(Collections.emptyList()).stream()
Map<Integer, List<String>> map = Optional.of(imgList).orElse(Collections.emptyList())
.stream().filter(e -> e.getProblemReplyId() != null)
.collect(Collectors.groupingBy(TabProblemImg::getProblemReplyId, Collectors.mapping(TabProblemImg::getImgUrl, Collectors.toList())));
for (ProblemReplyDTO problemReplyDTO : problemReplyDTOList) {
problemReplyDTO.setImgList(map.get(problemReplyDTO.getProblemReplyId()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment