// shadow.js
import request from '@/utils/request'

// 获取设备影子数据
export function getDeviceShadow(deviceId) {
  return request({
    url: `/device/shadow/${deviceId}`,
    method: 'get'
  })
}

// 获取设备运行统计
export function getRuntimeStats(deviceId) {
  return request({
    url: `/device/shadow/${deviceId}/runtime-stats`,
    method: 'get'
  })
}

// 获取设备实时状态
export function getRealtimeStatus(deviceId) {
  return request({
    url: `/device/shadow/${deviceId}/realtime-status`,
    method: 'get'
  })
}

// 获取设备状态历史
export function getStatusHistory(deviceId, limit = 50) {
  return request({
    url: `/device/shadow/${deviceId}/status-history`,
    method: 'get',
    params: { limit }
  })
}