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
79c50c8d
Commit
79c50c8d
authored
Mar 10, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常不抛出
parent
f4d9f105
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
15 deletions
+19
-15
core/src/main/java/com/wecloud/im/controller/ImConversationController.java
+8
-5
core/src/main/java/com/wecloud/im/service/ImConversationService.java
+8
-8
core/src/main/java/com/wecloud/im/service/impl/ImConversationMembersServiceImpl.java
+3
-2
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+0
-0
No files found.
core/src/main/java/com/wecloud/im/controller/ImConversationController.java
View file @
79c50c8d
...
@@ -53,8 +53,10 @@ public class ImConversationController extends BaseController {
...
@@ -53,8 +53,10 @@ public class ImConversationController extends BaseController {
*/
*/
@PostMapping
(
"/saveOrUpdateName"
)
@PostMapping
(
"/saveOrUpdateName"
)
@ApiOperation
(
value
=
"添加或修改会话名称"
,
notes
=
"权限:目前只有创建者有权限操作"
)
@ApiOperation
(
value
=
"添加或修改会话名称"
,
notes
=
"权限:目前只有创建者有权限操作"
)
public
ApiResult
<
Boolean
>
saveOrUpdateName
(
@RequestBody
ImConversationNameUpdate
imConversationNameUpdate
)
throws
Exception
{
public
ApiResult
<
Boolean
>
saveOrUpdateName
(
@RequestBody
ImConversationNameUpdate
param
)
{
return
imConversationService
.
saveOrUpdateName
(
imConversationNameUpdate
);
log
.
info
(
"添加或修改会话名称入参 {}"
,
JSON
.
toJSONString
(
param
));
imConversationService
.
saveOrUpdateName
(
param
);
return
ApiResult
.
ok
();
}
}
...
@@ -63,8 +65,9 @@ public class ImConversationController extends BaseController {
...
@@ -63,8 +65,9 @@ public class ImConversationController extends BaseController {
*/
*/
@PostMapping
(
"/saveOrUpdateAttr"
)
@PostMapping
(
"/saveOrUpdateAttr"
)
@ApiOperation
(
value
=
"添加或修改会话拓展字段"
,
notes
=
"权限:所有client都权限操作"
)
@ApiOperation
(
value
=
"添加或修改会话拓展字段"
,
notes
=
"权限:所有client都权限操作"
)
public
ApiResult
<
Boolean
>
saveOrUpdateAttr
(
@RequestBody
ImConversationAttrUpdate
imConversationAttrUpdate
)
throws
Exception
{
public
ApiResult
<
Boolean
>
saveOrUpdateAttr
(
@RequestBody
ImConversationAttrUpdate
imConversationAttrUpdate
)
{
return
imConversationService
.
saveOrUpdateAttr
(
imConversationAttrUpdate
);
imConversationService
.
saveOrUpdateAttr
(
imConversationAttrUpdate
);
return
ApiResult
.
ok
();
}
}
...
@@ -73,7 +76,7 @@ public class ImConversationController extends BaseController {
...
@@ -73,7 +76,7 @@ public class ImConversationController extends BaseController {
*/
*/
@PostMapping
(
"/leave"
)
@PostMapping
(
"/leave"
)
@ApiOperation
(
value
=
"client退出会话"
,
notes
=
"若是创建者退出,[创建者]权限将会转移给按加入会话时间排序的下一个client"
)
@ApiOperation
(
value
=
"client退出会话"
,
notes
=
"若是创建者退出,[创建者]权限将会转移给按加入会话时间排序的下一个client"
)
public
ApiResult
<
Boolean
>
leaveConversation
(
@RequestBody
ImClientLeaveConversation
imClientToConversation
)
throws
Exception
{
public
ApiResult
<
Boolean
>
leaveConversation
(
@RequestBody
ImClientLeaveConversation
imClientToConversation
)
{
log
.
info
(
"client退出会话入参 {}"
,
JSON
.
toJSONString
(
imClientToConversation
));
log
.
info
(
"client退出会话入参 {}"
,
JSON
.
toJSONString
(
imClientToConversation
));
return
imConversationService
.
leaveConversation
(
imClientToConversation
);
return
imConversationService
.
leaveConversation
(
imClientToConversation
);
}
}
...
...
core/src/main/java/com/wecloud/im/service/ImConversationService.java
View file @
79c50c8d
...
@@ -79,7 +79,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
...
@@ -79,7 +79,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
/**
/**
* client退出会话
* client退出会话
*/
*/
ApiResult
<
Boolean
>
leaveConversation
(
ImClientLeaveConversation
imClientToConversation
)
throws
Exception
;
ApiResult
<
Boolean
>
leaveConversation
(
ImClientLeaveConversation
imClientToConversation
);
/**
/**
* 群主转让
* 群主转让
...
@@ -121,12 +121,12 @@ public interface ImConversationService extends BaseService<ImConversation> {
...
@@ -121,12 +121,12 @@ public interface ImConversationService extends BaseService<ImConversation> {
/**
/**
* 添加或修改会话名称
* 添加或修改会话名称
*/
*/
ApiResult
<
Boolean
>
saveOrUpdateName
(
ImConversationNameUpdate
imConversationNameUpdate
)
throws
Exception
;
ApiResult
<
Boolean
>
saveOrUpdateName
(
ImConversationNameUpdate
imConversationNameUpdate
);
/**
/**
* 添加或修改会话拓展字段
* 添加或修改会话拓展字段
*/
*/
ApiResult
<
Boolean
>
saveOrUpdateAttr
(
ImConversationAttrUpdate
imConversationAttrUpdate
)
throws
Exception
;
void
saveOrUpdateAttr
(
ImConversationAttrUpdate
imConversationAttrUpdate
)
;
/**
/**
* 修改
* 修改
...
@@ -135,7 +135,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
...
@@ -135,7 +135,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
boolean
updateImConversation
(
ImConversation
imConversation
)
throws
Exception
;
boolean
updateImConversation
(
ImConversation
imConversation
);
/**
/**
* 修改为 是否单向隐藏会话","云端聊天记录不删除;假设有A和B两个用户,A删会话,B还能发; 如果B发了消息,A这边要重新把会话显示出来,并能显示之前的聊天记录"
* 修改为 是否单向隐藏会话","云端聊天记录不删除;假设有A和B两个用户,A删会话,B还能发; 如果B发了消息,A这边要重新把会话显示出来,并能显示之前的聊天记录"
...
@@ -169,7 +169,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
...
@@ -169,7 +169,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
Paging
<
ImConversationQueryVo
>
getImConversationPageList
(
ImConversationPageParam
imConversationPageParam
)
throws
Exception
;
Paging
<
ImConversationQueryVo
>
getImConversationPageList
(
ImConversationPageParam
imConversationPageParam
);
/**
/**
...
@@ -178,14 +178,14 @@ public interface ImConversationService extends BaseService<ImConversation> {
...
@@ -178,14 +178,14 @@ public interface ImConversationService extends BaseService<ImConversation> {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
List
<
ConversationVo
>
getMyImConversationListAndMsgCount
()
throws
Exception
;
List
<
ConversationVo
>
getMyImConversationListAndMsgCount
();
/**
/**
* 根据会话id查询单个会话信息 与会话的未读条数
* 根据会话id查询单个会话信息 与会话的未读条数
* @param param
* @param param
* @return
* @return
*/
*/
ConversationVo
infoImConversationAndMsgCount
(
ImConversationQueryParam
param
)
throws
Exception
;
ConversationVo
infoImConversationAndMsgCount
(
ImConversationQueryParam
param
);
/**
/**
* 获取加入的所有会话
* 获取加入的所有会话
...
@@ -193,7 +193,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
...
@@ -193,7 +193,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
List
<
ImConversation
>
getMyImConversationList
()
throws
Exception
;
List
<
ImConversation
>
getMyImConversationList
();
/**
/**
* 判断重复会话中的Attributes是否一样
* 判断重复会话中的Attributes是否一样
...
...
core/src/main/java/com/wecloud/im/service/impl/ImConversationMembersServiceImpl.java
View file @
79c50c8d
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Maps
;
import
com.wecloud.im.entity.ImApplication
;
import
com.wecloud.im.entity.ImApplication
;
import
com.wecloud.im.entity.ImClient
;
import
com.wecloud.im.entity.ImClient
;
import
com.wecloud.im.entity.ImConversationMembers
;
import
com.wecloud.im.entity.ImConversationMembers
;
...
@@ -129,9 +130,9 @@ public class ImConversationMembersServiceImpl extends BaseServiceImpl<ImConversa
...
@@ -129,9 +130,9 @@ public class ImConversationMembersServiceImpl extends BaseServiceImpl<ImConversa
// 封装响应的实体
// 封装响应的实体
ImMessageOnlineSend
imMessageOnlineSend
=
new
ImMessageOnlineSend
();
ImMessageOnlineSend
imMessageOnlineSend
=
new
ImMessageOnlineSend
();
imMessageOnlineSend
.
setCreateTime
(
new
Date
());
imMessageOnlineSend
.
setCreateTime
(
new
Date
());
imMessageOnlineSend
.
setType
(
MsgTypeEnum
.
CONVERSATION_
DISBAND
.
getUriCode
());
imMessageOnlineSend
.
setType
(
MsgTypeEnum
.
CONVERSATION_
MEMBER_NAME_MODIFY
.
getUriCode
());
imMessageOnlineSend
.
setSender
(
currentClient
.
getClientId
());
imMessageOnlineSend
.
setSender
(
currentClient
.
getClientId
());
Map
<
String
,
Object
>
content
=
new
HashMap
<>
();
Map
<
String
,
Object
>
content
=
Maps
.
newHashMap
();
content
.
put
(
"operator"
,
currentClient
.
getClientId
());
content
.
put
(
"operator"
,
currentClient
.
getClientId
());
content
.
put
(
"remarkName"
,
param
.
getClientRemarkName
());
content
.
put
(
"remarkName"
,
param
.
getClientRemarkName
());
imMessageOnlineSend
.
setContent
(
content
);
imMessageOnlineSend
.
setContent
(
content
);
...
...
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
79c50c8d
This diff is collapsed.
Click to expand it.
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