import request from '@/utils/request'
import { DictType } from '@/utils/dict'
import { PageType, StrAnyObj } from '@/typings'

// 根据字典标识查询字典数据信息
export function getListByCodeApi(params: StrAnyObj): Promise<DictType[]> {
  return request.get('/sysDictData/getListByCode', params)
}

export function getPageApi(params: StrAnyObj): Promise<PageType<StrAnyObj>> {
  return request.get('/sysDictData/getPage', params)
}

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

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

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

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