import request from '@/utils/request'

// ============ 场站可燃气体浓度监测 (krqildjc.vue) ============
export function getGasMonitorPoints() {
  return request({ url: '/api/gas-monitor/points', method: 'get' })
}

export function getGasMonitorTrend(pointId, hours = 24) {
  return request({ url: `/api/gas-monitor/point/${pointId}/trend`, method: 'get', params: { hours } })
}

// ============ 管线压力监测 (gxyljc.vue) ============
export function getPressureMonitorPoints() {
  return request({ url: '/api/pressure-monitor/points', method: 'get' })
}

export function getPressureMonitorTrend(pointId, days = 10) {
  return request({ url: `/api/pressure-monitor/point/${pointId}/trend`, method: 'get', params: { days } })
}

export function getPressureMonitorHistory(pointId, pageNum, pageSize) {
  return request({ url: `/api/pressure-monitor/point/${pointId}/history`, method: 'get', params: { pageNum, pageSize } })
}

// ============ 设备异常 (EquipmentAbnormal.vue) ============
export function getEquipmentAbnormalList(params) {
  return request({ url: '/api/equipment-abnormal/list', method: 'get', params })
}

export function getEquipmentAbnormalStats() {
  return request({ url: '/api/equipment-abnormal/stats', method: 'get' })
}
