diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/app/weather/WeatherApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/app/weather/WeatherApi.java index 5b6f3e47a..c52002098 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/app/weather/WeatherApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/app/weather/WeatherApi.java @@ -36,7 +36,7 @@ public class WeatherApi { */ @GetMapping(value = "/getFutureWeather") public ResponseVO getFutureWeather(String cityCode) { - String weatherData = GoodWeatherUtil.getWeatherData(cityCode); + String weatherData = GoodWeatherUtil.getFutureWeather(cityCode); JSONObject dataOfJson = JSONObject.parseObject(weatherData); JSONArray forecasts = dataOfJson.getJSONArray("forecasts"); return new ResponseVO(200,"",forecasts,0); diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/GoodWeatherUtil.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/GoodWeatherUtil.java index 96c8936ef..57d1c76f0 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/GoodWeatherUtil.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/GoodWeatherUtil.java @@ -52,6 +52,7 @@ public class GoodWeatherUtil { } + /** * 获取未来三天天气预报 * @param cityCode @@ -83,6 +84,7 @@ public class GoodWeatherUtil { } + /* * 将JSON格式数据进行解析 ,返回一个weather对象 */ @@ -90,7 +92,6 @@ public class GoodWeatherUtil { if ("500".equals(weatherInfobyJson)){ return null; } - JSONObject dataOfJson = JSONObject.parseObject(weatherInfobyJson); System.out.println(dataOfJson); //创建WeatherInfo对象,提取所需的天气信息