package com.zksy.web.controller.report;

import com.zksy.common.core.domain.AjaxResult;
import com.zksy.report.service.CreditReportService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/report")
public class CreditReportController {

    @Autowired
    private CreditReportService creditReportService;

    @GetMapping("/queryByUniCode")
    @ApiOperation(value = "查询企业信用报告", notes = "查询企业信用报告")
    public AjaxResult queryByUniCode(String uniCode) {
        return creditReportService.queryByUniCode(uniCode);
    }

    @PostMapping("/downloadReport")
    @ApiOperation(value = "下载企业信用报告", notes = "下载企业信用报告")
    public void downloadReport(@RequestParam String uniCode, HttpServletResponse response) {
        creditReportService.downloadReport(uniCode, response);
    }
}
