Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
b9f7367a
Commit
b9f7367a
authored
May 18, 2022
by
罗长华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对/conversation/getList返回值进行排序置顶优先
parent
69b8ddd6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+12
-0
No files found.
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
b9f7367a
...
@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -12,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -995,6 +996,17 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -995,6 +996,17 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImClient
currentClient
=
contextService
.
getImClientIfNotNullOrThrow
();
ImClient
currentClient
=
contextService
.
getImClientIfNotNullOrThrow
();
// 查询用户加入的所有会话 与每个会话的未读条数 成员
// 查询用户加入的所有会话 与每个会话的未读条数 成员
List
<
ConversationVo
>
myImConversationListAndMsgCount
=
imConversationMapper
.
getMyImConversationListAndMsgCount
(
currentClient
.
getId
(),
currentClient
.
getClientId
(),
null
);
List
<
ConversationVo
>
myImConversationListAndMsgCount
=
imConversationMapper
.
getMyImConversationListAndMsgCount
(
currentClient
.
getId
(),
currentClient
.
getClientId
(),
null
);
if
(
myImConversationListAndMsgCount
.
isEmpty
())
{
return
Collections
.
emptyList
();
}
// 根据top进行排序
List
<
ConversationVo
>
topList
=
myImConversationListAndMsgCount
.
stream
().
filter
(
ConversationVo:
:
getTop
).
collect
(
Collectors
.
toList
());
List
<
ConversationVo
>
normalList
=
myImConversationListAndMsgCount
.
stream
().
filter
(
vo
->
!
vo
.
getTop
()).
collect
(
Collectors
.
toList
());
myImConversationListAndMsgCount
=
new
ArrayList
<>(
topList
);
myImConversationListAndMsgCount
.
addAll
(
normalList
);
// 返回的
// 返回的
List
<
ConversationVo
>
myImConversationListAndMsgCountNew
=
new
ArrayList
<>();
List
<
ConversationVo
>
myImConversationListAndMsgCountNew
=
new
ArrayList
<>();
...
...
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