From ac609951fb6d24339a69b3bb142d41f260b83262 Mon Sep 17 00:00:00 2001 From: luofl <1442745593@qq.com> Date: 星期三, 12 二月 2025 09:52:17 +0800 Subject: [PATCH] 1 --- ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/inner/AuctionGoodsController.java | 65 ++++++++++++++++++++++++++++++-- 1 files changed, 60 insertions(+), 5 deletions(-) diff --git a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/inner/AuctionGoodsController.java b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/inner/AuctionGoodsController.java index 53ff0e0..409c8f6 100644 --- a/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/inner/AuctionGoodsController.java +++ b/ruoyi-modules/ruoyi-auction/src/main/java/com/ruoyi/auction/controller/inner/AuctionGoodsController.java @@ -1,14 +1,25 @@ package com.ruoyi.auction.controller.inner; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.fasterxml.jackson.core.JsonProcessingException; import com.ruoyi.auction.service.IAuctionGoodsService; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.security.annotation.InnerAuth; import com.ruoyi.system.api.domain.AuctionGoods; +import com.ruoyi.system.api.domain.GoodsSku; +import com.ruoyi.system.api.domain.dto.MemberAuctionSalesroomBondDTO; +import java.util.List; +import java.util.Set; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; +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; /** * <p> @@ -28,13 +39,13 @@ @InnerAuth @PostMapping("/getAuctionGoodsOne") - public R<AuctionGoods> getAuctionGoodsOne(@RequestBody Long auctionSalesroomId) { - AuctionGoods auctionGoods=auctionGoodsService.getById(auctionSalesroomId); + public R<AuctionGoods> getAuctionGoodsOne(@RequestBody MemberAuctionSalesroomBondDTO memberAuctionSalesroomBondDTO) { + AuctionGoods auctionGoods=auctionGoodsService.getById(memberAuctionSalesroomBondDTO.getAuctionGoodsId()); return R.ok(auctionGoods); } - @PutMapping("/auction-goods/end/{id}") + @PutMapping("/end/{id}") R<?> endAuctionGoods(@PathVariable("id") Long id) { try { auctionGoodsService.endAuctionGoods(id); @@ -45,7 +56,7 @@ return R.ok(); } - @PutMapping("/auction-goods/start/{id}") + @PutMapping("/start/{id}") R<?> startAuctionGoods(@PathVariable("id") Long id) { try { auctionGoodsService.startAuctionGoods(id); @@ -56,4 +67,48 @@ return R.ok(); } + /** + * 根据商品id获取正在进行的拍卖商品 + * + * @param id 商品id + * @return + */ + @InnerAuth + @GetMapping("/getAuctionGoodsBySkuId/{id}") + R<List<AuctionGoods>> getAuctionGoodsBySkuId(@PathVariable("id") Long id) { + return R.ok(auctionGoodsService.getAuctionGoodsBySkuId(id)); + } + + /** + * 根据id获取拍卖商品 + * + * @param goodsSkuId + * @return + */ + @InnerAuth + @GetMapping("/getAuctionGoodsId/{goodsSkuId}") + R<AuctionGoods> getAuctionGoodsId(@PathVariable("goodsSkuId") Long goodsSkuId) { + return R.ok(auctionGoodsService.getById(goodsSkuId)); + } + + /** + * 根据拍卖商品id获取商品sku信息 + * + * @param auctionGoodsIdSet + * @return + */ + @PostMapping("/getGoodsSkuByAuctionGoodsIdSet") + R<List<GoodsSku>> getGoodsSkuByAuctionGoodsIdSet(@RequestBody Set<Long> auctionGoodsIdSet) { + return R.ok(auctionGoodsService.getGoodsSkuByAuctionGoodsIdSet(auctionGoodsIdSet)); + } + + /** + * 根据商品id获取拍卖商品 + */ + @InnerAuth + @GetMapping("/getAuctionBySkuId/{goodsSkuId}") + R<AuctionGoods> getAuctionBySkuId(@PathVariable("goodsSkuId") Long goodsSkuId) { + return R.ok(auctionGoodsService.getOne(new LambdaQueryWrapper<AuctionGoods>() + .eq(AuctionGoods::getGoodsSkuId, goodsSkuId))); + } } -- Gitblit v1.7.1