diff --git a/src/main/java/com/xkrs/common/StaticScheduleTask.java b/src/main/java/com/xkrs/common/StaticScheduleTask.java index 8a8f2f6..b845dad 100644 --- a/src/main/java/com/xkrs/common/StaticScheduleTask.java +++ b/src/main/java/com/xkrs/common/StaticScheduleTask.java @@ -38,4 +38,11 @@ public class StaticScheduleTask { } } + //每4秒钟更新一次订阅 + @Scheduled(cron = "0/4 * * * * ?") + private void syncSubscribe6() { + firePointSubscribeManager.autoSync(); + } + + } \ No newline at end of file diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java index cc3b6b8..1c64f7f 100644 --- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -35,11 +35,12 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/push/**").permitAll() .antMatchers("/dispatch/**").permitAll() .antMatchers("/queryFirePoint").permitAll() - .antMatchers(HttpMethod.POST, "/insertFirePoint").permitAll() - .antMatchers(HttpMethod.POST, "/insertFirePointChannelPrecise").permitAll() - .antMatchers(HttpMethod.GET, "/queryFirePointBroadcast").permitAll() - .antMatchers(HttpMethod.POST, "/api/user/updateSysUser").permitAll() + .antMatchers( "/insertFirePoint").permitAll() + .antMatchers( "/insertFirePointChannelPrecise").permitAll() + .antMatchers("/queryFirePointBroadcast").permitAll() + .antMatchers("/autoSync").permitAll() .antMatchers(HttpMethod.GET, "/queryNotice").permitAll()//查询通知 + .antMatchers(HttpMethod.POST, "/api/user/updateSysUser").permitAll() .antMatchers(HttpMethod.POST, "/api/user/add").permitAll() .antMatchers(HttpMethod.POST, "/api/user/check/duplicate").permitAll() .antMatchers(HttpMethod.POST, "/api/login").permitAll() @@ -62,7 +63,6 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers(HttpMethod.GET, "/api/adm/getStreetList").permitAll()//根据区县编号获取街道列表 .antMatchers(HttpMethod.GET, "/selectTodayFirePoint").permitAll() .antMatchers(HttpMethod.GET, "/debug").permitAll() - .antMatchers(HttpMethod.GET, "/autoSync").permitAll() // 所有其它请求需要身份认证 .anyRequest().authenticated() .and() diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 9349aa6..8a255bd 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -23,7 +23,7 @@ spring.datasource.hikari.validation-timeout = 3000 ## Spring Data JPA 配置 spring.jpa.database = POSTGRESQL spring.jpa.database-platform = org.hibernate.dialect.PostgreSQLDialect -spring.jpa.show-sql = false +spring.jpa.show-sql = true # 指定 ddl mode (none, validate, create, create-drop, update) spring.jpa.hibernate.ddl-auto = update # 命名策略