import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/vue-element-admin/routes',
    method: 'get'
  })
}

export function getAllRoles() {
  return request({
    url: '/ultimate/roles',
    method: 'get'
  })
}

export function addRole(data) {
  return request({
    url: '/ultimate/roles',
    method: 'post',
    data
  })
}

export function updateRole(data) {
  return request({
    url: `/ultimate/roles/${data.id}`,
    method: 'put',
    data
  })
}

export function deleteRole(data) {
  return request({
    url: `/ultimate/roles/${data.id}`,
    method: 'delete'
  })
}
