wangpengfei
2023-08-17 06c0b03df2955475fe39ff2a793a5f151f4da99f
api/v1/product.go
@@ -31,6 +31,12 @@
   }
}
func CloseProductServiceConn() {
   if productServiceConn != nil {
      productServiceConn.Close()
   }
}
// List
//
// @Tags      产品
@@ -52,7 +58,6 @@
   }
   cli := product.NewProductServiceClient(productServiceConn)
   getProductListResponse, err := cli.GetProductList(ctx.GetCtx(), &product.GetProductListRequest{
      Page:          cast.ToInt32(params.Page),
      PageSize:      cast.ToInt32(params.PageSize),
@@ -92,7 +97,7 @@
   productId := c.Query("productNumber")
   cli := product.NewProductServiceClient(productServiceConn)
   getProductInfoResponse, err := cli.GetProductInfo(ctx.GetCtx(), &product.GetProductInfoRequest{ProductId: productId}, nil)
   getProductInfoResponse, err := cli.GetProductInfo(ctx.GetCtx(), &product.GetProductInfoRequest{ProductId: productId})
   if err != nil {
      logx.Errorf("GetProductInfo err: %v", err.Error())
      ctx.FailWithMsg(ecode.UnknownErr, "内部错误")
@@ -103,7 +108,5 @@
      ctx.FailWithMsg(ecode.UnknownErr, "内部错误")
      return
   }
   ctx.OkWithDetailed(contextx.Response{
      Data: getProductInfoResponse.Data,
   })
   ctx.OkWithDetailed(getProductInfoResponse.Data)
}