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

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

// --------------------------------------------------------------------------
// 角色用户
// --------------------------------------------------------------------------

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

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

/** 移出角色中的用户 POST /api/sys/role/user/remove-role-user */
export async function removeRoleUser(data: API.SysRoleUserInput, options?: { [key: string]: any }) {
    const url = '/api/sys/role/user/remove-role-user';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<any>>(url, config);
    return res?.data;
}

/** 获取指定角色中的用户列表 GET /api/sys/role/user/get-in-role-user-list */
export async function getInRoleUserList(
    params: {
        /**  */
        roleid: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/role/user/get-in-role-user-list';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.SysUserOutput[]>>(url, config);
    return res?.data;
}

/** 分页查询角色用户列表 POST /api/sys/role/user/query-in-role-user-page-list */
export async function queryInRoleUserPageList(
    data: API.SysRoleUserPageInput,
    options?: { [key: string]: any },
) {
    const url = '/api/sys/role/user/query-in-role-user-page-list';
    const config = { method: 'POST', data, ...(options || {}) };
    const res = await request<API.ResponseType<API.PageResponse<API.SysUserOutput>>>(url, config);
    return res?.data;
}

/** 获取未在指定角色中的用户列表 GET /api/sys/role/user/get-not-in-role-user-list */
export async function getNotInRoleUserList(
    params: {
        /**  */
        roleid: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/role/user/get-not-in-role-user-list';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.SysUserOutput[]>>(url, config);
    return res?.data;
}

/** 通过权限标识获取人员列表 GET /api/sys/role/user/get-user-list-by-permission */
export async function getUserListByPermission(
    params: {
        /** 权限标识 */
        permission: string;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/sys/role/user/get-user-list-by-permission';
    const config = { method: 'GET', params, ...(options || {}) };
    const res = await request<API.ResponseType<API.SysUserLiteOutput[]>>(url, config);
    return res?.data;
}

export default {
    /** 添加用户到角色 POST /api/sys/role/user/add-role-user */
    addRoleUser,
    /** 移出角色中的用户 POST /api/sys/role/user/remove-role-user */
    removeRoleUser,
    /** 获取指定角色中的用户列表 GET /api/sys/role/user/get-in-role-user-list */
    getInRoleUserList,
    /** 分页查询角色用户列表 POST /api/sys/role/user/query-in-role-user-page-list */
    queryInRoleUserPageList,
    /** 获取未在指定角色中的用户列表 GET /api/sys/role/user/get-not-in-role-user-list */
    getNotInRoleUserList,
    /** 通过权限标识获取人员列表 GET /api/sys/role/user/get-user-list-by-permission */
    getUserListByPermission,
};
