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

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

// --------------------------------------------------------------------------
// 试卷大题管理服务
// --------------------------------------------------------------------------

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

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

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

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

/** 根据试卷ID获取大题列表 GET /api/exam/paper/question/major/get-list-by-exam-paper-id */
export async function getListByExamPaperId(
    params: {
        /**  */
        exampaperid?: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/paper/question/major/get-list-by-exam-paper-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.ExamPaperQuestionMajorOutput[]>>(url, config);
    return res?.data;
}

export default {
    /** 添加 POST /api/exam/paper/question/major/add */
    add,
    /** 更新 POST /api/exam/paper/question/major/update */
    update,
    /** 删除 POST /api/exam/paper/question/major/del */
    del,
    /** 根据试卷ID获取大题列表 GET /api/exam/paper/question/major/get-list-by-exam-paper-id */
    getListByExamPaperId,
};
