Add list relative method into authkit

This commit is contained in:
2024-10-31 21:35:21 +08:00
parent 39ac016b46
commit 2b4f71e732
2 changed files with 23 additions and 15 deletions

19
pkg/authkit/relative.go Normal file
View File

@ -0,0 +1,19 @@
package authkit
import (
"git.solsynth.dev/hypernet/nexus/pkg/nex"
"git.solsynth.dev/hypernet/nexus/pkg/proto"
)
func ListRelative(nx *nex.Conn, userId uint, status int32, isRelated bool) ([]*proto.UserInfo, error) {
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
if err != nil {
return nil, err
}
resp, err := proto.NewUserServiceClient(conn).ListUserRelative(nil, &proto.ListUserRelativeRequest{
UserId: uint64(userId),
Status: status,
IsRelated: isRelated,
})
return resp.GetData(), err
}