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

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

// --------------------------------------------------------------------------
// 菜单
// --------------------------------------------------------------------------

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

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

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

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

/** 获取菜单列表 GET /api/sys/menu/get-all-list */
export async function getAllList(options?: { [key: string]: any }) {
    const url = '/api/sys/menu/get-all-list';
    const config = { method: 'GET', ...(options || {}) };
    const res = await request<API.ResponseType<API.SysMenuOutput[]>>(url, config);
    return res?.data;
}

/** 获取所有菜单（树形） GET /api/sys/menu/get-all-tree-list */
export async function getAllTreeList(options?: { [key: string]: any }) {
    const url = '/api/sys/menu/get-all-tree-list';
    const config = { method: 'GET', ...(options || {}) };
    const res = await request<API.ResponseType<API.SysMenuOutput[]>>(url, config);
    return res?.data;
}

export default {
    /** 添加菜单 POST /api/sys/menu/add */
    add,
    /** 更新菜单 POST /api/sys/menu/update */
    update,
    /** 删除菜单 POST /api/sys/menu/del */
    del,
    /** 获取菜单列表 GET /api/sys/menu/get-all-list */
    getAllList,
    /** 获取所有菜单（树形） GET /api/sys/menu/get-all-tree-list */
    getAllTreeList,
};
