import request from '@/utils/request'

export function getRoutes() {
  return request({
    url: '/rbac/menu/',
    method: 'get'
  })
}

export function getRoles() {
  return request({
    url: '/rbac/role/',
    method: 'get'
  })
}

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

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

export function deleteRole(id) {
  return request({
    url: `/rbac/role/${id}/`,
    method: 'delete'
  })
}
