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
f21707e3
Commit
f21707e3
authored
May 27, 2022
by
Shadow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取好友关系返回friendName字段
parent
ac182557
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
49 additions
and
39 deletions
+49
-39
core/src/main/java/com/wecloud/im/param/ClientRelationVo.java
+3
-0
core/src/main/java/com/wecloud/im/service/impl/ImClientServiceImpl.java
+3
-0
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
+4
-4
core/src/main/java/com/wecloud/im/vo/ConversationVo.java
+1
-2
im-sdk/src/main/java/com/wecloud/im/sdk/WecloudIm.java
+33
-33
im-sdk/src/main/java/com/wecloud/im/sdk/model/ClientRelation.java
+5
-0
No files found.
core/src/main/java/com/wecloud/im/param/ClientRelationVo.java
View file @
f21707e3
...
@@ -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
;
}
}
core/src/main/java/com/wecloud/im/service/impl/ImClientServiceImpl.java
View file @
f21707e3
...
@@ -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
);
}
}
...
...
core/src/main/java/com/wecloud/im/service/impl/ImConversationServiceImpl.java
View file @
f21707e3
...
@@ -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
);
...
...
core/src/main/java/com/wecloud/im/vo/ConversationVo.java
View file @
f21707e3
...
@@ -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
;
...
...
im-sdk/src/main/java/com/wecloud/im/sdk/WecloudIm.java
View file @
f21707e3
...
@@ -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
...
...
im-sdk/src/main/java/com/wecloud/im/sdk/model/ClientRelation.java
View file @
f21707e3
...
@@ -32,4 +32,9 @@ public class ClientRelation {
...
@@ -32,4 +32,9 @@ public class ClientRelation {
* 是否黑名单
* 是否黑名单
*/
*/
private
Boolean
blacklist
;
private
Boolean
blacklist
;
/**
* 好友备注
*/
private
String
friendName
;
}
}
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