refactor: localize protobuf definitions
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
package passport
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -31,9 +30,9 @@ const (
|
||||
// Passport(会员通行证)-验证
|
||||
type VerifyClient interface {
|
||||
// 认证请求
|
||||
Request(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
Request(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// KYC 认证回调
|
||||
JumioCallback(ctx context.Context, in *JumioCallbackPayload, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
JumioCallback(ctx context.Context, in *JumioCallbackPayload, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type verifyClient struct {
|
||||
@@ -44,9 +43,9 @@ func NewVerifyClient(cc grpc.ClientConnInterface) VerifyClient {
|
||||
return &verifyClient{cc}
|
||||
}
|
||||
|
||||
func (c *verifyClient) Request(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *verifyClient) Request(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Verify_Request_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -54,9 +53,9 @@ func (c *verifyClient) Request(ctx context.Context, in *VerifyRequest, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *verifyClient) JumioCallback(ctx context.Context, in *JumioCallbackPayload, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *verifyClient) JumioCallback(ctx context.Context, in *JumioCallbackPayload, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Verify_JumioCallback_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -71,9 +70,9 @@ func (c *verifyClient) JumioCallback(ctx context.Context, in *JumioCallbackPaylo
|
||||
// Passport(会员通行证)-验证
|
||||
type VerifyServer interface {
|
||||
// 认证请求
|
||||
Request(context.Context, *VerifyRequest) (*protobuf.StatusReply, error)
|
||||
Request(context.Context, *VerifyRequest) (*StatusReply, error)
|
||||
// KYC 认证回调
|
||||
JumioCallback(context.Context, *JumioCallbackPayload) (*protobuf.StatusReply, error)
|
||||
JumioCallback(context.Context, *JumioCallbackPayload) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedVerifyServer should be embedded to have
|
||||
@@ -83,10 +82,10 @@ type VerifyServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedVerifyServer struct{}
|
||||
|
||||
func (UnimplementedVerifyServer) Request(context.Context, *VerifyRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedVerifyServer) Request(context.Context, *VerifyRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Request not implemented")
|
||||
}
|
||||
func (UnimplementedVerifyServer) JumioCallback(context.Context, *JumioCallbackPayload) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedVerifyServer) JumioCallback(context.Context, *JumioCallbackPayload) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method JumioCallback not implemented")
|
||||
}
|
||||
func (UnimplementedVerifyServer) testEmbeddedByValue() {}
|
||||
|
||||
Reference in New Issue
Block a user