cmb
This commit is contained in:
parent
d3587c2c72
commit
61df9c223c
|
|
@ -18,7 +18,7 @@ func (v *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo) (or
|
|||
|
||||
err = lock.NewMutex(v.rdb.Rdb, c.TTL).Lock(ctx, c.Key, func(ctx context.Context) error {
|
||||
|
||||
order, err := v.OrderRepo.GetByOutBizNo(ctx, vo.OrderTypeCmb, req.AppID, req.OutBizNo)
|
||||
order, err := v.OrderRepo.GetByOutBizNo(ctx, vo.OrderTypeCmb, req.OutBizNo)
|
||||
|
||||
if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return err
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
type OrderRepo interface {
|
||||
GetByOutBizNo(ctx context.Context, t vo.OrderType, appId, outBizNo string) (*bo.OrderBo, error)
|
||||
GetByOutBizNo(ctx context.Context, t vo.OrderType, outBizNo string) (*bo.OrderBo, error)
|
||||
GetByOrderNo(ctx context.Context, orderNo string) (*bo.OrderBo, error)
|
||||
Create(ctx context.Context, req *bo.OrderBo) (*bo.OrderBo, error)
|
||||
GetByID(ctx context.Context, id uint64) (*bo.OrderBo, error)
|
||||
|
|
|
|||
|
|
@ -54,10 +54,10 @@ func (p *OrderRepoImpl) Create(ctx context.Context, req *bo.OrderBo) (*bo.OrderB
|
|||
return p.ToBo(info), nil
|
||||
}
|
||||
|
||||
func (p *OrderRepoImpl) GetByOutBizNo(ctx context.Context, t vo.OrderType, appId, outBizNo string) (*bo.OrderBo, error) {
|
||||
func (p *OrderRepoImpl) GetByOutBizNo(ctx context.Context, t vo.OrderType, outBizNo string) (*bo.OrderBo, error) {
|
||||
info := &model.Order{}
|
||||
|
||||
tx := p.DB(ctx).Where(model.Order{Type: t.GetValue(), AppID: appId, OutBizNo: outBizNo}).Find(&info)
|
||||
tx := p.DB(ctx).Where(model.Order{Type: t.GetValue(), OutBizNo: outBizNo}).Find(&info)
|
||||
|
||||
if tx.Error != nil {
|
||||
return nil, tx.Error
|
||||
|
|
|
|||
Loading…
Reference in New Issue