Commit 37e7b457 authored by 刘基明's avatar 刘基明

黑名单过滤

parent f908576f
......@@ -152,6 +152,9 @@ public class ThemeManager {
@Autowired
private TopicReportService topicReportService;
@Value("#{'${theme.filter.userIds}'.split(',')}")
private Set<String> filterUsers;
@PostConstruct
public void init() throws IOException {
File f = new File(tmpDir);
......@@ -514,6 +517,10 @@ public class ThemeManager {
// 权限控制,筛选出当前用户有权限的话题
Set<String> userPermitTopics = topicService.getUserPermitTopics(userId);
// 黑名单过滤
HashSet<String> blackList = new HashSet<>(this.filterUsers);
themes= themes.stream().filter(o->!blackList.contains(o.getAuthorId())).collect(Collectors.toList());
// 排序并去重
themes = RankUtils.sortThemeEntityByIds(themes, recmdIds, userPermitTopics).stream().limit(pageSize).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