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
9277964a
Commit
9277964a
authored
May 19, 2022
by
罗长华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
群主转移后下发事件
parent
5a7afa22
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
core/src/main/java/com/wecloud/im/service/impl/ImGroupServiceImpl.java
+16
-0
No files found.
core/src/main/java/com/wecloud/im/service/impl/ImGroupServiceImpl.java
View file @
9277964a
...
@@ -354,6 +354,9 @@ public class ImGroupServiceImpl implements ImGroupService {
...
@@ -354,6 +354,9 @@ public class ImGroupServiceImpl implements ImGroupService {
@Override
@Override
public
Boolean
groupOwnerTransfer
(
String
groupId
,
String
newGroupOwnerUserId
)
{
public
Boolean
groupOwnerTransfer
(
String
groupId
,
String
newGroupOwnerUserId
)
{
Long
appId
=
SecurityUtils
.
getCurrentAppId
();
ImApplication
imApplication
=
applicationService
.
getCacheById
(
appId
);
ImConversation
conversation
=
imConversationMapper
.
selectOne
(
Wrappers
.<
ImConversation
>
lambdaQuery
().
eq
(
ImConversation:
:
getFkAppid
,
ImConversation
conversation
=
imConversationMapper
.
selectOne
(
Wrappers
.<
ImConversation
>
lambdaQuery
().
eq
(
ImConversation:
:
getFkAppid
,
SecurityUtils
.
getCurrentAppId
()).
eq
(
ImConversation:
:
getId
,
groupId
));
SecurityUtils
.
getCurrentAppId
()).
eq
(
ImConversation:
:
getId
,
groupId
));
if
(
conversation
==
null
)
{
if
(
conversation
==
null
)
{
...
@@ -363,6 +366,7 @@ public class ImGroupServiceImpl implements ImGroupService {
...
@@ -363,6 +366,7 @@ public class ImGroupServiceImpl implements ImGroupService {
ImConversationMembers
oldGroupOwner
=
ImConversationMembers
oldGroupOwner
=
conversationMembersService
.
getOne
(
Wrappers
.<
ImConversationMembers
>
lambdaQuery
().
eq
(
ImConversationMembers:
:
getFkConversationId
,
conversationMembersService
.
getOne
(
Wrappers
.<
ImConversationMembers
>
lambdaQuery
().
eq
(
ImConversationMembers:
:
getFkConversationId
,
conversation
.
getId
()).
eq
(
ImConversationMembers:
:
getRole
,
GroupRoleEnum
.
OWNER
.
getCode
()));
conversation
.
getId
()).
eq
(
ImConversationMembers:
:
getRole
,
GroupRoleEnum
.
OWNER
.
getCode
()));
ImClient
oldGroupOwnerClient
=
clientService
.
getById
(
oldGroupOwner
.
getFkClientId
());
// 获取新群主
// 获取新群主
ImConversationMembers
newGroupOwner
=
ImConversationMembers
newGroupOwner
=
conversationMembersService
.
getOne
(
Wrappers
.<
ImConversationMembers
>
lambdaQuery
().
eq
(
ImConversationMembers:
:
getFkConversationId
,
conversationMembersService
.
getOne
(
Wrappers
.<
ImConversationMembers
>
lambdaQuery
().
eq
(
ImConversationMembers:
:
getFkConversationId
,
...
@@ -385,6 +389,18 @@ public class ImGroupServiceImpl implements ImGroupService {
...
@@ -385,6 +389,18 @@ public class ImGroupServiceImpl implements ImGroupService {
newGroupOwner
.
setRole
(
GroupRoleEnum
.
OWNER
.
getCode
());
newGroupOwner
.
setRole
(
GroupRoleEnum
.
OWNER
.
getCode
());
conversationMembersService
.
updateById
(
newGroupOwner
);
conversationMembersService
.
updateById
(
newGroupOwner
);
}
}
// 操作的client ID
Map
<
String
,
Object
>
content
=
new
HashMap
<>();
content
.
put
(
"operator"
,
newGroupOwner
.
getClientId
());
ImMessage
imMessage
=
MessageBuilder
.
buildEventMessage
(
MsgTypeEnum
.
REMOVE_CLIENT_CONVERSATION
,
imApplication
,
oldGroupOwnerClient
,
conversation
,
JsonUtils
.
encodeJson
(
content
));
imMessageService
.
save
(
imMessage
);
// 发送给在群内的成员
List
<
ImConversationMembers
>
existMemberList
=
conversationMembersService
.
list
(
Wrappers
.<
ImConversationMembers
>
lambdaQuery
()
.
eq
(
ImConversationMembers:
:
getFkConversationId
,
conversation
.
getId
()));
conversationService
.
sendMsgToMembers
(
conversation
,
existMemberList
,
oldGroupOwnerClient
,
imMessage
,
content
);
return
true
;
return
true
;
}
}
...
...
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