// @ts-ignore
/* eslint-disable */
import {request} from 'umi';

export async function reportList(params: API.ReportListParam) {
  return request<API.Response<API.Page<API.Report>>>('/api/v1/report/list', {
    method: 'POST',
    data: params,
  });
}

export async function createReport(institutionId: number, paperId: number) {
  return request<API.Response<any>>('/api/v1/report/create', {
    method: 'POST',
    data: {institutionId, paperId}
  });
}

export async function deleteReport(reportId: number) {
  return request<API.Response<any>>('/api/v1/report/delete', {
    method: 'POST',
    data: {reportId,}
  });
}

export async function updateReport(params: API.UpdateReportParam) {
  return request<API.Response<any>>('/api/v1/report/update', {
    method: 'POST',
    data: params,
    requestType: 'json'
  });
}

export async function download(reportId: number) {
  return request<API.Response<API.PaperResult>>('/api/v1/report/download', {
    method: 'POST',
    data: {reportId},
    responseType: 'blob',
    skipErrorHandler: true
  },);
}


