Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tanpu-community
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
探普后端
tanpu-community
Commits
fec67e58
Commit
fec67e58
authored
Aug 12, 2021
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评论列表时间
parent
d86eebbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
ThemeManager.java
...c/main/java/com/tanpu/community/manager/ThemeManager.java
+2
-0
RankService.java
...rc/main/java/com/tanpu/community/service/RankService.java
+2
-4
No files found.
community-service/src/main/java/com/tanpu/community/manager/ThemeManager.java
View file @
fec67e58
...
...
@@ -51,6 +51,7 @@ import com.tanpu.community.util.BizUtils;
import
com.tanpu.community.util.ConvertUtil
;
import
com.tanpu.community.util.RankUtils
;
import
com.tanpu.community.util.TencentcloudUtils
;
import
com.tanpu.community.util.TimeUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.ListUtils
;
...
...
@@ -866,6 +867,7 @@ public class ThemeManager {
.
commentId
(
commentEntity
.
getCommentId
())
.
themeType
(
ThemeTypeEnum
.
RES_COMMENT
.
getCode
())
.
follow
(
followRelService
.
checkFollow
(
userId
,
userId
))
.
upToNowTime
(
TimeUtils
.
calUpToNowTime
(
commentEntity
.
getCreateTime
()))
.
build
();
//原主题包装到formerThemeQo中
...
...
community-service/src/main/java/com/tanpu/community/service/RankService.java
View file @
fec67e58
...
...
@@ -187,8 +187,6 @@ public class RankService {
}
// 排序
List
<
TopicRankQo
>
rankList
=
topicRankQos
.
stream
()
.
sorted
(
Comparator
.
comparing
(
TopicRankQo:
:
getScore
).
reversed
())
...
...
@@ -200,10 +198,10 @@ public class RankService {
this
.
rankTopicList
=
rankList
;
// 首页推荐话题
// 记录排序前
最新的2个话题
//
最新的2个话题
List
<
TopicRankQo
>
newest2Topic
=
topicRankQos
.
stream
().
filter
(
TopicRankQo:
:
judgeNewTopic
)
.
sorted
(
Comparator
.
comparing
(
TopicRankQo:
:
getMinutesTillNow
)).
limit
(
2
).
collect
(
Collectors
.
toList
());
// 最熱的2个话题
List
<
TopicRankQo
>
top4Topic
=
rankList
.
stream
()
.
limit
(
6
)
.
filter
(
o
->
!
newest2Topic
.
contains
(
o
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment