package com.fzm.mall.server.front.order.controller;


import com.alibaba.fastjson.JSONObject;
import com.fzm.mall.server.front.base.PageVO;
import com.fzm.mall.server.front.base.ResponseVO;
import com.fzm.mall.server.front.constant.MallResponseEnum;
import com.fzm.mall.server.front.goods.model.qo.UserAuctionQO;
import com.fzm.mall.server.front.goods.model.vo.PageVo;
import com.fzm.mall.server.front.goods.model.vo.UserAuctionVO;
import com.fzm.mall.server.front.goods.service.IAuctionService;
import com.fzm.mall.server.front.order.model.BiddingRecord;
import com.fzm.mall.server.front.order.service.IBiddingRecordService;
import com.fzm.mall.server.front.user.model.Header;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @author tdz
 * @date 2021/09/02 11:26
 */
@Api(tags = "用户竞拍记录接口", description = "用户竞拍记录等")
@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping(value = "/mall/bidding/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class BiddingRecordController {
    private final IBiddingRecordService biddingRecordService;



    @ApiOperation(value = "根据拍卖ID查询用户出价记录")
    @PostMapping("/getBiddingRecordsByAuctionId")
    public ResponseVO<PageVO<BiddingRecord>> getBiddingRecordsByAuctionId(@RequestBody JSONObject obj, @RequestBody PageVo pageVo) {
        String auctionId = obj.getString("auctionId");
        PageVO<BiddingRecord> merchantCouponSettles = biddingRecordService.getBiddingRecordsByAuctionId(auctionId, pageVo);
        return new ResponseVO(MallResponseEnum.SUCCESS, merchantCouponSettles);
    }
}
