import { defAxios as request } from '@/utils/http'
/**
 * 获取菜单管理数据接口
 * @returns 菜单数据
 */
export function getMenuList(params) {
  return request({
    url: '/menu/index',
    method: 'GET',
    params
  })
}

/**
 * 获取菜单全部数据接口
 * @returns 菜单全部数据
 */
export function getMenu(params) {
  return request({
    url: '/menu/getMenuAll',
    method: 'GET',
    params
  })
}

/**
 * 添加菜单
 * params
 */
export function addMenu(data) {
  return request({
    url: '/menu/add',
    method: 'POST',
    data
  })
}

/**
 * 编辑菜单
 * params
 */
export function editMenu(data) {
  return request({
    url: '/menu/edit',
    method: 'PUT',
    data
  })
}

/**
 * 删除菜单
 * params
 */
export function deleteMenu(id) {
  return request({
    url: `/menu/delete/${id}`,
    method: 'DELETE'
  })
}
