fix(topup): guard wallet quota during recharge
This commit is contained in:
@@ -33,11 +33,11 @@ func RequestWaffoPancakeAmount(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": fmt.Sprintf("充值数量不能小于 %d", setting.WaffoPancakeMinTopUp)})
|
||||
return
|
||||
}
|
||||
if rejectInvalidTopUpQuota(c, req.Amount) {
|
||||
id := c.GetInt("id")
|
||||
if rejectInvalidTopUpQuota(c, id, req.Amount) {
|
||||
return
|
||||
}
|
||||
|
||||
id := c.GetInt("id")
|
||||
group, err := model.GetUserGroup(id, true)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": "获取用户分组失败"})
|
||||
@@ -354,11 +354,11 @@ func RequestWaffoPancakePay(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": fmt.Sprintf("充值数量不能小于 %d", setting.WaffoPancakeMinTopUp)})
|
||||
return
|
||||
}
|
||||
if rejectInvalidTopUpQuota(c, req.Amount) {
|
||||
id := c.GetInt("id")
|
||||
if rejectInvalidTopUpQuota(c, id, req.Amount) {
|
||||
return
|
||||
}
|
||||
|
||||
id := c.GetInt("id")
|
||||
user, err := model.GetUserById(id, false)
|
||||
if err != nil || user == nil {
|
||||
c.JSON(http.StatusOK, gin.H{"message": "error", "data": "用户不存在"})
|
||||
|
||||
Reference in New Issue
Block a user