Browse Source

add:和风天气sdk配置信息改为动态配置

show
luyie 2 weeks ago
parent
commit
9e7f33b1aa
  1. 2
      hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java
  2. 4
      hzims-service/weather/src/main/java/com/hnac/hzims/weather/config/StartupRunner.java

2
hzims-service-api/weather-api/src/main/java/com/hnac/hzims/hzimsweather/HeWeatherInitialize.java

@ -17,7 +17,7 @@ public class HeWeatherInitialize {
HeWeatherInitialize.privateKey = privateKey;
//HeWeatherInitialize.domain = "https://api.heweather.net";
//HeWeatherInitialize.domain = "https://devapi.qweather.com";
HeWeatherInitialize.domain = "https://px5khukpur.re.qweatherapi.com";
HeWeatherInitialize.domain = "https://mk5khnn58j.re.qweatherapi.com";
HeWeatherInitialize.geoDomain = "https://geoapi.heweather.net";
}

4
hzims-service/weather/src/main/java/com/hnac/hzims/weather/config/StartupRunner.java

@ -17,11 +17,13 @@ public class StartupRunner implements CommandLineRunner {
private String publicId;
@Value("${hzims.weather.private-key}")
private String privateKey;
@Value("${hzims.weather.domain}")
private String domain;
@Override
public void run(String... args) throws Exception {
log.info(">>>>>>>>>>>>>>>服务启动执行,执行初始化天气操作<<<<<<<<<<<<<");
log.info("publicId:{},privateKey:{}",publicId,privateKey);
HeWeatherInitialize.init(publicId, privateKey);
HeWeatherInitialize.init(publicId, privateKey, domain);
}
}

Loading…
Cancel
Save