CreateSecondKillEvent 创建新的秒杀活动
(ctx *gin.Context, req req.CreateSecondKillEventReq)
| 160 | |
| 161 | // CreateSecondKillEvent 创建新的秒杀活动 |
| 162 | func (lh *LotteryDrawHandler) CreateSecondKillEvent(ctx *gin.Context, req req.CreateSecondKillEventReq) (Result, error) { |
| 163 | input := domain.SecondKillEvent{ |
| 164 | Name: req.Name, |
| 165 | Description: req.Description, |
| 166 | StartTime: req.StartTime, |
| 167 | EndTime: req.EndTime, |
| 168 | } |
| 169 | |
| 170 | err := lh.svc.CreateSecondKillEvent(ctx, input) |
| 171 | if err != nil { |
| 172 | return Result{ |
| 173 | Code: ServerRequestError, |
| 174 | Msg: CreateSecondKillEventError, |
| 175 | }, err |
| 176 | } |
| 177 | |
| 178 | return Result{ |
| 179 | Code: RequestsOK, |
| 180 | Msg: CreateSecondKillEventSuccess, |
| 181 | }, nil |
| 182 | } |
| 183 | |
| 184 | // GetSecondKillEvent 获取指定ID的秒杀活动 |
| 185 | func (lh *LotteryDrawHandler) GetSecondKillEvent(ctx *gin.Context, req req.GetSecondKillEventReq) (Result, error) { |
nothing calls this directly
no test coverage detected