| | |
| | | |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.ruoyi.common.core.constant.SecurityConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.dto.GoodsInfoTitleQuery; |
| | |
| | | import com.ruoyi.goods.service.IGoodsInfoTitleService; |
| | | import com.ruoyi.goods.service.IGoodsSeriesService; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import com.ruoyi.system.api.domain.AuctionGoods; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | import com.ruoyi.system.api.feignClient.AuctionClient; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.List; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | private final IGoodsCategoryService goodsCategoryService; |
| | | private final IGoodsInfoTitleService goodsInfoTitleService; |
| | | private final IGoodsFlavorTypeService goodsFlavorTypeService; |
| | | |
| | | private final AuctionClient auctionClient; |
| | | /** |
| | | * 获取商品分类列表的接口 该接口不需要接收任何参数,调用后返回商品分类的列表信息。 |
| | | * |
| | |
| | | public R<GoodsSkuVO> getGoodsDetail(@PathVariable("id") Long id) { |
| | | return R.ok(goodsSkuService.getGoodsDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除商品 |
| | | */ |
| | | @ApiOperation("删除商品") |
| | | @DeleteMapping("/delete/{id}") |
| | | public R<Void> delete(@PathVariable("id") Long id) { |
| | | R<AuctionGoods> auctionR = auctionClient.getAuctionBySkuId(id, SecurityConstants.INNER); |
| | | if (auctionR.getData() != null){ |
| | | return R.fail("该商品正在拍卖中,无法删除"); |
| | | } |
| | | goodsSkuService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |