mock 满足招行第一次失败,二次成功

This commit is contained in:
ziming 2025-03-27 17:35:52 +08:00
parent 647fb437f2
commit bb4b857d9c
2 changed files with 8 additions and 1 deletions

View File

@ -39,7 +39,7 @@ func (v *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo) (or
}
orderNo = order.OrderNo
return orderNo, nil
return orderNo, err
}
product, err3 := v.ProductRepo.GetByProductNo(ctx, req.ProductNo)

View File

@ -37,6 +37,13 @@ func (v *VoucherBiz) order(ctx context.Context, req *bo.OrderCreateReqBo, produc
return nil, err
}
// 模拟一次失败
if err3 := v.fail(ctx, order, "mock 满足招行第一次失败,二次成功"); err3 != nil {
return nil, err3
}
return order, nil
return order, v.success(ctx, order, voucherNo)
}