// @ts-ignore
/* eslint-disable */

// 该文件自动生成，请勿手动修改！

// --------------------------------------------------------------------------
// 监测特殊学生上报管理服务
// --------------------------------------------------------------------------

import { request, RequestOptions } from '@umijs/max';
import contentDisposition from 'content-disposition';

/** 上传批量导入文件 POST /api/exam/special/student/upload */
export async function upload(data: FormData, options?: { [key: string]: any }) {
    const url = '/api/exam/special/student/upload';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<
        API.ResponseType<API.UploadExamDataOutput_UploadExamSpecialStudentOutput>
    >(url, config);
    return res?.data;
}

/** 批量导入监测特殊学生 POST /api/exam/special/student/import */
export async function importAction(
    data: API.ImportExamSpecialStudentInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/special/student/import';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<number>>(url, config);
    return res?.data;
}

/** 添加监测特殊学生 POST /api/exam/special/student/add */
export async function add(data: API.AddExamSpecialStudentInput, options?: { [key: string]: any }) {
    const url = '/api/exam/special/student/add';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 更新监测特殊学生 POST /api/exam/special/student/update */
export async function update(
    data: API.UpdateExamSpecialStudentInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/special/student/update';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 上传特殊学生佐证材料 POST /api/exam/special/student/upload-attachment */
export async function uploadAttachment(data: FormData, options?: { [key: string]: any }) {
    const url = '/api/exam/special/student/upload-attachment';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 删除特殊学生佐证材料 POST /api/exam/special/student/del-attachment */
export async function delAttachment(
    data: API.DeleteAttachmentInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/special/student/del-attachment';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 删除监测特殊学生 POST /api/exam/special/student/del */
export async function del(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/special/student/del';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 清空监测特殊学生 POST /api/exam/special/student/clear */
export async function clear(
    data: API.ClearExamSpecialStudentInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/special/student/clear';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 导出监测特殊学生上报打印表格 POST /api/exam/special/student/export-print-table */
export async function exportPrintTable(
    params: {
        /**  */
        examplanid?: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/special/student/export-print-table';
    const config = {
        method: 'POST',
        params,
        ...(options || {}),
        responseType: 'blob',
        getResponse: true,
    } as RequestOptions;
    const res = await request(url, config);
    const hcd = res.request.getResponseHeader('Content-Disposition');
    if (!hcd) {
        return null;
    }
    let fileName = '';
    const cd = contentDisposition.parse(hcd);
    if (cd?.parameters?.filename) {
        fileName = cd?.parameters?.filename;
    }
    return { fileName, data: res.data as Blob } as API.FileResponse;
}

/** 分页查询监测特殊学生列表 POST /api/exam/special/student/query-page-list */
export async function queryPageList(
    data: API.ExamSpecialStudentPageInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/special/student/query-page-list';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.PageResponse<API.ExamSpecialStudentOutput>>>(
        url,
        config,
    );
    return res?.data;
}

/** 获取机构班级特殊学生上报人数统计列表 GET /api/exam/special/student/get-org-grade-class-student-count */
export async function getOrgGradeClassStudentCount(
    params: {
        /**  */
        examplanid?: number;
        /**  */
        sysorgid?: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/special/student/get-org-grade-class-student-count';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.ExamSpecialStudentCountOutput>>(url, config);
    return res?.data;
}

/** 获取状态数量 POST /api/exam/special/student/query-status-count */
export async function queryStatusCount(
    data: API.ExamSpecialStudentPageInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/special/student/query-status-count';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.StatusCount[]>>(url, config);
    return res?.data;
}

export default {
    /** 上传批量导入文件 POST /api/exam/special/student/upload */
    upload,
    /** 批量导入监测特殊学生 POST /api/exam/special/student/import */
    importAction,
    /** 添加监测特殊学生 POST /api/exam/special/student/add */
    add,
    /** 更新监测特殊学生 POST /api/exam/special/student/update */
    update,
    /** 上传特殊学生佐证材料 POST /api/exam/special/student/upload-attachment */
    uploadAttachment,
    /** 删除特殊学生佐证材料 POST /api/exam/special/student/del-attachment */
    delAttachment,
    /** 删除监测特殊学生 POST /api/exam/special/student/del */
    del,
    /** 清空监测特殊学生 POST /api/exam/special/student/clear */
    clear,
    /** 导出监测特殊学生上报打印表格 POST /api/exam/special/student/export-print-table */
    exportPrintTable,
    /** 分页查询监测特殊学生列表 POST /api/exam/special/student/query-page-list */
    queryPageList,
    /** 获取机构班级特殊学生上报人数统计列表 GET /api/exam/special/student/get-org-grade-class-student-count */
    getOrgGradeClassStudentCount,
    /** 获取状态数量 POST /api/exam/special/student/query-status-count */
    queryStatusCount,
};
