This commit is contained in:
李子铭 2025-03-17 13:55:28 +08:00
parent 0afa6e0c68
commit 70b3b82dcf
3 changed files with 1 additions and 17 deletions

View File

@ -3,7 +3,6 @@ package biz
import (
"context"
"fmt"
"github.com/go-kratos/kratos/v2/log"
"time"
err2 "voucher/api/err"
v1 "voucher/api/v1"
@ -110,11 +109,9 @@ func (v *VoucherBiz) CmbProductQuery(ctx context.Context, productNo string) (rep
wechatResp, err := v.WechatCpnRepo.QueryProduct(ctx, product.MchId, product.BatchNo)
if err != nil {
return fmt.Errorf("批次号:%s,微信错误返回:%v", product.BatchNo, err)
return err
}
log.Warnf("微信查询券详情返回:%v", wechatResp)
inputFormat := time.RFC3339
beginTime := ""

View File

@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/go-kratos/kratos/v2/log"
"github.com/wechatpay-apiv3/wechatpay-go/core"
"github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons"
"io"
@ -53,8 +52,6 @@ func (c *CpnRepoImpl) bodyErr(_ context.Context, result *core.APIResult) error {
return err2.ErrorWechatFAIL(fmt.Sprintf("读取微信错误返回body报错:%s", err.Error()))
}
log.Errorf("请求微信返回错误:%s", string(bodyBytes))
var errBody ErrBody
if err = json.Unmarshal(bodyBytes, &errBody); err != nil {
return err2.ErrorWechatFAIL(fmt.Sprintf("微信错误返回内容解析错误:%s", err.Error()))

View File

@ -58,9 +58,6 @@ func (s *VoucherService) CmbOrder(ctx http.Context) error {
return ctx.JSON(400, err)
}
replyBytes, _ := json.Marshal(reply)
log.Warnf("cmbOrder reply: %v", string(replyBytes))
return ctx.JSON(200, reply)
}
@ -71,8 +68,6 @@ func (s *VoucherService) cmbOrder(ctx http.Context) (string, error) {
return "", err2.ErrorCmbParamFail(err.Error())
}
log.Warnf("cmbOrder req: %v", string(bodyBytes))
var req *v1.CmbRequest
if err = json.Unmarshal(bodyBytes, &req); err != nil {
return "", err2.ErrorCmbParamFail(err.Error())
@ -115,7 +110,6 @@ func (s *VoucherService) CmbQuery(ctx http.Context) error {
bizReply, err := s.cmbQuery(ctx)
if err != nil {
//se := errors.FromError(err)
//
//if len(se.Reason) == 0 {
@ -155,8 +149,6 @@ func (s *VoucherService) cmbQuery(ctx http.Context) (*v1.CmbQueryReply, error) {
return nil, err
}
log.Warnf("cmbQuery req: %s", string(bodyBytes))
var req *v1.CmbRequest
if err = json.Unmarshal(bodyBytes, &req); err != nil {
return nil, err
@ -225,8 +217,6 @@ func (s *VoucherService) cmbProductQuery(ctx http.Context) (*v1.CmbQueryProductR
return nil, err
}
log.Warnf("cmbProductQuery, body: %s", string(bodyBytes))
var req *v1.CmbRequest
if err = json.Unmarshal(bodyBytes, &req); err != nil {
return nil, err