mitao
2024-07-29 fc8b51f40e71aa09bb49f407c1e9f68ac94ceb58
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/management/MgtGoodsSkuController.java
@@ -4,15 +4,15 @@
import com.fasterxml.jackson.core.JsonProcessingException;
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.controller.management.DTO.GoodsSkuDTO;
import com.ruoyi.goods.controller.management.DTO.GoodsSkuQuery;
import com.ruoyi.goods.controller.management.VO.GoodsBrandVO;
import com.ruoyi.goods.controller.management.VO.GoodsCategoryVO;
import com.ruoyi.goods.controller.management.VO.GoodsFlavorTypeVO;
import com.ruoyi.goods.controller.management.VO.GoodsInfoTitleVO;
import com.ruoyi.goods.controller.management.VO.GoodsSeriesVO;
import com.ruoyi.goods.controller.management.VO.GoodsSkuVO;
import com.ruoyi.goods.controller.management.dto.GoodsInfoTitleQuery;
import com.ruoyi.goods.controller.management.dto.GoodsSkuDTO;
import com.ruoyi.goods.controller.management.dto.GoodsSkuQuery;
import com.ruoyi.goods.controller.management.vo.GoodsBrandVO;
import com.ruoyi.goods.controller.management.vo.GoodsCategoryVO;
import com.ruoyi.goods.controller.management.vo.GoodsFlavorTypeVO;
import com.ruoyi.goods.controller.management.vo.GoodsInfoTitleVO;
import com.ruoyi.goods.controller.management.vo.GoodsSeriesVO;
import com.ruoyi.goods.controller.management.vo.GoodsSkuVO;
import com.ruoyi.goods.service.IGoodsBrandService;
import com.ruoyi.goods.service.IGoodsCategoryService;
import com.ruoyi.goods.service.IGoodsFlavorTypeService;
@@ -27,6 +27,7 @@
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;
@@ -45,7 +46,7 @@
@RestController
@RequestMapping("/mgt/goods-sku")
@RequiredArgsConstructor
@Api(value = "管理后台商品相关接口", tags = {"管理后台接口"})
@Api(value = "管理后台商品相关接口", tags = {"管理后台-商品相关接口"})
public class MgtGoodsSkuController {
    private final IGoodsSkuService goodsSkuService;
@@ -158,9 +159,14 @@
     */
    @ApiOperation(value = "下架/上架 商品", notes = "下架/上架 商品")
    @PutMapping("/upd-status")
    public R<Void> updStatus(@RequestBody ListStatusDTO dto) {
    public R<Void> updStatus(@Validated @RequestBody ListStatusDTO dto) {
        goodsSkuService.updStatus(dto);
        return R.ok();
    }
    @ApiOperation("查看详情")
    @GetMapping("/detail/{id}")
    public R<GoodsSkuVO> getGoodsDetail(@PathVariable("id") Long id) {
        return R.ok(goodsSkuService.getGoodsDetail(id));
    }
}