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

export function getCodeListApi(): Promise<string[]> {
  return request.get('/sysPermission/getCodeList')
}

export function getListApi(params: StrAnyObj): Promise<StrAnyObjArr> {
  return request.get('/sysPermission/getList', params)
}

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

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

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