Commit c65e681d by Future

会话属性入参调整为string

parent 3d99100a
......@@ -22,8 +22,8 @@ import java.util.HashMap;
public class ImConversationAttrUpdate extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("json格式,自定义属性,供开发者扩展使用。")
private HashMap attributes;
@ApiModelProperty("string格式,自定义属性,供开发者扩展使用。")
private String attributes;
@ApiModelProperty("会话表id")
private Long conversationId;
......
......@@ -27,8 +27,8 @@ public class ImConversationCreate extends BaseEntity {
@ApiModelProperty("可选 对话的名字,可为群组命名。")
private String name;
@ApiModelProperty("json格式,可选 自定义属性,供开发者扩展使用。")
private HashMap attributes;
@ApiModelProperty("string格式,可选 自定义属性,供开发者扩展使用。")
private String attributes;
@ApiModelProperty("可选 邀请加入会话的客户端,如创建单聊,则填入对方的clientId")
private List<String> clientIds;
......
......@@ -181,11 +181,10 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
ImClient inviteClient = imClientService.getOne(new QueryWrapper<ImClient>().lambda()
.eq(ImClient::getFkAppid, createClient.getFkAppid())
.eq(ImClient::getClientId, imConversationCreate.getClientIds().get(0)));
String asString = JsonUtils.encodeJson(imConversationCreate.getAttributes());
log.info("RequestAttributes:" + asString);
log.info("RequestAttributes:" + imConversationCreate.getAttributes());
Long repetitionConversation = getRepetitionConversationAttributes(createClient.getId(), inviteClient.getId(), asString);
Long repetitionConversation = getRepetitionConversationAttributes(createClient.getId(), inviteClient.getId(), imConversationCreate.getAttributes());
// 存在重复会话
if (repetitionConversation != null) {
......@@ -1002,8 +1001,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
.ne(ImConversationMembers::getFkClientId, currentClient.getId())
);
String attributes = JsonUtils.encodeJson(imConversationAttrUpdate.getAttributes());
imConversationById.setAttributes(attributes);
imConversationById.setAttributes(imConversationAttrUpdate.getAttributes());
boolean b = imConversationService.updateById(imConversationById);
// 删除redis中该会话的缓存
......@@ -1310,10 +1308,7 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
imConversation.setChatType(imConversationCreate.getChatType());
imConversation.setName(imConversationCreate.getName());
imConversation.setSystemFlag(false);
// 拓展数据
String attributesStr = JsonUtils.encodeJson(imConversationCreate.getAttributes());
imConversation.setAttributes(attributesStr);
imConversation.setAttributes(imConversationCreate.getAttributes());
imConversationService.save(imConversation);
// 将创建者自己添加到会话
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment