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
044019c4
Commit
044019c4
authored
Apr 11, 2022
by
罗长华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整MessageService错误
parent
4fd6b716
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
97 deletions
+69
-97
core/src/main/java/com/wecloud/im/action/MessageAction.java
+13
-13
core/src/main/java/com/wecloud/im/controller/ImMessageController.java
+15
-13
core/src/main/java/com/wecloud/im/service/ImMessageService.java
+11
-10
core/src/main/java/com/wecloud/im/service/impl/ImMessageServiceImpl.java
+30
-61
No files found.
core/src/main/java/com/wecloud/im/action/MessageAction.java
View file @
044019c4
...
@@ -52,7 +52,7 @@ public class MessageAction {
...
@@ -52,7 +52,7 @@ public class MessageAction {
@ApiOperation
(
"消息撤回"
)
@ApiOperation
(
"消息撤回"
)
public
WsResponse
<
Map
<
String
,
Boolean
>>
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
));
boolean
r
=
imMessageService
.
withdrawMsg
(
request
,
msgRecall
);
boolean
r
=
imMessageService
.
withdrawMsg
(
msgRecall
);
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
result
.
put
(
"result"
,
r
);
result
.
put
(
"result"
,
r
);
return
WsResponse
.
ok
(
result
);
return
WsResponse
.
ok
(
result
);
...
@@ -66,9 +66,9 @@ public class MessageAction {
...
@@ -66,9 +66,9 @@ public class MessageAction {
*/
*/
@ActionMapping
(
"/delete"
)
@ActionMapping
(
"/delete"
)
@ApiOperation
(
"删除消息内容"
)
@ApiOperation
(
"删除消息内容"
)
public
WsResponse
<
Map
<
String
,
Boolean
>>
deleteMsg
(
ActionRequest
request
,
MsgDeleteParam
msgDeleteParam
,
String
reqId
)
{
public
WsResponse
<
Map
<
String
,
Boolean
>>
deleteMsg
(
MsgDeleteParam
data
)
{
log
.
info
(
"删除消息内容:{}"
,
JSON
.
toJSONString
(
msgDeleteParam
));
log
.
info
(
"删除消息内容:{}"
,
JSON
.
toJSONString
(
data
));
boolean
r
=
imMessageService
.
deleteMsg
(
request
,
msgDeleteParam
);
boolean
r
=
imMessageService
.
deleteMsg
(
data
);
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
result
.
put
(
"result"
,
r
);
result
.
put
(
"result"
,
r
);
return
WsResponse
.
ok
(
result
);
return
WsResponse
.
ok
(
result
);
...
@@ -82,9 +82,9 @@ public class MessageAction {
...
@@ -82,9 +82,9 @@ public class MessageAction {
*/
*/
@ActionMapping
(
"/updateMsgById"
)
@ActionMapping
(
"/updateMsgById"
)
@ApiOperation
(
"修改消息体"
)
@ApiOperation
(
"修改消息体"
)
public
WsResponse
<
Map
<
String
,
Boolean
>>
updateMsgById
(
ActionRequest
request
,
ImMsgUpdate
imMsgUpdate
,
String
reqId
)
{
public
WsResponse
<
Map
<
String
,
Boolean
>>
updateMsgById
(
ImMsgUpdate
data
)
{
log
.
info
(
"修改消息内容:{}"
,
JSON
.
toJSONString
(
imMsgUpdate
));
log
.
info
(
"修改消息内容:{}"
,
JSON
.
toJSONString
(
data
));
boolean
r
=
imMessageService
.
updateMsgById
(
imMsgUpdate
);
boolean
r
=
imMessageService
.
updateMsgById
(
data
);
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
Map
<
String
,
Boolean
>
result
=
new
HashMap
<>();
result
.
put
(
"result"
,
r
);
result
.
put
(
"result"
,
r
);
return
WsResponse
.
ok
(
result
);
return
WsResponse
.
ok
(
result
);
...
@@ -99,9 +99,9 @@ public class MessageAction {
...
@@ -99,9 +99,9 @@ public class MessageAction {
*/
*/
@ActionMapping
(
"/getHistoryMsg"
)
@ActionMapping
(
"/getHistoryMsg"
)
@ApiOperation
(
"查询某个会话历史消息分页列表"
)
@ApiOperation
(
"查询某个会话历史消息分页列表"
)
public
WsResponse
<
Paging
<
OfflineMsgDto
>>
getHistoryMsg
(
ActionRequest
request
,
ImHistoryMessagePageParam
param
,
String
reqId
)
{
public
WsResponse
<
Paging
<
OfflineMsgDto
>>
getHistoryMsg
(
ImHistoryMessagePageParam
data
)
{
log
.
info
(
"查询某个会话历史消息分页列表:{}"
,
JSON
.
toJSONString
(
param
));
log
.
info
(
"查询某个会话历史消息分页列表:{}"
,
JSON
.
toJSONString
(
data
));
return
WsResponse
.
ok
(
imMessageService
.
getHistoryMsgConversationId
(
param
));
return
WsResponse
.
ok
(
imMessageService
.
getHistoryMsgConversationId
(
data
));
}
}
/**
/**
...
@@ -113,9 +113,9 @@ public class MessageAction {
...
@@ -113,9 +113,9 @@ public class MessageAction {
*/
*/
@ActionMapping
(
"/getReaders"
)
@ActionMapping
(
"/getReaders"
)
@ApiOperation
(
"查询某个消息已读client列表和未读client"
)
@ApiOperation
(
"查询某个消息已读client列表和未读client"
)
public
WsResponse
<
ReaderList
>
getReaders
(
ActionRequest
request
,
GetReadersParam
param
,
String
reqId
)
{
public
WsResponse
<
ReaderList
>
getReaders
(
GetReadersParam
data
)
{
log
.
info
(
"查询某个消息已读client列表和未读client:{}"
,
JSON
.
toJSONString
(
param
));
log
.
info
(
"查询某个消息已读client列表和未读client:{}"
,
JSON
.
toJSONString
(
data
));
return
WsResponse
.
ok
(
imMessageService
.
getReaders
(
request
,
param
));
return
WsResponse
.
ok
(
imMessageService
.
getReaders
(
data
));
}
}
}
}
core/src/main/java/com/wecloud/im/controller/ImMessageController.java
View file @
044019c4
package
com
.
wecloud
.
im
.
controller
;
package
com
.
wecloud
.
im
.
controller
;
import
com.wecloud.im.param.GetReadersParam
;
import
com.wecloud.im.param.ImHistoryMessagePageParam
;
import
com.wecloud.im.param.MsgDeleteParam
;
import
com.wecloud.im.param.add.ImMsgRecall
;
import
com.wecloud.im.param.add.ImMsgUpdate
;
import
com.wecloud.im.service.ImMessageService
;
import
com.wecloud.im.vo.ImMessageOfflineListVo
;
import
com.wecloud.im.vo.OfflineMsgDto
;
import
com.wecloud.im.vo.ReaderList
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
...
@@ -18,6 +9,9 @@ import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
...
@@ -18,6 +9,9 @@ import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.List
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -26,7 +20,15 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -26,7 +20,15 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
com.wecloud.im.param.GetReadersParam
;
import
com.wecloud.im.param.ImHistoryMessagePageParam
;
import
com.wecloud.im.param.MsgDeleteParam
;
import
com.wecloud.im.param.add.ImMsgRecall
;
import
com.wecloud.im.param.add.ImMsgUpdate
;
import
com.wecloud.im.service.ImMessageService
;
import
com.wecloud.im.vo.ImMessageOfflineListVo
;
import
com.wecloud.im.vo.OfflineMsgDto
;
import
com.wecloud.im.vo.ReaderList
;
/**
/**
* 消息存储表 控制器
* 消息存储表 控制器
...
@@ -49,7 +51,7 @@ public class ImMessageController extends BaseController {
...
@@ -49,7 +51,7 @@ public class ImMessageController extends BaseController {
@PostMapping
(
"/withdraw"
)
@PostMapping
(
"/withdraw"
)
@ApiOperation
(
value
=
"消息撤回"
,
notes
=
"只能撤回客户端自己发送的消息"
)
@ApiOperation
(
value
=
"消息撤回"
,
notes
=
"只能撤回客户端自己发送的消息"
)
public
ApiResult
<
Boolean
>
withdrawMsg
(
@RequestBody
ImMsgRecall
imMsgRecall
)
throws
Exception
{
public
ApiResult
<
Boolean
>
withdrawMsg
(
@RequestBody
ImMsgRecall
imMsgRecall
)
throws
Exception
{
return
ApiResult
.
ok
(
imMessageService
.
withdrawMsg
(
null
,
imMsgRecall
));
return
ApiResult
.
ok
(
imMessageService
.
withdrawMsg
(
imMsgRecall
));
}
}
/**
/**
...
@@ -64,7 +66,7 @@ public class ImMessageController extends BaseController {
...
@@ -64,7 +66,7 @@ public class ImMessageController extends BaseController {
if
(
CollectionUtils
.
isEmpty
(
param
.
getMsgIds
()))
{
if
(
CollectionUtils
.
isEmpty
(
param
.
getMsgIds
()))
{
return
ApiResult
.
fail
(
"请选择要删除的消息id"
);
return
ApiResult
.
fail
(
"请选择要删除的消息id"
);
}
}
return
ApiResult
.
ok
(
imMessageService
.
deleteMsg
(
null
,
param
));
return
ApiResult
.
ok
(
imMessageService
.
deleteMsg
(
param
));
}
}
/**
/**
...
@@ -103,7 +105,7 @@ public class ImMessageController extends BaseController {
...
@@ -103,7 +105,7 @@ public class ImMessageController extends BaseController {
@PostMapping
(
"/getReaders"
)
@PostMapping
(
"/getReaders"
)
@ApiOperation
(
value
=
"查询某个消息已读client列表和未读client"
)
@ApiOperation
(
value
=
"查询某个消息已读client列表和未读client"
)
public
ApiResult
<
ReaderList
>
getReaders
(
@Validated
@RequestBody
GetReadersParam
param
)
{
public
ApiResult
<
ReaderList
>
getReaders
(
@Validated
@RequestBody
GetReadersParam
param
)
{
ReaderList
readerList
=
imMessageService
.
getReaders
(
null
,
param
);
ReaderList
readerList
=
imMessageService
.
getReaders
(
param
);
return
ApiResult
.
ok
(
readerList
);
return
ApiResult
.
ok
(
readerList
);
}
}
...
...
core/src/main/java/com/wecloud/im/service/ImMessageService.java
View file @
044019c4
package
com
.
wecloud
.
im
.
service
;
package
com
.
wecloud
.
im
.
service
;
import
com.wecloud.dispatch.extend.ActionRequest
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
java.util.List
;
import
org.springframework.transaction.annotation.Transactional
;
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.ImMessage
;
import
com.wecloud.im.entity.ImMessage
;
...
@@ -17,12 +24,6 @@ import com.wecloud.im.vo.OfflineMsgDto;
...
@@ -17,12 +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.request.ReceiveDataVO
;
import
com.wecloud.im.ws.model.request.ReceiveDataVO
;
import
com.wecloud.im.ws.model.request.ReceiveVO
;
import
com.wecloud.im.ws.model.request.ReceiveVO
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
/**
* 消息存储表 服务类
* 消息存储表 服务类
...
@@ -54,14 +55,14 @@ public interface ImMessageService extends BaseService<ImMessage> {
...
@@ -54,14 +55,14 @@ public interface ImMessageService extends BaseService<ImMessage> {
* @param request
* @param request
* @return
* @return
*/
*/
Boolean
withdrawMsg
(
ActionRequest
request
,
ImMsgRecall
imMsgRecall
);
Boolean
withdrawMsg
(
ImMsgRecall
imMsgRecall
);
/**
/**
* 删除消息
* 删除消息
* @param param
* @param param
* @return
* @return
*/
*/
Boolean
deleteMsg
(
ActionRequest
request
,
MsgDeleteParam
param
);
Boolean
deleteMsg
(
MsgDeleteParam
param
);
/**
/**
* 修改消息体
* 修改消息体
...
@@ -129,6 +130,6 @@ public interface ImMessageService extends BaseService<ImMessage> {
...
@@ -129,6 +130,6 @@ public interface ImMessageService extends BaseService<ImMessage> {
* @param param
* @param param
* @return
* @return
*/
*/
ReaderList
getReaders
(
ActionRequest
request
,
GetReadersParam
param
);
ReaderList
getReaders
(
GetReadersParam
param
);
}
}
core/src/main/java/com/wecloud/im/service/impl/ImMessageServiceImpl.java
View file @
044019c4
package
com
.
wecloud
.
im
.
service
.
impl
;
package
com
.
wecloud
.
im
.
service
.
impl
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.exception.BusinessException
;
import
io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl
;
import
io.geekidea.springbootplus.framework.core.pagination.PageInfo
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.wecloud.dispatch.extend.ActionRequest
;
import
com.wecloud.im.entity.ImApiMessageOnlineSend
;
import
com.wecloud.im.entity.ImApiMessageOnlineSend
;
import
com.wecloud.im.entity.ImApplication
;
import
com.wecloud.im.entity.ImApplication
;
import
com.wecloud.im.entity.ImClient
;
import
com.wecloud.im.entity.ImClient
;
...
@@ -25,6 +43,7 @@ import com.wecloud.im.param.MsgDeleteParam;
...
@@ -25,6 +43,7 @@ import com.wecloud.im.param.MsgDeleteParam;
import
com.wecloud.im.param.add.ImMsgRecall
;
import
com.wecloud.im.param.add.ImMsgRecall
;
import
com.wecloud.im.param.add.ImMsgSendToOnlineClient
;
import
com.wecloud.im.param.add.ImMsgSendToOnlineClient
;
import
com.wecloud.im.param.add.ImMsgUpdate
;
import
com.wecloud.im.param.add.ImMsgUpdate
;
import
com.wecloud.im.service.ContextService
;
import
com.wecloud.im.service.ImApplicationService
;
import
com.wecloud.im.service.ImApplicationService
;
import
com.wecloud.im.service.ImClientService
;
import
com.wecloud.im.service.ImClientService
;
import
com.wecloud.im.service.ImConversationMembersService
;
import
com.wecloud.im.service.ImConversationMembersService
;
...
@@ -44,23 +63,7 @@ import com.wecloud.im.ws.sender.ChannelSender;
...
@@ -44,23 +63,7 @@ import com.wecloud.im.ws.sender.ChannelSender;
import
com.wecloud.pushserver.client.model.constant.MqConstant
;
import
com.wecloud.pushserver.client.model.constant.MqConstant
;
import
com.wecloud.pushserver.client.model.dto.PushDTO
;
import
com.wecloud.pushserver.client.model.dto.PushDTO
;
import
com.wecloud.utils.JsonUtils
;
import
com.wecloud.utils.JsonUtils
;
import
io.geekidea.springbootplus.framework.common.api.ApiCode
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.exception.BusinessException
;
import
io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl
;
import
io.geekidea.springbootplus.framework.core.pagination.PageInfo
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 消息存储表 服务实现类
* 消息存储表 服务实现类
...
@@ -88,6 +91,8 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
...
@@ -88,6 +91,8 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
@Autowired
@Autowired
private
ImConversationMembersService
imConversationMembersService
;
private
ImConversationMembersService
imConversationMembersService
;
private
ContextService
contextService
;
@Autowired
@Autowired
private
ChannelSender
channelSender
;
private
ChannelSender
channelSender
;
...
@@ -202,23 +207,9 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
...
@@ -202,23 +207,9 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
withdrawMsg
(
ActionRequest
request
,
ImMsgRecall
imMsgRecall
)
{
public
Boolean
withdrawMsg
(
ImMsgRecall
imMsgRecall
)
{
ImClient
imClientSender
;
ImClient
imClientSender
=
contextService
.
getImClientIfNotNullOrThrow
();
ImApplication
imApplication
;
ImApplication
imApplication
=
contextService
.
getImApplicationIfNotNullOrThrow
(
imClientSender
.
getFkAppid
());
if
(
request
!=
null
)
{
imClientSender
=
imClientService
.
getCacheImClient
(
request
.
getSenderClientId
());
imApplication
=
imApplicationService
.
getCacheById
(
imClientSender
.
getFkAppid
());
}
else
{
imClientSender
=
imClientService
.
getCurrentClient
();
// 查询imApplication
imApplication
=
imApplicationService
.
getCacheById
(
imClientSender
.
getFkAppid
());
}
if
(
imClientSender
==
null
)
{
throw
new
BusinessException
(
"查无发送用户信息"
);
}
if
(
imApplication
==
null
)
{
throw
new
BusinessException
(
"查无应用信息"
);
}
ImMessage
messageById
=
this
.
getById
(
imMsgRecall
.
getMsgId
());
ImMessage
messageById
=
this
.
getById
(
imMsgRecall
.
getMsgId
());
// 判断该消息是否是该客户端发送 todo 单向撤回、双向撤回开关可配置
// 判断该消息是否是该客户端发送 todo 单向撤回、双向撤回开关可配置
...
@@ -313,23 +304,9 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
...
@@ -313,23 +304,9 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
}
}
@Override
@Override
public
Boolean
deleteMsg
(
ActionRequest
request
,
MsgDeleteParam
param
)
{
public
Boolean
deleteMsg
(
MsgDeleteParam
param
)
{
ImClient
imClientSender
;
ImClient
imClientSender
=
contextService
.
getImClientIfNotNullOrThrow
();
ImApplication
imApplication
;
ImApplication
imApplication
=
contextService
.
getImApplicationIfNotNullOrThrow
(
imClientSender
.
getFkAppid
());
if
(
request
!=
null
)
{
imClientSender
=
imClientService
.
getCacheImClient
(
request
.
getSenderClientId
());
imApplication
=
imApplicationService
.
getCacheById
(
imClientSender
.
getFkAppid
());
}
else
{
imClientSender
=
imClientService
.
getCurrentClient
();
// 查询imApplication
imApplication
=
imApplicationService
.
getCacheById
(
imClientSender
.
getFkAppid
());
}
if
(
imClientSender
==
null
)
{
throw
new
BusinessException
(
"查无发送用户信息"
);
}
if
(
imApplication
==
null
)
{
throw
new
BusinessException
(
"查无应用信息"
);
}
// todo 单向撤回、双向撤回开关可配置
// todo 单向撤回、双向撤回开关可配置
Boolean
deleteOther
=
true
;
Boolean
deleteOther
=
true
;
List
<
ImMessage
>
imMessageList
=
this
.
listByIds
(
param
.
getMsgIds
());
List
<
ImMessage
>
imMessageList
=
this
.
listByIds
(
param
.
getMsgIds
());
...
@@ -457,16 +434,8 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
...
@@ -457,16 +434,8 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
* @return
* @return
*/
*/
@Override
@Override
public
ReaderList
getReaders
(
ActionRequest
request
,
GetReadersParam
param
)
{
public
ReaderList
getReaders
(
GetReadersParam
param
)
{
ImClient
imClientSender
;
ImClient
imClientSender
=
contextService
.
getImClientIfNotNullOrThrow
();
if
(
request
!=
null
)
{
imClientSender
=
imClientService
.
getCacheImClient
(
request
.
getSenderClientId
());
}
else
{
imClientSender
=
imClientService
.
getCurrentClient
();
}
if
(
imClientSender
==
null
)
{
throw
new
BusinessException
(
"查无发送用户信息"
);
}
List
<
ReaderVo
>
readerVos
=
imMessageMapper
.
getReaders
(
imClientSender
.
getId
(),
param
);
List
<
ReaderVo
>
readerVos
=
imMessageMapper
.
getReaders
(
imClientSender
.
getId
(),
param
);
if
(
CollectionUtils
.
isEmpty
(
readerVos
))
{
if
(
CollectionUtils
.
isEmpty
(
readerVos
))
{
return
null
;
return
null
;
...
...
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