import request from '@/utils/request'

interface Page {
  MaxResultCount: number
  SkipCount: number
}
interface Alert extends Page {
  DeviceId: number | string
  Keyword?: number | string
  StartTime?: string
  EndTime?: string
}

/**
 *  获取历史报警记录
 * @param params
 * @returns
 */
export const getAlertRecords = (params: Alert) =>
  request.get('/api/services/app/VariableRecord/GetAlertRecords', { params })

/**
 *  获取 实时报警
 * @param DeviceId
 * @returns
 */
export const getRealTimeAlert = (params: Alert) =>
  request.get('/api/services/app/VariableRecord/GetRealTimeAlert', { params })

/**
 *  获取 历史数据
 * @param params
 * @returns
 */
export const getVariableRecords = (data: any) =>
  request.post('/api/services/app/VariableRecord/SearchVariableRecords', data)
/**
 * 获取授权设备实时报警
 * @param params
 * @returns
 */
export const getAllRealTimeAlert = (params: any) =>
  request.get('/api/services/app/VariableRecord/GetAllRealTimeAlert', { params })

/**
 *获取授权设备历史报警
 * @param params
 * @returns
 */
export const getAllAlertRecords = (params: any) =>
  request.get('/api/services/app/VariableRecord/GetAllAlertRecords', { params })
