This commit is contained in:
ziming 2025-05-21 18:22:23 +08:00
parent b8eb1208d0
commit e59653cdae
2 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/errors"
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
"time"
err2 "voucher/api/err" err2 "voucher/api/err"
v1 "voucher/api/v1" v1 "voucher/api/v1"
"voucher/internal/biz/bo" "voucher/internal/biz/bo"
@ -112,6 +113,8 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc
// } // }
// return nil, err // return nil, err
//} //}
// 休眠400微妙
time.Sleep(time.Millisecond * 400)
// mock发券成功,测试使用 // mock发券成功,测试使用
voucherNo := order.OrderNo voucherNo := order.OrderNo

View File

@ -40,13 +40,16 @@ func NewKxMixRepoImpl(bc *conf.Bootstrap) mixrepos.KxMixRepo {
func (this *KxMixRepoImpl) Request(ctx context.Context, req *kog.Notice) error { func (this *KxMixRepoImpl) Request(ctx context.Context, req *kog.Notice) error {
url := this.bc.Cmb.KxNoticeUrl
if url == "" {
return nil
}
body, err := req.Marshal() body, err := req.Marshal()
if err != nil { if err != nil {
return err return err
} }
url := this.bc.Cmb.KxNoticeUrl
_, bodyBytes, err := request.POST(ctx, url, body, this.options) _, bodyBytes, err := request.POST(ctx, url, body, this.options)
if err != nil { if err != nil {
log.Errorf("请求kx,url:%s,reqBody:%s,respBody:%s", url, string(body), string(bodyBytes)) log.Errorf("请求kx,url:%s,reqBody:%s,respBody:%s", url, string(body), string(bodyBytes))