删除,mock数据
This commit is contained in:
parent
3e9376ec56
commit
0bea08e91e
|
|
@ -31,7 +31,7 @@ func (v *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo) (or
|
||||||
|
|
||||||
if order != nil {
|
if order != nil {
|
||||||
|
|
||||||
if order.ProductNo != "001" && order.Status.IsFail() {
|
if order.Status.IsFail() {
|
||||||
|
|
||||||
if err4 := v.orderRetry(ctx, order); err4 != nil {
|
if err4 := v.orderRetry(ctx, order); err4 != nil {
|
||||||
return orderNo, err4
|
return orderNo, err4
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,6 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if product.ProductNo == "001" {
|
|
||||||
// 压测商品-直接返回
|
|
||||||
return order, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// 注册通知标签 order.MerchantNo 批次创建商户, order.BatchNo 商品批次号
|
// 注册通知标签 order.MerchantNo 批次创建商户, order.BatchNo 商品批次号
|
||||||
if err = v.registerNotifyTag(ctx, order.MerchantNo, order.BatchNo); err != nil {
|
if err = v.registerNotifyTag(ctx, order.MerchantNo, order.BatchNo); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -37,13 +32,6 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 模拟一次失败
|
|
||||||
if err3 := v.fail(ctx, order, "mock 满足招行第一次失败,二次成功"); err3 != nil {
|
|
||||||
return nil, err3
|
|
||||||
}
|
|
||||||
|
|
||||||
return order, fmt.Errorf("mock 满足招行第一次失败,二次成功")
|
|
||||||
|
|
||||||
return order, v.success(ctx, order, voucherNo)
|
return order, v.success(ctx, order, voucherNo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -76,11 +76,6 @@ func (p *OrderRepoImpl) Create(ctx context.Context, req *bo.OrderBo) (*bo.OrderB
|
||||||
UpdateTime: &now,
|
UpdateTime: &now,
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.ProductNo == "001" {
|
|
||||||
info.VoucherNo = req.OrderNo
|
|
||||||
info.Status = vo.OrderStatusSuccess.GetValue()
|
|
||||||
}
|
|
||||||
|
|
||||||
db := p.DB(ctx)
|
db := p.DB(ctx)
|
||||||
tx := db.Create(info)
|
tx := db.Create(info)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,6 @@ func (c *CmbService) OrderFail(ctx context.Context, err error) (*v1.CmbReply, er
|
||||||
|
|
||||||
func (c *CmbService) Order(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) {
|
func (c *CmbService) Order(ctx context.Context, request *v1.CmbRequest) (*v1.CmbReply, error) {
|
||||||
|
|
||||||
//ctx2, cancel := context.WithCancel(ctx)
|
|
||||||
//defer cancel()
|
|
||||||
|
|
||||||
orderNo, err := c.order(ctx, request)
|
orderNo, err := c.order(ctx, request)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue