复制项目

This commit is contained in:
kim.dev.6789
2026-01-14 22:16:44 +08:00
parent e2577b8cee
commit e50142a3b9
691 changed files with 97009 additions and 1 deletions

24
pkg/rpcli/relation.go Normal file
View File

@@ -0,0 +1,24 @@
package rpcli
import (
"context"
"git.imall.cloud/openim/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)
}