import request from '/@/utils/request'

/** 查询参数列表 */
export function getList(params?: any) {
  return request({
    url: '/system/config/list',
    method: 'get',
    params,
  })
}

/** 新增参数 */
export const doAdd = (data: any) => {
  return request({
    url: '/system/config',
    method: 'post',
    data,
  })
}

/** 修改岗位 */
export const doEdit = (data: any) => {
  return request({
    url: '/system/config',
    method: 'put',
    data,
  })
}

/** 删除参数 */
export const doDelete = (configId: any) => {
  return request({
    url: `/system/config/${configId}`,
    method: 'delete',
  })
}

/** 查询参数详细 */
export function getConfig(configId: any) {
  return request({
    url: `/system/config/${configId}`,
    method: 'get',
  })
}

// 刷新参数缓存
export function refreshCache() {
  return request({
    url: '/system/config/refreshCache',
    method: 'delete',
  })
}
