From 06c0b03df2955475fe39ff2a793a5f151f4da99f Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期四, 17 八月 2023 19:25:30 +0800 Subject: [PATCH] Merge branch 'master' into fly --- api/v1/product.go | 13 ++++++++----- 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/api/v1/product.go b/api/v1/product.go index 8782b69..0b51826 100644 --- a/api/v1/product.go +++ b/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) } -- Gitblit v1.8.0