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"
"github.com/go-kratos/kratos/v2/errors"
"github.com/go-kratos/kratos/v2/log"
"time"
err2 "voucher/api/err"
v1 "voucher/api/v1"
"voucher/internal/biz/bo"
@ -112,6 +113,8 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc
// }
// return nil, err
//}
// 休眠400微妙
time.Sleep(time.Millisecond * 400)
// mock发券成功,测试使用
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 {
url := this.bc.Cmb.KxNoticeUrl
if url == "" {
return nil
}
body, err := req.Marshal()
if err != nil {
return err
}
url := this.bc.Cmb.KxNoticeUrl
_, bodyBytes, err := request.POST(ctx, url, body, this.options)
if err != nil {
log.Errorf("请求kx,url:%s,reqBody:%s,respBody:%s", url, string(body), string(bodyBytes))