37 lines
1.7 KiB
Go

package model
import "time"
// SensorData 传感器数据结构
type SensorData struct {
ID int64 `json:"id"`
Timestamp time.Time `json:"timestamp"`
WindSpeed int `json:"wind_speed"` // 风速
WindForce int `json:"wind_force"` // 风力
WindDirection8 int `json:"wind_direction_8"` // 8方位风向
WindDirection360 int `json:"wind_direction_360"` // 360度风向
Humidity int `json:"humidity"` // 湿度
Temperature int `json:"temperature"` // 温度
Noise int `json:"noise"` // 噪声
PM25 int `json:"pm25"` // PM2.5
PM10 int `json:"pm10"` // PM10
AtmPressure int `json:"atm_pressure"` // 大气压
Lux20WH int `json:"lux_20w_h"` // 20W Lux值(高16位)
Lux20WL int `json:"lux_20w_l"` // 20W Lux值(低16位)
Light20W int `json:"light_20w"` // 20W光照
OpticalRain int `json:"optical_rain"` // 光学雨量
CompassAngle int `json:"compass_angle"` // 电子指南针角度
SolarRadiation int `json:"solar_radiation"` // 太阳辐射
}
// AggregatedData 聚合数据结构
type AggregatedData struct {
Timestamp time.Time `json:"timestamp"`
AvgTemperature float64 `json:"avg_temperature"`
Rainfall float64 `json:"rainfall"`
AvgHumidity float64 `json:"avg_humidity"`
AvgWindSpeed float64 `json:"avg_wind_speed"`
AvgAtmPressure float64 `json:"atm_pressure"` // 平均大气压
AvgSolarRadiation float64 `json:"solar_radiation"` // 平均太阳辐射
}