|
@@ -89,26 +89,37 @@ public class WeatherController {
|
|
|
|
|
|
Object towTomorrow = JSONObject.fromObject(jsonData.get("forecast_24h")).get("3"); //24小时天气预报的 “1” 为当天的天气预报
|
|
Object towTomorrow = JSONObject.fromObject(jsonData.get("forecast_24h")).get("3"); //24小时天气预报的 “1” 为当天的天气预报
|
|
|
|
|
|
- DayWeatherEntity tomorrowEntity = new DayWeatherEntity();
|
|
|
|
|
|
+ Object threeTomorrow = JSONObject.fromObject(jsonData.get("forecast_24h")).get("4"); //24小时天气预报的 “1” 为当天的天气预报
|
|
|
|
|
|
- tomorrowEntity.setMax_degree((String)JSONObject.fromObject(tomorrow).get("max_degree") );
|
|
|
|
|
|
|
|
|
|
+ DayWeatherEntity tomorrowEntity = new DayWeatherEntity();
|
|
|
|
+ tomorrowEntity.setMax_degree((String)JSONObject.fromObject(tomorrow).get("max_degree") );
|
|
tomorrowEntity.setMin_degree((String)JSONObject.fromObject(tomorrow).get("min_degree") );
|
|
tomorrowEntity.setMin_degree((String)JSONObject.fromObject(tomorrow).get("min_degree") );
|
|
-
|
|
|
|
tomorrowEntity.setDay_weather((String)JSONObject.fromObject(tomorrow).get("day_weather") );
|
|
tomorrowEntity.setDay_weather((String)JSONObject.fromObject(tomorrow).get("day_weather") );
|
|
|
|
+ tomorrowEntity.setDay_wind_direction((String)JSONObject.fromObject(tomorrow).get("day_wind_direction") );
|
|
|
|
+ tomorrowEntity.setDay_wind_power((String)JSONObject.fromObject(tomorrow).get("day_wind_power") );
|
|
|
|
+ tomorrowEntity.setWeather_time( ((String)JSONObject.fromObject(tomorrow).get("time")).substring(5,10) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- DayWeatherEntity towTomorrowEntity = new DayWeatherEntity();
|
|
|
|
|
|
|
|
|
|
+ DayWeatherEntity towTomorrowEntity = new DayWeatherEntity();
|
|
towTomorrowEntity.setMax_degree((String)JSONObject.fromObject(towTomorrow).get("max_degree") );
|
|
towTomorrowEntity.setMax_degree((String)JSONObject.fromObject(towTomorrow).get("max_degree") );
|
|
-
|
|
|
|
towTomorrowEntity.setMin_degree((String)JSONObject.fromObject(towTomorrow).get("min_degree") );
|
|
towTomorrowEntity.setMin_degree((String)JSONObject.fromObject(towTomorrow).get("min_degree") );
|
|
-
|
|
|
|
towTomorrowEntity.setDay_weather((String)JSONObject.fromObject(towTomorrow).get("day_weather") );
|
|
towTomorrowEntity.setDay_weather((String)JSONObject.fromObject(towTomorrow).get("day_weather") );
|
|
|
|
+ towTomorrowEntity.setDay_wind_direction((String)JSONObject.fromObject(towTomorrow).get("day_wind_direction") );
|
|
|
|
+ towTomorrowEntity.setDay_wind_power((String)JSONObject.fromObject(towTomorrow).get("day_wind_power") );
|
|
|
|
+ towTomorrowEntity.setWeather_time( ((String)JSONObject.fromObject(towTomorrow).get("time")).substring(5,10) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ DayWeatherEntity threeTomorrowEntity = new DayWeatherEntity();
|
|
|
|
+ threeTomorrowEntity.setMax_degree((String)JSONObject.fromObject(threeTomorrow).get("max_degree") );
|
|
|
|
+ threeTomorrowEntity.setMin_degree((String)JSONObject.fromObject(threeTomorrow).get("min_degree") );
|
|
|
|
+ threeTomorrowEntity.setDay_weather((String)JSONObject.fromObject(threeTomorrow).get("day_weather") );
|
|
|
|
+ threeTomorrowEntity.setDay_wind_direction((String)JSONObject.fromObject(threeTomorrow).get("day_wind_direction") );
|
|
|
|
+ threeTomorrowEntity.setDay_wind_power((String)JSONObject.fromObject(threeTomorrow).get("day_wind_power") );
|
|
|
|
+ threeTomorrowEntity.setWeather_time( ((String)JSONObject.fromObject(threeTomorrow).get("time")).substring(5,10) );
|
|
|
|
|
|
|
|
|
|
Object forecastobject01hDetail = JSONObject.fromObject(jsonData.get("forecast_1h")).get("0"); //24小时天气预报的 “1” 为当天的天气预报
|
|
Object forecastobject01hDetail = JSONObject.fromObject(jsonData.get("forecast_1h")).get("0"); //24小时天气预报的 “1” 为当天的天气预报
|
|
@@ -229,6 +240,7 @@ public class WeatherController {
|
|
|
|
|
|
weatherResultEntity.setTowTomorrow(towTomorrowEntity);//后天天气
|
|
weatherResultEntity.setTowTomorrow(towTomorrowEntity);//后天天气
|
|
|
|
|
|
|
|
+ weatherResultEntity.setThreeTomorrow(threeTomorrowEntity);//后天天气
|
|
|
|
|
|
return new Result(ResultCode.SUCCESS, weatherResultEntity);
|
|
return new Result(ResultCode.SUCCESS, weatherResultEntity);
|
|
|
|
|
|
@@ -238,8 +250,7 @@ public class WeatherController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- /*public static void main(String[] args) {
|
|
|
|
- // 浙江省,杭州市,余杭区,咯咯3
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
String province = "浙江省";
|
|
String province = "浙江省";
|
|
String city = "杭州市";
|
|
String city = "杭州市";
|
|
String county = "余杭区";
|
|
String county = "余杭区";
|
|
@@ -294,6 +305,6 @@ public class WeatherController {
|
|
System.out.println("canshu "+humidityValu);
|
|
System.out.println("canshu "+humidityValu);
|
|
|
|
|
|
|
|
|
|
- }*/
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|