From 4af9a94256e5109a6b09a6e3e61f72c43e80db50 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期一, 28 八月 2023 11:48:07 +0800
Subject: [PATCH] update

---
 api/v1/purchase/purchase.go |   34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/api/v1/purchase/purchase.go b/api/v1/purchase/purchase.go
index 4151621..d68781c 100644
--- a/api/v1/purchase/purchase.go
+++ b/api/v1/purchase/purchase.go
@@ -130,12 +130,12 @@
 
 // GetPurchaseList
 // @Tags      Purchase
-// @Summary   鍒嗛〉鑾峰彇鏉冮檺閲囪喘鍗曞垪琛�
+// @Summary   鍒嗛〉鑾峰彇閲囪喘鍗曞垪琛�
 // @Security  ApiKeyAuth
 // @accept    application/json
 // @Produce   application/json
 // @Param     data  query     request.PageInfo                                        true  "椤电爜, 姣忛〉澶у皬"
-// @Success   200   {object}  response.Response{data=response.PageResult,msg=string}  "鍒嗛〉鑾峰彇鏉冮檺閲囪喘鍗曞垪琛�,杩斿洖鍖呮嫭鍒楄〃,鎬绘暟,椤电爜,姣忛〉鏁伴噺"
+// @Success   200   {object}  response.Response{data=response.PageResult,msg=string}  "鍒嗛〉鑾峰彇閲囪喘鍗曞垪琛�,杩斿洖鍖呮嫭鍒楄〃,鎬绘暟,椤电爜,姣忛〉鏁伴噺"
 // @Router    /purchase/purchaseList [get]
 func (e *PurchaseApi) GetPurchaseList(c *gin.Context) {
 	var pageInfo request.PageInfo
@@ -162,3 +162,33 @@
 		PageSize: pageInfo.PageSize,
 	}, "鑾峰彇鎴愬姛", c)
 }
+
+// Submit
+// @Tags      Purchase
+// @Summary   鎻愪氦閲囪喘鍗�
+// @Security  ApiKeyAuth
+// @accept    application/json
+// @Produce   application/json
+// @Param		id	path		int	true	"閲囪喘鍗旾D"
+// @Success   200   {object}  response.Response{msg=string}  "鎻愪氦閲囪喘鍗�"
+// @Router    /purchase/submit/{id} [post]
+func (e *PurchaseApi) Submit(c *gin.Context) {
+	var params purchaserequest.AddPurchase
+	err := c.ShouldBindJSON(&params)
+	if err != nil {
+		response.FailWithMessage(err.Error(), c)
+		return
+	}
+	err = utils.Verify(params.Purchase.GVA_MODEL, utils.IdVerify)
+	if err != nil {
+		response.FailWithMessage(err.Error(), c)
+		return
+	}
+	err = service.NewPurchaseService().UpdatePurchase(&params)
+	if err != nil {
+		global.GVA_LOG.Error("鏇存柊澶辫触!", zap.Error(err))
+		response.FailWithMessage("鏇存柊澶辫触", c)
+		return
+	}
+	response.OkWithMessage("鏇存柊鎴愬姛", c)
+}

--
Gitblit v1.8.0