Invite friends check

This commit is contained in:
2024-04-06 14:36:36 +08:00
parent b2719ae302
commit a96910edd2
7 changed files with 60 additions and 3 deletions

View File

@ -10,6 +10,17 @@ import (
"github.com/spf13/viper"
)
func GetAccountFriend(userId, relatedId uint, status int) (*proto.FriendshipResponse, error) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()
return grpc.Friendships.GetFriendship(ctx, &proto.FriendshipTwoSideLookupRequest{
AccountId: uint64(userId),
RelatedId: uint64(relatedId),
Status: uint32(status),
})
}
func NotifyAccount(user models.Account, subject, content string, realtime bool, links ...*proto.NotifyLink) error {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()