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
f518d744
Commit
f518d744
authored
Aug 18, 2021
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 未读人数, 已读为0
parent
7f50a93b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
91 deletions
+61
-91
common/src/main/java/com/wecloud/im/service/ImMessageService.java
+44
-49
common/src/main/java/com/wecloud/im/service/impl/ImMessageServiceImpl.java
+1
-1
common/src/main/java/com/wecloud/im/vo/OfflineMsgDto.java
+13
-0
common/src/main/java/com/wecloud/im/ws/model/FileHelperOfflineModel.java
+0
-37
common/src/main/resources/mapper/ImConversationMapper.xml
+1
-3
common/src/main/resources/mapper/ImMessageMapper.xml
+2
-1
No files found.
common/src/main/java/com/wecloud/im/service/ImMessageService.java
View file @
f518d744
...
...
@@ -37,6 +37,50 @@ public interface ImMessageService extends BaseService<ImMessage> {
ApiResult
<
Boolean
>
updateMsgById
(
ImMsgUpdate
imMsgUpdate
);
/**
* 查询某个会话历史消息分页列表
*
* @param imHistoryMessagePageParam
* @return
* @throws Exception
*/
Paging
<
OfflineMsgDto
>
getHistoryMsgConversationId
(
ImHistoryMessagePageParam
imHistoryMessagePageParam
)
throws
Exception
;
/**
* 查询用户所有离线消息
*
* @return
* @throws Exception
*/
List
<
ImMessageOfflineListVo
>
getOfflineList
()
throws
Exception
;
/**
* 根据客户端id与会话id 查询离线消息
*
* @param clientId
* @param conversationId
* @return
*/
List
<
OfflineMsgDto
>
getOfflineListByClientAndConversation
(
Long
clientId
,
Long
conversationId
);
/**
* 查询会话的最后一条消息
*
* @param conversationId
* @return
*/
OfflineMsgDto
getLastMsgByConversationId
(
Long
conversationId
);
/**
* 查询会话接收的最后一条消息
*
* @param clientId
* @param conversationId
* @return
*/
OfflineMsgDto
getReceivedLastMsgByConversationId
(
Long
clientId
,
Long
conversationId
);
/**
* 保存
*
* @param imMessage
...
...
@@ -80,53 +124,4 @@ public interface ImMessageService extends BaseService<ImMessage> {
// * @throws Exception
// */
// Paging<ImMessageQueryVo> getImMessagePageList(ImMessagePageParam imMessagePageParam) throws Exception;
/**
* 查询某个会话历史消息分页列表
*
* @param imHistoryMessagePageParam
* @return
* @throws Exception
*/
Paging
<
OfflineMsgDto
>
getHistoryMsgConversationId
(
ImHistoryMessagePageParam
imHistoryMessagePageParam
)
throws
Exception
;
/**
* 查询用户所有离线消息
*
* @return
* @throws Exception
*/
List
<
ImMessageOfflineListVo
>
getOfflineList
()
throws
Exception
;
/**
* 根据客户端id与会话id 查询离线消息
*
* @param clientId
* @param conversationId
* @return
*/
List
<
OfflineMsgDto
>
getOfflineListByClientAndConversation
(
Long
clientId
,
Long
conversationId
);
/**
* 查询会话接收的最后一条消息
*
* @param clientId
* @param conversationId
* @return
*/
OfflineMsgDto
getReceivedLastMsgByConversationId
(
Long
clientId
,
Long
conversationId
);
/**
* 查询会话的最后一条消息
*
* @param conversationId
* @return
*/
OfflineMsgDto
getLastMsgByConversationId
(
Long
conversationId
);
}
common/src/main/java/com/wecloud/im/service/impl/ImMessageServiceImpl.java
View file @
f518d744
...
...
@@ -172,7 +172,7 @@ public class ImMessageServiceImpl extends BaseServiceImpl<ImMessageMapper, ImMes
for
(
ImConversation
imConversation
:
myImConversationList
)
{
//根据客户端id与会话id 查询离线消息
List
<
OfflineMsgDto
>
offlineListByClientAndConversation
=
getOfflineListByClientAndConversation
(
client
.
getId
(),
imConversation
.
getId
());
List
<
OfflineMsgDto
>
offlineListByClientAndConversation
=
this
.
getOfflineListByClientAndConversation
(
client
.
getId
(),
imConversation
.
getId
());
ImMessageOfflineListVo
imMessageOfflineListVo
=
new
ImMessageOfflineListVo
();
imMessageOfflineListVo
.
setMsgList
(
offlineListByClientAndConversation
);
...
...
common/src/main/java/com/wecloud/im/vo/OfflineMsgDto.java
View file @
f518d744
...
...
@@ -42,4 +42,17 @@ public class OfflineMsgDto implements Serializable {
@ApiModelProperty
(
"at他人,传入客户端id数组"
)
private
String
at
;
@ApiModelProperty
(
"未读人数, 已读为0"
)
private
Integer
notReadCount
;
// @ApiModelProperty("读取时间")
// private Date readTime;
//
// @ApiModelProperty("接收时间")
// private Date receiverTime;
// @ApiModelProperty("0未接收; 1已接收")
// private Integer receiverMsgStatus;
}
common/src/main/java/com/wecloud/im/ws/model/FileHelperOfflineModel.java
deleted
100644 → 0
View file @
7f50a93b
package
com
.
wecloud
.
im
.
ws
.
model
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
public
class
FileHelperOfflineModel
implements
Serializable
{
private
String
messageId
;
@ApiModelProperty
(
value
=
"消息内容"
)
private
String
content
;
@ApiModelProperty
(
value
=
"消息类型 text, audio, image, file, video, location"
)
private
String
type
;
@ApiModelProperty
(
value
=
"资源id"
)
private
String
sourceId
;
@ApiModelProperty
(
value
=
"时长(s)"
)
private
Integer
duration
;
@ApiModelProperty
(
value
=
"位置信息"
)
private
String
locationInfo
;
@ApiModelProperty
(
value
=
"图片/视频尺寸相关信息"
)
private
String
measureInfo
;
@ApiModelProperty
(
value
=
"消息回执id"
)
private
String
backId
;
@ApiModelProperty
(
value
=
"文件名"
)
private
String
fileName
;
@ApiModelProperty
(
value
=
"文件大小"
)
private
String
fileSize
;
@ApiModelProperty
(
value
=
"消息渠道 singleChat, groupChat,systemNotice,syncMySend"
)
private
String
route
;
@ApiModelProperty
(
value
=
"时间戳"
)
private
Date
timestamp
;
}
common/src/main/resources/mapper/ImConversationMapper.xml
View file @
f518d744
...
...
@@ -31,7 +31,7 @@
FROM im_inbox
WHERE im_inbox.fk_conversation_id = imConversation.id
AND im_inbox.receiver = #{clientId}
AND im_inbox.re
ceiver
_msg_status = 0) AS msg_not_read_count,
AND im_inbox.re
ad
_msg_status = 0) AS msg_not_read_count,
(
SELECT GROUP_CONCAT(im_client.client_id)
FROM im_conversation_members AS im_conversation_members
...
...
@@ -79,9 +79,7 @@
FROM im_conversation_members
WHERE im_conversation_members.fk_client_id = #{clientId2}) AS im_conversation_members2
ON im_conversation_members.fk_conversation_id = im_conversation_members2.fk_conversation_id
INNER JOIN im_conversation ON im_conversation.id = im_conversation_members.fk_conversation_id
WHERE im_conversation_members.fk_client_id = #{clientId1} LIMIT 1
</select>
...
...
common/src/main/resources/mapper/ImMessageMapper.xml
View file @
f518d744
...
...
@@ -52,7 +52,8 @@
im_message.system,
im_message.`at`,
im_message.send_status,
im_message.fk_conversation_id
im_message.fk_conversation_id,
(SELECT COUNT(id) FROM im_inbox WHERE fk_msg_id = msgId AND read_msg_status = 0) AS not_read_count
FROM `im_message`
INNER JOIN `im_client` ON `im_client`.id = `im_message`.sender
WHERE fk_conversation_id = #{param.conversationId}
...
...
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