rentaiming
2024-05-24 a312e70d3bcb91c2cb5a77d2c239a9431cbb0dc7
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/GoodsSkuController.java
@@ -1,8 +1,14 @@
package com.ruoyi.goods.controller;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.goods.domain.GoodsSku;
import com.ruoyi.goods.service.IGoodsSkuService;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -17,4 +23,27 @@
@RequestMapping("/goods-sku")
public class GoodsSkuController {
    @Resource
    private IGoodsSkuService iGoodsSkuService;
    /**
     * 获取当前商品信息
     *
     */
    @PostMapping("/getGoodsSkuOne")
    @ResponseBody
    public R<GoodsSku> getGoodsSkuOne(@RequestBody Integer goodsSkuId) {
        GoodsSku goodsSkuOne=iGoodsSkuService.getById(goodsSkuId);
        return R.ok(goodsSkuOne);
    }
    @PostMapping("/updateGoodsSkuOne")
    @ResponseBody
    public R<Boolean> updateGoodsSkuOne(@RequestBody GoodsSku goodsSku) {
        return R.ok(iGoodsSkuService.updateById(goodsSku));
    }
}