package com.ruoyi.goods.controller.inner;
|
|
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.security.annotation.InnerAuth;
|
import com.ruoyi.goods.service.IGoodsSkuService;
|
import com.ruoyi.system.api.domain.GoodsSku;
|
import java.util.List;
|
import javax.annotation.Resource;
|
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.RequestBody;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
/**
|
* <p>
|
* 商品表 前端控制器
|
* </p>
|
*
|
* @author mitao
|
* @since 2024-05-16
|
*/
|
@RestController
|
@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));
|
|
}
|
|
/**
|
* 根据商品名称查询商品SKU列表。
|
*
|
* @param goodsSkuName 商品名称
|
* @return List<GoodsSku>商品SKU列表
|
*/
|
@InnerAuth
|
@GetMapping("/goods-sku/name/{goodsSkuName}")
|
R<List<GoodsSku>> getGoodsByName(@PathVariable("goodsSkuName") String goodsSkuName) {
|
return R.ok(iGoodsSkuService.getGoodsByName(goodsSkuName));
|
}
|
}
|