import request from '@/config/axios'

export interface HumidityRecordVO {
  id?: number
  pointName: string
  airTemp: number
  airHumidity: number
  soilTemp: number
  soilHumidity: number
  time: Date
  remark?: string
}

// 分页查询：点位、空气温度、空气湿度、土壤温度、土壤湿度、时间、备注
export const getHumidityPage = (params: any) => {
  return request.get({ url: '/mes/humidity/page', params })
}

// 趋势查询：返回折线图使用的数据
export const getHumidityTrend = (params: any) => {
  // 期望返回：{ times: string[], airTemp: number[], airHumidity: number[], soilTemp: number[], soilHumidity: number[] }
  return request.get({ url: '/mes/humidity/trend', params })
}

// 获取并创建温湿度数据
export const fetchAndCreateHumidity = () => {
  return request.get({ url: '/mes/humidity/fetch-and-create' })
} 
