package com.org.hktshop.controller.portal.enquiry;

import com.org.hktshop.Interface.enquiry.IHktEnquiryDetailSerevice;
import com.org.hktshop.base.BaseResult;
import com.org.hktshop.controller.BaseController;
import com.org.hktshop.entity.Page;
import com.org.hktshop.entity.enquiry.HktEnquiryDetail;
import com.org.hktshop.utils.HttpCode;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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;

/**
 * 询价详情
 * @author hotking03
 */
@RestController
@RequestMapping("/enquiryDetail")
public class HktEnquiryDetailController extends BaseController {

    @Autowired
    private IHktEnquiryDetailSerevice hktEnquiryDetailSerevice;

    @ApiOperation(value = "详情列表", notes = "详情列表", httpMethod = "POST")
    @RequestMapping("/selectEnquiryDetail")
    public Object selectEnquiryDetail(@RequestBody HktEnquiryDetail hktEnquiryDetail){
        try {
            List<HktEnquiryDetail> page = hktEnquiryDetailSerevice.selectEnquiryDetail(hktEnquiryDetail);
            return BaseResult.successWithData(page);
        } catch (Exception e) {
            logger.info("详情列表错误  error={}",e.toString());
            return BaseResult.fail(HttpCode.INTERNAL_SERVER_ERROR.getCode());
        }
    }
}
