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
f09ab871
Commit
f09ab871
authored
Feb 28, 2022
by
刘基明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关注话题排序
parent
8577e00c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
1 deletion
+6
-1
TopicFollowQo.java
.../java/com/tanpu/community/api/beans/qo/TopicFollowQo.java
+3
-0
TopicManager.java
...c/main/java/com/tanpu/community/manager/TopicManager.java
+1
-1
ThemeService.java
...c/main/java/com/tanpu/community/service/ThemeService.java
+2
-0
No files found.
community-api/src/main/java/com/tanpu/community/api/beans/qo/TopicFollowQo.java
View file @
f09ab871
...
...
@@ -45,6 +45,9 @@ public class TopicFollowQo {
@ApiModelProperty
(
value
=
"最近一条讨论"
)
public
String
lastTheme
;
@ApiModelProperty
(
value
=
"最近一条讨论发表时间"
)
public
long
lastThemeSecond
;
@ApiModelProperty
(
value
=
"最近一条讨论发表时间-格式化"
)
public
String
lastThemeTime
;
...
...
community-service/src/main/java/com/tanpu/community/manager/TopicManager.java
View file @
f09ab871
...
...
@@ -111,7 +111,7 @@ public class TopicManager {
// 排序
List
<
TopicFollowQo
>
res
=
topicFollowQos
.
stream
().
filter
(
o
->
o
.
checkTopicName
(
keyword
)).
sorted
(
Comparator
.
comparing
(
TopicFollowQo:
:
getSpecialPermission
,
Comparator
.
reverseOrder
()).
thenComparing
(
TopicFollowQo:
:
getLastTheme
Time
,
Comparator
.
nullsFirst
(
Stri
ng:
:
compareTo
).
reversed
()))
thenComparing
(
TopicFollowQo:
:
getLastTheme
Second
,
Comparator
.
nullsFirst
(
Lo
ng:
:
compareTo
).
reversed
()))
.
collect
(
Collectors
.
toList
());
return
res
;
...
...
community-service/src/main/java/com/tanpu/community/service/ThemeService.java
View file @
f09ab871
...
...
@@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.time.ZoneOffset
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Date
;
...
...
@@ -361,6 +362,7 @@ public class ThemeService {
topic
.
setLastTheme
(
getUserName
(
themeQo
.
getAuthorId
())
+
":"
+
themeQo
.
content
.
get
(
0
).
getValue
());
topic
.
setLastThemeTime
(
TimeUtils
.
formatTopicListTime
(
themeEntity
.
getUpdateTime
()));
topic
.
setLastThemeSecond
(
themeEntity
.
getUpdateTime
().
toEpochSecond
(
ZoneOffset
.
of
(
"+8"
)));
}
...
...
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