Merge branch 'refs/heads/feature-im-gitea'

This commit is contained in:
junleea 2024-08-07 16:49:43 +08:00
commit 0d3d8face2
1 changed files with 2 additions and 2 deletions

View File

@ -180,12 +180,12 @@ func FindFriend(from_user_id, to_user_id int) []Friend {
type FriendRet struct { type FriendRet struct {
ID int `json:"id"` //用户id ID int `json:"id"` //用户id
Username string `json:"username"` //用户名 Username string `json:"username"` //用户名
Avatar string `json:"avatar"` //头像 Email string `json:"email"` //邮箱
} }
func FindFriends(user_id int) []FriendRet { func FindFriends(user_id int) []FriendRet {
var friends []FriendRet var friends []FriendRet
DB.Debug().Raw("select users.id, users.username, users.avatar from users join friends on users.id = friends.friend_id where friends.user_id = ?", user_id).Scan(&friends) DB.Debug().Raw("select users.id, users.name, users.email from users join friends on users.id = friends.friend_id where friends.user_id = ?", user_id).Scan(&friends)
return friends return friends
} }