Commit f21707e3 by Shadow

获取好友关系返回friendName字段

parent ac182557
...@@ -25,4 +25,7 @@ public class ClientRelationVo { ...@@ -25,4 +25,7 @@ public class ClientRelationVo {
@ApiModelProperty("是否黑名单") @ApiModelProperty("是否黑名单")
private Boolean blacklist = false; private Boolean blacklist = false;
@ApiModelProperty("好友备注")
private String friendName;
} }
...@@ -367,6 +367,9 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien ...@@ -367,6 +367,9 @@ public class ImClientServiceImpl extends BaseServiceImpl<ImClientMapper, ImClien
relationVo.setFriendClientId(param.getFriendClientId()); relationVo.setFriendClientId(param.getFriendClientId());
// 查询该好友与自己关系: 陌生人、好友、被拉黑名单 // 查询该好友与自己关系: 陌生人、好友、被拉黑名单
ImFriend imFriend = imFriendService.getByKey(param.getClientId(), param.getFriendClientId()); ImFriend imFriend = imFriendService.getByKey(param.getClientId(), param.getFriendClientId());
if (imFriend != null) {
relationVo.setFriendName(imFriend.getFriendName());
}
if (imFriend != null && FriendStateEnum.CONFORM.getCode().equals(imFriend.getState())) { if (imFriend != null && FriendStateEnum.CONFORM.getCode().equals(imFriend.getState())) {
relationVo.setFriend(true); relationVo.setFriend(true);
} }
......
...@@ -782,8 +782,8 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -782,8 +782,8 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
// 转换json格式 // 转换json格式
for (ConversationVo myconversationlistvo : myImConversationListAndMsgCount) { for (ConversationVo myconversationlistvo : myImConversationListAndMsgCount) {
HashMap attributess = JsonUtils.json2Map(myconversationlistvo.getAttribute()); // HashMap attributess = JsonUtils.json2Map(myconversationlistvo.getAttribute());
myconversationlistvo.setAttributes(attributess); myconversationlistvo.setAttributes(myconversationlistvo.getAttribute());
// 查询会话的最后一条消息 // 查询会话的最后一条消息
OfflineMsgDto lastMsg = imMessageService.getLastMsgByConversationId(myconversationlistvo.getId(), currentClient.getId()); OfflineMsgDto lastMsg = imMessageService.getLastMsgByConversationId(myconversationlistvo.getId(), currentClient.getId());
...@@ -823,8 +823,8 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap ...@@ -823,8 +823,8 @@ public class ImConversationServiceImpl extends BaseServiceImpl<ImConversationMap
return null; return null;
} }
ConversationVo conversationVo = conversationList.get(0); ConversationVo conversationVo = conversationList.get(0);
HashMap attributess = JsonUtils.json2Map(conversationVo.getAttribute()); // HashMap attributess = JsonUtils.json2Map(conversationVo.getAttribute());
conversationVo.setAttributes(attributess); conversationVo.setAttributes(conversationVo.getAttribute());
// 查询会话的最后一条消息 // 查询会话的最后一条消息
OfflineMsgDto lastMsg = imMessageService.getLastMsgByConversationId(conversationVo.getId(), client.getId()); OfflineMsgDto lastMsg = imMessageService.getLastMsgByConversationId(conversationVo.getId(), client.getId());
conversationVo.setLastMsg(lastMsg); conversationVo.setLastMsg(lastMsg);
......
...@@ -7,7 +7,6 @@ import lombok.experimental.Accessors; ...@@ -7,7 +7,6 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
...@@ -44,7 +43,7 @@ public class ConversationVo implements Serializable { ...@@ -44,7 +43,7 @@ public class ConversationVo implements Serializable {
private String attribute; private String attribute;
@ApiModelProperty("可选 自定义属性,供开发者扩展使用。") @ApiModelProperty("可选 自定义属性,供开发者扩展使用。")
private HashMap attributes; private String attributes;
@ApiModelProperty("可选 对话类型标志,是否是系统对话,后面会说明。") @ApiModelProperty("可选 对话类型标志,是否是系统对话,后面会说明。")
private Boolean systemFlag; private Boolean systemFlag;
......
...@@ -110,6 +110,39 @@ public interface WecloudIm { ...@@ -110,6 +110,39 @@ public interface WecloudIm {
List<Friend> getFriends(String userId); List<Friend> getFriends(String userId);
/** /**
* 好友申请
* @Author luozh
* @Date 2022年04月28日 02:05:11
* @param userId 用户id
* @param friendId 好友id
* @param friendName 备注好友名称
* @param requestRemark 请求备注
* @Return
*/
Boolean friendRequest(String userId, String friendId, String friendName, String requestRemark);
/**
* 删除好友
* @Author luozh
* @Date 2022年05月16日 10:14:07
* @param userId
* @param friendUserIds
* @Return
*/
Boolean unfriend(String userId, String friendUserIds);
/**
* 备注好友
* @Author luozh
* @Date 2022年05月16日 11:13:35
* @param userId
* @param friendUserId
* @param remark
* @Return
*/
Boolean remarkFriend(String userId, String friendUserId, String remark);
/**
* 用户好友关系 * 用户好友关系
* @Author luozh * @Author luozh
* @Date 2022年05月13日 10:58:28 * @Date 2022年05月13日 10:58:28
...@@ -160,18 +193,6 @@ public interface WecloudIm { ...@@ -160,18 +193,6 @@ public interface WecloudIm {
Boolean setConversationDoNotDisturb(String userId, Long conversationId, Boolean doNotDisturb); Boolean setConversationDoNotDisturb(String userId, Long conversationId, Boolean doNotDisturb);
/** /**
* 好友申请
* @Author luozh
* @Date 2022年04月28日 02:05:11
* @param userId 用户id
* @param friendId 好友id
* @param friendName 备注好友名称
* @param requestRemark 请求备注
* @Return
*/
Boolean friendRequest(String userId, String friendId, String friendName, String requestRemark);
/**
* 群成员好友申请 * 群成员好友申请
* @Author luozh * @Author luozh
* @Date 2022年04月28日 02:06:01 * @Date 2022年04月28日 02:06:01
...@@ -329,27 +350,6 @@ public interface WecloudIm { ...@@ -329,27 +350,6 @@ public interface WecloudIm {
Boolean removeGroupAdmin(String groupId, String adminUserIds); Boolean removeGroupAdmin(String groupId, String adminUserIds);
/** /**
* 删除好友
* @Author luozh
* @Date 2022年05月16日 10:14:07
* @param userId
* @param friendUserIds
* @Return
*/
Boolean unfriend(String userId, String friendUserIds);
/**
* 备注好友
* @Author luozh
* @Date 2022年05月16日 11:13:35
* @param userId
* @param friendUserId
* @param remark
* @Return
*/
Boolean remarkFriend(String userId, String friendUserId, String remark);
/**
* 获取通话记录列表 * 获取通话记录列表
* @Author nanqianhao * @Author nanqianhao
* @Date 2022年05月23日 11:30 * @Date 2022年05月23日 11:30
......
...@@ -32,4 +32,9 @@ public class ClientRelation { ...@@ -32,4 +32,9 @@ public class ClientRelation {
* 是否黑名单 * 是否黑名单
*/ */
private Boolean blacklist; private Boolean blacklist;
/**
* 好友备注
*/
private String friendName;
} }
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