Compare commits

...

2 Commits

  1. 31
      .gitignore
  2. 3
      hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java
  3. 2
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/aspect/WeatherCacheAspect.java

31
.gitignore vendored

@ -1,8 +1,23 @@
*.idea *.class
/hzims-biz-common/target *.project
/hzims-service/*/target # Mobile Tools for Java (J2ME)
/hzims-service-api/*/target .mtj.tmp/
log .springBeans
# Package Files #
*.jar
*.war
*.ear
.DS_Store
hs_err_pid*
.factorypath
.project
.gradle/
.idea/
.settings/
*.iml
.classpath
build/
target/
*.logs
*.log
logs/

3
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.publicId = publicId;
HeWeatherInitialize.privateKey = privateKey; HeWeatherInitialize.privateKey = privateKey;
//HeWeatherInitialize.domain = "https://api.heweather.net"; //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"; HeWeatherInitialize.geoDomain = "https://geoapi.heweather.net";
} }

2
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) { private void saveCacheForHash(String key, String location, Object result,long timeout,TimeUnit unit) {
HeWeatherResponse response = (HeWeatherResponse) result; HeWeatherResponse response = (HeWeatherResponse) result;
if(response.getCode().isOk()) { if(null != response && null != response.getCode() && response.getCode().isOk()) {
redisTemplate.opsForHash().put(key,location,result); redisTemplate.opsForHash().put(key,location,result);
redisTemplate.expire(key,timeout,unit); redisTemplate.expire(key,timeout,unit);
} }

Loading…
Cancel
Save