From f4508a84236a4aff1c7b5bfa17a14a8ff95728ba Mon Sep 17 00:00:00 2001 From: yinbentan <yinbentan@live.com> Date: 星期一, 08 七月 2024 09:45:10 +0800 Subject: [PATCH] 接口调用报错处理 --- proto/purchase_wms/purchase_wms_grpc.pb.go | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 170 insertions(+), 10 deletions(-) diff --git a/proto/purchase_wms/purchase_wms_grpc.pb.go b/proto/purchase_wms/purchase_wms_grpc.pb.go index dcc5c68..347f50f 100644 --- a/proto/purchase_wms/purchase_wms_grpc.pb.go +++ b/proto/purchase_wms/purchase_wms_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.19.0 +// source: purchase_wms.proto package purchase_wms @@ -14,6 +18,18 @@ // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + PurchaseService_PurchaseToWms_FullMethodName = "/PurchaseService/PurchaseToWms" + PurchaseService_UpdatePurchaseStatus_FullMethodName = "/PurchaseService/UpdatePurchaseStatus" + PurchaseService_GetSupplierListByProductId_FullMethodName = "/PurchaseService/GetSupplierListByProductId" + PurchaseService_CreatePurchaseByWms_FullMethodName = "/PurchaseService/CreatePurchaseByWms" + PurchaseService_GetPurchaseInfo_FullMethodName = "/PurchaseService/GetPurchaseInfo" + PurchaseService_ExistSupplier_FullMethodName = "/PurchaseService/ExistSupplier" + PurchaseService_SrmGetWarehouseInfo_FullMethodName = "/PurchaseService/SrmGetWarehouseInfo" + PurchaseService_SrmGetOperationInfo_FullMethodName = "/PurchaseService/SrmGetOperationInfo" + PurchaseService_CreatePurchaseByAps_FullMethodName = "/PurchaseService/CreatePurchaseByAps" +) + // PurchaseServiceClient is the client API for PurchaseService service. // // 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. @@ -23,6 +39,10 @@ GetSupplierListByProductId(ctx context.Context, in *GetSupplierListByProductIdRequest, opts ...grpc.CallOption) (*GetSupplierListByProductIdResponse, error) CreatePurchaseByWms(ctx context.Context, in *CreatePurchaseByWmsRequest, opts ...grpc.CallOption) (*CreatePurchaseByWmsResponse, error) GetPurchaseInfo(ctx context.Context, in *GetPurchaseInfoRequest, opts ...grpc.CallOption) (*GetPurchaseInfoResponse, error) + ExistSupplier(ctx context.Context, in *ExistSupplierRequest, opts ...grpc.CallOption) (*ExistSupplierResponse, error) + SrmGetWarehouseInfo(ctx context.Context, in *SrmGetWarehouseInfoRequest, opts ...grpc.CallOption) (*SrmGetWarehouseInfoResponse, error) + SrmGetOperationInfo(ctx context.Context, in *SrmGetOperationInfoRequest, opts ...grpc.CallOption) (*SrmGetOperationInfoResponse, error) + CreatePurchaseByAps(ctx context.Context, in *CreatePurchaseByApsRequest, opts ...grpc.CallOption) (*CreatePurchaseByWmsResponse, error) } type purchaseServiceClient struct { @@ -35,7 +55,7 @@ func (c *purchaseServiceClient) PurchaseToWms(ctx context.Context, in *PurchaseToWmsRequest, opts ...grpc.CallOption) (*PurchaseToWmsResponse, error) { out := new(PurchaseToWmsResponse) - err := c.cc.Invoke(ctx, "/PurchaseService/PurchaseToWms", in, out, opts...) + err := c.cc.Invoke(ctx, PurchaseService_PurchaseToWms_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -44,7 +64,7 @@ func (c *purchaseServiceClient) UpdatePurchaseStatus(ctx context.Context, in *UpdatePurchaseStatusRequest, opts ...grpc.CallOption) (*UpdatePurchaseStatusResponse, error) { out := new(UpdatePurchaseStatusResponse) - err := c.cc.Invoke(ctx, "/PurchaseService/UpdatePurchaseStatus", in, out, opts...) + err := c.cc.Invoke(ctx, PurchaseService_UpdatePurchaseStatus_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -53,7 +73,7 @@ func (c *purchaseServiceClient) GetSupplierListByProductId(ctx context.Context, in *GetSupplierListByProductIdRequest, opts ...grpc.CallOption) (*GetSupplierListByProductIdResponse, error) { out := new(GetSupplierListByProductIdResponse) - err := c.cc.Invoke(ctx, "/PurchaseService/GetSupplierListByProductId", in, out, opts...) + err := c.cc.Invoke(ctx, PurchaseService_GetSupplierListByProductId_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -62,7 +82,7 @@ func (c *purchaseServiceClient) CreatePurchaseByWms(ctx context.Context, in *CreatePurchaseByWmsRequest, opts ...grpc.CallOption) (*CreatePurchaseByWmsResponse, error) { out := new(CreatePurchaseByWmsResponse) - err := c.cc.Invoke(ctx, "/PurchaseService/CreatePurchaseByWms", in, out, opts...) + err := c.cc.Invoke(ctx, PurchaseService_CreatePurchaseByWms_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -71,7 +91,43 @@ func (c *purchaseServiceClient) GetPurchaseInfo(ctx context.Context, in *GetPurchaseInfoRequest, opts ...grpc.CallOption) (*GetPurchaseInfoResponse, error) { out := new(GetPurchaseInfoResponse) - err := c.cc.Invoke(ctx, "/PurchaseService/GetPurchaseInfo", in, out, opts...) + err := c.cc.Invoke(ctx, PurchaseService_GetPurchaseInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *purchaseServiceClient) ExistSupplier(ctx context.Context, in *ExistSupplierRequest, opts ...grpc.CallOption) (*ExistSupplierResponse, error) { + out := new(ExistSupplierResponse) + err := c.cc.Invoke(ctx, PurchaseService_ExistSupplier_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *purchaseServiceClient) SrmGetWarehouseInfo(ctx context.Context, in *SrmGetWarehouseInfoRequest, opts ...grpc.CallOption) (*SrmGetWarehouseInfoResponse, error) { + out := new(SrmGetWarehouseInfoResponse) + err := c.cc.Invoke(ctx, PurchaseService_SrmGetWarehouseInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *purchaseServiceClient) SrmGetOperationInfo(ctx context.Context, in *SrmGetOperationInfoRequest, opts ...grpc.CallOption) (*SrmGetOperationInfoResponse, error) { + out := new(SrmGetOperationInfoResponse) + err := c.cc.Invoke(ctx, PurchaseService_SrmGetOperationInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *purchaseServiceClient) CreatePurchaseByAps(ctx context.Context, in *CreatePurchaseByApsRequest, opts ...grpc.CallOption) (*CreatePurchaseByWmsResponse, error) { + out := new(CreatePurchaseByWmsResponse) + err := c.cc.Invoke(ctx, PurchaseService_CreatePurchaseByAps_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -87,6 +143,10 @@ GetSupplierListByProductId(context.Context, *GetSupplierListByProductIdRequest) (*GetSupplierListByProductIdResponse, error) CreatePurchaseByWms(context.Context, *CreatePurchaseByWmsRequest) (*CreatePurchaseByWmsResponse, error) GetPurchaseInfo(context.Context, *GetPurchaseInfoRequest) (*GetPurchaseInfoResponse, error) + ExistSupplier(context.Context, *ExistSupplierRequest) (*ExistSupplierResponse, error) + SrmGetWarehouseInfo(context.Context, *SrmGetWarehouseInfoRequest) (*SrmGetWarehouseInfoResponse, error) + SrmGetOperationInfo(context.Context, *SrmGetOperationInfoRequest) (*SrmGetOperationInfoResponse, error) + CreatePurchaseByAps(context.Context, *CreatePurchaseByApsRequest) (*CreatePurchaseByWmsResponse, error) mustEmbedUnimplementedPurchaseServiceServer() } @@ -108,6 +168,18 @@ } func (UnimplementedPurchaseServiceServer) GetPurchaseInfo(context.Context, *GetPurchaseInfoRequest) (*GetPurchaseInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPurchaseInfo not implemented") +} +func (UnimplementedPurchaseServiceServer) ExistSupplier(context.Context, *ExistSupplierRequest) (*ExistSupplierResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExistSupplier not implemented") +} +func (UnimplementedPurchaseServiceServer) SrmGetWarehouseInfo(context.Context, *SrmGetWarehouseInfoRequest) (*SrmGetWarehouseInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SrmGetWarehouseInfo not implemented") +} +func (UnimplementedPurchaseServiceServer) SrmGetOperationInfo(context.Context, *SrmGetOperationInfoRequest) (*SrmGetOperationInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SrmGetOperationInfo not implemented") +} +func (UnimplementedPurchaseServiceServer) CreatePurchaseByAps(context.Context, *CreatePurchaseByApsRequest) (*CreatePurchaseByWmsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePurchaseByAps not implemented") } func (UnimplementedPurchaseServiceServer) mustEmbedUnimplementedPurchaseServiceServer() {} @@ -132,7 +204,7 @@ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/PurchaseService/PurchaseToWms", + FullMethod: PurchaseService_PurchaseToWms_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PurchaseServiceServer).PurchaseToWms(ctx, req.(*PurchaseToWmsRequest)) @@ -150,7 +222,7 @@ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/PurchaseService/UpdatePurchaseStatus", + FullMethod: PurchaseService_UpdatePurchaseStatus_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PurchaseServiceServer).UpdatePurchaseStatus(ctx, req.(*UpdatePurchaseStatusRequest)) @@ -168,7 +240,7 @@ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/PurchaseService/GetSupplierListByProductId", + FullMethod: PurchaseService_GetSupplierListByProductId_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PurchaseServiceServer).GetSupplierListByProductId(ctx, req.(*GetSupplierListByProductIdRequest)) @@ -186,7 +258,7 @@ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/PurchaseService/CreatePurchaseByWms", + FullMethod: PurchaseService_CreatePurchaseByWms_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PurchaseServiceServer).CreatePurchaseByWms(ctx, req.(*CreatePurchaseByWmsRequest)) @@ -204,10 +276,82 @@ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/PurchaseService/GetPurchaseInfo", + FullMethod: PurchaseService_GetPurchaseInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PurchaseServiceServer).GetPurchaseInfo(ctx, req.(*GetPurchaseInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PurchaseService_ExistSupplier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExistSupplierRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PurchaseServiceServer).ExistSupplier(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PurchaseService_ExistSupplier_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PurchaseServiceServer).ExistSupplier(ctx, req.(*ExistSupplierRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PurchaseService_SrmGetWarehouseInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SrmGetWarehouseInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PurchaseServiceServer).SrmGetWarehouseInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PurchaseService_SrmGetWarehouseInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PurchaseServiceServer).SrmGetWarehouseInfo(ctx, req.(*SrmGetWarehouseInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PurchaseService_SrmGetOperationInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SrmGetOperationInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PurchaseServiceServer).SrmGetOperationInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PurchaseService_SrmGetOperationInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PurchaseServiceServer).SrmGetOperationInfo(ctx, req.(*SrmGetOperationInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PurchaseService_CreatePurchaseByAps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePurchaseByApsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PurchaseServiceServer).CreatePurchaseByAps(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PurchaseService_CreatePurchaseByAps_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PurchaseServiceServer).CreatePurchaseByAps(ctx, req.(*CreatePurchaseByApsRequest)) } return interceptor(ctx, in, info, handler) } @@ -239,6 +383,22 @@ MethodName: "GetPurchaseInfo", Handler: _PurchaseService_GetPurchaseInfo_Handler, }, + { + MethodName: "ExistSupplier", + Handler: _PurchaseService_ExistSupplier_Handler, + }, + { + MethodName: "SrmGetWarehouseInfo", + Handler: _PurchaseService_SrmGetWarehouseInfo_Handler, + }, + { + MethodName: "SrmGetOperationInfo", + Handler: _PurchaseService_SrmGetOperationInfo_Handler, + }, + { + MethodName: "CreatePurchaseByAps", + Handler: _PurchaseService_CreatePurchaseByAps_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "purchase_wms.proto", -- Gitblit v1.8.0