From 7c851ddb1b4f7abf2a75565cc2dab3aeb6114d39 Mon Sep 17 00:00:00 2001 From: ziming Date: Wed, 25 Mar 2026 17:29:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=BB=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/wechat_notify.go | 6 +++--- internal/service/notify.go | 2 +- internal/service/voucher.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/biz/wechat_notify.go b/internal/biz/wechat_notify.go index cf19609..ac73bc1 100644 --- a/internal/biz/wechat_notify.go +++ b/internal/biz/wechat_notify.go @@ -9,9 +9,9 @@ import ( "voucher/internal/pkg/lock" ) -func (this *VoucherBiz) WechatNotifyConsumer(ctx context.Context, ip, tag string, req *bo.WechatVoucherNotifyBo) error { +func (this *VoucherBiz) WechatNotifyConsumer(ctx context.Context, ip string, req *bo.WechatVoucherNotifyBo) error { - c := vo.WechatNotifyConsumeLockKey.BuildCache([]string{tag, req.PlainText.StockID, req.PlainText.CouponID}) + c := vo.WechatNotifyConsumeLockKey.BuildCache([]string{req.PlainText.StockCreatorMchid, req.PlainText.StockID, req.PlainText.CouponID}) return lock.NewMutex(this.rdb.Rdb, c.TTL).Lock(ctx, c.Key, func(ctx context.Context) error { @@ -21,7 +21,7 @@ func (this *VoucherBiz) WechatNotifyConsumer(ctx context.Context, ip, tag string } if order.ActivityId != "" { - return this.MultiBiz.Run(ctx, ip, "lsxd_"+req.PlainText.StockCreatorMchid, req, order) + return this.MultiBiz.Run(ctx, ip, req.PlainText.StockCreatorMchid, req, order) } if req.PlainText.Status.IsSended() { diff --git a/internal/service/notify.go b/internal/service/notify.go index a347b71..01dfb5b 100644 --- a/internal/service/notify.go +++ b/internal/service/notify.go @@ -66,7 +66,7 @@ func (srv *NotifyService) Notify(ctx http.Context) error { ip := helper.GetClientIP(ctx) - if err = srv.VoucherBiz.WechatNotifyConsumer(ctx, ip, "WECHAT_NOTIFY", response); err != nil { + if err = srv.VoucherBiz.WechatNotifyConsumer(ctx, ip, response); err != nil { log.Errorf("微信回调通知[%s],处理失败,headers:%+v,body:%s,err:%s", mchId, headers, string(bodyBytes), err.Error()) return ctx.JSON(http2.StatusBadRequest, map[string]string{ diff --git a/internal/service/voucher.go b/internal/service/voucher.go index fddf7d1..07b3211 100644 --- a/internal/service/voucher.go +++ b/internal/service/voucher.go @@ -133,5 +133,5 @@ func (v *VoucherService) WechatUseNotifyConsumer(ctx context.Context, tag, msg s return err } - return v.VoucherBiz.WechatNotifyConsumer(ctx, "127.0.0.1", tag, req) + return v.VoucherBiz.WechatNotifyConsumer(ctx, "127.0.0.1", req) }