| | |
| | | "wms/pkg/structx" |
| | | "wms/proto/product_inventory" |
| | | "wms/proto/purchase_wms" |
| | | "wms/proto/supplier" |
| | | "wms/request" |
| | | "wms/utils/http" |
| | | "wms/utils/upload" |
| | |
| | | return fileUrl, nil |
| | | |
| | | } |
| | | |
| | | // GetSupplierList |
| | | // @Tags 入库/出库 |
| | | // @Summary 获取物流公司列表 |
| | | // @Produce application/json |
| | | // |
| | | // @Success 200 {object} util.Response "成功" |
| | | // |
| | | // @Router /api-wms/v1/operation/getSupplierList [get] |
| | | func (slf OperationController) GetSupplierList(c *gin.Context) { |
| | | cli := supplier.NewSupplierServiceClient(supplier.SupplierConn) |
| | | resp, err := cli.GetSupplierList(c, &supplier.SupplierListRequest{Status: 1}) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "grpc调用失败:"+err.Error()) |
| | | return |
| | | } |
| | | util.ResponseFormat(c, code.Success, resp.List) |
| | | } |
| | |
| | | "models.Operation": { |
| | | "type": "object", |
| | | "properties": { |
| | | "auditDate": { |
| | | "type": "string" |
| | | }, |
| | | "baseOperationType": { |
| | | "description": "基础作业类型", |
| | | "allOf": [ |
| | |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "receiverAddr": { |
| | | "type": "string" |
| | | }, |
| | | "receiverName": { |
| | | "type": "string" |
| | | }, |
| | | "receiverPhone": { |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "receiverAddr": { |
| | | "type": "string" |
| | | }, |
| | | "receiverName": { |
| | | "type": "string" |
| | | }, |
| | | "receiverPhone": { |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "receiverAddr": { |
| | | "type": "string" |
| | | }, |
| | | "receiverName": { |
| | | "type": "string" |
| | | }, |
| | | "receiverPhone": { |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | | "description": "源单号", |
| | | "type": "string" |
| | |
| | | "models.Operation": { |
| | | "type": "object", |
| | | "properties": { |
| | | "auditDate": { |
| | | "type": "string" |
| | | }, |
| | | "baseOperationType": { |
| | | "description": "基础作业类型", |
| | | "allOf": [ |
| | |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "receiverAddr": { |
| | | "type": "string" |
| | | }, |
| | | "receiverName": { |
| | | "type": "string" |
| | | }, |
| | | "receiverPhone": { |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | |
| | | }, |
| | | "operationTypeName": { |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "receiverAddr": { |
| | | "type": "string" |
| | | }, |
| | | "receiverName": { |
| | | "type": "string" |
| | | }, |
| | | "receiverPhone": { |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | |
| | | "description": "作业类型名称", |
| | | "type": "string" |
| | | }, |
| | | "receiverAddr": { |
| | | "type": "string" |
| | | }, |
| | | "receiverName": { |
| | | "type": "string" |
| | | }, |
| | | "receiverPhone": { |
| | | "type": "string" |
| | | }, |
| | | "sourceNumber": { |
| | | "description": "源单号", |
| | | "type": "string" |
| | |
| | | type: object |
| | | models.Operation: |
| | | properties: |
| | | auditDate: |
| | | type: string |
| | | baseOperationType: |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.BaseOperationType' |
| | |
| | | type: integer |
| | | operationTypeName: |
| | | description: 作业类型名称 |
| | | type: string |
| | | receiverAddr: |
| | | type: string |
| | | receiverName: |
| | | type: string |
| | | receiverPhone: |
| | | type: string |
| | | sourceNumber: |
| | | description: 源单号 |
| | |
| | | type: integer |
| | | operationTypeName: |
| | | description: 作业类型名称 |
| | | type: string |
| | | receiverAddr: |
| | | type: string |
| | | receiverName: |
| | | type: string |
| | | receiverPhone: |
| | | type: string |
| | | sourceNumber: |
| | | description: 源单号 |
| | |
| | | operationTypeName: |
| | | description: 作业类型名称 |
| | | type: string |
| | | receiverAddr: |
| | | type: string |
| | | receiverName: |
| | | type: string |
| | | receiverPhone: |
| | | type: string |
| | | sourceNumber: |
| | | description: 源单号 |
| | | type: string |
| | |
| | | "wms/pkg/logx" |
| | | "wms/proto/product_inventory" |
| | | "wms/proto/purchase_wms" |
| | | "wms/proto/supplier" |
| | | "wms/router" |
| | | "wms/service" |
| | | ) |
| | |
| | | go controllers.InitInventoryOrderServiceConn() |
| | | go controllers.InitProductInventoryServiceConn() |
| | | go controllers.InitCodeServiceConn() |
| | | go supplier.InitConn() |
| | | //启动grpc服务 |
| | | go func() { |
| | | ln, err := net.Listen("tcp", ":"+conf.WebConf.GrpcPort) |
| | |
| | | controllers.CloseInventoryOrderServiceConn() |
| | | controllers.CloseProductInventoryServiceConn() |
| | | controllers.CloseCodeServiceConn() |
| | | supplier.CloseConn() |
| | | // 关闭HTTP服务器 |
| | | if err := server.Shutdown(ctx); err != nil { |
| | | logx.Infof("服务优雅退出失败: %v", err) |
New file |
| | |
| | | syntax = "proto3"; |
| | | |
| | | option go_package = "./supplier"; |
| | | |
| | | service SupplierService { |
| | | rpc GetSupplierList(SupplierListRequest) returns (SupplierListResponse); |
| | | } |
| | | |
| | | message SupplierListRequest { |
| | | int32 Status=1; |
| | | } |
| | | |
| | | message SupplierInfo { |
| | | int32 SupplierId =1 ; |
| | | string SupplierName =2; |
| | | } |
| | | |
| | | message SupplierListResponse { |
| | | repeated SupplierInfo List =1; |
| | | } |
New file |
| | |
| | | package supplier |
| | | |
| | | import ( |
| | | "google.golang.org/grpc" |
| | | "google.golang.org/grpc/credentials/insecure" |
| | | "wms/conf" |
| | | "wms/pkg/logx" |
| | | ) |
| | | |
| | | var ( |
| | | SupplierConn *grpc.ClientConn |
| | | ) |
| | | |
| | | func InitConn() { |
| | | var err error |
| | | SupplierConn, err = grpc.Dial(conf.GrpcServerConf.SrmAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) |
| | | if err != nil { |
| | | logx.Errorf("grpc dial product service error: %v", err.Error()) |
| | | return |
| | | } |
| | | } |
| | | |
| | | func CloseConn() { |
| | | if SupplierConn != nil { |
| | | SupplierConn.Close() |
| | | } |
| | | } |
New file |
| | |
| | | // Code generated by protoc-gen-go. DO NOT EDIT. |
| | | // versions: |
| | | // protoc-gen-go v1.30.0 |
| | | // protoc v3.8.0 |
| | | // source: supplier.proto |
| | | |
| | | package supplier |
| | | |
| | | import ( |
| | | protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| | | protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| | | reflect "reflect" |
| | | sync "sync" |
| | | ) |
| | | |
| | | const ( |
| | | // Verify that this generated code is sufficiently up-to-date. |
| | | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| | | // Verify that runtime/protoimpl is sufficiently up-to-date. |
| | | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| | | ) |
| | | |
| | | type SupplierListRequest struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | Status int32 `protobuf:"varint,1,opt,name=Status,proto3" json:"Status,omitempty"` |
| | | } |
| | | |
| | | func (x *SupplierListRequest) Reset() { |
| | | *x = SupplierListRequest{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_supplier_proto_msgTypes[0] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *SupplierListRequest) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*SupplierListRequest) ProtoMessage() {} |
| | | |
| | | func (x *SupplierListRequest) ProtoReflect() protoreflect.Message { |
| | | mi := &file_supplier_proto_msgTypes[0] |
| | | if protoimpl.UnsafeEnabled && x != nil { |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | if ms.LoadMessageInfo() == nil { |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | return ms |
| | | } |
| | | return mi.MessageOf(x) |
| | | } |
| | | |
| | | // Deprecated: Use SupplierListRequest.ProtoReflect.Descriptor instead. |
| | | func (*SupplierListRequest) Descriptor() ([]byte, []int) { |
| | | return file_supplier_proto_rawDescGZIP(), []int{0} |
| | | } |
| | | |
| | | func (x *SupplierListRequest) GetStatus() int32 { |
| | | if x != nil { |
| | | return x.Status |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | type SupplierInfo struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | SupplierId int32 `protobuf:"varint,1,opt,name=SupplierId,proto3" json:"SupplierId,omitempty"` |
| | | SupplierName string `protobuf:"bytes,2,opt,name=SupplierName,proto3" json:"SupplierName,omitempty"` |
| | | } |
| | | |
| | | func (x *SupplierInfo) Reset() { |
| | | *x = SupplierInfo{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_supplier_proto_msgTypes[1] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *SupplierInfo) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*SupplierInfo) ProtoMessage() {} |
| | | |
| | | func (x *SupplierInfo) ProtoReflect() protoreflect.Message { |
| | | mi := &file_supplier_proto_msgTypes[1] |
| | | if protoimpl.UnsafeEnabled && x != nil { |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | if ms.LoadMessageInfo() == nil { |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | return ms |
| | | } |
| | | return mi.MessageOf(x) |
| | | } |
| | | |
| | | // Deprecated: Use SupplierInfo.ProtoReflect.Descriptor instead. |
| | | func (*SupplierInfo) Descriptor() ([]byte, []int) { |
| | | return file_supplier_proto_rawDescGZIP(), []int{1} |
| | | } |
| | | |
| | | func (x *SupplierInfo) GetSupplierId() int32 { |
| | | if x != nil { |
| | | return x.SupplierId |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | func (x *SupplierInfo) GetSupplierName() string { |
| | | if x != nil { |
| | | return x.SupplierName |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | type SupplierListResponse struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | List []*SupplierInfo `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"` |
| | | } |
| | | |
| | | func (x *SupplierListResponse) Reset() { |
| | | *x = SupplierListResponse{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_supplier_proto_msgTypes[2] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *SupplierListResponse) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*SupplierListResponse) ProtoMessage() {} |
| | | |
| | | func (x *SupplierListResponse) ProtoReflect() protoreflect.Message { |
| | | mi := &file_supplier_proto_msgTypes[2] |
| | | if protoimpl.UnsafeEnabled && x != nil { |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | if ms.LoadMessageInfo() == nil { |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | return ms |
| | | } |
| | | return mi.MessageOf(x) |
| | | } |
| | | |
| | | // Deprecated: Use SupplierListResponse.ProtoReflect.Descriptor instead. |
| | | func (*SupplierListResponse) Descriptor() ([]byte, []int) { |
| | | return file_supplier_proto_rawDescGZIP(), []int{2} |
| | | } |
| | | |
| | | func (x *SupplierListResponse) GetList() []*SupplierInfo { |
| | | if x != nil { |
| | | return x.List |
| | | } |
| | | return nil |
| | | } |
| | | |
| | | var File_supplier_proto protoreflect.FileDescriptor |
| | | |
| | | var file_supplier_proto_rawDesc = []byte{ |
| | | 0x0a, 0x0e, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, |
| | | 0x22, 0x2d, 0x0a, 0x13, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, |
| | | 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, |
| | | 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, |
| | | 0x52, 0x0a, 0x0c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, |
| | | 0x1e, 0x0a, 0x0a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, |
| | | 0x01, 0x28, 0x05, 0x52, 0x0a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x49, 0x64, 0x12, |
| | | 0x22, 0x0a, 0x0c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, |
| | | 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4e, |
| | | 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x14, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, |
| | | 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, 0x4c, |
| | | 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x75, 0x70, 0x70, |
| | | 0x6c, 0x69, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x32, 0x51, |
| | | 0x0a, 0x0f, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, |
| | | 0x65, 0x12, 0x3e, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, |
| | | 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, |
| | | 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x53, 0x75, 0x70, |
| | | 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, |
| | | 0x65, 0x42, 0x0c, 0x5a, 0x0a, 0x2e, 0x2f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x62, |
| | | 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
| | | } |
| | | |
| | | var ( |
| | | file_supplier_proto_rawDescOnce sync.Once |
| | | file_supplier_proto_rawDescData = file_supplier_proto_rawDesc |
| | | ) |
| | | |
| | | func file_supplier_proto_rawDescGZIP() []byte { |
| | | file_supplier_proto_rawDescOnce.Do(func() { |
| | | file_supplier_proto_rawDescData = protoimpl.X.CompressGZIP(file_supplier_proto_rawDescData) |
| | | }) |
| | | return file_supplier_proto_rawDescData |
| | | } |
| | | |
| | | var file_supplier_proto_msgTypes = make([]protoimpl.MessageInfo, 3) |
| | | var file_supplier_proto_goTypes = []interface{}{ |
| | | (*SupplierListRequest)(nil), // 0: SupplierListRequest |
| | | (*SupplierInfo)(nil), // 1: SupplierInfo |
| | | (*SupplierListResponse)(nil), // 2: SupplierListResponse |
| | | } |
| | | var file_supplier_proto_depIdxs = []int32{ |
| | | 1, // 0: SupplierListResponse.List:type_name -> SupplierInfo |
| | | 0, // 1: SupplierService.GetSupplierList:input_type -> SupplierListRequest |
| | | 2, // 2: SupplierService.GetSupplierList:output_type -> SupplierListResponse |
| | | 2, // [2:3] is the sub-list for method output_type |
| | | 1, // [1:2] is the sub-list for method input_type |
| | | 1, // [1:1] is the sub-list for extension type_name |
| | | 1, // [1:1] is the sub-list for extension extendee |
| | | 0, // [0:1] is the sub-list for field type_name |
| | | } |
| | | |
| | | func init() { file_supplier_proto_init() } |
| | | func file_supplier_proto_init() { |
| | | if File_supplier_proto != nil { |
| | | return |
| | | } |
| | | if !protoimpl.UnsafeEnabled { |
| | | file_supplier_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*SupplierListRequest); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | file_supplier_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*SupplierInfo); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | file_supplier_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*SupplierListResponse); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | } |
| | | type x struct{} |
| | | out := protoimpl.TypeBuilder{ |
| | | File: protoimpl.DescBuilder{ |
| | | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| | | RawDescriptor: file_supplier_proto_rawDesc, |
| | | NumEnums: 0, |
| | | NumMessages: 3, |
| | | NumExtensions: 0, |
| | | NumServices: 1, |
| | | }, |
| | | GoTypes: file_supplier_proto_goTypes, |
| | | DependencyIndexes: file_supplier_proto_depIdxs, |
| | | MessageInfos: file_supplier_proto_msgTypes, |
| | | }.Build() |
| | | File_supplier_proto = out.File |
| | | file_supplier_proto_rawDesc = nil |
| | | file_supplier_proto_goTypes = nil |
| | | file_supplier_proto_depIdxs = nil |
| | | } |
New file |
| | |
| | | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| | | // versions: |
| | | // - protoc-gen-go-grpc v1.3.0 |
| | | // - protoc v3.8.0 |
| | | // source: supplier.proto |
| | | |
| | | package supplier |
| | | |
| | | import ( |
| | | context "context" |
| | | grpc "google.golang.org/grpc" |
| | | codes "google.golang.org/grpc/codes" |
| | | status "google.golang.org/grpc/status" |
| | | ) |
| | | |
| | | // This is a compile-time assertion to ensure that this generated file |
| | | // is compatible with the grpc package it is being compiled against. |
| | | // Requires gRPC-Go v1.32.0 or later. |
| | | const _ = grpc.SupportPackageIsVersion7 |
| | | |
| | | const ( |
| | | SupplierService_GetSupplierList_FullMethodName = "/SupplierService/GetSupplierList" |
| | | ) |
| | | |
| | | // SupplierServiceClient is the client API for SupplierService 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. |
| | | type SupplierServiceClient interface { |
| | | GetSupplierList(ctx context.Context, in *SupplierListRequest, opts ...grpc.CallOption) (*SupplierListResponse, error) |
| | | } |
| | | |
| | | type supplierServiceClient struct { |
| | | cc grpc.ClientConnInterface |
| | | } |
| | | |
| | | func NewSupplierServiceClient(cc grpc.ClientConnInterface) SupplierServiceClient { |
| | | return &supplierServiceClient{cc} |
| | | } |
| | | |
| | | func (c *supplierServiceClient) GetSupplierList(ctx context.Context, in *SupplierListRequest, opts ...grpc.CallOption) (*SupplierListResponse, error) { |
| | | out := new(SupplierListResponse) |
| | | err := c.cc.Invoke(ctx, SupplierService_GetSupplierList_FullMethodName, in, out, opts...) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | return out, nil |
| | | } |
| | | |
| | | // SupplierServiceServer is the server API for SupplierService service. |
| | | // All implementations must embed UnimplementedSupplierServiceServer |
| | | // for forward compatibility |
| | | type SupplierServiceServer interface { |
| | | GetSupplierList(context.Context, *SupplierListRequest) (*SupplierListResponse, error) |
| | | mustEmbedUnimplementedSupplierServiceServer() |
| | | } |
| | | |
| | | // UnimplementedSupplierServiceServer must be embedded to have forward compatible implementations. |
| | | type UnimplementedSupplierServiceServer struct { |
| | | } |
| | | |
| | | func (UnimplementedSupplierServiceServer) GetSupplierList(context.Context, *SupplierListRequest) (*SupplierListResponse, error) { |
| | | return nil, status.Errorf(codes.Unimplemented, "method GetSupplierList not implemented") |
| | | } |
| | | func (UnimplementedSupplierServiceServer) mustEmbedUnimplementedSupplierServiceServer() {} |
| | | |
| | | // UnsafeSupplierServiceServer may be embedded to opt out of forward compatibility for this service. |
| | | // Use of this interface is not recommended, as added methods to SupplierServiceServer will |
| | | // result in compilation errors. |
| | | type UnsafeSupplierServiceServer interface { |
| | | mustEmbedUnimplementedSupplierServiceServer() |
| | | } |
| | | |
| | | func RegisterSupplierServiceServer(s grpc.ServiceRegistrar, srv SupplierServiceServer) { |
| | | s.RegisterService(&SupplierService_ServiceDesc, srv) |
| | | } |
| | | |
| | | func _SupplierService_GetSupplierList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| | | in := new(SupplierListRequest) |
| | | if err := dec(in); err != nil { |
| | | return nil, err |
| | | } |
| | | if interceptor == nil { |
| | | return srv.(SupplierServiceServer).GetSupplierList(ctx, in) |
| | | } |
| | | info := &grpc.UnaryServerInfo{ |
| | | Server: srv, |
| | | FullMethod: SupplierService_GetSupplierList_FullMethodName, |
| | | } |
| | | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| | | return srv.(SupplierServiceServer).GetSupplierList(ctx, req.(*SupplierListRequest)) |
| | | } |
| | | return interceptor(ctx, in, info, handler) |
| | | } |
| | | |
| | | // SupplierService_ServiceDesc is the grpc.ServiceDesc for SupplierService service. |
| | | // It's only intended for direct use with grpc.RegisterService, |
| | | // and not to be introspected or modified (even as a copy) |
| | | var SupplierService_ServiceDesc = grpc.ServiceDesc{ |
| | | ServiceName: "SupplierService", |
| | | HandlerType: (*SupplierServiceServer)(nil), |
| | | Methods: []grpc.MethodDesc{ |
| | | { |
| | | MethodName: "GetSupplierList", |
| | | Handler: _SupplierService_GetSupplierList_Handler, |
| | | }, |
| | | }, |
| | | Streams: []grpc.StreamDesc{}, |
| | | Metadata: "supplier.proto", |
| | | } |
| | |
| | | operationAPI.GET("getLogisticCompanyList", operationController.GetLogisticCompanyList) |
| | | operationAPI.PUT("cancel/:id", operationController.Cancel) |
| | | operationAPI.PUT("outputOperation/:id", operationController.OutputOperation) |
| | | operationAPI.GET("getSupplierList", operationController.GetSupplierList) |
| | | |
| | | } |
| | | |