73 lines
2.1 KiB
Go
73 lines
2.1 KiB
Go
package types
|
|
|
|
import "html/template"
|
|
|
|
// Station 站点信息
|
|
type Station struct {
|
|
StationID string `json:"station_id"`
|
|
StationAlias string `json:"station_alias"`
|
|
StationName string `json:"station_name"`
|
|
DeviceType string `json:"device_type"`
|
|
LastUpdate string `json:"last_update"`
|
|
Latitude float64 `json:"latitude"`
|
|
Longitude float64 `json:"longitude"`
|
|
Name string `json:"name"`
|
|
Location string `json:"location"`
|
|
Z int `json:"z"`
|
|
Y int `json:"y"`
|
|
X int `json:"x"`
|
|
DecimalID string `json:"decimal_id"`
|
|
}
|
|
|
|
// WeatherPoint 气象数据点
|
|
type WeatherPoint struct {
|
|
DateTime string `json:"date_time"`
|
|
Temperature float64 `json:"temperature"`
|
|
Humidity float64 `json:"humidity"`
|
|
Pressure float64 `json:"pressure"`
|
|
WindSpeed float64 `json:"wind_speed"`
|
|
WindDir float64 `json:"wind_direction"`
|
|
Rainfall float64 `json:"rainfall"`
|
|
Light float64 `json:"light"`
|
|
UV float64 `json:"uv"`
|
|
RainTotal float64 `json:"rain_total"`
|
|
}
|
|
|
|
// KmlLayer 描述一个可供前端加载的KML图层
|
|
type KmlLayer struct {
|
|
Name string `json:"name"`
|
|
URL string `json:"url"`
|
|
}
|
|
|
|
// PageData 页面数据结构
|
|
type PageData struct {
|
|
Title string
|
|
ServerTime string
|
|
OnlineDevices int
|
|
TiandituKey string
|
|
KmlLayersJSON template.JS
|
|
}
|
|
|
|
// SystemStatus 系统状态结构
|
|
type SystemStatus struct {
|
|
OnlineDevices int `json:"online_devices"`
|
|
ServerTime string `json:"server_time"`
|
|
}
|
|
|
|
// ForecastPoint 预报数据点
|
|
type ForecastPoint struct {
|
|
DateTime string `json:"date_time"`
|
|
Provider string `json:"provider"`
|
|
IssuedAt string `json:"issued_at"`
|
|
Temperature *float64 `json:"temperature"`
|
|
Humidity *float64 `json:"humidity"`
|
|
Pressure *float64 `json:"pressure"`
|
|
WindSpeed *float64 `json:"wind_speed"`
|
|
WindDir *float64 `json:"wind_direction"`
|
|
Rainfall *float64 `json:"rainfall"`
|
|
PrecipProb *float64 `json:"precip_prob"`
|
|
UV *float64 `json:"uv"`
|
|
Source string `json:"source"` // "forecast"
|
|
LeadHours int `json:"lead_hours"`
|
|
}
|