|
|
@ -258,10 +258,11 @@ public class WeatherForecastController extends BaseController { |
|
|
|
if (jsonResult.getInteger("code") == UniversalEnum.TWO_HUNDRED.getNumber()) { |
|
|
|
JSONArray data = jsonResult.getJSONArray("data"); |
|
|
|
if (data.size() != UniversalEnum.ZERO.getNumber()) { |
|
|
|
redisCache.setCacheObject("currentWeatherAndForecastInformation", data); |
|
|
|
redisCache.deleteObject("currentWeatherAndForecastInformation" + numStake); |
|
|
|
redisCache.setCacheObject("currentWeatherAndForecastInformation" + numStake, data); |
|
|
|
return AjaxResult.success(data); |
|
|
|
} else { |
|
|
|
return AjaxResult.success(redisCache.getCacheObject("currentWeatherAndForecastInformation")); |
|
|
|
return AjaxResult.success(redisCache.getCacheObject("currentWeatherAndForecastInformation" + numStake)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
return AjaxResult.error(jsonResult.getInteger("code"), UniversalEnum.REQUEST_FAILED.getValue()); |
|
|
@ -269,6 +270,7 @@ public class WeatherForecastController extends BaseController { |
|
|
|
} |
|
|
|
} catch (Exception ignored) { |
|
|
|
|
|
|
|
logger.error(String.valueOf(ignored)); |
|
|
|
|
|
|
|
} |
|
|
|
return AjaxResult.error(UniversalEnum.REQUEST_FAILED.getValue()); |
|
|
|