import http from '@/api'
import { type Dict } from '@/api/system/dictionary/interface'

//获取字典类型
export const getDictTreeList = (params: Dict.ResDictTree) => {
    const name = params.name || '';
    return http.get(`/dictTree/getTree?keyword=${name}`, params)
}

//添加字典类型
export const addDictTree = (params: Dict.ResDictTree) => {
    return http.post(`/dictTree/add`, params)
}

//编辑字典类型
export const updateDictTree = (params: Dict.ResDictTree) => {
    return http.post(`/dictTree/update`, params)
}

//删除字典类型
export const deleteDictTree = (params: Dict.ResDictTree) => {
    return http.post(`/dictTree/delete?id=${params.id}`)
}

