Compare commits
3 Commits
feature/fz
...
pro
| Author | SHA1 | Date |
|---|---|---|
|
|
0eb11c1544 | |
|
|
0fd16e66b7 | |
|
|
0f22ff2fdb |
|
|
@ -3,10 +3,8 @@ package biz
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
err2 "voucher/api/err"
|
err2 "voucher/api/err"
|
||||||
"voucher/internal/biz/bo"
|
"voucher/internal/biz/bo"
|
||||||
"voucher/internal/biz/businesserr"
|
|
||||||
"voucher/internal/biz/vo"
|
"voucher/internal/biz/vo"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -34,21 +32,6 @@ func (this *VoucherBiz) CmbOrder(ctx context.Context, req *bo.OrderCreateReqBo)
|
||||||
return nil, product, err3
|
return nil, product, err3
|
||||||
}
|
}
|
||||||
|
|
||||||
if product.StartTime == nil {
|
|
||||||
return nil, product, businesserr.BatchNotSetStartedError
|
|
||||||
}
|
|
||||||
if product.EndTime == nil {
|
|
||||||
return nil, product, businesserr.BatchSetEndedError
|
|
||||||
}
|
|
||||||
|
|
||||||
nowTime := time.Now()
|
|
||||||
if nowTime.Before(*product.StartTime) {
|
|
||||||
return nil, product, businesserr.BatchNotStartedError
|
|
||||||
}
|
|
||||||
if nowTime.After(*product.EndTime) {
|
|
||||||
return nil, product, businesserr.BatchEndedError
|
|
||||||
}
|
|
||||||
|
|
||||||
order, err3 = this.order(ctx, req, product)
|
order, err3 = this.order(ctx, req, product)
|
||||||
if err3 != nil {
|
if err3 != nil {
|
||||||
return nil, product, err3
|
return nil, product, err3
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue