|
|
|
@ -11,33 +11,64 @@ type WeatherResponse struct {
|
|
|
|
|
Status int `json:"status"`
|
|
|
|
|
Result struct {
|
|
|
|
|
Location struct {
|
|
|
|
|
Country string `json:"country"`
|
|
|
|
|
Province string `json:"province"`
|
|
|
|
|
City string `json:"city"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Id string `json:"id"`
|
|
|
|
|
} `json:"location"`
|
|
|
|
|
Country string `json:"country"` // 国家名称
|
|
|
|
|
Province string `json:"province"` // 省份名称
|
|
|
|
|
City string `json:"city"` // 城市名称
|
|
|
|
|
Name string `json:"name"` // 区县名称
|
|
|
|
|
Id string `json:"id"` // 区县id
|
|
|
|
|
} `json:"location"` // 地理位置信息
|
|
|
|
|
Now struct {
|
|
|
|
|
Text string `json:"text"`
|
|
|
|
|
Temp int `json:"temp"`
|
|
|
|
|
FeelsLike int `json:"feels_like"`
|
|
|
|
|
Rh int `json:"rh"`
|
|
|
|
|
WindClass string `json:"wind_class"`
|
|
|
|
|
WindDir string `json:"wind_dir"`
|
|
|
|
|
Uptime string `json:"uptime"`
|
|
|
|
|
} `json:"now"`
|
|
|
|
|
Text string `json:"text"` // 天气现象
|
|
|
|
|
Temp int `json:"temp"` // 温度(℃)
|
|
|
|
|
FeelsLike int `json:"feels_like"` // 体感温度(℃)
|
|
|
|
|
Rh int `json:"rh"` // 相对湿度(%)
|
|
|
|
|
WindClass string `json:"wind_class"` // 风力等级
|
|
|
|
|
WindDir string `json:"wind_dir"` // 风向描述
|
|
|
|
|
Prec1h float64 `json:"prec_1h"` // 1小时累计降水量(mm)
|
|
|
|
|
Clouds int `json:"clouds"` // 云量(%)
|
|
|
|
|
Vis int `json:"vis"` // 能见度(m)
|
|
|
|
|
Aqi int `json:"aqi"` // 空气质量指数数值
|
|
|
|
|
Pm25 int `json:"pm25"` // pm2.5浓度(μg/m3)
|
|
|
|
|
Pm10 int `json:"pm10"` // pm10浓度(μg/m3)
|
|
|
|
|
No2 int `json:"no2"` // 二氧化氮浓度(μg/m3)
|
|
|
|
|
So2 int `json:"so2"` // 二氧化硫浓度(μg/m3)
|
|
|
|
|
O3 int `json:"o3"` // 臭氧浓度(μg/m3)
|
|
|
|
|
Co float64 `json:"co"` // 一氧化碳浓度(mg/m3)
|
|
|
|
|
Uptime string `json:"uptime"` // 数据更新时间,北京时间
|
|
|
|
|
} `json:"now"` // 实况数据
|
|
|
|
|
Alert []struct {
|
|
|
|
|
Type string `json:"type"` // 预警事件类型
|
|
|
|
|
Level string `json:"level"` // 预警事件等级
|
|
|
|
|
Title string `json:"title"` // 预警标题
|
|
|
|
|
Desc string `json:"desc"` // 预警详细提示信息
|
|
|
|
|
} `json:"alert"` // 气象预警数据
|
|
|
|
|
Indexes []struct {
|
|
|
|
|
Name string `json:"name"` // 生活指数中文名称
|
|
|
|
|
Brief string `json:"brief"` // 生活指数概要说明
|
|
|
|
|
Detail string `json:"detail"` // 生活指数详细说明
|
|
|
|
|
} `json:"indexes"` // 生活指数数据
|
|
|
|
|
Forecasts []struct {
|
|
|
|
|
TextDay string `json:"text_day"`
|
|
|
|
|
TextNight string `json:"text_night"`
|
|
|
|
|
High int `json:"high"`
|
|
|
|
|
Low int `json:"low"`
|
|
|
|
|
WcDay string `json:"wc_day"`
|
|
|
|
|
WdDay string `json:"wd_day"`
|
|
|
|
|
WcNight string `json:"wc_night"`
|
|
|
|
|
WdNight string `json:"wd_night"`
|
|
|
|
|
Date string `json:"date"`
|
|
|
|
|
Week string `json:"week"`
|
|
|
|
|
} `json:"forecasts"`
|
|
|
|
|
Date string `json:"date"` // 日期,北京时区
|
|
|
|
|
Week string `json:"week"` // 星期,北京时区
|
|
|
|
|
High int `json:"high"` // 最高温度(℃)
|
|
|
|
|
Low int `json:"low"` // 最低温度(℃)
|
|
|
|
|
WcDay string `json:"wc_day"` // 白天风力
|
|
|
|
|
WcNight string `json:"wc_night"` // 晚上风力
|
|
|
|
|
WdDay string `json:"wd_day"` // 白天风向
|
|
|
|
|
WdNight string `json:"wd_night"` // 晚上风向
|
|
|
|
|
TextDay string `json:"text_day"` // 白天天气现象
|
|
|
|
|
TextNight string `json:"text_night"` // 晚上天气现象
|
|
|
|
|
} `json:"forecasts"` // 预报数据
|
|
|
|
|
ForecastHours []struct {
|
|
|
|
|
Text string `json:"text"` // 天气现象
|
|
|
|
|
TempFc int `json:"temp_fc"` // 温度(℃)
|
|
|
|
|
WindClass string `json:"wind_class"` // 风力等级
|
|
|
|
|
WindDir string `json:"wind_dir"` // 风向描述
|
|
|
|
|
Rh int `json:"rh"` // 相对湿度
|
|
|
|
|
Prec1h float64 `json:"prec_1h"` // 1小时累计降水量(mm)
|
|
|
|
|
Clouds int `json:"clouds"` // 云量(%)
|
|
|
|
|
DataTime string `json:"data_time"` // 数据时间
|
|
|
|
|
} `json:"forecast_hours"` // 未来24小时逐小时预报
|
|
|
|
|
} `json:"result"`
|
|
|
|
|
Message string `json:"message"`
|
|
|
|
|
}
|
|
|
|
|