import http from '@/utils/http'

export function getAllMenu() {
  return http.get('/sys-perm/menu-tree')
}

export function addMenu(menuData) {
  return http.post(`/sys-perm/add`, menuData)
}

export function getPermInfo(permId) {
  return http.get(`/sys-perm/info/${permId}`)
}

export function moveMenuSort(type, permId) {
  return http.put(`/sys-perm/move/${type}/${permId}`)
}

export function getMenuChildrenPerm({ permId }) {
  return http.get(`/sys-perm/menu-perm/${permId}`)
}

export function editMenu(editData) {
  return http.put(`/sys-perm/edit`, editData)
}

export function deleteMenu({ permId }) {
  return http.delete(`/sys-perm/${permId}`)
}
export function deleteMore(permIds) {
  return http.put(`/sys-perm/delete-more`, permIds)
}

export function getAllNotDefaultPermTree() {
  return http.get('/sys-perm/all/not-default')
}
