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
ec9a1154
Commit
ec9a1154
authored
Dec 10, 2021
by
hweeeeeei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug:返回已存在的一对一会话id
parent
61ed7094
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
common/src/main/java/com/wecloud/im/mapper/ImConversationMapper.java
+1
-1
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+1
-1
common/src/main/resources/mapper/ImConversationMapper.xml
+7
-2
No files found.
common/src/main/java/com/wecloud/im/mapper/ImConversationMapper.java
View file @
ec9a1154
...
...
@@ -77,7 +77,7 @@ public interface ImConversationMapper extends BaseMapper<ImConversation> {
/**
* 查询已经存在的会话信息
* 查询已经存在的
一对一
会话信息
*
* @param clientId1
* @param clientId2
...
...
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
ec9a1154
...
...
@@ -135,7 +135,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
if
(
repetitionConversation
!=
0
)
{
log
.
info
(
"repetitionConversation != 0"
);
// 返回已存在的会话id
// 返回已存在的
一对一
会话id
ImConversation
repetitionConversationInfo
=
imConversationMapper
.
getRepetitionConversationInfo
(
createClient
.
getId
(),
client2
.
getId
());
ImConversationCreateVo
imConversationCreateVo
=
new
ImConversationCreateVo
();
imConversationCreateVo
.
setId
(
repetitionConversationInfo
.
getId
());
...
...
common/src/main/resources/mapper/ImConversationMapper.xml
View file @
ec9a1154
...
...
@@ -92,14 +92,19 @@
<select
id=
"getRepetitionConversationInfo"
resultType=
"com.wecloud.im.entity.ImConversation"
>
SELECT im_conversation.*
SELECT im_conversation.*,
(SELECT COUNT(im2.id)
FROM im_conversation_members AS im2
WHERE im2.fk_conversation_id = im_conversation_members.fk_conversation_id) AS members_count
FROM im_conversation_members
INNER JOIN (SELECT *
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
WHERE im_conversation_members.fk_client_id = #{clientId1}
HAVING members_count = 2 LIMIT 1
</select>
</mapper>
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