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

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

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

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

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

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

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