validateSecondKillEventInput 验证创建秒杀活动的输入
(input domain.SecondKillEvent)
| 613 | |
| 614 | // validateSecondKillEventInput 验证创建秒杀活动的输入 |
| 615 | func validateSecondKillEventInput(input domain.SecondKillEvent) error { |
| 616 | if input.Name == "" { |
| 617 | return errors.New("秒杀活动名称不能为空") |
| 618 | } |
| 619 | if input.StartTime >= input.EndTime { |
| 620 | return errors.New("无效的秒杀活动时间范围") |
| 621 | } |
| 622 | return nil |
| 623 | } |
no outgoing calls
no test coverage detected