| | |
| | | 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.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | * 获取当前商品信息 |
| | | * |
| | | */ |
| | | @InnerAuth |
| | | @PostMapping("/getGoodsSkuOne") |
| | | @ResponseBody |
| | | public R<GoodsSku> getGoodsSkuOne(@RequestBody Integer goodsSkuId) { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @InnerAuth |
| | | @PostMapping("/updateGoodsSkuOne") |
| | | @ResponseBody |
| | | public R<Boolean> updateGoodsSkuOne(@RequestBody GoodsSku goodsSku) { |
| | |
| | | * @return List<GoodsSku>商品SKU列表 |
| | | */ |
| | | @InnerAuth |
| | | @GetMapping("/goods-sku/name/{goodsSkuName}") |
| | | @GetMapping("/name/{goodsSkuName}") |
| | | R<List<GoodsSku>> getGoodsByName(@PathVariable("goodsSkuName") String goodsSkuName) { |
| | | return R.ok(iGoodsSkuService.getGoodsByName(goodsSkuName)); |
| | | } |
| | | |
| | | /** |
| | | * 扣减商品库存 |
| | | * |
| | | * @param goodsSkuId 商品SKU ID |
| | | * @param auctionStock 拍卖商品库存 |
| | | */ |
| | | @InnerAuth |
| | | @PutMapping("/deduct-stock") |
| | | R<?> deductStock(@RequestParam("goodsSkuId") Long goodsSkuId, |
| | | @RequestParam("auctionStock") Integer auctionStock) { |
| | | iGoodsSkuService.deductStock(goodsSkuId, auctionStock); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 退回商品库存 |
| | | * |
| | | * @param goodsSkuId 商品SKU ID |
| | | * @param auctionStock 拍卖商品库存 |
| | | */ |
| | | @InnerAuth |
| | | @PutMapping("/goods-sku/returning-stock") |
| | | R<?> returningStock(@RequestParam("goodsSkuId") Long goodsSkuId, |
| | | @RequestParam("auctionStock") Integer auctionStock) { |
| | | iGoodsSkuService.returningStock(goodsSkuId, auctionStock); |
| | | return R.ok(); |
| | | } |
| | | } |