import request from '@/config/axios'

export interface CoalConsumptionChartData {
  date: string
  value: number
}

export interface CoalConsumptionHistoryData {
  updateTime: string
  deviceName: string
  location: string
  currentConsumption: number | string
  lastConsumption: number | string
}

// 获取煤炭消耗量折线图数据
export const getCoalConsumptionChart = (params: { type: 'week' | 'month' | 'year' }) => {
  return request.get<CoalConsumptionChartData[]>({ 
    url: '/energy/coal-consumption/chart', 
    params 
  })
}

// 获取煤炭消耗量历史记录表格数据
export const getCoalConsumptionHistory = () => {
  return request.get<CoalConsumptionHistoryData[]>({ 
    url: '/energy/coal-consumption/history' 
  })
}
