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

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

// --------------------------------------------------------------------------
// 监测数据上报类型管理服务
// --------------------------------------------------------------------------

import { request } from '@umijs/max';

/** 添加上报类型 POST /api/exam/data/report/add */
export async function add(data: API.AddExamDataReportInput, options?: { [key: string]: any }) {
    const url = '/api/exam/data/report/add';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 更新上报类型 POST /api/exam/data/report/update */
export async function update(
    data: API.UpdateExamDataReportInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/data/report/update';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 删除上报类型 POST /api/exam/data/report/del */
export async function del(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/data/report/del';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 上传附件 POST /api/exam/data/report/upload-attachment */
export async function uploadAttachment(data: FormData, options?: { [key: string]: any }) {
    const url = '/api/exam/data/report/upload-attachment';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 删除附件 POST /api/exam/data/report/del-attachment */
export async function delAttachment(
    data: API.DeleteAttachmentInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam/data/report/del-attachment';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 开始 POST /api/exam/data/report/start */
export async function start(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/data/report/start';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 结束 POST /api/exam/data/report/stop */
export async function stop(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/data/report/stop';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 取消 POST /api/exam/data/report/cancel */
export async function cancel(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam/data/report/cancel';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 根据ID获取监测数据上报类型 GET /api/exam/data/report/get-by-id */
export async function getById(
    params: {
        /**  */
        id: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/data/report/get-by-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.ExamDataReportOutput>>(url, config);
    return res?.data;
}

/** 根据监测计划ID获取数据上报类型列表 GET /api/exam/data/report/get-list-by-exam-plan-id */
export async function getListByExamPlanId(
    params: {
        /**  */
        examplanid: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/data/report/get-list-by-exam-plan-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.ExamDataReportOutput[]>>(url, config);
    return res?.data;
}

export default {
    /** 添加上报类型 POST /api/exam/data/report/add */
    add,
    /** 更新上报类型 POST /api/exam/data/report/update */
    update,
    /** 删除上报类型 POST /api/exam/data/report/del */
    del,
    /** 上传附件 POST /api/exam/data/report/upload-attachment */
    uploadAttachment,
    /** 删除附件 POST /api/exam/data/report/del-attachment */
    delAttachment,
    /** 开始 POST /api/exam/data/report/start */
    start,
    /** 结束 POST /api/exam/data/report/stop */
    stop,
    /** 取消 POST /api/exam/data/report/cancel */
    cancel,
    /** 根据ID获取监测数据上报类型 GET /api/exam/data/report/get-by-id */
    getById,
    /** 根据监测计划ID获取数据上报类型列表 GET /api/exam/data/report/get-list-by-exam-plan-id */
    getListByExamPlanId,
};
