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

export default {
  paging(data: DictTypes.SearchForm & G.PageParam) {
    return get<G.PageResult<DictTypes.SysDict>>('/sys_dict/paging', data)
  },
  list() {
    return get<DictTypes.SysDict[]>('/sys_dict/list')
  },
  detail(id: string) {
    return get<DictTypes.SysDict>('/sys_dict/detail', {id})
  },
  add(data: DictTypes.SysDict) {
    return post('/sys_dict/add', data)
  },
  modify(data: DictTypes.SysDict) {
    return post('/sys_dict/modify', data)
  },
  del(ids: string[]) {
    return post('/sys_dict/del', ids)
  },
  obtainDictData(dictKey: string) {
    return get<DictTypes.SysDictItem[]>('/sys_dict/dict_data', {dictKey})
  },
}
