From b4400a06b5f801bc7a85320680d0b6c45c547ff0 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期五, 28 七月 2023 10:21:33 +0800
Subject: [PATCH] fix

---
 api/v1/orderManage.go |   56 ++++++++++++++++++++++++++++++--------------------------
 1 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/api/v1/orderManage.go b/api/v1/orderManage.go
index 8f5856a..0a5d9c4 100644
--- a/api/v1/orderManage.go
+++ b/api/v1/orderManage.go
@@ -15,7 +15,7 @@
 // Add
 //
 //	@Tags		OrderManage
-//	@Summary	娣诲姞璁㈠崟
+//	@Summary	娣诲姞宸ュ崟
 //	@Produce	application/json
 //	@Param		object	body		request.AddOrderManage	true	"鏌ヨ鍙傛暟"
 //	@Success	200		{object}	contextx.Response{}
@@ -45,7 +45,7 @@
 // Delete
 //
 //	@Tags		OrderManage
-//	@Summary	鍒犻櫎璁㈠崟
+//	@Summary	鍒犻櫎宸ュ崟
 //	@Produce	application/json
 //	@Param		id	path		int	true	"鏌ヨ鍙傛暟"
 //	@Success	200	{object}	contextx.Response{}
@@ -69,7 +69,7 @@
 // Update
 //
 //	@Tags		OrderManage
-//	@Summary	鏇存柊璁㈠崟
+//	@Summary	鏇存柊宸ュ崟
 //	@Produce	application/json
 //	@Param		object	body		request.UpdateOrderManage	true	"鏌ヨ鍙傛暟"
 //	@Success	200		{object}	contextx.Response{}
@@ -98,29 +98,6 @@
 	ctx.Ok()
 }
 
-// List
-//
-//	@Tags		OrderManage
-//	@Summary	璁㈠崟鍒楄〃
-//	@Produce	application/json
-//	@Success	200	{object}	contextx.Response{}
-//	@Router		/api/orderManage/list [get]
-func (o *OrderManageApi) List(c *gin.Context) {
-	ctx, ok := contextx.NewContext(c, nil)
-	if !ok {
-		return
-	}
-
-	list, errCode := orderManageService.GetOrderManageList()
-	if errCode != ecode.OK {
-		ctx.Fail(errCode)
-		return
-	}
-
-	ctx.OkWithDetailed(response.OrderManageResponse{
-		List: list,
-	})
-}
 
 // checkOrderManageParams
 func checkOrderManageParams(orderManage request.OrderManage) (int, model.OrderManage) {
@@ -153,3 +130,30 @@
 		File:               orderManage.File,
 	}
 }
+
+// List
+//
+//	@Tags		OrderManage
+//	@Summary	宸ュ崟绠$悊鍒楄〃
+//	@Produce	application/json
+//	@Param		object	body		request.GetOrderManageList	true	"鍙傛暟"
+//	@Success	200		{object}	contextx.Response{data=response.OrderManageResponse}
+//	@Router		/api/orderManage/list [post]
+func (con *OrderManageApi) List(c *gin.Context) {
+	var params request.GetOrderManageList
+	ctx, ok := contextx.NewContext(c, &params)
+	if !ok {
+		return
+	}
+
+	orderManages, total, errCode := orderManageService.GetOrderManageList(params.Page, params.PageSize, params.Keyword)
+	if errCode != ecode.OK {
+		ctx.Fail(errCode)
+		return
+	}
+
+	ctx.OkWithDetailed(response.OrderManageResponse{
+		List: orderManages,
+		Count: int(total),
+	})
+}
\ No newline at end of file

--
Gitblit v1.8.0