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
2d2227b1
Commit
2d2227b1
authored
Oct 11, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志
parent
6087944f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
core/src/main/java/com/wecloud/im/action/NormalChatAction.java
+8
-3
No files found.
core/src/main/java/com/wecloud/im/action/NormalChatAction.java
View file @
2d2227b1
...
...
@@ -95,9 +95,6 @@ public class NormalChatAction {
@ActionMapping
(
"/normal/send"
)
@ApiOperation
(
"普通消息发送"
)
public
void
sendMsg
(
ActionRequest
request
,
ChatContentVo
data
,
String
reqId
)
{
// if (log.isDebugEnabled()) {
// log.debug("接收到参数,reqId: {},\n data: {}, ", reqId, data);
// }
ImConversationQueryVo
conversation
=
ehcacheService
.
getEhCacheConversation
(
data
.
getToConversation
());
if
(
conversation
==
null
)
{
log
.
warn
(
"会reqId: {} ,会话id: {}db中不存在"
,
reqId
,
data
.
getToConversation
());
...
...
@@ -112,6 +109,8 @@ public class NormalChatAction {
// 查询imApplication
ImApplication
imApplication
=
imApplicationService
.
getCacheById
(
imClientSender
.
getFkAppid
());
log
.
info
(
"1"
);
// 给所有人(在线+离线)遍历发送
// 先查询该会话所有成员
List
<
ImConversationMembers
>
membersList
=
ehcacheService
.
getEhCacheMember
(
"member"
+
conversation
.
getId
(),
conversation
.
getId
());
...
...
@@ -128,6 +127,7 @@ public class NormalChatAction {
}
Map
<
Long
,
ImConversationMembers
>
memberMap
=
membersList
.
stream
().
collect
(
Collectors
.
toMap
(
ImConversationMembers:
:
getFkClientId
,
member
->
member
));
log
.
info
(
"2"
);
// 判断为单聊
if
(
ChatTypeEnum
.
SINGLE
.
getCode
().
equals
(
conversation
.
getChatType
()))
{
// 判断是否被拉黑逻辑
...
...
@@ -156,6 +156,7 @@ public class NormalChatAction {
}
ImMessageOnlineSend
imMessageOnlineSend
=
assembleImMessageOnlineSend
(
data
,
imClientSender
,
imApplication
.
getId
());
log
.
info
(
"3"
);
// 入库 保存收件箱
batchSaveInbox
(
imApplication
,
imClientSender
,
conversation
,
imMessageOnlineSend
.
getMsgId
(),
membersList
);
// 入库成功后 判断是否是临时会话 如果是,双方会话display状态是否是1(显示),如果不是,需要修改为是
...
...
@@ -179,6 +180,7 @@ public class NormalChatAction {
// 不给自己发
continue
;
}
log
.
info
(
"6"
);
SendMsgThreadPool
.
SEND_MSG_THREAD_POOL_EXECUTOR
.
execute
(()
->
{
this
.
sendMsgToMember
(
imApplication
,
member
,
imMessageOnlineSend
,
data
.
getPush
(),
isPush
);
});
...
...
@@ -190,6 +192,8 @@ public class NormalChatAction {
private
void
sendMsgToMember
(
ImApplication
imApplication
,
ImConversationMembers
member
,
ImMessageOnlineSend
imMessageOnlineSend
,
PushVO
push
,
Boolean
isPush
)
{
// 在线用户直接发消息
log
.
info
(
"11"
);
Boolean
sendSuccess
=
sendMsgForOnline
(
member
.
getFkClientId
(),
imMessageOnlineSend
);
if
(
isPush
&&
!
sendSuccess
&&
!
member
.
getDoNotDisturb
())
{
// 异步推送系统通知消息 5分钟内推一次消息
...
...
@@ -215,6 +219,7 @@ public class NormalChatAction {
responseModel
.
setMsg
(
result
.
getMessage
());
responseModel
.
setData
(
imMessageOnlineSend
);
responseModel
.
setReqId
(
null
);
log
.
info
(
"21"
);
return
channelSender
.
sendMsg
(
responseModel
,
receiverClientId
);
}
...
...
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