From 97ee26e00305aa064d1cc9583a9591a723b065a2 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Wed, 25 Dec 2024 17:53:11 +0800 Subject: [PATCH] update --- app/hdl/hdl_points_center.go | 4 ++++ app/hdl/hdl_wallet.go | 4 ++++ docs/docs.go | 6 +++++- docs/swagger.json | 6 +++++- docs/swagger.yaml | 5 ++++- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/hdl/hdl_points_center.go b/app/hdl/hdl_points_center.go index 228173e..8895263 100644 --- a/app/hdl/hdl_points_center.go +++ b/app/hdl/hdl_points_center.go @@ -471,6 +471,10 @@ func ExchangeEnergy(c *gin.Context) { e.OutErr(c, e.ERR_BALANCE_NOT_ENOUGH, nil) return } + if utils.StrToFloat64(req.EnergyAmount) <= 0 { + e.OutErr(c, 400, e.NewErr(400, "请输入能量值")) + return + } // 5. 调用降价公式 err, calcPriceReductionFormula := egg_energy.CalcPriceReductionFormula(req.EnergyAmount, eggEnergyCoreData, utils.IntToStr(user.Level), *setting) diff --git a/app/hdl/hdl_wallet.go b/app/hdl/hdl_wallet.go index 6b259a3..50262e0 100644 --- a/app/hdl/hdl_wallet.go +++ b/app/hdl/hdl_wallet.go @@ -167,6 +167,10 @@ func WithdrawApply(c *gin.Context) { e.OutErr(c, err1.Code, err1.Error()) return } + if utils.StrToFloat64(req.Amount) <= 0 { + e.OutErr(c, 400, e.NewErr(400, "请输入金额")) + return + } user := svc.GetUser(c) var userId, openId string var kind int diff --git a/docs/docs.go b/docs/docs.go index bf3eae7..a6715cf 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -5692,7 +5692,11 @@ const docTemplate = `{ "type": "string" }, "total_egg_energy": { - "description": "总蛋蛋能量", + "description": "总蛋蛋能量 (个人+团队+预估)", + "type": "string" + }, + "total_egg_energy_value": { + "description": "总蛋蛋能量价值", "type": "string" } } diff --git a/docs/swagger.json b/docs/swagger.json index 00d10af..b382aeb 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -5686,7 +5686,11 @@ "type": "string" }, "total_egg_energy": { - "description": "总蛋蛋能量", + "description": "总蛋蛋能量 (个人+团队+预估)", + "type": "string" + }, + "total_egg_energy_value": { + "description": "总蛋蛋能量价值", "type": "string" } } diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 6b6020b..365adbc 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -892,7 +892,10 @@ definitions: description: 总蛋蛋积分 type: string total_egg_energy: - description: 总蛋蛋能量 + description: 总蛋蛋能量 (个人+团队+预估) + type: string + total_egg_energy_value: + description: 总蛋蛋能量价值 type: string type: object md.HomePageWatchAdRuleResp: