| | |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsGroupPurchaseDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsGroupPurchaseQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsGroupPurchaseVO; |
| | | import com.ruoyi.goods.service.IGoodsGroupPurchaseService; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | 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.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.RestController; |
| | | |
| | |
| | | @Api(value = "管理后台商品团购相关接口", tags = {"管理后台接口"}) |
| | | public class MgtGoodsGroupPurchaseController { |
| | | |
| | | private final IGoodsGroupPurchaseService goodsGroupPurchaseService; |
| | | |
| | | /** |
| | | * 获取团购商品列表的分页数据 |
| | | * |
| | | * @param query 团购商品查询对象 |
| | | * @return PageDTO < GoodsGroupPurchaseVO> |
| | | */ |
| | | @ApiOperation(value = "获取团购商品列表的分页数据", notes = "获取团购商品列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<GoodsGroupPurchaseVO>> getGoodsGroupPurchasePage( |
| | | GoodsGroupPurchaseQuery query) { |
| | | return R.ok(goodsGroupPurchaseService.getGoodsGroupPurchasePage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加/编辑 团购商品 |
| | | * |
| | | * @param dto 团购商品数据传输对象 |
| | | */ |
| | | @ApiOperation(value = "添加/编辑 团购商品", notes = "添加/编辑 团购商品") |
| | | @PostMapping("/save") |
| | | public R<Void> saveGoodsGroupPurchase(GoodsGroupPurchaseDTO dto) { |
| | | goodsGroupPurchaseService.saveGoodsGroupPurchase(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 团购商品id |
| | | * @return GoodsGroupPurchaseVO |
| | | */ |
| | | @ApiOperation(value = " 查看详情", notes = "查看详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<GoodsGroupPurchaseVO> getGoodsGroupPurchaseDetail(@PathVariable("id") Long id) { |
| | | return R.ok(goodsGroupPurchaseService.getGoodsGroupPurchaseDetail(id)); |
| | | } |
| | | |
| | | /** |
| | | * 下架/上架 团购商品 |
| | | * |
| | | * @param dto 商品上下架状态对象 |
| | | */ |
| | | @ApiOperation(value = "下架/上架 团购商品", notes = "下架 /上架 团购商品") |
| | | @PutMapping("/upd-status") |
| | | public R<Void> updStatus(@Validated @RequestBody ListStatusDTO dto) { |
| | | goodsGroupPurchaseService.updStatus(dto); |
| | | return R.ok(); |
| | | } |
| | | } |