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

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

// --------------------------------------------------------------------------
// 角色菜单
// --------------------------------------------------------------------------

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

/** 获取角色的菜单Id集合 GET /api/sys/role/menu/get-role-menu-id-list */
export async function getRoleMenuIdList(
    params: {
        /**  */
        roleid?: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/role/menu/get-role-menu-id-list';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<number[]>>(url, config);
    return res?.data;
}

/** 获取角色对象菜单列表 GET /api/sys/role/menu/get-role-menu-list */
export async function getRoleMenuList(
    params: {
        /**  */
        roleid?: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/role/menu/get-role-menu-list';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.SysRoleMenuOutput[]>>(url, config);
    return res?.data;
}

/** 授权角色菜单 POST /api/sys/role/menu/grant-role-menu */
export async function grantRoleMenu(
    data: API.GrantSysRoleMenuInput,
    options?: { [key: string]: any },
) {
    const url = '/api/sys/role/menu/grant-role-menu';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

export default {
    /** 获取角色的菜单Id集合 GET /api/sys/role/menu/get-role-menu-id-list */
    getRoleMenuIdList,
    /** 获取角色对象菜单列表 GET /api/sys/role/menu/get-role-menu-list */
    getRoleMenuList,
    /** 授权角色菜单 POST /api/sys/role/menu/grant-role-menu */
    grantRoleMenu,
};
