diff --git a/pom.xml b/pom.xml index f970486..787f0f2 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,8 @@ org.postgresql postgresql - runtime + 42.5.0 + org.springframework diff --git a/src/main/java/com/rehome/jpahefengweather/service/ScheduledHefengWeatherService.java b/src/main/java/com/rehome/jpahefengweather/service/ScheduledHefengWeatherService.java index 1fa9104..d46e367 100644 --- a/src/main/java/com/rehome/jpahefengweather/service/ScheduledHefengWeatherService.java +++ b/src/main/java/com/rehome/jpahefengweather/service/ScheduledHefengWeatherService.java @@ -53,7 +53,7 @@ public class ScheduledHefengWeatherService { * //天气图标用法: https://icons.qweather.com/usage/ * @Param: null */ - //@Scheduled(cron = "0 30 * * * *")//每个小时执行一次 + //@Scheduled(cron = "0 0 2 * * *")//每个小时执行一次 public void scheduled() { log.info("scheduled"); log.info("=====>>>>>使用cron:" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); diff --git a/src/main/java/com/rehome/jpahefengweather/service/ScheduledWztfwStormService.java b/src/main/java/com/rehome/jpahefengweather/service/ScheduledWztfwStormService.java index 6590a22..9723345 100644 --- a/src/main/java/com/rehome/jpahefengweather/service/ScheduledWztfwStormService.java +++ b/src/main/java/com/rehome/jpahefengweather/service/ScheduledWztfwStormService.java @@ -38,13 +38,13 @@ public class ScheduledWztfwStormService { * @description: 从温州气象台获取台风列表 * @Param: null */ - @Scheduled(cron = "0 39 15 * * *") - public void getWztfHistoryStormList() { - for(int i=1945;i<2026;i++){ - getWztfStormList(String.valueOf(i)); - } - //getWztfStormList(String.valueOf(1944)); - } +// @Scheduled(cron = "0 39 15 * * *") +// public void getWztfHistoryStormList() { +// for(int i=1945;i<2026;i++){ +// getWztfStormList(String.valueOf(i)); +// } +// //getWztfStormList(String.valueOf(1944)); +// } /** * @date 2022-03-16 09:41 @@ -52,7 +52,7 @@ public class ScheduledWztfwStormService { * @Param: null */ //@Scheduled(cron = "0 15 * * * *") - public void getWztfStormList(String nowYear) { + public void getWztfStormList() { // 初始化 OkHttpClient OkHttpClient client = new OkHttpClient.Builder() .connectTimeout(10, TimeUnit.SECONDS) @@ -65,7 +65,7 @@ public class ScheduledWztfwStormService { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy"); String nowDate = sdf.format(new Date()); - //String nowYear = sdfYear.format(new Date()); + String nowYear = sdfYear.format(new Date()); //nowYear = String.valueOf(i); String url = "http://data.istrongcloud.com/v2/data/complex/" + nowYear + ".json?v=" + String.valueOf(System.currentTimeMillis()); diff --git a/src/main/java/com/rehome/jpahefengweather/service/ScheduledZjsltStormService.java b/src/main/java/com/rehome/jpahefengweather/service/ScheduledZjsltStormService.java index a950eda..3839800 100644 --- a/src/main/java/com/rehome/jpahefengweather/service/ScheduledZjsltStormService.java +++ b/src/main/java/com/rehome/jpahefengweather/service/ScheduledZjsltStormService.java @@ -41,7 +41,7 @@ public class ScheduledZjsltStormService { * @description: 从浙江省水利厅获取历史台风列表数据和对应的台风详情 * @Param: null */ -// @Scheduled(cron = "0 24 * * * *") +// @Scheduled(cron = "0 57 1 * * *") // public void getZjsltHistoryStormList() { // for(int i=1944;i<2026;i++){ // getZjsltStormList(String.valueOf(i)); @@ -52,7 +52,7 @@ public class ScheduledZjsltStormService { * @description: 从浙江省水利厅获取台风列表 * @Param: null */ - //@Scheduled(cron = "0 23 * * * *") + @Scheduled(cron = "0 23 * * * *") public void getZjsltStormList() { log.info("getZjsltStormList"); String strNow = String.valueOf(System.currentTimeMillis()); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e8e2474..400ea89 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -41,4 +41,4 @@ spring: # 最大请求大小 max-request-size: 20MB rehome: - resources-path: /Users/admin/storage # 外部资源文件存储路径 格式:/Users/edao/storage \ No newline at end of file + resources-path: /Users/edao/storage # 外部资源文件存储路径 格式:/Users/edao/storage \ No newline at end of file