import request from '@/libs/request'

export function getRolePagedList(query) {
    return request({
        url: '/role/pagedlist',
        method: 'get',
        params: query
    })
}

export function getRoleWithUserPagedList(query) {
    return request({
        url: '/roleuser/pagedlist',
        method: 'get',
        params: query
    })
}

export function delRole(id) {
    return request({
        url: '/role/del',
        method: 'delete',
        params: id,
        loading:"hourglass"
    })
}

export function delRoles(ids) {
    return request({
        url: '/role/batchdel/'+ids,
        method: 'delete',
        loading:"hourglass"
    })
}

export function saveRole(data) {
    return request({
        url: '/role/save',
        method: 'post',
        data: data,
        loading:"hourglass"
    })
}

export function savePermission(data){
    return request({
        url: '/role/savepermission',
        method: 'post',
        data: data,
        loading:"hourglass"
    })
}

export function platformapplicationslistall(){
    return request({
        url: '/PlatformApplicationsController/platformapplications/listall',
        method: 'get',
        data: '',
        loading:"hourglass"
    })
}

export function listbyrole(id){
    return request({
        url: '/PlatformApplicationsController/platformapplications/listbyrole/'+id,
        method: 'get',
        data: '',
        loading:"hourglass"
    })
}

export function platformapplicationslistallApp(){
    return request({
        url: '/PlatformRoleApplicationAppController/platformapplications/listallApp',
        method: 'get',
        data: '',
        loading:"hourglass"
    })
}

export function listbyroleApp(id){
    return request({
        url: '/PlatformRoleApplicationAppController/platformapplications/listbyroleApp/'+id,
        method: 'get',
        data: '',
        loading:"hourglass"
    })
}
