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

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

// --------------------------------------------------------------------------
// 学期信息管理服务
// --------------------------------------------------------------------------

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

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

/** 设置当前学期 POST /api/base/semester/set-current */
export async function setCurrent(data: API.BaseId_Int16, options?: { [key: string]: any }) {
    const url = '/api/base/semester/set-current';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 根据ID获取单个学期 GET /api/base/semester/get-by-id */
export async function getById(
    params: {
        /**  */
        id: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/base/semester/get-by-id';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.SemesterOutput>>(url, config);
    return res?.data;
}

/** 获取当前学期 GET /api/base/semester/get-current */
export async function getCurrent(options?: { [key: string]: any }) {
    const url = '/api/base/semester/get-current';
    const config = { method: 'GET', ...(options || {}) };
    const res = await request<API.ResponseType<API.SemesterOutput>>(url, config);
    return res?.data;
}

/** 获取全部学期信息列表 GET /api/base/semester/get-all-list */
export async function getAllList(options?: { [key: string]: any }) {
    const url = '/api/base/semester/get-all-list';
    const config = { method: 'GET', ...(options || {}) };
    const res = await request<API.ResponseType<API.SemesterOutput[]>>(url, config);
    return res?.data;
}

export default {
    /** 添加学期 POST /api/base/semester/add */
    add,
    /** 设置当前学期 POST /api/base/semester/set-current */
    setCurrent,
    /** 根据ID获取单个学期 GET /api/base/semester/get-by-id */
    getById,
    /** 获取当前学期 GET /api/base/semester/get-current */
    getCurrent,
    /** 获取全部学期信息列表 GET /api/base/semester/get-all-list */
    getAllList,
};
