|
|
|
@ -4,7 +4,6 @@ package com.luoo.comment.service.impl;
|
|
|
|
|
import api.Result;
|
|
|
|
|
import client.vo.SimpleUser;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
import com.luoo.comment.client.UserClient;
|
|
|
|
|
import com.luoo.comment.dao.CommentDao;
|
|
|
|
|
import com.luoo.comment.enums.CommentStatusEnum;
|
|
|
|
|
import com.luoo.comment.pojo.Comment;
|
|
|
|
@ -32,8 +31,8 @@ import java.util.stream.Collectors;
|
|
|
|
|
@Transactional
|
|
|
|
|
public class CommentServiceImpl implements CommentService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserClient userClient;
|
|
|
|
|
// @Autowired
|
|
|
|
|
// private UserClient userClient;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private CommentDao commentDao;
|
|
|
|
@ -109,7 +108,8 @@ public class CommentServiceImpl implements CommentService {
|
|
|
|
|
|
|
|
|
|
List<String> userIds = comments.stream().map(Comment::getUserId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
Result<List<SimpleUser>> userByIds = userClient.findUserByIds(userIds);
|
|
|
|
|
// Result<List<SimpleUser>> userByIds = userClient.findUserByIds(userIds);
|
|
|
|
|
Result<List<SimpleUser>> userByIds = Result.success(null);
|
|
|
|
|
|
|
|
|
|
Map<String, SimpleUser> userIdAndInfoMap = userByIds.getData().stream().collect(Collectors.toMap(SimpleUser::getUserId, Function.identity()));
|
|
|
|
|
|
|
|
|
@ -161,8 +161,8 @@ public class CommentServiceImpl implements CommentService {
|
|
|
|
|
List<CommentVo> commentVos = byArticleId.stream().map(Comment::convertVo).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
List<String> userIds = byArticleId.stream().map(Comment::getUserId).collect(Collectors.toList());
|
|
|
|
|
Result<List<SimpleUser>> userByIds = userClient.findUserByIds(userIds);
|
|
|
|
|
|
|
|
|
|
// Result<List<SimpleUser>> userByIds = userClient.findUserByIds(userIds);
|
|
|
|
|
Result<List<SimpleUser>> userByIds = Result.success(null);
|
|
|
|
|
Map<String, SimpleUser> userIdAndInfoMap = userByIds.getData().stream().collect(Collectors.toMap(SimpleUser::getUserId, Function.identity()));
|
|
|
|
|
|
|
|
|
|
for (CommentVo commentVo : commentVos) {
|
|
|
|
|