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
4316ec03
Commit
4316ec03
authored
May 23, 2022
by
wei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改/server/conversation中字段;
添加mapper: getImConversationInfoByIdForServerApi;
parent
04327fca
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
2 deletions
+38
-2
common/src/main/java/com/wecloud/im/controller/serverapi/ApiImConversationController.java
+2
-2
common/src/main/java/com/wecloud/im/mapper/ImConversationMapper.java
+2
-0
common/src/main/java/com/wecloud/im/service/ImConversationService.java
+1
-0
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+9
-0
common/src/main/resources/mapper/ImConversationMapper.xml
+24
-0
No files found.
common/src/main/java/com/wecloud/im/controller/serverapi/ApiImConversationController.java
View file @
4316ec03
...
...
@@ -40,7 +40,7 @@ public class ApiImConversationController extends BaseController {
*/
@GetMapping
(
"/info"
)
@ApiOperation
(
value
=
"会话表详情"
)
public
ApiResult
<
MyConversationListVo
>
getImConversation
(
@RequestParam
(
"
id"
)
Long
i
d
public
ApiResult
<
MyConversationListVo
>
getImConversation
(
@RequestParam
(
"
conversationId"
)
Long
conversationI
d
,
@RequestHeader
String
appkey
,
@RequestHeader
String
appSecret
)
throws
Exception
{
// 根据appKey从数据库查询密钥
...
...
@@ -55,7 +55,7 @@ public class ApiImConversationController extends BaseController {
return
ApiResult
.
result
(
ApiCode
.
FAIL
,
null
);
}
MyConversationListVo
imConversationQueryVo
=
imConversationService
.
getImConversationInfoById
(
i
d
);
MyConversationListVo
imConversationQueryVo
=
imConversationService
.
getImConversationInfoById
ForServerApi
(
conversationI
d
);
return
ApiResult
.
ok
(
imConversationQueryVo
);
}
...
...
common/src/main/java/com/wecloud/im/mapper/ImConversationMapper.java
View file @
4316ec03
...
...
@@ -50,6 +50,8 @@ public interface ImConversationMapper extends BaseMapper<ImConversation> {
MyConversationListVo
getImConversationAndMsgCountById
(
@Param
(
"clientId"
)
Long
clientId
,
@Param
(
"conversationId"
)
Long
conversationId
);
MyConversationListVo
getImConversationInfoByIdForServerApi
(
@Param
(
"conversationId"
)
Long
conversationId
);
/**
* 查询用户加入的所有会话
*
...
...
common/src/main/java/com/wecloud/im/service/ImConversationService.java
View file @
4316ec03
...
...
@@ -107,6 +107,7 @@ public interface ImConversationService extends BaseService<ImConversation> {
MyConversationListVo
getImConversationInfoById
(
Long
id
)
throws
Exception
;
MyConversationListVo
getImConversationInfoByIdForServerApi
(
Long
id
)
throws
Exception
;
/**
* 获取分页对象
...
...
common/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
4316ec03
...
...
@@ -816,6 +816,15 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
}
@Override
public
MyConversationListVo
getImConversationInfoByIdForServerApi
(
Long
id
)
throws
Exception
{
MyConversationListVo
imConversationAndMsgCountById
=
imConversationMapper
.
getImConversationInfoByIdForServerApi
(
id
);
JsonMapper
jsonMapper
=
new
JsonMapper
();
HashMap
attributess
=
jsonMapper
.
readValue
(
imConversationAndMsgCountById
.
getAttribute
(),
HashMap
.
class
);
imConversationAndMsgCountById
.
setAttributes
(
attributess
);
return
imConversationAndMsgCountById
;
}
@Override
public
Paging
<
ImConversationQueryVo
>
getImConversationPageList
(
ImConversationPageParam
imConversationPageParam
)
throws
Exception
{
Page
<
ImConversationQueryVo
>
page
=
new
PageInfo
<>(
imConversationPageParam
,
OrderItem
.
desc
(
getLambdaColumn
(
ImConversation:
:
getCreateTime
)));
IPage
<
ImConversationQueryVo
>
iPage
=
imConversationMapper
.
getImConversationPageList
(
page
,
imConversationPageParam
);
...
...
common/src/main/resources/mapper/ImConversationMapper.xml
View file @
4316ec03
...
...
@@ -136,5 +136,29 @@
GROUP BY imConversation.id
</select>
<select
id=
"getImConversationInfoByIdForServerApi"
resultType=
"com.wecloud.im.vo.MyConversationListVo"
>
SELECT imConversation.id,
imConversation.create_time,
imConversation.`name`,
imConversation.attributes AS attribute,
imConversation.system,
im_client.client_id AS creator,
(
SELECT GROUP_CONCAT(im_client.client_id)
FROM im_conversation_members AS im_conversation_members
INNER JOIN im_client AS im_client ON im_client.id = im_conversation_members.fk_client_id
WHERE im_conversation_members.fk_conversation_id = imConversation.id
) AS members,
(SELECT COUNT(*)
FROM im_conversation_members
WHERE fk_conversation_id = imConversation.id) AS memberCount
FROM im_conversation AS imConversation
INNER JOIN im_client AS im_client ON im_client.id = imConversation.creator
WHERE imConversation.id = #{conversationId}
GROUP BY imConversation.id
</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