2024-10-31 13:35:21 +00:00
|
|
|
package authkit
|
|
|
|
|
|
|
|
import (
|
2024-11-02 04:48:17 +00:00
|
|
|
"context"
|
2024-10-31 13:35:21 +00:00
|
|
|
"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
|
|
|
|
}
|
2024-11-02 04:48:17 +00:00
|
|
|
resp, err := proto.NewUserServiceClient(conn).ListUserRelative(context.Background(), &proto.ListUserRelativeRequest{
|
2024-10-31 13:35:21 +00:00
|
|
|
UserId: uint64(userId),
|
|
|
|
Status: status,
|
|
|
|
IsRelated: isRelated,
|
|
|
|
})
|
2024-11-02 04:48:17 +00:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
2024-10-31 13:35:21 +00:00
|
|
|
return resp.GetData(), err
|
|
|
|
}
|