| | |
| | | package com.ruoyi.goods.controller.inner; |
| | | |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.annotation.InnerAuth; |
| | | import com.ruoyi.goods.service.IGoodsSeckillService; |
| | |
| | | @InnerAuth |
| | | @GetMapping("/start/{seckillId}") |
| | | R<?> startSeckill(@PathVariable("seckillId") Long seckillId) { |
| | | goodsSeckillService.startSeckill(seckillId); |
| | | try { |
| | | goodsSeckillService.startSeckill(seckillId); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("秒杀开始异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @InnerAuth |
| | | @GetMapping("/end/{seckillId}") |
| | | R<?> endSeckill(@PathVariable("seckillId") Long seckillId) { |
| | | goodsSeckillService.endSeckill(seckillId); |
| | | try { |
| | | goodsSeckillService.endSeckill(seckillId); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("秒杀结束异常", e); |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |