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

评论列表时间

parent d86eebbe
...@@ -51,6 +51,7 @@ import com.tanpu.community.util.BizUtils; ...@@ -51,6 +51,7 @@ import com.tanpu.community.util.BizUtils;
import com.tanpu.community.util.ConvertUtil; import com.tanpu.community.util.ConvertUtil;
import com.tanpu.community.util.RankUtils; import com.tanpu.community.util.RankUtils;
import com.tanpu.community.util.TencentcloudUtils; import com.tanpu.community.util.TencentcloudUtils;
import com.tanpu.community.util.TimeUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.ListUtils;
...@@ -866,6 +867,7 @@ public class ThemeManager { ...@@ -866,6 +867,7 @@ public class ThemeManager {
.commentId(commentEntity.getCommentId()) .commentId(commentEntity.getCommentId())
.themeType(ThemeTypeEnum.RES_COMMENT.getCode()) .themeType(ThemeTypeEnum.RES_COMMENT.getCode())
.follow(followRelService.checkFollow(userId, userId)) .follow(followRelService.checkFollow(userId, userId))
.upToNowTime(TimeUtils.calUpToNowTime(commentEntity.getCreateTime()))
.build(); .build();
//原主题包装到formerThemeQo中 //原主题包装到formerThemeQo中
......
...@@ -187,8 +187,6 @@ public class RankService { ...@@ -187,8 +187,6 @@ public class RankService {
} }
// 排序 // 排序
List<TopicRankQo> rankList = topicRankQos.stream() List<TopicRankQo> rankList = topicRankQos.stream()
.sorted(Comparator.comparing(TopicRankQo::getScore).reversed()) .sorted(Comparator.comparing(TopicRankQo::getScore).reversed())
...@@ -200,10 +198,10 @@ public class RankService { ...@@ -200,10 +198,10 @@ public class RankService {
this.rankTopicList = rankList; this.rankTopicList = rankList;
// 首页推荐话题 // 首页推荐话题
// 记录排序前最新的2个话题 // 最新的2个话题
List<TopicRankQo> newest2Topic = topicRankQos.stream().filter(TopicRankQo::judgeNewTopic) List<TopicRankQo> newest2Topic = topicRankQos.stream().filter(TopicRankQo::judgeNewTopic)
.sorted(Comparator.comparing(TopicRankQo::getMinutesTillNow)).limit(2).collect(Collectors.toList()); .sorted(Comparator.comparing(TopicRankQo::getMinutesTillNow)).limit(2).collect(Collectors.toList());
// 最熱的2个话题
List<TopicRankQo> top4Topic = rankList.stream() List<TopicRankQo> top4Topic = rankList.stream()
.limit(6) .limit(6)
.filter(o -> !newest2Topic.contains(o)) .filter(o -> !newest2Topic.contains(o))
......
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