add positions
This commit is contained in:
+38
-1
@@ -19,7 +19,8 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
CRM_GetCatalog_FullMethodName = "/crabs.crm.CRM/GetCatalog"
|
||||
CRM_GetCatalog_FullMethodName = "/crabs.crm.CRM/GetCatalog"
|
||||
CRM_GetPositions_FullMethodName = "/crabs.crm.CRM/GetPositions"
|
||||
)
|
||||
|
||||
// CRMClient is the client API for CRM service.
|
||||
@@ -27,6 +28,7 @@ const (
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type CRMClient interface {
|
||||
GetCatalog(ctx context.Context, in *GetCatalogReq, opts ...grpc.CallOption) (*CatalogRsp, error)
|
||||
GetPositions(ctx context.Context, in *GetPositionsReq, opts ...grpc.CallOption) (*PositionsRsp, error)
|
||||
}
|
||||
|
||||
type cRMClient struct {
|
||||
@@ -46,11 +48,21 @@ func (c *cRMClient) GetCatalog(ctx context.Context, in *GetCatalogReq, opts ...g
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *cRMClient) GetPositions(ctx context.Context, in *GetPositionsReq, opts ...grpc.CallOption) (*PositionsRsp, error) {
|
||||
out := new(PositionsRsp)
|
||||
err := c.cc.Invoke(ctx, CRM_GetPositions_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// CRMServer is the server API for CRM service.
|
||||
// All implementations must embed UnimplementedCRMServer
|
||||
// for forward compatibility
|
||||
type CRMServer interface {
|
||||
GetCatalog(context.Context, *GetCatalogReq) (*CatalogRsp, error)
|
||||
GetPositions(context.Context, *GetPositionsReq) (*PositionsRsp, error)
|
||||
mustEmbedUnimplementedCRMServer()
|
||||
}
|
||||
|
||||
@@ -61,6 +73,9 @@ type UnimplementedCRMServer struct {
|
||||
func (UnimplementedCRMServer) GetCatalog(context.Context, *GetCatalogReq) (*CatalogRsp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCatalog not implemented")
|
||||
}
|
||||
func (UnimplementedCRMServer) GetPositions(context.Context, *GetPositionsReq) (*PositionsRsp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPositions not implemented")
|
||||
}
|
||||
func (UnimplementedCRMServer) mustEmbedUnimplementedCRMServer() {}
|
||||
|
||||
// UnsafeCRMServer may be embedded to opt out of forward compatibility for this service.
|
||||
@@ -92,6 +107,24 @@ func _CRM_GetCatalog_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CRM_GetPositions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPositionsReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CRMServer).GetPositions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CRM_GetPositions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CRMServer).GetPositions(ctx, req.(*GetPositionsReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// CRM_ServiceDesc is the grpc.ServiceDesc for CRM service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@@ -103,6 +136,10 @@ var CRM_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetCatalog",
|
||||
Handler: _CRM_GetCatalog_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPositions",
|
||||
Handler: _CRM_GetPositions_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "main.proto",
|
||||
|
||||
Reference in New Issue
Block a user