From aa3bc269e46d82bdd6d088e5d07babd2d3b493a1 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期一, 28 八月 2023 11:31:51 +0800 Subject: [PATCH] fix --- api/v1/test/product.go | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v1/test/product.go b/api/v1/test/product.go index 46bf465..53cf92c 100644 --- a/api/v1/test/product.go +++ b/api/v1/test/product.go @@ -26,17 +26,17 @@ // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body test.Product true "鍒涘缓Product" +// @Param data body request.ProductCreate true "鍒涘缓Product" // @Success 200 {string} string "{"success":true,"data":{},"msg":"鑾峰彇鎴愬姛"}" // @Router /p/createProduct [post] func (pApi *ProductApi) CreateProduct(c *gin.Context) { - var p test.Product + var p testReq.ProductCreate err := c.ShouldBindJSON(&p) if err != nil { response.FailWithMessage(err.Error(), c) return } - if err := pService.CreateProduct(&p); err != nil { + if err := pService.CreateProduct(p.List); err != nil { global.GVA_LOG.Error("鍒涘缓澶辫触!", zap.Error(err)) response.FailWithMessage("鍒涘缓澶辫触", c) } else { -- Gitblit v1.8.0