This commit is contained in:
ziming 2025-07-01 18:17:50 +08:00
parent cb61887221
commit e9c1c63a69
1 changed files with 3 additions and 6 deletions

View File

@ -12,11 +12,6 @@ import (
"voucher/internal/biz/vo" "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) { 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) 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 w.AllBudget > product.AllBudget {
if err := this.WarningBudgetIncrDel(ctx, key); err != nil { if err := this.WarningBudgetIncrDel(ctx, key); err != nil {