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
c65e681d
Commit
c65e681d
authored
Apr 29, 2022
by
Future
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
会话属性入参调整为string
parent
3d99100a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
13 deletions
+8
-13
core/src/main/java/com/wecloud/im/param/add/ImConversationAttrUpdate.java
+2
-2
core/src/main/java/com/wecloud/im/param/add/ImConversationCreate.java
+2
-2
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+4
-9
No files found.
core/src/main/java/com/wecloud/im/param/add/ImConversationAttrUpdate.java
View file @
c65e681d
...
@@ -22,8 +22,8 @@ import java.util.HashMap;
...
@@ -22,8 +22,8 @@ import java.util.HashMap;
public
class
ImConversationAttrUpdate
extends
BaseEntity
{
public
class
ImConversationAttrUpdate
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"
json
格式,自定义属性,供开发者扩展使用。"
)
@ApiModelProperty
(
"
string
格式,自定义属性,供开发者扩展使用。"
)
private
HashMap
attributes
;
private
String
attributes
;
@ApiModelProperty
(
"会话表id"
)
@ApiModelProperty
(
"会话表id"
)
private
Long
conversationId
;
private
Long
conversationId
;
...
...
core/src/main/java/com/wecloud/im/param/add/ImConversationCreate.java
View file @
c65e681d
...
@@ -27,8 +27,8 @@ public class ImConversationCreate extends BaseEntity {
...
@@ -27,8 +27,8 @@ public class ImConversationCreate extends BaseEntity {
@ApiModelProperty
(
"可选 对话的名字,可为群组命名。"
)
@ApiModelProperty
(
"可选 对话的名字,可为群组命名。"
)
private
String
name
;
private
String
name
;
@ApiModelProperty
(
"
json
格式,可选 自定义属性,供开发者扩展使用。"
)
@ApiModelProperty
(
"
string
格式,可选 自定义属性,供开发者扩展使用。"
)
private
HashMap
attributes
;
private
String
attributes
;
@ApiModelProperty
(
"可选 邀请加入会话的客户端,如创建单聊,则填入对方的clientId"
)
@ApiModelProperty
(
"可选 邀请加入会话的客户端,如创建单聊,则填入对方的clientId"
)
private
List
<
String
>
clientIds
;
private
List
<
String
>
clientIds
;
...
...
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
c65e681d
...
@@ -181,11 +181,10 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -181,11 +181,10 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImClient
inviteClient
=
imClientService
.
getOne
(
new
QueryWrapper
<
ImClient
>().
lambda
()
ImClient
inviteClient
=
imClientService
.
getOne
(
new
QueryWrapper
<
ImClient
>().
lambda
()
.
eq
(
ImClient:
:
getFkAppid
,
createClient
.
getFkAppid
())
.
eq
(
ImClient:
:
getFkAppid
,
createClient
.
getFkAppid
())
.
eq
(
ImClient:
:
getClientId
,
imConversationCreate
.
getClientIds
().
get
(
0
)));
.
eq
(
ImClient:
:
getClientId
,
imConversationCreate
.
getClientIds
().
get
(
0
)));
String
asString
=
JsonUtils
.
encodeJson
(
imConversationCreate
.
getAttributes
());
log
.
info
(
"RequestAttributes:"
+
imConversationCreate
.
getAttributes
());
log
.
info
(
"RequestAttributes:"
+
asString
);
Long
repetitionConversation
=
getRepetitionConversationAttributes
(
createClient
.
getId
(),
inviteClient
.
getId
(),
asString
);
Long
repetitionConversation
=
getRepetitionConversationAttributes
(
createClient
.
getId
(),
inviteClient
.
getId
(),
imConversationCreate
.
getAttributes
()
);
// 存在重复会话
// 存在重复会话
if
(
repetitionConversation
!=
null
)
{
if
(
repetitionConversation
!=
null
)
{
...
@@ -1002,8 +1001,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -1002,8 +1001,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
.
ne
(
ImConversationMembers:
:
getFkClientId
,
currentClient
.
getId
())
.
ne
(
ImConversationMembers:
:
getFkClientId
,
currentClient
.
getId
())
);
);
String
attributes
=
JsonUtils
.
encodeJson
(
imConversationAttrUpdate
.
getAttributes
());
imConversationById
.
setAttributes
(
imConversationAttrUpdate
.
getAttributes
());
imConversationById
.
setAttributes
(
attributes
);
boolean
b
=
imConversationService
.
updateById
(
imConversationById
);
boolean
b
=
imConversationService
.
updateById
(
imConversationById
);
// 删除redis中该会话的缓存
// 删除redis中该会话的缓存
...
@@ -1310,10 +1308,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
...
@@ -1310,10 +1308,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
imConversation
.
setChatType
(
imConversationCreate
.
getChatType
());
imConversation
.
setChatType
(
imConversationCreate
.
getChatType
());
imConversation
.
setName
(
imConversationCreate
.
getName
());
imConversation
.
setName
(
imConversationCreate
.
getName
());
imConversation
.
setSystemFlag
(
false
);
imConversation
.
setSystemFlag
(
false
);
// 拓展数据
imConversation
.
setAttributes
(
imConversationCreate
.
getAttributes
());
String
attributesStr
=
JsonUtils
.
encodeJson
(
imConversationCreate
.
getAttributes
());
imConversation
.
setAttributes
(
attributesStr
);
imConversationService
.
save
(
imConversation
);
imConversationService
.
save
(
imConversation
);
// 将创建者自己添加到会话
// 将创建者自己添加到会话
...
...
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