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
68774ee0
Commit
68774ee0
authored
Dec 02, 2021
by
hweeeeeei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会话的创建者退出时,是否需要转移给下一个client, true为转移, false暂时没开发
parent
4b5ddcec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
common/src/main/java/com/wecloud/im/param/GetClientInfoParam.java
+1
-1
common/src/main/java/com/wecloud/im/param/add/ImClientLeaveConversation.java
+3
-0
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+12
-3
No files found.
common/src/main/java/com/wecloud/im/param/GetClientInfoParam.java
View file @
68774ee0
...
...
@@ -14,7 +14,7 @@ import java.util.List;
* @since 2021-04-29
*/
@Data
@ApiModel
(
value
=
"Get
Sign
Param"
)
@ApiModel
(
value
=
"Get
ClientInfo
Param"
)
public
class
GetClientInfoParam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
...
...
common/src/main/java/com/wecloud/im/param/add/ImClientLeaveConversation.java
View file @
68774ee0
...
...
@@ -19,4 +19,7 @@ public class ImClientLeaveConversation extends BaseEntity {
@ApiModelProperty
(
"会话表id"
)
private
Long
conversationId
;
@ApiModelProperty
(
"会话的创建者退出时,是否需要转移给下一个client, true为转移, false为不转移直接解散"
)
private
Boolean
transfer
;
}
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
68774ee0
...
...
@@ -472,6 +472,9 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImClient
imClientSender
=
imClientService
.
getCurentClient
();
ImConversation
imConversationById
=
imConversationService
.
getById
(
imClientToConversation
.
getConversationId
());
if
(
imConversationById
==
null
)
{
throw
new
Exception
(
"imConversationById == null"
);
}
// 查询该会话所有成员
List
<
ImConversationMembers
>
membersList
=
imConversationMembersService
.
list
(
...
...
@@ -565,11 +568,17 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
}
// 判断是否为群主
if
(
imConversationById
==
null
||
!
imConversationById
.
getCreator
().
equals
(
imClientSender
.
getId
()))
{
// return ApiResult.result(false);
// 群主退出 是否需要转移给下一个人
if
(
imConversationById
.
getCreator
().
equals
(
imClientSender
.
getId
())
&&
imClientToConversation
.
getTransfer
())
{
ImConversationMembers
conversationMember
=
membersList
.
get
(
0
);
imConversationById
.
setCreator
(
conversationMember
.
getFkClientId
());
// 创建者权限转移给下一个人
imConversationService
.
updateById
(
imConversationById
);
}
return
ApiResult
.
ok
();
}
...
...
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