zhangqian
2023-08-16 83df0eea93430543529a9d8b1af30ebb3abdd6fc
Merge branch 'zq'
4个文件已修改
16 ■■■■■ 已修改文件
api/v1/product.go 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
conf/config.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product.proto 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/product/product.pb.go 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/v1/product.go
@@ -52,7 +52,6 @@
    }
    cli := product.NewProductServiceClient(productServiceConn)
    getProductListResponse, err := cli.GetProductList(ctx.GetCtx(), &product.GetProductListRequest{
        Page:          cast.ToInt32(params.Page),
        PageSize:      cast.ToInt32(params.PageSize),
conf/config.go
@@ -127,6 +127,7 @@
    }
    ShowConfig()
    CheckConfig()
}
// WriteConfig 回写配置
@@ -148,3 +149,9 @@
    log.Printf("   GrpcServiceAddr:       %+v", Conf.GrpcServiceAddr)
    log.Println("......................................................")
}
func CheckConfig() {
    if Conf.GrpcServiceAddr.Aps == "" {
        log.Fatalf("%v 尚未配置", "GrpcServiceAddr.Aps")
    }
}
proto/product.proto
@@ -21,7 +21,7 @@
  string Name = 2;
  string  Unit = 3;
  bool IsSale = 4; //是否销售
  float SalePrice = 5; //销售价格
  double SalePrice = 5; //销售价格
  float Amount = 6;//库存剩余量
  int32 MinInventory = 7;//安全库存
  string MaterialMode = 8; //物料类型
proto/product/product.pb.go
@@ -139,7 +139,7 @@
    Name         string  `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
    Unit         string  `protobuf:"bytes,3,opt,name=Unit,proto3" json:"Unit,omitempty"`
    IsSale       bool    `protobuf:"varint,4,opt,name=IsSale,proto3" json:"IsSale,omitempty"`             //是否销售
    SalePrice    float32 `protobuf:"fixed32,5,opt,name=SalePrice,proto3" json:"SalePrice,omitempty"`      //销售价格
    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"`  //物料类型
@@ -206,7 +206,7 @@
    return false
}
func (x *Product) GetSalePrice() float32 {
func (x *Product) GetSalePrice() float64 {
    if x != nil {
        return x.SalePrice
    }
@@ -403,7 +403,7 @@
    0x55, 0x6e, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x55, 0x6e, 0x69, 0x74,
    0x12, 0x16, 0x0a, 0x06, 0x49, 0x73, 0x53, 0x61, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08,
    0x52, 0x06, 0x49, 0x73, 0x53, 0x61, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x61, 0x6c, 0x65,
    0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x53, 0x61, 0x6c,
    0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x53, 0x61, 0x6c,
    0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
    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,