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
91b31c16
Commit
91b31c16
authored
May 10, 2022
by
罗长华
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/xiaohudou_20220427' into xiaohudou_20220427
parents
4526cd88
785b6363
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
17 deletions
+30
-17
config/src/main/resources/config/application-dev.yml
+7
-7
core/src/main/java/com/wecloud/im/action/ConversationAction.java
+1
-1
core/src/main/java/com/wecloud/im/chatroom/cache/ChatRoomCacheManager.java
+6
-5
core/src/main/java/com/wecloud/im/entity/ImConversation.java
+1
-1
core/src/main/java/com/wecloud/im/param/ImConversationQueryParam.java
+3
-0
core/src/main/java/com/wecloud/im/param/ImConversationQueryVo.java
+1
-1
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+9
-0
im-sdk/src/main/java/com/wecloud/im/sdk/model/Conversation.java
+1
-1
im-sdk/src/main/java/com/wecloud/im/sdk/model/ListConversationRequest.java
+1
-1
No files found.
config/src/main/resources/config/application-dev.yml
View file @
91b31c16
...
...
@@ -27,16 +27,16 @@ spring:
# Redis配置
redis
:
# database: 0
# host: 127.0.0.1
# password:
# port: 6379
database
:
0
host
:
12
1.37.22.224
password
:
temple123456
host
:
12
7.0.0.1
password
:
port
:
6379
# database: 0
# host: 121.37.22.224
# password: temple123456
# port: 6379
dubbo
:
protocol
:
port
:
20882
...
...
core/src/main/java/com/wecloud/im/action/ConversationAction.java
View file @
91b31c16
...
...
@@ -280,7 +280,7 @@ public class ConversationAction {
/**
* 全量获取聊天室成员
*/
@
Post
Mapping
(
"/listChatRoomMember"
)
@
Action
Mapping
(
"/listChatRoomMember"
)
@ApiOperation
(
value
=
"全量获取聊天室成员"
,
notes
=
"全量获取聊天室成员"
)
public
WsResponse
<
List
<
ChatRoomMemberVo
>>
listChatRoomMember
(
ChatRoomMemberPageParam
data
)
{
log
.
info
(
"全量获取聊天室成员入参 {}"
,
JSON
.
toJSONString
(
data
));
...
...
core/src/main/java/com/wecloud/im/chatroom/cache/ChatRoomCacheManager.java
View file @
91b31c16
...
...
@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -25,9 +26,9 @@ public class ChatRoomCacheManager {
/**
* redis的群聊天室房间键 key
*/
public
static
final
String
CHAT_
ROOM_KEY
=
"chat_room
_"
;
public
static
final
String
CHAT_
MEMBER_KEY
=
"chat_member
_"
;
@
Autowired
@
Resource
private
RedisUtils
redisUtils
;
/**
...
...
@@ -38,7 +39,7 @@ public class ChatRoomCacheManager {
* @param platform
*/
public
void
intoRoom
(
Long
clientId
,
Long
chatRoomId
,
Integer
platform
)
{
redisUtils
.
hashset
(
CHAT_
ROOM
_KEY
+
chatRoomId
,
clientId
+
RedisUtils
.
SPLIT
+
platform
,
GetIpUtils
.
getlanIp
(),
redisUtils
.
hashset
(
CHAT_
MEMBER
_KEY
+
chatRoomId
,
clientId
+
RedisUtils
.
SPLIT
+
platform
,
GetIpUtils
.
getlanIp
(),
2
,
TimeUnit
.
DAYS
);
}
...
...
@@ -51,7 +52,7 @@ public class ChatRoomCacheManager {
* @param platform
*/
public
void
exitRoom
(
Long
clientId
,
Long
chatRoomId
,
Integer
platform
)
{
redisUtils
.
hashdel
(
CHAT_
ROOM
_KEY
+
chatRoomId
,
clientId
+
RedisUtils
.
SPLIT
+
platform
);
redisUtils
.
hashdel
(
CHAT_
MEMBER
_KEY
+
chatRoomId
,
clientId
+
RedisUtils
.
SPLIT
+
platform
);
}
/**
...
...
@@ -61,7 +62,7 @@ public class ChatRoomCacheManager {
* @return 在线成员的key-val,其中key是 client的主键id:platform, val是 ip
*/
public
Map
<
String
,
String
>
findOnlineClientsByChatRoomId
(
Long
chatRoomId
)
{
return
redisUtils
.
hashgetll
(
CHAT_
ROOM
_KEY
+
chatRoomId
);
return
redisUtils
.
hashgetll
(
CHAT_
MEMBER
_KEY
+
chatRoomId
);
}
/**
...
...
core/src/main/java/com/wecloud/im/entity/ImConversation.java
View file @
91b31c16
...
...
@@ -45,7 +45,7 @@ public class ImConversation extends BaseEntity {
@ApiModelProperty
(
"群成员数量"
)
private
Integer
memberCount
;
@ApiModelProperty
(
"会话属性,1:单聊,2:普通群,3:万人群"
)
@ApiModelProperty
(
"会话属性,1:单聊,2:普通群,3:万人群
,4:聊天室
"
)
private
Integer
chatType
;
@NotNull
(
message
=
"应用appid不能为空"
)
...
...
core/src/main/java/com/wecloud/im/param/ImConversationQueryParam.java
View file @
91b31c16
...
...
@@ -24,4 +24,7 @@ public class ImConversationQueryParam implements Serializable {
@ApiModelProperty
(
"会话id"
)
private
Long
id
;
@ApiModelProperty
(
"会话属性,1:单聊,2:普通群,3:万人群 4:聊天室"
)
private
Integer
chatType
;
}
core/src/main/java/com/wecloud/im/param/ImConversationQueryVo.java
View file @
91b31c16
...
...
@@ -52,7 +52,7 @@ public class ImConversationQueryVo implements Serializable {
@ApiModelProperty
(
"群成员数量"
)
private
Integer
memberCount
;
@ApiModelProperty
(
"会话属性,1:单聊,2:普通群,3:万人群"
)
@ApiModelProperty
(
"会话属性,1:单聊,2:普通群,3:万人群
,4:聊天室
"
)
private
Integer
chatType
;
/**
...
...
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
91b31c16
...
...
@@ -1135,6 +1135,15 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
try
{
// 获取当前client
ImClient
client
=
contextService
.
getImClientIfNotNullOrThrow
();
if
(
param
.
getChatType
()
!=
null
&&
param
.
getChatType
()
==
4
)
{
// 聊天室
ImConversation
imConversation
=
imConversationMapper
.
selectById
(
param
.
getId
());
if
(
imConversation
!=
null
)
{
ConversationVo
conversationVo
=
new
ConversationVo
();
BeanUtils
.
copyProperties
(
imConversation
,
conversationVo
);
return
conversationVo
;
}
}
// 查询用户加入的所有会话 与每个会话的未读条数 成员
List
<
ConversationVo
>
conversationList
=
imConversationMapper
.
getMyImConversationListAndMsgCount
(
client
.
getId
(),
client
.
getClientId
(),
param
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
conversationList
))
{
...
...
im-sdk/src/main/java/com/wecloud/im/sdk/model/Conversation.java
View file @
91b31c16
...
...
@@ -67,7 +67,7 @@ public class Conversation implements Serializable {
private
String
members
;
/**
* "会话属性,1:单聊,2:普通群,3:万人群"
* "会话属性,1:单聊,2:普通群,3:万人群
,4:聊天室
"
*/
private
Integer
chatType
;
...
...
im-sdk/src/main/java/com/wecloud/im/sdk/model/ListConversationRequest.java
View file @
91b31c16
...
...
@@ -19,7 +19,7 @@ public class ListConversationRequest extends WebServiceRequest {
private
static
final
long
serialVersionUID
=
-
3602523207000275557L
;
/**
* 会话属性,1:单聊,2:普通群,3:万人群
* 会话属性,1:单聊,2:普通群,3:万人群
,4:聊天室
*/
private
Integer
chatType
;
...
...
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