| @@ -11,7 +11,7 @@ func GetSingleDailyPointLimitConfig() (*models.LimitConfigVO, error) { | |||||
| r, err := GetLimitConfigList(models.LimitConfigQueryOpts{ | r, err := GetLimitConfigList(models.LimitConfigQueryOpts{ | ||||
| RefreshRate: models.PeriodDaily, | RefreshRate: models.PeriodDaily, | ||||
| Scope: models.LimitScopeSingleUser, | Scope: models.LimitScopeSingleUser, | ||||
| LimitCode: "", | |||||
| LimitCode: models.SourceTypeAccomplishTask.Name(), | |||||
| LimitType: models.LimitTypeRewardPoint, | LimitType: models.LimitTypeRewardPoint, | ||||
| }) | }) | ||||
| if err != nil { | if err != nil { | ||||
| @@ -27,7 +27,7 @@ func SetSingleDailyPointLimitConfig(limitNum int64, doer *models.User) error { | |||||
| l := &models.LimitConfigVO{ | l := &models.LimitConfigVO{ | ||||
| RefreshRate: models.PeriodDaily, | RefreshRate: models.PeriodDaily, | ||||
| Scope: models.LimitScopeSingleUser.Name(), | Scope: models.LimitScopeSingleUser.Name(), | ||||
| LimitCode: "", | |||||
| LimitCode: models.SourceTypeAccomplishTask.Name(), | |||||
| LimitType: models.LimitTypeRewardPoint.Name(), | LimitType: models.LimitTypeRewardPoint.Name(), | ||||
| LimitNum: limitNum, | LimitNum: limitNum, | ||||
| } | } | ||||
| @@ -150,7 +150,7 @@ func (l *limiterRunner) limit(r models.LimitConfig) error { | |||||
| if usedNum > r.LimitNum { | if usedNum > r.LimitNum { | ||||
| if usedNum-r.LimitNum >= l.amount { | if usedNum-r.LimitNum >= l.amount { | ||||
| redis_client.IncrBy(redisKey, -1*l.amount) | redis_client.IncrBy(redisKey, -1*l.amount) | ||||
| return errors.New(fmt.Sprintf("%s:over limit", r.Tittle)) | |||||
| return errors.New(fmt.Sprintf("over limit,congfigId=%d", r.ID)) | |||||
| } | } | ||||
| switch l.rejectPolicy { | switch l.rejectPolicy { | ||||
| case models.FillUp: | case models.FillUp: | ||||
| @@ -161,7 +161,7 @@ func (l *limiterRunner) limit(r models.LimitConfig) error { | |||||
| return nil | return nil | ||||
| case models.JustReject: | case models.JustReject: | ||||
| redis_client.IncrBy(redisKey, -1*l.amount) | redis_client.IncrBy(redisKey, -1*l.amount) | ||||
| return errors.New(fmt.Sprintf("%s:over limit", r.Tittle)) | |||||
| return errors.New(fmt.Sprintf("over limit,congfigId=%d", r.ID)) | |||||
| case models.PermittedOnce: | case models.PermittedOnce: | ||||
| l.resultMap[l.index] = newLimitResult(false, l.amount, l.amount) | l.resultMap[l.index] = newLimitResult(false, l.amount, l.amount) | ||||
| return nil | return nil | ||||