| | |
| | | package com.ruoyi.auction.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.auction.controller.management.dto.AuctionGoodsDTO; |
| | | import com.ruoyi.auction.controller.management.dto.AuctionGoodsQuery; |
| | | import com.ruoyi.auction.controller.management.vo.AuctionGoodsVO; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionGoodsDTO; |
| | | import com.ruoyi.auction.controller.management.dto.MgtAuctionGoodsQuery; |
| | | import com.ruoyi.auction.controller.management.vo.MgtAuctionGoodsVO; |
| | | import com.ruoyi.auction.service.IAuctionGoodsService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.RequiredArgsConstructor; |
| | | 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; |
| | |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Api(value = "管理后台拍卖商品相关接口", tags = {"管理后台接口"}) |
| | | @Api(value = "拍卖商品管理相关接口", tags = {"管理后台-拍卖商品管理相关接口"}) |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/auction-goods") |
| | |
| | | */ |
| | | @ApiOperation(value = "获取拍卖商品列表的分页数据", notes = "获取拍卖商品列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<AuctionGoodsVO>> getAuctionGoodsPage( |
| | | AuctionGoodsQuery query) { |
| | | public R<PageDTO<MgtAuctionGoodsVO>> getAuctionGoodsPage( |
| | | @Validated @RequestBody MgtAuctionGoodsQuery query) { |
| | | return R.ok(auctionGoodsService.getAuctionGoodsPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 拍卖商品id |
| | | * @return AuctionGoodsVO |
| | | */ |
| | | @ApiOperation(value = "查看详情", notes = "查看详情") |
| | | @GetMapping("/{id}") |
| | | public R<MgtAuctionGoodsVO> getAuctionGoods( |
| | | @ApiParam(name = "id", value = "拍卖商品id", required = true) @PathVariable("id") Long id) { |
| | | return R.ok(auctionGoodsService.getAuctionGoodsById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 添加/编辑 拍卖商品 |
| | | * |
| | | * @param dto 拍卖商品数据传输对象 |
| | | */ |
| | | @ApiOperation(value = "添加/编辑 拍卖商品", notes = "添加/编辑 拍卖商品") |
| | | @PostMapping("/save") |
| | | public R<?> saveAuctionGoods(@Validated @RequestBody AuctionGoodsDTO dto) { |
| | | public R<?> saveAuctionGoods(@Validated @RequestBody MgtAuctionGoodsDTO dto) { |
| | | auctionGoodsService.saveAuctionGoods(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 立即结束 |
| | | * |
| | | * @param id 拍卖商品id |
| | | */ |
| | | @ApiOperation("立即结束") |
| | | @PutMapping("/stop/{id}") |
| | | public R<?> stopAuctionGoods( |
| | | @ApiParam(name = "id", value = "拍卖商品id", required = true) @PathVariable("id") Long id) { |
| | | auctionGoodsService.stopAuctionGoods(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 下架/上架 拍卖商品 |
| | | * |
| | | * @param dto 商品上下架状态对象 |
| | | */ |
| | | @ApiOperation(value = "下架/上架 拍卖商品", notes = "下架/上架 拍卖商品") |
| | | @PutMapping("/upd-status") |
| | | public R<?> updStatus(@Validated @RequestBody ListStatusDTO dto) { |
| | | auctionGoodsService.updStatus(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |