From 41df5bff23b8c7af5a2a36556c76bd00b42bd852 Mon Sep 17 00:00:00 2001 From: ziming Date: Thu, 29 May 2025 17:39:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/data/wechatrepoimpl/cpn.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/data/wechatrepoimpl/cpn.go b/internal/data/wechatrepoimpl/cpn.go index c212f61..0bc9ea8 100644 --- a/internal/data/wechatrepoimpl/cpn.go +++ b/internal/data/wechatrepoimpl/cpn.go @@ -88,7 +88,7 @@ func (c *CpnRepoImpl) Order(ctx context.Context, order *bo.OrderBo) (string, err if err != nil { - if result.Response.Body != nil { + if result.Response != nil && result.Response.Body != nil { return "", c.bodyErr(ctx, result) } @@ -116,7 +116,7 @@ func (c *CpnRepoImpl) Query(ctx context.Context, orderWechat *bo.OrderBo) (vo.Or resp, result, err := svc.QueryCoupon(ctx, req) if err != nil { - if result.Response.Body != nil { + if result.Response != nil && result.Response.Body != nil { return 0, c.bodyErr(ctx, result) } @@ -147,7 +147,7 @@ func (c *CpnRepoImpl) QueryProduct(ctx context.Context, stockCreatorMchId, stock if err != nil { - if result.Response.Body != nil { + if result.Response != nil && result.Response.Body != nil { return nil, c.bodyErr(ctx, result) } @@ -172,7 +172,7 @@ func (c *CpnRepoImpl) QueryCallback(ctx context.Context) (*cashcoupons.Callback, if err != nil { - if result.Response.Body != nil { + if result.Response != nil && result.Response.Body != nil { return nil, c.bodyErr(ctx, result) } @@ -199,7 +199,7 @@ func (c *CpnRepoImpl) SetCallback(ctx context.Context, url string) (*cashcoupons if err != nil { - if result.Response.Body != nil { + if result.Response != nil && result.Response.Body != nil { return nil, c.bodyErr(ctx, result) }