Compare commits

..

5 Commits

Author SHA1 Message Date
junleea 6de6a1a318 Merge branch 'refs/heads/feat-im-avator' 2025-01-01 14:08:46 +08:00
junleea 6880e033a8 查询好友添加avatar 2025-01-01 14:08:37 +08:00
junleea a83aa1002d Merge branch 'refs/heads/feat-file' into release 2024-12-28 13:45:14 +08:00
junleea 2d155b3156 Merge branch 'refs/heads/feat-file' into release
# Conflicts:
#	service/userService.go
2024-12-27 20:56:14 +08:00
junleea aac77e078a Merge branch 'refs/heads/feat-file' into release 2024-12-27 20:43:36 +08:00
1 changed files with 5 additions and 4 deletions

View File

@ -234,6 +234,7 @@ type FriendRet struct {
ID int `json:"id"` //用户id ID int `json:"id"` //用户id
Name string `json:"name"` //用户名 Name string `json:"name"` //用户名
Email string `json:"email"` //邮箱 Email string `json:"email"` //邮箱
Avatar string `json:"avatar"` //头像
} }
func FindFriendsIDs(user_id int) []Friend { func FindFriendsIDs(user_id int) []Friend {
@ -244,7 +245,7 @@ func FindFriendsIDs(user_id int) []Friend {
func FindFriends(user_id int) []FriendRet { func FindFriends(user_id int) []FriendRet {
var friends []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 return friends
} }
func GetGroups(user_id int) []Group { func GetGroups(user_id int) []Group {