✨ Add list relative method into authkit
This commit is contained in:
19
pkg/authkit/relative.go
Normal file
19
pkg/authkit/relative.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user