|
|
|
@ -57,6 +57,9 @@ public class TagService {
|
|
|
|
|
.distinct().collect(toList());
|
|
|
|
|
Map<String, Tag> parentTagMap = queryTagMap(parentIdList);
|
|
|
|
|
Map<String, TagStatistic> tagStatisticMap = queryTagStatistic(tagIdList);
|
|
|
|
|
List<String> creatorIdList = tagPage.stream().map(Tag::getCreatorId).distinct().collect(toList());
|
|
|
|
|
List<UserInfo> userInfoList = userClient.queryByIds(creatorIdList);
|
|
|
|
|
Map<String, String> userInfoMap = userInfoList.stream().collect(toMap(UserInfo::getId, UserInfo::getName));
|
|
|
|
|
Page<TagDTO> pageDTOPage = tagPage.map(tag -> {
|
|
|
|
|
TagDTO tagDTO = new TagDTO();
|
|
|
|
|
BeanUtils.copyProperties(tag, tagDTO);
|
|
|
|
@ -68,6 +71,7 @@ public class TagService {
|
|
|
|
|
if (Objects.nonNull(parentTag)) {
|
|
|
|
|
tagDTO.setParentNameCh(parentTag.getNameCh());
|
|
|
|
|
}
|
|
|
|
|
tagDTO.setCreatorName(userInfoMap.get(tag.getCreatorId()));
|
|
|
|
|
return tagDTO;
|
|
|
|
|
});
|
|
|
|
|
return new PageResult<>(pageDTOPage.getTotalElements(), pageDTOPage.getContent());
|
|
|
|
@ -211,15 +215,8 @@ public class TagService {
|
|
|
|
|
* @return 标签创建人列表
|
|
|
|
|
*/
|
|
|
|
|
public List<UserInfo> queryCreator(){
|
|
|
|
|
/*List<String> creatorIdList = tagDao.queryCreator();
|
|
|
|
|
Result<List<UserInfo>> userInfoResult = userClient.queryAdminList(creatorIdList);
|
|
|
|
|
long resultCode = userInfoResult.getCode();
|
|
|
|
|
if(resultCode == 0){
|
|
|
|
|
return userInfoResult.getData();
|
|
|
|
|
}*/
|
|
|
|
|
UserInfo foo = UserInfo.builder().id("1627863701048659968").name("foo").build();
|
|
|
|
|
UserInfo other = UserInfo.builder().id("1627863701048659969").name("老左").build();
|
|
|
|
|
return Lists.newArrayList(foo, other);
|
|
|
|
|
List<String> creatorIdList = tagDao.queryCreator();
|
|
|
|
|
return userClient.queryByIds(creatorIdList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|