From 28fb78f3fa0e4f629ff7d49f8305f5120cdafd15 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期一, 28 八月 2023 14:16:39 +0800 Subject: [PATCH] fix --- proto/product.proto | 8 ++ proto/product/product.pb.go | 112 +++++++++++++++++++++++++------------ proto/product/product_grpc.pb.go | 17 +---- config.yaml | 2 api/v1/test/product.go | 8 +- 5 files changed, 91 insertions(+), 56 deletions(-) diff --git a/api/v1/test/product.go b/api/v1/test/product.go index 53cf92c..937a65c 100644 --- a/api/v1/test/product.go +++ b/api/v1/test/product.go @@ -220,9 +220,11 @@ productList[k].Name = v.Name productList[k].Unit = v.Unit productList[k].PurchasePrice = &v.SalePrice - //productList[k].MinimumStock = &v.SalePrice - //productList[k].MaximumStock = &v.SalePrice - //productList[k].Remark = &v.SalePrice + min := int(v.MinInventory) + productList[k].MinimumStock = &min + max := int(v.MaxInventory) + productList[k].MaximumStock = &max + productList[k].Remark = v.Node productList[k].ProductType = v.MaterialMode } diff --git a/config.yaml b/config.yaml index 0cfd477..a172756 100644 --- a/config.yaml +++ b/config.yaml @@ -182,7 +182,7 @@ iplimit-time: 3600 use-multipoint: false use-redis: false - grpc-url: 192.168.20.119:9091 + grpc-url: 192.168.20.118:9091 grpc-admin-url: 192.168.20.119:50051 tencent-cos: bucket: xxxxx-10005608 diff --git a/proto/product.proto b/proto/product.proto index bf9d1dd..3727bcc 100644 --- a/proto/product.proto +++ b/proto/product.proto @@ -24,8 +24,12 @@ double SalePrice = 5; //閿�鍞环鏍� float Amount = 6;//搴撳瓨鍓╀綑閲� int32 MinInventory = 7;//瀹夊叏搴撳瓨 - string MaterialMode = 8; //鐗╂枡绫诲瀷 - string PurchaseType = 9;//閲囪喘绫诲瀷 + int32 MaxInventory = 8; // 鏈�澶у簱瀛� + string MaterialMode = 9; //鐗╂枡绫诲瀷 + string PurchaseType = 10;//閲囪喘绫诲瀷 + string Node = 11; // 澶囨敞 + string Type = 12; // 鍨嬪彿 + string Specs = 13; // 瑙勬牸 } message GetProductListRequest{ diff --git a/proto/product/product.pb.go b/proto/product/product.pb.go index fa286ea..0f60c59 100644 --- a/proto/product/product.pb.go +++ b/proto/product/product.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 -// protoc v3.19.0 +// protoc-gen-go v1.26.0 +// protoc v4.24.0 // source: product.proto package product @@ -142,8 +142,12 @@ SalePrice float64 `protobuf:"fixed64,5,opt,name=SalePrice,proto3" json:"SalePrice,omitempty"` //閿�鍞环鏍� Amount float32 `protobuf:"fixed32,6,opt,name=Amount,proto3" json:"Amount,omitempty"` //搴撳瓨鍓╀綑閲� MinInventory int32 `protobuf:"varint,7,opt,name=MinInventory,proto3" json:"MinInventory,omitempty"` //瀹夊叏搴撳瓨 - MaterialMode string `protobuf:"bytes,8,opt,name=MaterialMode,proto3" json:"MaterialMode,omitempty"` //鐗╂枡绫诲瀷 - PurchaseType string `protobuf:"bytes,9,opt,name=PurchaseType,proto3" json:"PurchaseType,omitempty"` //閲囪喘绫诲瀷 + MaxInventory int32 `protobuf:"varint,8,opt,name=MaxInventory,proto3" json:"MaxInventory,omitempty"` // 鏈�澶у簱瀛� + MaterialMode string `protobuf:"bytes,9,opt,name=MaterialMode,proto3" json:"MaterialMode,omitempty"` //鐗╂枡绫诲瀷 + PurchaseType string `protobuf:"bytes,10,opt,name=PurchaseType,proto3" json:"PurchaseType,omitempty"` //閲囪喘绫诲瀷 + Node string `protobuf:"bytes,11,opt,name=Node,proto3" json:"Node,omitempty"` // 澶囨敞 + Type string `protobuf:"bytes,12,opt,name=Type,proto3" json:"Type,omitempty"` // 鍨嬪彿 + Specs string `protobuf:"bytes,13,opt,name=Specs,proto3" json:"Specs,omitempty"` // 瑙勬牸 } func (x *Product) Reset() { @@ -227,6 +231,13 @@ return 0 } +func (x *Product) GetMaxInventory() int32 { + if x != nil { + return x.MaxInventory + } + return 0 +} + func (x *Product) GetMaterialMode() string { if x != nil { return x.MaterialMode @@ -237,6 +248,27 @@ func (x *Product) GetPurchaseType() string { if x != nil { return x.PurchaseType + } + return "" +} + +func (x *Product) GetNode() string { + if x != nil { + return x.Node + } + return "" +} + +func (x *Product) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Product) GetSpecs() string { + if x != nil { + return x.Specs } return "" } @@ -396,7 +428,7 @@ 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x04, - 0x44, 0x61, 0x74, 0x61, 0x22, 0x83, 0x02, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x44, 0x61, 0x74, 0x61, 0x22, 0xe5, 0x02, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, @@ -408,39 +440,45 @@ 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x4d, 0x69, 0x6e, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x4d, 0x69, 0x6e, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4d, 0x6f, - 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, - 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, - 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x50, 0x75, - 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x15, 0x47, + 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x4d, 0x61, 0x78, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x4d, 0x61, 0x78, 0x49, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x4d, 0x61, + 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x50, 0x75, + 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x4e, 0x6f, 0x64, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x63, 0x73, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x53, 0x70, 0x65, 0x63, 0x73, 0x22, 0x8f, 0x01, 0x0a, + 0x15, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, + 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, + 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x50, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, + 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x72, + 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x1c, + 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x50, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x54, 0x6f, 0x74, + 0x61, 0x6c, 0x32, 0x9a, 0x01, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, + 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, + 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x72, 0x0a, 0x16, - 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, - 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x04, - 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x6f, - 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x54, 0x6f, 0x74, 0x61, 0x6c, - 0x32, 0x9a, 0x01, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, - 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, - 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0b, 0x5a, - 0x09, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, + 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/product/product_grpc.pb.go b/proto/product/product_grpc.pb.go index 16e851e..bd6fa0d 100644 --- a/proto/product/product_grpc.pb.go +++ b/proto/product/product_grpc.pb.go @@ -1,8 +1,4 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.19.0 -// source: product.proto package product @@ -17,11 +13,6 @@ // is compatible with the grpc package it is being compiled against. // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 - -const ( - ProductService_GetProductInfo_FullMethodName = "/productService/GetProductInfo" - ProductService_GetProductList_FullMethodName = "/productService/GetProductList" -) // ProductServiceClient is the client API for ProductService service. // @@ -41,7 +32,7 @@ func (c *productServiceClient) GetProductInfo(ctx context.Context, in *GetProductInfoRequest, opts ...grpc.CallOption) (*GetProductInfoResponse, error) { out := new(GetProductInfoResponse) - err := c.cc.Invoke(ctx, ProductService_GetProductInfo_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/productService/GetProductInfo", in, out, opts...) if err != nil { return nil, err } @@ -50,7 +41,7 @@ func (c *productServiceClient) GetProductList(ctx context.Context, in *GetProductListRequest, opts ...grpc.CallOption) (*GetProductListResponse, error) { out := new(GetProductListResponse) - err := c.cc.Invoke(ctx, ProductService_GetProductList_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/productService/GetProductList", in, out, opts...) if err != nil { return nil, err } @@ -99,7 +90,7 @@ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ProductService_GetProductInfo_FullMethodName, + FullMethod: "/productService/GetProductInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProductServiceServer).GetProductInfo(ctx, req.(*GetProductInfoRequest)) @@ -117,7 +108,7 @@ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ProductService_GetProductList_FullMethodName, + FullMethod: "/productService/GetProductList", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ProductServiceServer).GetProductList(ctx, req.(*GetProductListRequest)) -- Gitblit v1.8.0