Merge branch 'refs/heads/feat-im-avator'

This commit is contained in:
junleea 2025-01-01 14:08:46 +08:00
commit 6de6a1a318
1 changed files with 5 additions and 4 deletions

View File

@ -234,6 +234,7 @@ type FriendRet struct {
ID int `json:"id"` //用户id
Name string `json:"name"` //用户名
Email string `json:"email"` //邮箱
Avatar string `json:"avatar"` //头像
}
func FindFriendsIDs(user_id int) []Friend {
@ -244,7 +245,7 @@ func FindFriendsIDs(user_id int) []Friend {
func FindFriends(user_id int) []FriendRet {
var friends []FriendRet
DB.Raw("select distinct users.id, users.name, users.email from users join friends on users.id = friends.friend_id where friends.user_id = ? and friends.deleted_at is null", user_id).Scan(&friends)
DB.Raw("select distinct users.id, users.name, users.email,user.avatar from users join friends on users.id = friends.friend_id where friends.user_id = ? and friends.deleted_at is null", user_id).Scan(&friends)
return friends
}
func GetGroups(user_id int) []Group {