import http from '@/api'

/**
 * @name 查询操作日志记录列表
 * @param query 参数
 * @returns 返回列表
 */
export const listOperlogApi = (query: any) => {
  return http.get<any>('/monitor/operlog/list', query, { loading: true })
}

/**
 * @name 查询操作日志记录详细
 * @param operId operId
 * @returns returns
 */
export const getOperlogApi = (operId: any) => {
  return http.get<any>(`/monitor/operlog/${operId}`)
}

/**
 * @name 新增操作日志记录
 * @param data data
 * @returns returns
 */
export const addOperlogApi = (data: any) => {
  return http.post<any>('/monitor/operlog', data, { loading: false })
}

/**
 * @name 修改操作日志记录
 * @param data data
 * @returns returns
 */
export const updateOperlogApi = (data: any) => {
  return http.put<any>('/monitor/operlog', data, { loading: false })
}

/**
 * @name 删除操作日志记录
 * @param operId operId
 * @returns returns
 */
export const delOperlogApi = (operId: any) => {
  return http.delete<any>(`/monitor/operlog/${operId}`)
}

/**
 * @name 下载模板
 * @returns returns
 */
export const importTemplateApi = () => {
  return http.downloadPost('/monitor/operlog/importTemplate', {})
}

/**
 * @name 导入数据
 * @returns returns
 */
export const importDataApi = (data: any) => {
  return http.post('/monitor/operlog/importData', data)
}

/**
 * @name 导出数据
 * @returns returns
 */
export const exportApi = (data: any) => {
  return http.downloadPost('/monitor/operlog/export', data)
}
