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

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

// --------------------------------------------------------------------------
// 角色
// --------------------------------------------------------------------------

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

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

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

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

/** 获取所有角色 GET /api/sys/role/get-all-list */
export async function getAllList(options?: { [key: string]: any }) {
    const url = '/api/sys/role/get-all-list';
    const config = { method: 'GET', ...(options || {}) };
    const res = await request<API.ResponseType<API.SysRoleOutput[]>>(url, config);
    return res?.data;
}

export default {
    /** 添加角色 POST /api/sys/role/add */
    add,
    /** 删除角色 POST /api/sys/role/del */
    del,
    /** 更新角色 POST /api/sys/role/update */
    update,
    /** 获取所有角色 GET /api/sys/role/get-all-list */
    getAllList,
};
