import http from '@/api'
import { type Dict } from '@/api/system/dictionary/interface'
import {c} from "vite/dist/node/types.d-aGj9QkWt";

//获取字典类型
export const getDictTreeByCode = (params: Dict.ResDictTree) => {
    const code = params.code || '';
    return http.get(`/dictTree/getTreeByCode?code=${code}`)
}

export const getDictTreeByName = (params: Dict.ResDictTree) => {
    const name = params.name || '';
    return http.get(`/dictTree/getTreeByName?name=${name}`)
}

//添加字典类型
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}`)
}

