diff --git a/comm/imodule.go b/comm/imodule.go index 742190dbb..d8cc37d53 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -126,6 +126,8 @@ type ( ResetFriend(uid string) // 获取好友数量 GetFriendCount(uid string) int32 + // 获取好友列表 + GetFriendList(uid string) []string } //聊天系统 diff --git a/modules/friend/module.go b/modules/friend/module.go index e4f199bb4..454435a69 100644 --- a/modules/friend/module.go +++ b/modules/friend/module.go @@ -67,3 +67,10 @@ func (this *Friend) GetFriendCount(uid string) (count int32) { } return } + +func (this *Friend) GetFriendList(uid string) (uids []string) { + if friend := this.modelFriend.GetFriend(uid); friend != nil { + uids = friend.FriendIds + } + return +}