Kaynağa Gözat

修改星图气象token

douzhi 1 ay önce
ebeveyn
işleme
0b726169ba

+ 7 - 6
src/main/java/com/example/getweather/service/GetWeatherGeovisearth.java

@@ -179,6 +179,7 @@ public class GetWeatherGeovisearth {
             connProps.setProperty(TSDBDriver.PROPERTY_KEY_LOCALE, "en_US.UTF-8");
             connProps.setProperty(TSDBDriver.PROPERTY_KEY_TIME_ZONE, "UTC-8");
             Connection conn = DriverManager.getConnection(jdbcUrl, connProps);
+            String token = "64aec81530f8a96d1232786703b225b9";  //ori: 15d7d762ca3eca516c8344a24c8af2b6 modified by andy at 2025-09-05 14:15
             //省份
             for (String code : areaCodes) {
                 //中科星图 只接甘肃
@@ -194,8 +195,8 @@ public class GetWeatherGeovisearth {
                         String xmoUrl;
                         String location = d.getLng() + "," + d.getLat();
                         //xmo综合数据查询
-                        url = "https://api.open.geovisearth.com/v2/cn/city/basic?token=15d7d762ca3eca516c8344a24c8af2b6&location=" + location + "&yesterday=false";
-                        url120 = "https://api.open.geovisearth.com/v2/cn/hourly/professional?token=15d7d762ca3eca516c8344a24c8af2b6&location=" + location;
+                        url = "https://api.open.geovisearth.com/v2/cn/city/basic?token="+token+"&location=" + location + "&yesterday=false";
+                        url120 = "https://api.open.geovisearth.com/v2/cn/hourly/professional?token="+token+"&location=" + location;
                         xmoUrl = "https://weather-api.xm-opt.com/v1/forecastDaily?latitude=" + d.getLat() + "&longitude=" + d.getLng() + "&daily=wind_speed_10m_max,shortwave_radiation_sum&timezone=Asia%2FShanghai&start_date=" + startDate + "&end_date=" + endDate;
                         isApiQuotaExhausted = analysisGeovisearth(url, url120, xmoUrl, d.getCode(), d.getName(), conn); // 传递标志变量
                         if (isApiQuotaExhausted) break; // 检查标志变量
@@ -203,8 +204,8 @@ public class GetWeatherGeovisearth {
                         for (DistrictCodeDO q : quList) {
                             if (isApiQuotaExhausted) break; // 检查标志变量
                             location = q.getLng() + "," + q.getLat();
-                            url = "https://api.open.geovisearth.com/v2/cn/city/basic?token=15d7d762ca3eca516c8344a24c8af2b6&location=" + location + "&yesterday=false";
-                            url120 = "https://api.open.geovisearth.com/v2/cn/hourly/professional?token=15d7d762ca3eca516c8344a24c8af2b6&location=" + location;
+                            url = "https://api.open.geovisearth.com/v2/cn/city/basic?token="+token+"&location=" + location + "&yesterday=false";
+                            url120 = "https://api.open.geovisearth.com/v2/cn/hourly/professional?token="+token+"&location=" + location;
                             xmoUrl = "https://weather-api.xm-opt.com/v1/forecastDaily?latitude=" + q.getLat() + "&longitude=" + q.getLng() + "&daily=wind_speed_10m_max,shortwave_radiation_sum&timezone=Asia%2FShanghai&start_date=" + startDate + "&end_date=" + endDate;
                             isApiQuotaExhausted = analysisGeovisearth(url, url120, xmoUrl, q.getCode(), q.getName(), conn); // 传递标志变量
                             if (isApiQuotaExhausted) break; // 检查标志变量
@@ -216,8 +217,8 @@ public class GetWeatherGeovisearth {
                     //2025-07-18 新增 甘肃库里 powerstation表里场站的经纬度也获取数据, td表的tag是场站编号而不是地区编号
                     for (DistrictCodeDO d : districtCodeDOList1) {
                         String location = d.getLng() + "," + d.getLat();
-                        String url = "https://api.open.geovisearth.com/v2/cn/city/basic?token=15d7d762ca3eca516c8344a24c8af2b6&location=" + location + "&yesterday=false";
-                        String url120 = "https://api.open.geovisearth.com/v2/precision_grid/forecast/day?start=" + getNowDateString() + "&end=" + getSevenDaysLater() + "&token=15d7d762ca3eca516c8344a24c8af2b6&meteCodes=ws_day,ws_night,wd_day,wd_night&location=" + location;
+                        String url = "https://api.open.geovisearth.com/v2/cn/city/basic?token="+token+"&location=" + location + "&yesterday=false";
+                        String url120 = "https://api.open.geovisearth.com/v2/precision_grid/forecast/day?start=" + getNowDateString() + "&end=" + getSevenDaysLater() + "&token="+token+"&meteCodes=ws_day,ws_night,wd_day,wd_night&location=" + location;
                         String xmoUrl = "https://weather-api.xm-opt.com/v1/forecastDaily?latitude=" + d.getLat() + "&longitude=" + d.getLng() + "&daily=wind_speed_10m_max,shortwave_radiation_sum&timezone=Asia%2FShanghai&start_date=" + startDate + "&end_date=" + endDate;
                         if (isApiQuotaExhausted) break; // 检查标志变量
                         isApiQuotaExhausted = analysisGeovisearth(url, url120, xmoUrl, d.getCode(), d.getName(), conn); // 传递标志变量