From d7b3c61e01aadf99ce6a1d8ebf18c4e6dd81cc2b Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期四, 12 十二月 2024 18:05:34 +0800 Subject: [PATCH] 12.12 --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java index 7864100..8b38be4 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java @@ -34,14 +34,14 @@ @PostMapping("/addGoodsCategory") @ApiOperation(value = "添加商品分类", tags = {"管理后台-商品分类"}) - public R<Void> addGoodsCategory(GoodsCategory goodsCategory){ + public R<Void> addGoodsCategory(@RequestBody GoodsCategory goodsCategory){ goodsCategoryService.save(goodsCategory); return R.ok(); } @PutMapping("/updateGoodsCategory") @ApiOperation(value = "修改商品分类", tags = {"管理后台-商品分类"}) - public R<Void> updateGoodsCategory(GoodsCategory goodsCategory){ + public R<Void> updateGoodsCategory(@RequestBody GoodsCategory goodsCategory){ goodsCategoryService.updateById(goodsCategory); return R.ok(); } @@ -62,6 +62,16 @@ return R.ok(page); } + @DeleteMapping("/delete") + @ApiOperation(value = "删除商品分类", tags = {"管理后台-商品分类"}) + public R<Void> delete(@RequestParam("id") Integer id){ + goodsCategoryService.removeById(id); + return R.ok(); + } + + + + @GetMapping("/index/list") @ApiOperation(value = "商品分类", tags = {"小程序-首页"}) public R<List<GoodsCategory>> indexlist(){ -- Gitblit v1.7.1