From 8cf3c66cb354897196954d9a8aecc3b55b8ac333 Mon Sep 17 00:00:00 2001 From: ziming Date: Thu, 26 Mar 2026 14:00:55 +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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/biz/wechat_notify.go b/internal/biz/wechat_notify.go index 4641c65..94d576c 100644 --- a/internal/biz/wechat_notify.go +++ b/internal/biz/wechat_notify.go @@ -13,6 +13,10 @@ import ( func (this *VoucherBiz) WechatNotifyConsumer(ctx context.Context, ip string, req *bo.WechatVoucherNotifyBo) error { + if req.PlainText.StockCreatorMchid == "" || req.PlainText.StockID == "" || req.PlainText.CouponID == "" { + return fmt.Errorf("回调必要信息不能为空") + } + // 商品数据量较少,先查询商品是否存在,过滤多余的通知信息 _, err := this.ProductRepo.GetByMchStockId(ctx, req.PlainText.StockCreatorMchid, req.PlainText.StockID) if err != nil { @@ -57,10 +61,6 @@ func (this *VoucherBiz) WechatNotifyConsumer(ctx context.Context, ip string, req func (this *VoucherBiz) getOrder(ctx context.Context, req *bo.WechatVoucherNotifyBo) (*bo.OrderBo, error) { - if req.PlainText.StockCreatorMchid == "" || req.PlainText.StockID == "" || req.PlainText.CouponID == "" { - return nil, fmt.Errorf("订单查询参数错误") - } - order, err := this.OrderRepo.GetByCouponId(ctx, req.PlainText.StockCreatorMchid, req.PlainText.StockID, req.PlainText.CouponID) if err != nil { return nil, fmt.Errorf("订单查询错误 error: %w", err)