import http from '@/api'

/**
 * @name 查询系统访问记录列表
 * @param query 参数
 * @returns 返回列表
 */
export const listLogininforApi = (query: any) => {
  return http.get<any>('/monitor/logininfor/list', query, { loading: true })
}

/**
 * @name 查询系统访问记录详细
 * @param infoId infoId
 * @returns returns
 */
export const getLogininforApi = (infoId: any) => {
  return http.get<any>(`/monitor/logininfor/${infoId}`)
}

/**
 * @name 新增系统访问记录
 * @param data data
 * @returns returns
 */
export const addLogininforApi = (data: any) => {
  return http.post<any>('/monitor/logininfor', data, { loading: false })
}

/**
 * @name 修改系统访问记录
 * @param data data
 * @returns returns
 */
export const updateLogininforApi = (data: any) => {
  return http.put<any>('/monitor/logininfor', data, { loading: false })
}

/**
 * @name 删除系统访问记录
 * @param infoId infoId
 * @returns returns
 */
export const delLogininforApi = (infoId: any) => {
  return http.delete<any>(`/monitor/logininfor/${infoId}`)
}

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

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

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