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
4c876043
Commit
4c876043
authored
Jun 24, 2022
by
Shadow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复更新client attributes 后把旧的覆盖了的问题
parent
54533414
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletions
+16
-1
core/src/main/java/com/wecloud/im/service/impl/ImClientServiceImpl.java
+16
-1
No files found.
core/src/main/java/com/wecloud/im/service/impl/ImClientServiceImpl.java
View file @
4c876043
...
...
@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.wecloud.dispatch.extend.ActionRequest
;
import
com.wecloud.dispatch.util.ActionRequestHolder
;
import
com.wecloud.im.entity.ImApplication
;
...
...
@@ -405,7 +406,21 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
if
(
targetClient
==
null
)
{
throw
new
BusinessException
(
"用户不存在"
);
}
targetClient
.
setAttributes
(
JSONObject
.
toJSONString
(
attributes
));
TypeReference
<
Map
<
String
,
Object
>>
typeReference
=
new
TypeReference
<
Map
<
String
,
Object
>>()
{
};
Map
<
String
,
Object
>
clientAttribute
=
JSONObject
.
parseObject
(
targetClient
.
getAttributes
(),
typeReference
);
if
(
clientAttribute
==
null
)
{
clientAttribute
=
Maps
.
newHashMap
();
}
if
(
attributes
==
null
||
attributes
.
isEmpty
())
{
clientAttribute
=
Maps
.
newHashMap
();
}
else
{
clientAttribute
.
putAll
(
attributes
);
}
targetClient
.
setAttributes
(
JSONObject
.
toJSONString
(
clientAttribute
));
// 清除client的redis缓存
redisUtils
.
delKey
(
"cache"
+
targetClient
.
getId
());
redisUtils
.
delKey
(
"cache"
+
targetClient
.
getFkAppid
()
+
targetClient
.
getClientId
());
...
...
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