| | |
| | | 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.IGoodsGroupPurchaseService; |
| | |
| | | @InnerAuth |
| | | @GetMapping("/start/{groupPurchaseId}") |
| | | R<?> startGroupPurchase(@PathVariable("groupPurchaseId") Long groupPurchaseId) { |
| | | goodsGroupPurchaseService.startGroupPurchase(groupPurchaseId); |
| | | try { |
| | | goodsGroupPurchaseService.startGroupPurchase(groupPurchaseId); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("团购商品开始团购失败", e); |
| | | return R.fail("团购商品开始团购失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @InnerAuth |
| | | @GetMapping("/end/{groupPurchaseId}") |
| | | R<?> endGroupPurchase(@PathVariable("groupPurchaseId") Long groupPurchaseId) { |
| | | goodsGroupPurchaseService.endGroupPurchase(groupPurchaseId); |
| | | try { |
| | | goodsGroupPurchaseService.endGroupPurchase(groupPurchaseId); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("团购商品开始团购失败", e); |
| | | return R.fail("团购商品结束团购失败"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |