From 20ca649b9f0fa0af0361024149dee6833858c2fa Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期二, 15 八月 2023 17:12:27 +0800
Subject: [PATCH] fix
---
api/v1/saleChance.go | 36 +++++++++++++++++++++++++++++++-----
1 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/api/v1/saleChance.go b/api/v1/saleChance.go
index 33df8a5..06712c1 100644
--- a/api/v1/saleChance.go
+++ b/api/v1/saleChance.go
@@ -104,7 +104,6 @@
ctx.Ok()
}
-
// checkSaleChanceParams
// 妫�鏌ラ攢鍞満浼氬弬鏁�
func checkSaleChanceParams(saleChance request.SaleChance) (int, model.SaleChance) {
@@ -191,7 +190,9 @@
// @Summary 閿�鍞満浼氬垪琛�
// @Produce application/json
// @Param object body request.GetSaleChanceList true "鍙傛暟"
-// @Success 200 {object} contextx.Response{data=response.SaleChanceResponse}
+//
+// @Success 200 {object} contextx.Response{data=response.SaleChanceResponse}
+//
// @Router /api/saleChance/list [post]
func (con *SaleChanceApi) List(c *gin.Context) {
var params request.GetSaleChanceList
@@ -200,14 +201,39 @@
return
}
- saleChances, errCode := saleChanceService.GetSaleChanceList(params.Page, params.PageSize, params.Keyword)
+ saleChances, total, errCode := saleChanceService.GetSaleChanceList(params.Page, params.PageSize, params.SearchMap)
if errCode != ecode.OK {
ctx.Fail(errCode)
return
}
ctx.OkWithDetailed(response.SaleChanceResponse{
- List: saleChances,
- Count: len(saleChances),
+ List: saleChances,
+ Count: int(total),
})
}
+
+// Push
+//
+// @Tags SaleChance
+// @Summary 鎺ㄨ繘閿�鍞満浼�
+// @Produce application/json
+// @Param object body request.PushSaleChance true "鏌ヨ鍙傛暟"
+// @Success 200 {object} contextx.Response{}
+// @Router /api/saleChance/push [put]
+func (s *SaleChanceApi) Push(c *gin.Context) {
+ var params request.PushSaleChance
+ ctx, ok := contextx.NewContext(c, ¶ms)
+ if !ok {
+ ctx.Fail(ecode.InvalidParams)
+ return
+ }
+
+ errCode := saleChanceService.PushSaleChance(params.Id, params.Step)
+ if errCode != ecode.OK {
+ ctx.Fail(errCode)
+ return
+ }
+
+ ctx.Ok()
+}
--
Gitblit v1.8.0