mitao
2024-05-27 d90ab2929710cd4d31f6fa3640cd454a6a5d1662
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/inner/GoodsSeckillController.java
@@ -1,6 +1,7 @@
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;
@@ -45,7 +46,12 @@
    @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();
    }
@@ -57,7 +63,12 @@
    @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();
    }