package com.ruoyi.auction.controller.forepart;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.ruoyi.auction.controller.forepart.VO.AuctionSalesroomVO;
|
import com.ruoyi.auction.domain.pojo.AuctionSalesroom;
|
import com.ruoyi.auction.domain.pojo.AuctionVideo;
|
import com.ruoyi.auction.service.IAuctionSalesroomService;
|
import com.ruoyi.auction.service.IAuctionVideoService;
|
import com.ruoyi.common.core.domain.R;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.annotation.Resource;
|
import java.util.List;
|
|
/**
|
* <p>
|
* 拍卖场表 前端控制器
|
* </p>
|
*
|
* @author mitao
|
* @since 2024-05-16
|
*/
|
@RestController
|
@RequestMapping("/forepart/auction-salesroom")
|
public class ForepartAuctionSalesroomController {
|
|
|
@Resource
|
private IAuctionSalesroomService iAuctionSalesroomService;
|
|
@Resource
|
private IAuctionVideoService iAuctionVideoService;
|
|
/**
|
* 拍卖大屏获取拍卖信息
|
*
|
*/
|
@RequestMapping("getAuctionBidRecordList")
|
@ResponseBody
|
@ApiOperation(value = "拍卖大屏获取拍卖信息")
|
public R<List<AuctionSalesroom>> getAuctionBidRecordList(@PathVariable("salesroomName") String salesroomName) {
|
LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery();
|
wrapper.eq(AuctionSalesroom::getSalesroomName,salesroomName);
|
wrapper.eq(AuctionSalesroom::getDelFlag,0);
|
List<AuctionSalesroom> auctionBidRecordList=iAuctionSalesroomService.list(wrapper);
|
return R.ok(auctionBidRecordList);
|
|
}
|
|
/**
|
* 暖场视频or封面海报
|
*
|
*/
|
@RequestMapping("/getBaaner")
|
@ResponseBody
|
@ApiOperation(value = " 暖场视频or封面海报")
|
public R<AuctionSalesroomVO> getBaaner(@PathVariable("salesroomId") Integer SalesroomId) {
|
|
LambdaQueryWrapper<AuctionVideo> wrapper=Wrappers.lambdaQuery();
|
wrapper.eq(AuctionVideo::getAuctionSalesroomId,SalesroomId);
|
wrapper.eq(AuctionVideo::getDelFlag,0);
|
AuctionVideo auctionVideo=iAuctionVideoService.getOne(wrapper);
|
AuctionSalesroomVO auctionSalesroomVO=new AuctionSalesroomVO();
|
AuctionSalesroom auctionSalesroom=iAuctionSalesroomService.getById(SalesroomId);
|
auctionSalesroomVO.setAuctionSalesroomStatus(auctionSalesroom.getStatus().getCode());
|
if (auctionVideo!=null){
|
auctionSalesroomVO.setUrl(auctionVideo.getPromotionVideoUrl());
|
}else{
|
auctionSalesroomVO.setUrl(auctionSalesroom.getCoverPic());
|
}
|
|
return R.ok(auctionSalesroomVO);
|
}
|
|
|
@RequestMapping("/getAuctionBidRecordOne")
|
@ResponseBody
|
@ApiOperation(value = "扫码二维码获取拍卖场信息")
|
public R<AuctionSalesroom> getAuctionBidRecordOne(@PathVariable("auctionSalesroomQrcode") String auctionSalesroomQrcode) {
|
LambdaQueryWrapper<AuctionSalesroom> wrapper=Wrappers.lambdaQuery();
|
wrapper.eq(AuctionSalesroom::getAuctionSalesroomQrcode,auctionSalesroomQrcode);
|
wrapper.eq(AuctionSalesroom::getDelFlag,0);
|
AuctionSalesroom auctionBidRecord=iAuctionSalesroomService.getOne(wrapper);
|
return R.ok(auctionBidRecord);
|
|
}
|
|
|
}
|