From c9cedfb740614a995576171df73f19ebd613aff0 Mon Sep 17 00:00:00 2001 From: jiangshuai <291802688@qq.com> Date: 星期四, 23 十一月 2023 19:12:44 +0800 Subject: [PATCH] 获取供应商列表grpc客户端 --- controllers/operation.go | 19 + proto/supplier/supplier_grpc.pb.go | 109 ++++++++++ proto/supplier/client.go | 27 ++ proto/supplier/supplier.pb.go | 287 ++++++++++++++++++++++++++++ main.go | 3 docs/swagger.yaml | 20 ++ docs/docs.go | 30 +++ proto/supplier.proto | 20 ++ docs/swagger.json | 30 +++ router/router.go | 1 10 files changed, 546 insertions(+), 0 deletions(-) diff --git a/controllers/operation.go b/controllers/operation.go index 238b057..136a9c3 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -26,6 +26,7 @@ "wms/pkg/structx" "wms/proto/product_inventory" "wms/proto/purchase_wms" + "wms/proto/supplier" "wms/request" "wms/utils/http" "wms/utils/upload" @@ -1065,3 +1066,21 @@ 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) +} diff --git a/docs/docs.go b/docs/docs.go index 9da5c1e..477c6e3 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -3221,6 +3221,9 @@ "models.Operation": { "type": "object", "properties": { + "auditDate": { + "type": "string" + }, "baseOperationType": { "description": "鍩虹浣滀笟绫诲瀷", "allOf": [ @@ -3291,6 +3294,15 @@ }, "operationTypeName": { "description": "浣滀笟绫诲瀷鍚嶇О", + "type": "string" + }, + "receiverAddr": { + "type": "string" + }, + "receiverName": { + "type": "string" + }, + "receiverPhone": { "type": "string" }, "sourceNumber": { @@ -3694,6 +3706,15 @@ }, "operationTypeName": { "description": "浣滀笟绫诲瀷鍚嶇О", + "type": "string" + }, + "receiverAddr": { + "type": "string" + }, + "receiverName": { + "type": "string" + }, + "receiverPhone": { "type": "string" }, "sourceNumber": { @@ -4379,6 +4400,15 @@ "description": "浣滀笟绫诲瀷鍚嶇О", "type": "string" }, + "receiverAddr": { + "type": "string" + }, + "receiverName": { + "type": "string" + }, + "receiverPhone": { + "type": "string" + }, "sourceNumber": { "description": "婧愬崟鍙�", "type": "string" diff --git a/docs/swagger.json b/docs/swagger.json index c6beb2f..aff7979 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -3209,6 +3209,9 @@ "models.Operation": { "type": "object", "properties": { + "auditDate": { + "type": "string" + }, "baseOperationType": { "description": "鍩虹浣滀笟绫诲瀷", "allOf": [ @@ -3279,6 +3282,15 @@ }, "operationTypeName": { "description": "浣滀笟绫诲瀷鍚嶇О", + "type": "string" + }, + "receiverAddr": { + "type": "string" + }, + "receiverName": { + "type": "string" + }, + "receiverPhone": { "type": "string" }, "sourceNumber": { @@ -3682,6 +3694,15 @@ }, "operationTypeName": { "description": "浣滀笟绫诲瀷鍚嶇О", + "type": "string" + }, + "receiverAddr": { + "type": "string" + }, + "receiverName": { + "type": "string" + }, + "receiverPhone": { "type": "string" }, "sourceNumber": { @@ -4367,6 +4388,15 @@ "description": "浣滀笟绫诲瀷鍚嶇О", "type": "string" }, + "receiverAddr": { + "type": "string" + }, + "receiverName": { + "type": "string" + }, + "receiverPhone": { + "type": "string" + }, "sourceNumber": { "description": "婧愬崟鍙�", "type": "string" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 3e83835..667604e 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -581,6 +581,8 @@ type: object models.Operation: properties: + auditDate: + type: string baseOperationType: allOf: - $ref: '#/definitions/constvar.BaseOperationType' @@ -627,6 +629,12 @@ type: integer operationTypeName: description: 浣滀笟绫诲瀷鍚嶇О + type: string + receiverAddr: + type: string + receiverName: + type: string + receiverPhone: type: string sourceNumber: description: 婧愬崟鍙� @@ -903,6 +911,12 @@ type: integer operationTypeName: description: 浣滀笟绫诲瀷鍚嶇О + type: string + receiverAddr: + type: string + receiverName: + type: string + receiverPhone: type: string sourceNumber: description: 婧愬崟鍙� @@ -1376,6 +1390,12 @@ operationTypeName: description: 浣滀笟绫诲瀷鍚嶇О type: string + receiverAddr: + type: string + receiverName: + type: string + receiverPhone: + type: string sourceNumber: description: 婧愬崟鍙� type: string diff --git a/main.go b/main.go index acfe495..d4a15c9 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,7 @@ "wms/pkg/logx" "wms/proto/product_inventory" "wms/proto/purchase_wms" + "wms/proto/supplier" "wms/router" "wms/service" ) @@ -49,6 +50,7 @@ go controllers.InitInventoryOrderServiceConn() go controllers.InitProductInventoryServiceConn() go controllers.InitCodeServiceConn() + go supplier.InitConn() //鍚姩grpc鏈嶅姟 go func() { ln, err := net.Listen("tcp", ":"+conf.WebConf.GrpcPort) @@ -87,6 +89,7 @@ controllers.CloseInventoryOrderServiceConn() controllers.CloseProductInventoryServiceConn() controllers.CloseCodeServiceConn() + supplier.CloseConn() // 鍏抽棴HTTP鏈嶅姟鍣� if err := server.Shutdown(ctx); err != nil { logx.Infof("鏈嶅姟浼橀泤閫�鍑哄け璐�: %v", err) diff --git a/proto/supplier.proto b/proto/supplier.proto new file mode 100644 index 0000000..027529e --- /dev/null +++ b/proto/supplier.proto @@ -0,0 +1,20 @@ +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; +} \ No newline at end of file diff --git a/proto/supplier/client.go b/proto/supplier/client.go new file mode 100644 index 0000000..be1c71f --- /dev/null +++ b/proto/supplier/client.go @@ -0,0 +1,27 @@ +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() + } +} diff --git a/proto/supplier/supplier.pb.go b/proto/supplier/supplier.pb.go new file mode 100644 index 0000000..9f82b20 --- /dev/null +++ b/proto/supplier/supplier.pb.go @@ -0,0 +1,287 @@ +// 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 +} diff --git a/proto/supplier/supplier_grpc.pb.go b/proto/supplier/supplier_grpc.pb.go new file mode 100644 index 0000000..c03c768 --- /dev/null +++ b/proto/supplier/supplier_grpc.pb.go @@ -0,0 +1,109 @@ +// 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", +} diff --git a/router/router.go b/router/router.go index a75aba3..6ca5d1b 100644 --- a/router/router.go +++ b/router/router.go @@ -89,6 +89,7 @@ operationAPI.GET("getLogisticCompanyList", operationController.GetLogisticCompanyList) operationAPI.PUT("cancel/:id", operationController.Cancel) operationAPI.PUT("outputOperation/:id", operationController.OutputOperation) + operationAPI.GET("getSupplierList", operationController.GetSupplierList) } -- Gitblit v1.8.0