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 ( import (
"context" "context"
"fmt" "fmt"
"github.com/go-kratos/kratos/v2/log"
"time" "time"
err2 "voucher/api/err" err2 "voucher/api/err"
v1 "voucher/api/v1" 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) wechatResp, err := v.WechatCpnRepo.QueryProduct(ctx, product.MchId, product.BatchNo)
if err != nil { if err != nil {
return fmt.Errorf("批次号:%s,微信错误返回:%v", product.BatchNo, err) return err
} }
log.Warnf("微信查询券详情返回:%v", wechatResp)
inputFormat := time.RFC3339 inputFormat := time.RFC3339
beginTime := "" beginTime := ""

View File

@ -4,7 +4,6 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/go-kratos/kratos/v2/log"
"github.com/wechatpay-apiv3/wechatpay-go/core" "github.com/wechatpay-apiv3/wechatpay-go/core"
"github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons" "github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons"
"io" "io"
@ -53,8 +52,6 @@ func (c *CpnRepoImpl) bodyErr(_ context.Context, result *core.APIResult) error {
return err2.ErrorWechatFAIL(fmt.Sprintf("读取微信错误返回body报错:%s", err.Error())) return err2.ErrorWechatFAIL(fmt.Sprintf("读取微信错误返回body报错:%s", err.Error()))
} }
log.Errorf("请求微信返回错误:%s", string(bodyBytes))
var errBody ErrBody var errBody ErrBody
if err = json.Unmarshal(bodyBytes, &errBody); err != nil { if err = json.Unmarshal(bodyBytes, &errBody); err != nil {
return err2.ErrorWechatFAIL(fmt.Sprintf("微信错误返回内容解析错误:%s", err.Error())) 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) return ctx.JSON(400, err)
} }
replyBytes, _ := json.Marshal(reply)
log.Warnf("cmbOrder reply: %v", string(replyBytes))
return ctx.JSON(200, reply) return ctx.JSON(200, reply)
} }
@ -71,8 +68,6 @@ func (s *VoucherService) cmbOrder(ctx http.Context) (string, error) {
return "", err2.ErrorCmbParamFail(err.Error()) return "", err2.ErrorCmbParamFail(err.Error())
} }
log.Warnf("cmbOrder req: %v", string(bodyBytes))
var req *v1.CmbRequest var req *v1.CmbRequest
if err = json.Unmarshal(bodyBytes, &req); err != nil { if err = json.Unmarshal(bodyBytes, &req); err != nil {
return "", err2.ErrorCmbParamFail(err.Error()) return "", err2.ErrorCmbParamFail(err.Error())
@ -115,7 +110,6 @@ func (s *VoucherService) CmbQuery(ctx http.Context) error {
bizReply, err := s.cmbQuery(ctx) bizReply, err := s.cmbQuery(ctx)
if err != nil { if err != nil {
//se := errors.FromError(err) //se := errors.FromError(err)
// //
//if len(se.Reason) == 0 { //if len(se.Reason) == 0 {
@ -155,8 +149,6 @@ func (s *VoucherService) cmbQuery(ctx http.Context) (*v1.CmbQueryReply, error) {
return nil, err return nil, err
} }
log.Warnf("cmbQuery req: %s", string(bodyBytes))
var req *v1.CmbRequest var req *v1.CmbRequest
if err = json.Unmarshal(bodyBytes, &req); err != nil { if err = json.Unmarshal(bodyBytes, &req); err != nil {
return nil, err return nil, err
@ -225,8 +217,6 @@ func (s *VoucherService) cmbProductQuery(ctx http.Context) (*v1.CmbQueryProductR
return nil, err return nil, err
} }
log.Warnf("cmbProductQuery, body: %s", string(bodyBytes))
var req *v1.CmbRequest var req *v1.CmbRequest
if err = json.Unmarshal(bodyBytes, &req); err != nil { if err = json.Unmarshal(bodyBytes, &req); err != nil {
return nil, err return nil, err