diff --git a/internal/biz/warning_budget.go b/internal/biz/warning_budget.go index 540b90b..a11d2b6 100644 --- a/internal/biz/warning_budget.go +++ b/internal/biz/warning_budget.go @@ -12,11 +12,6 @@ import ( "voucher/internal/biz/vo" ) -func (this *VoucherBiz) WarningBudgetIncrKv(uid string) (string, time.Duration) { - v := vo.WarningBudgetSendIncr.BuildCache([]string{uid}) - return v.Key, v.TTL -} - func (this *VoucherBiz) WarningBudgetIncr(ctx context.Context, key string, ttl time.Duration) (int64, error) { // 增加发送计数 @@ -118,7 +113,9 @@ func (this *VoucherBiz) Calculate(ctx context.Context, product *bo.ProductBo, wx w := this.WxResp(wxResp) - key, ttl := this.WarningBudgetIncrKv(product.BatchNo) + b := vo.WarningBudgetSendIncr.BuildCache([]string{product.BatchNo}) + key := b.Key + ttl := b.TTL if w.AllBudget > product.AllBudget { if err := this.WarningBudgetIncrDel(ctx, key); err != nil {