From be1f7116b929ae3459bcc96ccb1f44a733168b25 Mon Sep 17 00:00:00 2001 From: luyie Date: Thu, 5 Jun 2025 11:31:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=92=8C=E9=A3=8E=E5=A4=A9=E6=B0=94?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9B=B4=E6=8D=A2=E8=B4=A6=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java | 3 ++- .../main/java/com/hnac/hzims/weather/aspect/WeatherCacheAspect.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java index eea093c..0f7c9a0 100644 --- a/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java +++ b/hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java @@ -16,7 +16,8 @@ public class HeWeatherInitialize { HeWeatherInitialize.publicId = publicId; HeWeatherInitialize.privateKey = privateKey; //HeWeatherInitialize.domain = "https://api.heweather.net"; - HeWeatherInitialize.domain = "https://devapi.qweather.com"; + //HeWeatherInitialize.domain = "https://devapi.qweather.com"; + HeWeatherInitialize.domain = "https://px5khukpur.re.qweatherapi.com"; HeWeatherInitialize.geoDomain = "https://geoapi.heweather.net"; } diff --git a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/aspect/WeatherCacheAspect.java b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/aspect/WeatherCacheAspect.java index 277a37c..32f675e 100644 --- a/hzims-service/weather/src/main/java/com/hnac/hzims/weather/aspect/WeatherCacheAspect.java +++ b/hzims-service/weather/src/main/java/com/hnac/hzims/weather/aspect/WeatherCacheAspect.java @@ -64,7 +64,7 @@ public class WeatherCacheAspect { */ private void saveCacheForHash(String key, String location, Object result,long timeout,TimeUnit unit) { HeWeatherResponse response = (HeWeatherResponse) result; - if(response.getCode().isOk()) { + if(null != response && null != response.getCode() && response.getCode().isOk()) { redisTemplate.opsForHash().put(key,location,result); redisTemplate.expire(key,timeout,unit); }