import request from '@/utils/request'
import { StrAnyObj, StrAnyObjArr } from '@/typings'

export function getTreeApi(params: StrAnyObj): Promise<StrAnyObjArr> {
  return request.get('/sysMenu/getTree', params)
}

export function getDetailApi(params: StrAnyObj): Promise<StrAnyObj> {
  return request.get('/sysMenu/getDetail', params)
}

export function addApi(data: StrAnyObj): Promise<void> {
  return request.post('/sysMenu/add', data)
}

export function editApi(data: StrAnyObj): Promise<void> {
  return request.post('/sysMenu/edit', data)
}

export function deleteApi(data: StrAnyObj): Promise<void> {
  return request.post('/sysMenu/delete', data)
}
