Commit 1b7d5b56 authored by 王亚雷's avatar 王亚雷

关注列表

parent 5cf99e31
......@@ -264,20 +264,21 @@ public class HomePageManager {
List<UserInfoResp> userInfoNews = feignClientForFatools.queryUserListNew(userIdsPage.getContent());
List<FollowQo> followQos = userInfoNews.stream().map(ConvertUtil::userInfoNew2FollowQo).collect(Collectors.toList());
if (StringUtils.isNotEmpty(userId)) {
judgeFollowed(followQos, userId);
followQos = judgeFollowed(followQos, userId);
}
return PageUtils.page(userIdsPage, followQos);
}
//判断返回列表中的用户是否被当前用户关注
public void judgeFollowed(List<FollowQo> followQos, @NotEmpty String followerId) {
public List<FollowQo> judgeFollowed(List<FollowQo> followQos, @NotEmpty String followerId) {
Set<String> idolSet = new HashSet<>(followRelService.queryIdolsByFansId(followerId));
followQos.stream().peek(o -> {
return followQos.stream().map(o -> {
if (idolSet.contains(o.getUserId())) {
o.setFollowed(true);
}
});
return o;
}).collect(Collectors.toList());
}
public void addFollowRel(FollowRelReq req, String followerId) {
......
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