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

export function getListApi(params: StrAnyObj): Promise<StrAnyObjArr> {
  return request.get('/sysDept/getList', params)
}

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

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

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

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

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