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

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

// --------------------------------------------------------------------------
// 年级信息服务
// --------------------------------------------------------------------------

import { request } from '@umijs/max';
import { EducationStage } from '../enums';

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

/** 根据学段获取年级列表 GET /api/base/grade/get-list-by-education-stage */
export async function getListByEducationStage(
    params: {
        /**  */
        stage: EducationStage;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/base/grade/get-list-by-education-stage';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.GradeOutput[]>>(url, config);
    return res?.data;
}

/** 根据学期和学段获取年级年份 POST /api/base/grade/query-grade-year-list */
export async function queryGradeYearList(
    data: API.QueryGradeYearInput,
    options?: { [key: string]: any },
) {
    const url = '/api/base/grade/query-grade-year-list';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.GradeYearOutput[]>>(url, config);
    return res?.data;
}

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

export default {
    /** 根据ID获取年级信息 GET /api/base/grade/get-by-id */
    getById,
    /** 根据学段获取年级列表 GET /api/base/grade/get-list-by-education-stage */
    getListByEducationStage,
    /** 根据学期和学段获取年级年份 POST /api/base/grade/query-grade-year-list */
    queryGradeYearList,
    /** 获取全部年级列表 GET /api/base/grade/get-all-list */
    getAllList,
};
