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

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

// --------------------------------------------------------------------------
// 监测发布内容管理服务
// --------------------------------------------------------------------------

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

/** 添加发布内容 POST /api/exam-data-publish/add */
export async function add(data: API.AddExamDataPublishInput, options?: { [key: string]: any }) {
    const url = '/api/exam-data-publish/add';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 更新发布内容 POST /api/exam-data-publish/update */
export async function update(
    data: API.UpdateExamDataPublishInput,
    options?: { [key: string]: any },
) {
    const url = '/api/exam-data-publish/update';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 删除发布内容 POST /api/exam-data-publish/del */
export async function del(data: API.BaseId, options?: { [key: string]: any }) {
    const url = '/api/exam-data-publish/del';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

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

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

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

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

export default {
    /** 添加发布内容 POST /api/exam-data-publish/add */
    add,
    /** 更新发布内容 POST /api/exam-data-publish/update */
    update,
    /** 删除发布内容 POST /api/exam-data-publish/del */
    del,
    /** 发布 POST /api/exam-data-publish/publish */
    publish,
    /** 取消 POST /api/exam-data-publish/unpublish */
    unpublish,
    /** 根据ID获取监测数据发布内容 GET /api/exam-data-publish/get-by-id */
    getById,
    /** 根据监测计划ID获取数据发布内容列表 GET /api/exam-data-publish/get-list-by-exam-plan-id */
    getListByExamPlanId,
};
