微信回调消费接收消息成功

This commit is contained in:
ziming 2025-05-29 17:05:12 +08:00
parent 216500e4d1
commit 73a0321d99
1 changed files with 25 additions and 5 deletions

View File

@ -88,9 +88,13 @@ func (c *CpnRepoImpl) Order(ctx context.Context, order *bo.OrderBo) (string, err
if err != nil { if err != nil {
if result.Response.Body != nil {
return "", c.bodyErr(ctx, result) return "", c.bodyErr(ctx, result)
} }
return "", err
}
return *resp.CouponId, nil return *resp.CouponId, nil
} }
@ -112,9 +116,13 @@ func (c *CpnRepoImpl) Query(ctx context.Context, orderWechat *bo.OrderBo) (vo.Or
resp, result, err := svc.QueryCoupon(ctx, req) resp, result, err := svc.QueryCoupon(ctx, req)
if err != nil { if err != nil {
if result.Response.Body != nil {
return 0, c.bodyErr(ctx, result) return 0, c.bodyErr(ctx, result)
} }
return 0, err
}
return CpnStatus(*resp.Status).GetStatus() return CpnStatus(*resp.Status).GetStatus()
} }
@ -139,9 +147,13 @@ func (c *CpnRepoImpl) QueryProduct(ctx context.Context, stockCreatorMchId, stock
if err != nil { if err != nil {
if result.Response.Body != nil {
return nil, c.bodyErr(ctx, result) return nil, c.bodyErr(ctx, result)
} }
return nil, err
}
return response, nil return response, nil
} }
@ -160,9 +172,13 @@ func (c *CpnRepoImpl) QueryCallback(ctx context.Context) (*cashcoupons.Callback,
if err != nil { if err != nil {
if result.Response.Body != nil {
return nil, c.bodyErr(ctx, result) return nil, c.bodyErr(ctx, result)
} }
return nil, err
}
return response, nil return response, nil
} }
@ -183,9 +199,13 @@ func (c *CpnRepoImpl) SetCallback(ctx context.Context, url string) (*cashcoupons
if err != nil { if err != nil {
if result.Response.Body != nil {
return nil, c.bodyErr(ctx, result) return nil, c.bodyErr(ctx, result)
} }
return nil, err
}
return response, nil return response, nil
} }