Commit c70b73cf by shenjunjie

渠道榜单移除情感过滤

parent 0ba5c8e1
...@@ -516,18 +516,14 @@ public class ChannelServiceImpl implements ChannelService { ...@@ -516,18 +516,14 @@ public class ChannelServiceImpl implements ChannelService {
// 过滤掉不符合时间条件的数据并排序 // 过滤掉不符合时间条件的数据并排序
Map<String, List<ChannelRecord>> channelRecords = keyMap.values().stream().map(pair -> { Map<String, List<ChannelRecord>> channelRecords = keyMap.values().stream().map(pair -> {
ChannelRecord channelRecord = pair.getRight(); ChannelRecord channelRecord = pair.getRight();
// 情感过滤 List<ChannelIndex.Article> articles = ChannelIndex.Record.filterArticles(startTime, endTime,
if (emotion == EmotionEnum.ALL.getState() || emotion == channelRecord.getEmotion()) { channelRecord.getRecord().getArticles(), emotion);
List<ChannelIndex.Article> articles = ChannelIndex.Record.filterArticles(startTime, endTime, if (0 == articles.size()) {
channelRecord.getRecord().getArticles(), emotion); return null;
if (0 == articles.size()) {
return null;
}
articles.sort(Comparator.comparingLong(ChannelIndex.Article::getTime).reversed());
channelRecord.getRecord().setArticles(articles);
return channelRecord;
} }
return null; articles.sort(Comparator.comparingLong(ChannelIndex.Article::getTime).reversed());
channelRecord.getRecord().setArticles(articles);
return channelRecord;
}).filter(Objects::nonNull).collect(Collectors.groupingBy(ChannelRecord::getPlatform)); }).filter(Objects::nonNull).collect(Collectors.groupingBy(ChannelRecord::getPlatform));
for (String platformName : PLATFORMS) { for (String platformName : PLATFORMS) {
List<ChannelRecord> channelRecordList = channelRecords.getOrDefault(platformName, Collections.emptyList()).stream().limit(size).collect(Collectors.toList()); List<ChannelRecord> channelRecordList = channelRecords.getOrDefault(platformName, Collections.emptyList()).stream().limit(size).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