From 8d2ee7f39032ed214db4a3c9f2d55f8037f132ae Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 21 五月 2024 17:11:58 +0800 Subject: [PATCH] 1.提交【管理后台】商品分类管理、商品香型管理、商品系列管理接口 2.提交 文件微服务华为云OBS文件上传接口 --- ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsSeriesController.java | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 53 insertions(+), 1 deletions(-) diff --git a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsSeriesController.java b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsSeriesController.java index b7452d2..aec1815 100644 --- a/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsSeriesController.java +++ b/ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsSeriesController.java @@ -1,9 +1,21 @@ package com.ruoyi.goods.controller.mamagement; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.utils.page.PageDTO; +import com.ruoyi.goods.controller.mamagement.DTO.GoodsSeriesDTO; +import com.ruoyi.goods.controller.mamagement.DTO.GoodsSeriesQuery; +import com.ruoyi.goods.controller.mamagement.VO.GoodsSeriesVO; +import com.ruoyi.goods.service.IGoodsSeriesService; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.DeleteMapping; +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.RestController; @@ -19,7 +31,47 @@ @RestController @RequiredArgsConstructor @RequestMapping("/mgt/goods-series") -@Api(value = "管理后台商品秒杀相关接口", tags = {"管理后台接口"}) +@Api(value = "管理后台商品系列相关接口", tags = {"管理后台接口"}) public class MgtGoodsSeriesController { + private final IGoodsSeriesService goodsSeriesService; + + /** + * 获取商品系列列表的分页数据 + * + * @param query 商品系列查询条件,用于筛选和排序等操作 + * @return 返回商品系列的分页数据,包含分页信息和商品系列列表 + */ + @ApiOperation(value = "获取商品系列列表的分页数据", notes = "获取商品系列列表的分页数据") + @PostMapping("/page") + public R<PageDTO<GoodsSeriesVO>> getGoodsSeriesPage( + @Validated @RequestBody GoodsSeriesQuery query) { + return R.ok(goodsSeriesService.getGoodsSeriesPage(query)); + } + + /** + * 新增/编辑商品系列。 该接口用于通过接收商品系列数据对象(GoodsSeriesDTO),来新增或编辑商品系列信息。 + * + * @param dto 商品系列数据传输对象,包含商品系列的详细信息,通过RequestBody接收。 需要进行合法性验证(@Validated)以确保数据的完整性和正确性。 + * @return R<Void> 返回一个结果对象,表示操作是否成功。如果操作成功,返回状态码200。 + */ + @ApiOperation(value = "新增/编辑 商品系列", notes = "新增/编辑 商品系列") + @PostMapping("/save") + public R<Void> saveGoodsSeries(@Validated @RequestBody GoodsSeriesDTO dto) { + goodsSeriesService.saveGoodsSeries(dto); + return R.ok(); + } + + /** + * 删除商品香型 + * + * @param id 商品香型的ID,用于指定要删除的具体商品香型 + * @return 返回操作结果,如果删除成功,则返回一个成功响应码 + */ + @ApiOperation(value = "删除商品香型", notes = "删除商品香型") + @DeleteMapping("/{id}") + public R<Void> deleteGoodsSeries(@PathVariable("id") Long id) { + goodsSeriesService.removeById(id); + return R.ok(); + } } -- Gitblit v1.7.1