Commit bf54a288 authored by 刘基明's avatar 刘基明

修复主题列表

parent a5c966b5
......@@ -219,7 +219,7 @@ public class ThemeManager {
throw new BizException("TopicId为空");
}
List<String> rankThemeIds = rankService.getRankThemeListByTopic(req.getTopicId()).subList(pageStart, pageSize);
List<String> rankThemeIds = rankService.getRankThemeListByTopic(req.getTopicId(),pageSize,req.excludeIds);
themes = themeService.queryByThemeIds(rankThemeIds);
themes = RankUtils.sortThemeEntityByIds(themes, rankThemeIds);
......
......@@ -197,11 +197,13 @@ public class RankService {
return hotestThemes;
}
public List<String> getRankThemeListByTopic(String topicId) {
public List<String> getRankThemeListByTopic(String topicId, Integer pageSize, List<String> excludeIds) {
if (this.hotestThemes.size() == 0) {
this.rankThemes();
}
return hotestThemes.stream().filter(o -> topicId.equals(o.getTopicId()))
HashSet<String> excludSet = new HashSet<>(excludeIds);
return hotestThemes.stream().filter(o -> topicId.equals(o.getTopicId()) && !excludSet.contains(o.getThemeId()))
.limit(pageSize)
.map(ThemeAnalysDO::getThemeId)
.collect(Collectors.toList());
}
......
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