import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url'

// 菜单新增
export function addMenu(data) {
  return request({
    url: getUrl('/sysMenu/create'),
    method: 'post',
    data
  })
}

//菜单编辑
export function updateMenu(data) {
  return request({
    url: getUrl('/sysMenu/update'),
    method: 'post',
    data
  })
}
// 菜单删除
export function deleteMenu(data) {
  return request({
    url: getUrl('/sysMenu/delete'),
    method: 'post',
    data
  })
}
// 查询菜单详情
export function queryMenuDetail(params) {
  return request({
    url: getUrl('/sysMenu/query'),
    method: 'get',
    params: params
  })
}
// 菜单分页查询
export function getMenuPage(data) {
  return request({
    url: getUrl('/sysMenu/pageEx'),
    method: 'post',
    data
  })
}
// 菜单列表查询
export function getMenuList(data) {
  return request({
    url: getUrl('/sysMenu/list'),
    method: 'post',
    data
  })
}
// 菜单树型结构
export function getMenuTree(data) {
  return request({
    url: getUrl('/sysMenuEx/getTreeMenu'),
    method: 'post',
    data
  })
}
