import {
  get,
  post,
} from '@/common/utils/http-util.ts'

export default {
  paging(data: DictTypes.SearchDictParam) {
    return get<G.PageResult<DictTypes.SearchDictResult>>('/dict/paging', data)
  },
  detail(id: string) {
    return get<DictTypes.SearchDictResult>('/dict/detail', {id})
  },
  obtainDictData(data: DictItemTypes.SearchDictItemParam) {
    return get<DictItemTypes.SearchDictItemResult[]>('/dict/dict_data', data)
  },
  add(data: DictTypes.AddDictParam) {
    return post('/dict/add', data)
  },
  modify(data: DictTypes.ModifyDictParam) {
    return post('/dict/modify', data)
  },
  del(ids: string[]) {
    return post('/dict/del', ids)
  },
}
