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
4fd6b716
Commit
4fd6b716
authored
Apr 11, 2022
by
罗长华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整MessageAction代码
parent
e944a8d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
27 deletions
+32
-27
core/src/main/java/com/wecloud/im/action/MessageAction.java
+32
-27
No files found.
core/src/main/java/com/wecloud/im/action/MessageAction.java
View file @
4fd6b716
package
com
.
wecloud
.
im
.
action
;
package
com
.
wecloud
.
im
.
action
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.wecloud.dispatch.annotation.ActionMapping
;
import
com.wecloud.dispatch.annotation.ActionMapping
;
import
com.wecloud.dispatch.extend.ActionRequest
;
import
com.wecloud.dispatch.extend.ActionRequest
;
...
@@ -13,13 +24,6 @@ import com.wecloud.im.vo.OfflineMsgDto;
...
@@ -13,13 +24,6 @@ import com.wecloud.im.vo.OfflineMsgDto;
import
com.wecloud.im.vo.ReaderList
;
import
com.wecloud.im.vo.ReaderList
;
import
com.wecloud.im.ws.model.WsResponse
;
import
com.wecloud.im.ws.model.WsResponse
;
import
com.wecloud.im.ws.sender.ChannelSender
;
import
com.wecloud.im.ws.sender.ChannelSender
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.netty.channel.socket.nio.NioSocketChannel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
/**
/**
* @Author wenzhida
* @Author wenzhida
...
@@ -46,11 +50,12 @@ public class MessageAction {
...
@@ -46,11 +50,12 @@ public class MessageAction {
*/
*/
@ActionMapping
(
"/withdraw"
)
@ActionMapping
(
"/withdraw"
)
@ApiOperation
(
"消息撤回"
)
@ApiOperation
(
"消息撤回"
)
public
void
withdraw
(
ActionRequest
request
,
ImMsgRecall
msgRecall
,
String
reqId
)
{
public
WsResponse
<
Map
<
String
,
Boolean
>>
withdraw
(
ActionRequest
request
,
ImMsgRecall
msgRecall
,
String
reqId
)
{
log
.
info
(
"撤回消息内容:{}"
,
JSON
.
toJSONString
(
msgRecall
));
log
.
info
(
"撤回消息内容:{}"
,
JSON
.
toJSONString
(
msgRecall
));
WsResponse
<
Boolean
>
wsResponse
=
new
WsResponse
<>();
boolean
r
=
imMessageService
.
withdrawMsg
(
request
,
msgRecall
);
wsResponse
.
setData
(
imMessageService
.
withdrawMsg
(
request
,
msgRecall
));
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
channelSender
.
sendMsgLocal
((
NioSocketChannel
)
request
.
getSenderChannel
(),
wsResponse
);
result
.
put
(
"result"
,
r
);
return
WsResponse
.
ok
(
result
);
}
}
/**
/**
...
@@ -61,11 +66,12 @@ public class MessageAction {
...
@@ -61,11 +66,12 @@ public class MessageAction {
*/
*/
@ActionMapping
(
"/delete"
)
@ActionMapping
(
"/delete"
)
@ApiOperation
(
"删除消息内容"
)
@ApiOperation
(
"删除消息内容"
)
public
void
deleteMsg
(
ActionRequest
request
,
MsgDeleteParam
msgDeleteParam
,
String
reqId
)
{
public
WsResponse
<
Map
<
String
,
Boolean
>>
deleteMsg
(
ActionRequest
request
,
MsgDeleteParam
msgDeleteParam
,
String
reqId
)
{
log
.
info
(
"删除消息内容:{}"
,
JSON
.
toJSONString
(
msgDeleteParam
));
log
.
info
(
"删除消息内容:{}"
,
JSON
.
toJSONString
(
msgDeleteParam
));
WsResponse
<
Boolean
>
wsResponse
=
new
WsResponse
<>();
boolean
r
=
imMessageService
.
deleteMsg
(
request
,
msgDeleteParam
);
wsResponse
.
setData
(
imMessageService
.
deleteMsg
(
request
,
msgDeleteParam
));
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
channelSender
.
sendMsgLocal
((
NioSocketChannel
)
request
.
getSenderChannel
(),
wsResponse
);
result
.
put
(
"result"
,
r
);
return
WsResponse
.
ok
(
result
);
}
}
/**
/**
...
@@ -76,11 +82,12 @@ public class MessageAction {
...
@@ -76,11 +82,12 @@ public class MessageAction {
*/
*/
@ActionMapping
(
"/updateMsgById"
)
@ActionMapping
(
"/updateMsgById"
)
@ApiOperation
(
"修改消息体"
)
@ApiOperation
(
"修改消息体"
)
public
void
updateMsgById
(
ActionRequest
request
,
ImMsgUpdate
imMsgUpdate
,
String
reqId
)
{
public
WsResponse
<
Map
<
String
,
Boolean
>>
updateMsgById
(
ActionRequest
request
,
ImMsgUpdate
imMsgUpdate
,
String
reqId
)
{
log
.
info
(
"修改消息内容:{}"
,
JSON
.
toJSONString
(
imMsgUpdate
));
log
.
info
(
"修改消息内容:{}"
,
JSON
.
toJSONString
(
imMsgUpdate
));
WsResponse
<
Boolean
>
wsResponse
=
new
WsResponse
<>();
boolean
r
=
imMessageService
.
updateMsgById
(
imMsgUpdate
);
wsResponse
.
setData
(
imMessageService
.
updateMsgById
(
imMsgUpdate
));
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
channelSender
.
sendMsgLocal
((
NioSocketChannel
)
request
.
getSenderChannel
(),
wsResponse
);
result
.
put
(
"result"
,
r
);
return
WsResponse
.
ok
(
result
);
}
}
/**
/**
...
@@ -88,14 +95,13 @@ public class MessageAction {
...
@@ -88,14 +95,13 @@ public class MessageAction {
* @param request
* @param request
* @param param
* @param param
* @param reqId
* @param reqId
* @return
*/
*/
@ActionMapping
(
"/getHistoryMsg"
)
@ActionMapping
(
"/getHistoryMsg"
)
@ApiOperation
(
"查询某个会话历史消息分页列表"
)
@ApiOperation
(
"查询某个会话历史消息分页列表"
)
public
void
getHistoryMsg
(
ActionRequest
request
,
ImHistoryMessagePageParam
param
,
String
reqId
)
{
public
WsResponse
<
Paging
<
OfflineMsgDto
>>
getHistoryMsg
(
ActionRequest
request
,
ImHistoryMessagePageParam
param
,
String
reqId
)
{
log
.
info
(
"查询某个会话历史消息分页列表:{}"
,
JSON
.
toJSONString
(
param
));
log
.
info
(
"查询某个会话历史消息分页列表:{}"
,
JSON
.
toJSONString
(
param
));
WsResponse
<
Paging
<
OfflineMsgDto
>>
wsResponse
=
new
WsResponse
<>();
return
WsResponse
.
ok
(
imMessageService
.
getHistoryMsgConversationId
(
param
));
wsResponse
.
setData
(
imMessageService
.
getHistoryMsgConversationId
(
param
));
channelSender
.
sendMsgLocal
((
NioSocketChannel
)
request
.
getSenderChannel
(),
wsResponse
);
}
}
/**
/**
...
@@ -103,14 +109,13 @@ public class MessageAction {
...
@@ -103,14 +109,13 @@ public class MessageAction {
* @param request
* @param request
* @param param
* @param param
* @param reqId
* @param reqId
* @return
*/
*/
@ActionMapping
(
"/getReaders"
)
@ActionMapping
(
"/getReaders"
)
@ApiOperation
(
"查询某个消息已读client列表和未读client"
)
@ApiOperation
(
"查询某个消息已读client列表和未读client"
)
public
void
getReaders
(
ActionRequest
request
,
GetReadersParam
param
,
String
reqId
)
{
public
WsResponse
<
ReaderList
>
getReaders
(
ActionRequest
request
,
GetReadersParam
param
,
String
reqId
)
{
log
.
info
(
"查询某个消息已读client列表和未读client:{}"
,
JSON
.
toJSONString
(
param
));
log
.
info
(
"查询某个消息已读client列表和未读client:{}"
,
JSON
.
toJSONString
(
param
));
WsResponse
<
ReaderList
>
wsResponse
=
new
WsResponse
<>();
return
WsResponse
.
ok
(
imMessageService
.
getReaders
(
request
,
param
));
wsResponse
.
setData
(
imMessageService
.
getReaders
(
request
,
param
));
channelSender
.
sendMsgLocal
((
NioSocketChannel
)
request
.
getSenderChannel
(),
wsResponse
);
}
}
}
}
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