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

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

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

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

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

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

export function refreshCacheApi(): Promise<void> {
  return request.post('/sysDictType/refreshCache')
}
