| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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; |
| | |
| | | return R.ok(auctionGoodsService.getAuctionGoodsPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 查看详情 |
| | | * |
| | | * @param id 拍卖商品id |
| | | * @return AuctionGoodsVO |
| | | */ |
| | | @ApiOperation(value = "查看详情", notes = "查看详情") |
| | | @GetMapping("/{id}") |
| | | public R<AuctionGoodsVO> getAuctionGoods(@PathVariable("id") Long id) { |
| | | return R.ok(auctionGoodsService.getAuctionGoodsById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 添加/编辑 拍卖商品 |
| | | * |
| | | * @param dto 拍卖商品数据传输对象 |
| | | */ |
| | | @ApiOperation(value = "添加/编辑 拍卖商品", notes = "添加/编辑 拍卖商品") |
| | | @PostMapping("/save") |
| | | public R<?> saveAuctionGoods(@Validated @RequestBody AuctionGoodsDTO dto) { |
| | | auctionGoodsService.saveAuctionGoods(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("立即结束") |
| | | @PutMapping("/stop/{id}") |
| | | public R<?> stopAuctionGoods(@PathVariable("id") Long id) { |
| | | auctionGoodsService.stopAuctionGoods(id); |
| | | return R.ok(); |
| | | } |
| | | } |