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

首页推荐返回空列表 fix

parent 3c8f46e0
...@@ -413,9 +413,13 @@ public class ThemeManager { ...@@ -413,9 +413,13 @@ public class ThemeManager {
List<String> excludes = ListUtils.union(excludeIds, visitedIds); List<String> excludes = ListUtils.union(excludeIds, visitedIds);
List<String> recmdIds = recommendService.getRecommendThemes(pageStart, pageSize, userId, excludes); List<String> recmdIds = recommendService.getRecommendThemes(pageStart, pageSize, userId, excludes);
themes = themeService.queryByThemeIds(recmdIds); // 加载第一页时,为防止首页显示空列表,从推荐池中再捞出已看过帖子
if (req.page.pageNumber == 1 && visitedIds.size() < pageSize) {
recmdIds.addAll(recommendService.getRecommendThemes(pageStart, pageSize, userId, recmdIds));
}
//排序并去重 themes = themeService.queryByThemeIds(recmdIds);
// 排序并去重
themes = RankUtils.sortThemeEntityByIds(themes, recmdIds).stream().limit(pageSize).collect(Collectors.toList()); themes = RankUtils.sortThemeEntityByIds(themes, recmdIds).stream().limit(pageSize).collect(Collectors.toList());
...@@ -683,7 +687,7 @@ public class ThemeManager { ...@@ -683,7 +687,7 @@ public class ThemeManager {
public void convertFromNewsFeed(SynchroThemeReq req2) { public void convertFromNewsFeed(SynchroThemeReq req2) {
String userId = req2.getUserId(); String userId = req2.getUserId();
CreateThemeReq req = new CreateThemeReq(); CreateThemeReq req = new CreateThemeReq();
BeanUtils.copyProperties(req2,req); BeanUtils.copyProperties(req2, req);
req.setTopicId(""); req.setTopicId("");
req.setTitle(""); req.setTitle("");
......
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