Commit a6d5c8d4 authored by 王亚雷's avatar 王亚雷

游客权限

parent 3314de2c
...@@ -505,19 +505,20 @@ public class ThemeManager { ...@@ -505,19 +505,20 @@ public class ThemeManager {
} else if (ThemeListTypeEnum.FOLLOW.getCode().equals(req.getType())) { } else if (ThemeListTypeEnum.FOLLOW.getCode().equals(req.getType())) {
if (StringUtils.isEmpty(req.getUserId())) { if (StringUtils.isEmpty(req.getUserId())) {
throw new BizException(ResultCode.UNAUTHORIZED.getCode(), ResultCode.UNAUTHORIZED.getMsg()); // 未登录情况下返回空数组
} themes = Lists.newArrayListWithCapacity(0);
// 根据关注列表查询,按时间倒序 } else {
List<String> fansList = followRelService.queryIdolsByFansId(req.getUserId()); // 根据关注列表查询,按时间倒序
themes = themeService.queryByUserIdsCreateDesc(fansList, pageStart, pageSize); List<String> fansList = followRelService.queryIdolsByFansId(req.getUserId());
themes = themeService.queryByUserIdsCreateDesc(fansList, pageStart, pageSize);
if (CollectionUtils.isEmpty(excludeIds) && !themes.isEmpty()) {
// 说明是从头开始刷,则直接把最新的lastId放到redis中,保留一个月 if (CollectionUtils.isEmpty(excludeIds) && !themes.isEmpty()) {
Long lastId = themes.stream().map(ThemeEntity::getId).max(Long::compareTo).get(); // 说明是从头开始刷,则直接把最新的lastId放到redis中,保留一个月
redisCache.put(CACHE_IDOL_THEME_LAST_ID + req.getUserId(), lastId, 60 * 60 * 24 * 7 * 4); Long lastId = themes.stream().map(ThemeEntity::getId).max(Long::compareTo).get();
redisCache.put(CACHE_IDOL_THEME_LAST_ID + req.getUserId(), lastId, 60 * 60 * 24 * 7 * 4);
// visitLogService.addPageView(userId, userId, VisitTypeEnum.FOLLOW_THEME_VIEW); // visitLogService.addPageView(userId, userId, VisitTypeEnum.FOLLOW_THEME_VIEW);
}
} }
} else if (ThemeListTypeEnum.TOPIC_HOT.getCode().equals(req.getType())) { } else if (ThemeListTypeEnum.TOPIC_HOT.getCode().equals(req.getType())) {
// 根据话题查询热门 // 根据话题查询热门
if (StringUtils.isEmpty(req.getTopicId())) { if (StringUtils.isEmpty(req.getTopicId())) {
......
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