Merge branch 'refs/heads/feat-im-avator'
This commit is contained in:
commit
6de6a1a318
|
|
@ -231,9 +231,10 @@ func FindFriend(from_user_id, to_user_id int) []Friend {
|
|||
}
|
||||
|
||||
type FriendRet struct {
|
||||
ID int `json:"id"` //用户id
|
||||
Name string `json:"name"` //用户名
|
||||
Email string `json:"email"` //邮箱
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue