package cn.hobbystocks.auc.web; import cn.hobbystocks.auc.common.core.controller.BaseController; import cn.hobbystocks.auc.common.core.domain.AjaxResult; import cn.hobbystocks.auc.domain.Auction; import cn.hobbystocks.auc.domain.Lot; import cn.hobbystocks.auc.service.IAuctionService; import cn.hobbystocks.auc.service.ILotService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * 首页拍卖会banner查询 */ @RestController @RequestMapping("/auction") @Api(tags = "移动端拍卖会") public class AuctionController extends BaseController { @Autowired private IAuctionService auctionService; @Autowired private ILotService lotService; @PostMapping("/banner/list") @ApiOperation("首页banner列表查询") public AjaxResult bannerList(){ //查询已发布的拍卖会banner、状态,开始时间 List list = auctionService.selectBannerList(); return AjaxResult.success(list); } /** * 根据拍卖会id查询详情 * @param auction * @return */ @PostMapping("/details") @ApiOperation(value = "拍卖会详情查询",notes = "根据拍卖会id,查询拍品列表") public AjaxResult details(@RequestBody Auction auction){ Auction dbAuction = auctionService.selectAuctionById(auction.getId()); startPage(auction); List lots = lotService.selectLotListByAucId(auction.getId()); return AjaxResult.success().put("auction",dbAuction).put("lotList",lots); } }