|
|
@@ -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) |
|
|
|