国外区域、天气api获取

This commit is contained in:
2025-07-22 17:01:54 +08:00
parent 2a7c3d42c0
commit c12b165816
6 changed files with 232 additions and 4 deletions

View File

@ -310,9 +310,9 @@ public class StationServiceImpl implements StationService {
* @param station
*/
private void updateStationInfo(Station station) {
MyAddress address = AddressUntils.getAddress(String.valueOf(station.getLatitude()),String.valueOf(station.getLongitude()));
MyAddress address = AbroadAddressUtils.getAddress(String.valueOf(station.getLatitude()),String.valueOf(station.getLongitude()));
if (null != address) {
String adCode = address.getAdcode();
String adCode = address.getCityCode();
station.setAdCode(adCode);
station.setDistrict(address.getDistrict());
station.setCity(address.getCity());
@ -320,7 +320,7 @@ public class StationServiceImpl implements StationService {
station.setNation(address.getNation());
String key = RedisKeyConstant.WEATHER_PROVINCE_CITY + adCode;
if (!redisService.hasKey(key)) {
WeatherRespVo weatherRespVo = WeatherUntils.getWeatherRespVo(station.getAdCode());
WeatherRespVo weatherRespVo = AbroadWeatherUtils.getWeatherRespVo(String.valueOf(station.getLatitude()),String.valueOf(station.getLongitude()));
if (weatherRespVo != null) {
weatherRespVo.setUpdateTime(System.currentTimeMillis());
redisService.set(key, weatherRespVo);