You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/pkg/rpcli/relation.go

24 lines
682 B

package rpcli
import (
"context"
"github.com/openimsdk/protocol/relation"
"google.golang.org/grpc"
)
func NewRelationClient(cc grpc.ClientConnInterface) *RelationClient {
return &RelationClient{relation.NewFriendClient(cc)}
}
type RelationClient struct {
relation.FriendClient
}
func (x *RelationClient) GetFriendsInfo(ctx context.Context, ownerUserID string, friendUserIDs []string) ([]*relation.FriendInfoOnly, error) {
if len(friendUserIDs) == 0 {
return nil, nil
}
req := &relation.GetFriendInfoReq{OwnerUserID: ownerUserID, FriendUserIDs: friendUserIDs}
return extractField(ctx, x.FriendClient.GetFriendInfo, req, (*relation.GetFriendInfoResp).GetFriendInfos)
}