import createAxios from '@/utils/request'

export function add(data: any) {
    return createAxios({
        url: '/user-boot/role/add',
        method: 'post',
        data: data
    })
}

export function update(data: any) {
    return createAxios({
        url: '/user-boot/role/update',
        method: 'post',
        data: data
    })
}

export function del(data: any) {
    return createAxios({
        url: '/user-boot/role/delete',
        method: 'post',
        data: data
    })
}


export function roleList(id: number) {
    return createAxios({
        url: '/user-boot/role/selectRoleDetail?id=' + id,
        method: 'post'
    })
}

/**
 * 全部角色
 */
export function allRoleList(data:any) {
    return createAxios({
        url: '/user-boot/role/allRoleList',
        method: 'GET'
    })
}

// 根据id获取所有角色信息
export function getRoleListByIds(data:any) {
    return createAxios({
        url: '/user-boot/role/getRoleListByIds',
        method: 'POST',
        data
    })
}

/**
 * 查询所有角色
 */
export const getRoleSimpleList = () => {
    return createAxios({
        url:  '/user-boot/role/simpleList',
        method: 'GET'
    })
}


