From 09569f6dfad542e35ae3ed1addf9e33682515cec Mon Sep 17 00:00:00 2001 From: trydofor Date: Fri, 20 Oct 2023 18:08:17 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=F0=9F=93=8C=20boot=203.0.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 0a680af0d..a9a2251bd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.0.9 + 3.0.12 @@ -21,7 +21,7 @@ - 3.0.9 + 3.0.12 300-SNAPSHOT @@ -41,8 +41,8 @@ 24.0.1 1.5.5.Final - 32.1.1-jre - 2.13.0 + 32.1.3-jre + 2.14.0 4.4 1.10.0 2.2.3 @@ -51,11 +51,11 @@ 1.4.1-SNAPSHOT 5.3.2 2.3.3 - 2.0.36 + 2.0.41 ${fastjson2.version} 5.5.0 2.14.3 - 1.74 + 1.76 1.16.5 2.8.8 From 13a0af9fb5a251cd2d7063837d6f3d38fa540867 Mon Sep 17 00:00:00 2001 From: trydofor Date: Mon, 23 Oct 2023 20:34:30 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=F0=9F=92=A5=20import=20instead=20of=20sc?= =?UTF-8?q?an=20#142?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.properties | 1 + observe/docs | 2 +- pom.xml | 11 ++- .../spring/bean/TinyMailConfiguration.java | 23 ++++-- .../spring/boot/WingsAutoConfiguration.java | 18 ----- .../conf/TinyMailAutoConfiguration.java | 18 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../{ => app}/WingsTinyMailApplication.java | 2 +- .../conf}/StatusHookConfiguration.java | 2 +- .../spring/bean/TinyTaskConfiguration.java | 14 +++- .../TinyTaskAutoConfiguration.java} | 11 ++- ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../{ => app}/WingsTinyTaskApplication.java | 2 +- wings/aegis/pom.xml | 18 ----- .../spring/consts/NamingFacelessConst.java | 10 --- .../spring/consts/NamingSlardarConst.java | 13 --- .../spring/consts/NamingWarlockConst.java | 12 --- .../spring/consts/OrderedBatriderConst.java | 10 --- .../spring/consts/OrderedFacelessConst.java | 25 ------ .../spring/consts/OrderedSilencerConst.java | 16 ---- .../spring/consts/OrderedSlardarConst.java | 80 ------------------- .../spring/consts/OrderedWarlockConst.java | 62 -------------- .../wings/spring/consts/WingsBeanNaming.java | 8 -- wings/batrider-test/pom.xml | 5 ++ .../WingsBatriderTestApplication.java | 7 +- .../spring-datasource-79.properties | 4 - .../bean/BatriderServcombConfiguration.java | 6 +- .../spring/boot/WingsAutoConfiguration.java | 18 ----- .../conf/BatriderAutoConfiguration.java | 19 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../WingsFacelessAwesomeApplication.java | 2 +- .../bean/WingsFlywaveConfiguration.java | 10 ++- .../spring/conf/FlywaveAutoConfiguration.java | 21 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../app/WingsFacelessFlywaveApplication.java | 15 ++++ .../sample/WingsInitDatabaseSample.java | 2 +- .../faceless/sample/WingsSchemaGenerator.java | 2 +- .../WingsFacelessFlywaveApplication.kt | 15 ---- .../flywave/SchemaFulldumpManagerTest.kt | 4 +- .../flywave/SchemaJournalManagerTest.kt | 8 +- .../flywave/SchemaRevisionMangerTest.kt | 6 +- .../sample/WingsFlywaveInitDatabaseSample.kt | 2 +- .../sample/WingsFlywaveShardJournalSample.kt | 4 +- .../lightid/impl/LightIdServiceImplTest.kt | 2 +- .../bean/FacelessJooqConfiguration.java | 11 +-- .../conf/FacelessJooqAutoConfiguration.java | 22 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsFacelessJooqApplication.java | 2 +- .../conf}/SlowSqlConfiguration.java | 2 +- .../conf}/TableCudConfiguration.java | 2 +- .../jooq/WingsJooqDaoAliasImplTest.java | 6 +- .../faceless/jooq/JooqDeleteListenerTest.java | 6 +- .../jooq/JooqMapperCompatibleTest.java | 6 +- .../jooq/JooqTableCudListenerTest.java | 6 +- .../jooq/TransactionalServiceTest.java | 2 +- .../faceless/sample/JooqDslAndDaoSample.java | 4 +- .../faceless/sample/JooqMostSelectSample.java | 4 +- .../FacelessShardingsphereConfiguration.java | 3 - .../conf/FacelessShardAutoConfiguration.java | 18 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsFacelessShardApplication.java | 2 +- .../faceless/flywave/FlywaveShardingTest.java | 8 +- .../wings/faceless/jooq/JooqShardingTest.java | 10 +-- .../{ => helper}/WingsTestHelper.java | 2 +- .../conf/FacelessTestAutoConfiguration.java | 19 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../bean/FacelessDataSourceConfiguration.java | 3 - .../bean/FacelessEnumI18nConfiguration.java | 3 - .../bean/FacelessFlakeIdConfiguration.java | 3 - .../bean/FacelessJournalConfiguration.java | 3 - .../bean/FacelessLightIdConfiguration.java | 5 +- .../spring/boot/WingsAutoConfiguration.java | 18 ----- .../conf/FacelessAutoConfiguration.java | 30 +++++++ ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../{ => app}/WingsFacelessApplication.java | 2 +- wings/pom.xml | 1 - wings/silencer-curse/pom.xml | 4 - .../bean/SilencerAutoLogConfiguration.java | 9 +-- .../bean/SilencerEncryptConfiguration.java | 5 +- .../bean/SilencerInspectConfiguration.java | 10 +-- .../bean/SilencerRuntimeConfiguration.java | 5 +- .../bean/SilencerTweakConfiguration.java | 5 +- .../conf/SilencerCurseAutoConfiguration.java | 27 +++++++ .../wings/silencer/watch/WatchingAround.java | 6 +- ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsSilencerCurseApplication.java | 2 +- .../conf}/ApplicationEventLogger.java | 3 +- .../conf}/SpringOrderConfiguration.java | 2 +- .../bean/SilencerContextHelperTest.java | 2 +- .../test/resources/META-INF/spring.factories | 2 +- .../src/test/resources/application.properties | 1 + .../wings/silencer/spring/WingsOrdered.java} | 15 ++-- .../bean/SilencerMessageConfiguration.java | 6 +- .../bean/SilencerRunnerConfiguration.java | 2 - .../spring/boot/WingsAutoConfiguration.java | 18 ----- .../conf/SilencerAutoConfiguration.java | 31 +++++++ ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../spring-wings-enabled-79.properties | 4 +- .../{ => app}/WingsSilencerApplication.java | 5 +- .../src/test/resources/application.properties | 2 + .../bean/HazelcastCacheConfiguration.java | 7 +- .../bean/HazelcastFlakeIdConfiguration.java | 3 - .../bean/HazelcastLightIdConfiguration.java | 3 - .../bean/HazelcastMockConfiguration.java | 3 - .../bean/HazelcastPublisherConfiguration.java | 3 - .../SlardarHazelCachingAutoConfiguration.java | 28 +++++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsSlardarHazelCachingApplication.java | 2 +- .../bean/HazelcastSessionConfiguration.java | 6 -- .../SlardarHazelSessionAutoConfiguration.java | 18 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsSlardarHazelSessionApplication.java | 2 +- .../conf}/TestSecurityConfiguration.java | 2 +- wings/slardar-sprint/pom.xml | 6 ++ .../bean/SlardarActuatorConfiguration.java | 3 - .../bean/SlardarBootAdminConfiguration.java | 11 ++- .../bean/SlardarSecurityConfiguration.java | 10 +-- .../conf/SlardarSprintAutoConfiguration.java | 23 ++++++ .../conf/WingsSecBeanInitConfigurer.java | 6 +- ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsSlardarSprintApplication.java | 5 +- .../TestSecurityConfiguration.java | 2 +- .../service/TestWingsUserDetailsService.java | 2 +- .../SlardarTestAutoConfiguration.java} | 15 +++- ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../concur/impl/DebounceInterceptor.java | 5 +- .../impl/DoubleKillExceptionResolver.java | 6 +- .../concur/impl/FirstBloodImageHandler.java | 5 +- .../concur/impl/FirstBloodInterceptor.java | 6 +- .../concur/impl/RighterExceptionResolver.java | 6 +- .../concur/impl/RighterInterceptor.java | 6 +- .../slardar/context/TerminalInterceptor.java | 10 ++- .../domainx/WingsDomainExtendFilter.java | 8 +- .../servlet/cookie/WingsCookieFilter.java | 7 +- .../servlet/filter/WingsOverloadFilter.java | 6 +- .../stream/WingsReuseStreamFilter.java | 7 +- .../bean/SlardarCookieConfiguration.java | 5 +- .../bean/SlardarDebounceConfiguration.java | 7 +- .../SlardarDomainExtendConfiguration.java | 5 +- .../SlardarDoubleKillWebConfiguration.java | 11 +-- .../bean/SlardarFirstBloodConfiguration.java | 7 +- .../bean/SlardarJacksonWebConfiguration.java | 10 +-- .../bean/SlardarLocaleConfiguration.java | 5 +- .../bean/SlardarOkhttpWebConfiguration.java | 3 - .../bean/SlardarOverloadConfiguration.java | 9 ++- .../bean/SlardarPageQueryConfiguration.java | 5 +- .../bean/SlardarRemoteConfiguration.java | 5 +- .../bean/SlardarRestreamConfiguration.java | 3 - .../bean/SlardarRighterConfiguration.java | 11 ++- .../bean/SlardarSessionConfiguration.java | 5 +- .../bean/SlardarSwaggerConfiguration.java | 5 +- .../bean/SlardarTerminalConfiguration.java | 5 +- .../bean/SlardarUndertowConfiguration.java | 3 - .../bean/SlardarWebMvcConfiguration.java | 3 - .../conf/SlardarWebmvcAutoConfiguration.java | 54 +++++++++++++ .../webmvc/SlowResponseInterceptor.java | 12 +-- ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsSlardarWebmvcApplication.java | 5 +- .../conf}/LoggingRequestConfiguration.java | 3 +- .../conf/SlardarAutoScanConfiguration.java | 16 ++++ .../SlardarFirstBloodTestConfiguration.java | 9 +-- .../slardar/async/TaskSchedulerHelper.java | 3 +- .../slardar/concur/impl/DoubleKillAround.java | 23 ++---- .../bean/SlardarAsyncConfiguration.java | 24 ++++-- .../bean/SlardarCacheConfiguration.java | 8 +- .../bean/SlardarDateTimeConfiguration.java | 5 +- .../bean/SlardarDingNoticeConfiguration.java | 5 +- .../bean/SlardarDoubleKillConfiguration.java | 3 - .../spring/bean/SlardarI18nConfiguration.java | 6 +- .../bean/SlardarJacksonConfiguration.java | 6 +- .../bean/SlardarMonitorConfiguration.java | 7 +- .../bean/SlardarOkhttpConfiguration.java | 8 +- .../bean/SlardarTweakingConfiguration.java | 3 - .../spring/boot/WingsAutoConfiguration.java | 18 ----- .../spring/conf/SlardarAutoConfiguration.java | 41 ++++++++++ ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../{ => app}/WingsSlardarApplication.java | 4 +- .../slardar/async/TaskSchedulerTest.java | 1 + .../{async => service}/AsyncService.java | 2 +- .../{async => service}/ScheduleService.java | 2 +- .../bean/WarlockAwesomeConfiguration.java | 6 +- .../conf/WarlockAwesomeAutoConfiguration.java | 15 ++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsWarlockAwesomeApplication.java | 2 +- .../auth/impl/DefaultDaoAuthnCombo.java | 7 +- .../bean/WarlockBondBeanConfiguration.java | 7 +- .../conf/WarlockBondAutoConfiguration.java | 15 ++++ .../spring/prop/WarlockDangerProp.java | 0 ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsWarlockBondApplication.java | 2 +- .../WingsWarlockCodegenApplication.java | 2 +- .../errorhandle/DefaultExceptionResolver.java | 3 - .../errorhandle/auto/BindExceptionAdvice.java | 6 +- .../justauth/JustAuthRequestBuilder.java | 7 +- .../loginpage/JustAuthLoginPageCombo.java | 7 +- .../loginpage/ListAllLoginPageCombo.java | 7 +- .../auth/impl/DefaultPermRoleCombo.java | 7 +- .../auth/impl/DefaultUserAuthnAutoReg.java | 7 +- .../auth/impl/DefaultUserDetailsCombo.java | 11 +-- .../auth/impl/MemoryTypedAuthzCombo.java | 7 +- .../bean/WarlockExceptionConfiguration.java | 37 +++++++++ .../bean/WarlockHazelcastConfiguration.java | 3 - .../bean/WarlockJournalConfiguration.java | 3 - .../bean/WarlockJustAuthConfiguration.java | 5 +- .../bean/WarlockOauthTicketConfiguration.java | 5 +- .../bean/WarlockOtherBeanConfiguration.java | 5 +- .../WarlockSecurityBeanConfiguration.java | 16 ++-- .../WarlockSecurityConfConfiguration.java | 14 ++-- .../bean/WarlockWatching2Configuration.java | 3 - .../conf/WarlockShadowAutoConfiguration.java | 39 +++++++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../WingsWarlockShadowApplication.java | 2 +- .../conf/WarlockTestAutoConfiguration.java | 18 +++++ ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../bean/WarlockAutoRunConfiguration.java | 10 +-- .../bean/WarlockLockBeanConfiguration.java | 3 - .../bean/WarlockTableChangeConfiguration.java | 3 - .../bean/WarlockWatchingConfiguration.java | 9 +-- .../spring/boot/WingsAutoConfiguration.java | 18 ----- .../spring/conf/WarlockAutoConfiguration.java | 27 +++++++ ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../{ => app}/WingsWarlockApplication.java | 2 +- 222 files changed, 987 insertions(+), 867 deletions(-) delete mode 100644 radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/boot/WingsAutoConfiguration.java create mode 100644 radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java rename radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/{ => app}/WingsTinyMailApplication.java (90%) rename radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/{mail/spring/bean => app/conf}/StatusHookConfiguration.java (94%) rename radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/{boot/WingsAutoConfiguration.java => conf/TinyTaskAutoConfiguration.java} (50%) rename radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/{ => app}/WingsTinyTaskApplication.java (90%) delete mode 100644 wings/aegis/pom.xml delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingFacelessConst.java delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingSlardarConst.java delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingWarlockConst.java delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedBatriderConst.java delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedFacelessConst.java delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedSilencerConst.java delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedSlardarConst.java delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedWarlockConst.java delete mode 100644 wings/aegis/src/main/java/pro/fessional/wings/spring/consts/WingsBeanNaming.java rename wings/batrider-test/src/test/java/pro/fessional/wings/batrider/{ => app}/WingsBatriderTestApplication.java (61%) delete mode 100644 wings/batrider-test/src/test/resources/wings-conf/spring-datasource-79.properties delete mode 100644 wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/boot/WingsAutoConfiguration.java create mode 100644 wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java rename wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/{ => app}/WingsFacelessAwesomeApplication.java (89%) create mode 100644 wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java create mode 100644 wings/faceless-flywave/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports create mode 100644 wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessFlywaveApplication.java delete mode 100644 wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/WingsFacelessFlywaveApplication.kt create mode 100644 wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java create mode 100644 wings/faceless-jooq/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/WingsFacelessJooqApplication.java (89%) rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{spring/bean => app/conf}/SlowSqlConfiguration.java (94%) rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{spring/bean => app/conf}/TableCudConfiguration.java (89%) create mode 100644 wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessShardAutoConfiguration.java create mode 100644 wings/faceless-shard/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/WingsFacelessShardApplication.java (89%) rename wings/faceless-test/src/main/java/pro/fessional/wings/faceless/{ => helper}/WingsTestHelper.java (99%) create mode 100644 wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java create mode 100644 wings/faceless-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports delete mode 100644 wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/boot/WingsAutoConfiguration.java create mode 100644 wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java rename wings/faceless/src/test/java/pro/fessional/wings/faceless/{ => app}/WingsFacelessApplication.java (89%) create mode 100644 wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java create mode 100644 wings/silencer-curse/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/{ => app}/WingsSilencerCurseApplication.java (92%) rename wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/{spring => app/conf}/ApplicationEventLogger.java (83%) rename wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/{spring/bean => app/conf}/SpringOrderConfiguration.java (98%) rename wings/{aegis/src/main/java/pro/fessional/wings/spring/consts/WingsBeanOrdered.java => silencer/src/main/java/pro/fessional/wings/silencer/spring/WingsOrdered.java} (78%) delete mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfiguration.java create mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java rename wings/silencer/src/test/java/pro/fessional/wings/silencer/{ => app}/WingsSilencerApplication.java (60%) create mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java create mode 100644 wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/{ => app}/WingsSlardarHazelCachingApplication.java (93%) create mode 100644 wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java create mode 100644 wings/slardar-hazel-session/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/{ => app}/WingsSlardarHazelSessionApplication.java (93%) rename wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/{spring/bean => app/conf}/TestSecurityConfiguration.java (98%) create mode 100644 wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java create mode 100644 wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/{ => app}/WingsSlardarSprintApplication.java (80%) rename wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/{spring/bean => webconf}/TestSecurityConfiguration.java (98%) rename wings/slardar-test/src/main/java/pro/fessional/wings/slardar/{security => }/service/TestWingsUserDetailsService.java (97%) rename wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/{bean/TestSecurityBeans.java => conf/SlardarTestAutoConfiguration.java} (57%) create mode 100644 wings/slardar-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports create mode 100644 wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java create mode 100644 wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/WingsSlardarWebmvcApplication.java (72%) rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{spring/bean => app/conf}/LoggingRequestConfiguration.java (96%) create mode 100644 wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarAutoScanConfiguration.java rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{spring/bean => app/conf}/SlardarFirstBloodTestConfiguration.java (91%) delete mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/boot/WingsAutoConfiguration.java create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java rename wings/slardar/src/test/java/pro/fessional/wings/slardar/{ => app}/WingsSlardarApplication.java (78%) rename wings/slardar/src/test/java/pro/fessional/wings/slardar/{async => service}/AsyncService.java (95%) rename wings/slardar/src/test/java/pro/fessional/wings/slardar/{async => service}/ScheduleService.java (91%) create mode 100644 wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java create mode 100644 wings/warlock-awesome/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/{ => app}/WingsWarlockAwesomeApplication.java (90%) create mode 100644 wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java rename wings/{warlock-shadow => warlock-bond}/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockDangerProp.java (100%) create mode 100644 wings/warlock-bond/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/{ => app}/WingsWarlockBondApplication.java (89%) rename wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/{ => app}/WingsWarlockCodegenApplication.java (90%) create mode 100644 wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java create mode 100644 wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java create mode 100644 wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports rename wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/{ => app}/WingsWarlockShadowApplication.java (92%) create mode 100644 wings/warlock-test/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockTestAutoConfiguration.java create mode 100644 wings/warlock-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports delete mode 100644 wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/boot/WingsAutoConfiguration.java create mode 100644 wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java rename wings/warlock/src/test/java/pro/fessional/wings/warlock/{ => app}/WingsWarlockApplication.java (89%) diff --git a/example/winx-front/src/main/resources/application.properties b/example/winx-front/src/main/resources/application.properties index 31562f693..00e776632 100644 --- a/example/winx-front/src/main/resources/application.properties +++ b/example/winx-front/src/main/resources/application.properties @@ -1,2 +1,3 @@ server.port=8094 spring.application.name=winx-front +#spring.index.ignore=true \ No newline at end of file diff --git a/observe/docs b/observe/docs index f87702130..0e7b1770d 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit f8770213052a93012d20d18463841d3d1934c863 +Subproject commit 0e7b1770d87a87643f5ae37eac56f6977ebe3297 diff --git a/pom.xml b/pom.xml index a9a2251bd..b1f2c788b 100644 --- a/pom.xml +++ b/pom.xml @@ -125,11 +125,6 @@ ${mirana.version} - - pro.fessional.wings - aegis - ${wings.version} - pro.fessional.wings silencer @@ -583,7 +578,11 @@ spring-boot-autoconfigure-processor ${spring-boot.version} - + + org.springframework + spring-context-indexer + ${spring-framework.version} + diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java index 4849a64dc..252f54bb2 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java @@ -3,23 +3,23 @@ import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.web.bind.annotation.RestController; -import pro.fessional.wings.spring.consts.WingsBeanOrdered; import pro.fessional.wings.tiny.mail.sender.MailConfigProvider; import pro.fessional.wings.tiny.mail.sender.MailNotice; import pro.fessional.wings.tiny.mail.sender.MailSenderManager; import pro.fessional.wings.tiny.mail.sender.MailSenderProvider; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailConfigProp; +import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailSenderProp; +import pro.fessional.wings.tiny.mail.spring.prop.TinyMailServiceProp; +import pro.fessional.wings.tiny.mail.spring.prop.TinyMailUrlmapProp; /** * @author trydofor @@ -27,11 +27,18 @@ */ @Configuration(proxyBeanMethods = false) -@ComponentScan({"pro.fessional.wings.tiny.mail.database", - "pro.fessional.wings.tiny.mail.service"}) -@AutoConfigureAfter(MailSenderAutoConfiguration.class) +@EnableConfigurationProperties({ + TinyMailConfigProp.class, + TinyMailEnabledProp.class, + TinyMailSenderProp.class, + TinyMailServiceProp.class, + TinyMailUrlmapProp.class, +}) +@ComponentScan({ + "pro.fessional.wings.tiny.mail.database", + "pro.fessional.wings.tiny.mail.service" +}) @RequiredArgsConstructor -@AutoConfigureOrder(WingsBeanOrdered.Lv3Service) public class TinyMailConfiguration { private static final Log log = LogFactory.getLog(TinyMailConfiguration.class); diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/boot/WingsAutoConfiguration.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/boot/WingsAutoConfiguration.java deleted file mode 100644 index 6dd073078..000000000 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/boot/WingsAutoConfiguration.java +++ /dev/null @@ -1,18 +0,0 @@ -package pro.fessional.wings.tiny.mail.spring.boot; - -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationPropertiesScan; -import org.springframework.context.annotation.ComponentScan; -import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp; - -/** - * @author trydofor - * @since 2019-07-11 - */ -@ComponentScan("pro.fessional.wings.tiny.mail.spring.bean") -@ConfigurationPropertiesScan("pro.fessional.wings.tiny.mail.spring.prop") -@AutoConfiguration -@ConditionalOnProperty(name = TinyMailEnabledProp.Key$autoconf, havingValue = "true") -public class WingsAutoConfiguration { -} diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java new file mode 100644 index 000000000..2e1b6eadb --- /dev/null +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java @@ -0,0 +1,18 @@ +package pro.fessional.wings.tiny.mail.spring.conf; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration; +import pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration; +import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp; + +/** + * @author trydofor + * @since 2019-07-11 + */ +@AutoConfiguration(after = MailSenderAutoConfiguration.class) +@ConditionalOnProperty(name = TinyMailEnabledProp.Key$autoconf, havingValue = "true") +@ImportAutoConfiguration(TinyMailConfiguration.class) +public class TinyMailAutoConfiguration { +} diff --git a/radiant/tiny-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/radiant/tiny-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 37c20aeb8..25b15d7a2 100644 --- a/radiant/tiny-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/radiant/tiny-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1 @@ -pro.fessional.wings.tiny.mail.spring.boot.WingsAutoConfiguration +pro.fessional.wings.tiny.mail.spring.conf.TinyMailAutoConfiguration diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/WingsTinyMailApplication.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/WingsTinyMailApplication.java similarity index 90% rename from radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/WingsTinyMailApplication.java rename to radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/WingsTinyMailApplication.java index 54303fcb5..b47961e1a 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/WingsTinyMailApplication.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/WingsTinyMailApplication.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.tiny; +package pro.fessional.wings.tiny.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/spring/bean/StatusHookConfiguration.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/conf/StatusHookConfiguration.java similarity index 94% rename from radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/spring/bean/StatusHookConfiguration.java rename to radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/conf/StatusHookConfiguration.java index 87f77abc7..efc43b30a 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/spring/bean/StatusHookConfiguration.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/conf/StatusHookConfiguration.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.tiny.mail.spring.bean; +package pro.fessional.wings.tiny.app.conf; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java index 90024e451..f3fcc186c 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java @@ -4,19 +4,21 @@ import org.apache.commons.logging.LogFactory; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.bind.annotation.RestController; import pro.fessional.wings.silencer.runner.ApplicationReadyEventRunner; -import pro.fessional.wings.spring.consts.WingsBeanOrdered; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.tiny.task.schedule.TinyTasker; import pro.fessional.wings.tiny.task.service.TinyTaskService; +import pro.fessional.wings.tiny.task.spring.prop.TinyTaskDefineProp; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; +import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp; import java.util.Map; @@ -28,7 +30,11 @@ @Configuration(proxyBeanMethods = false) @ComponentScan({"pro.fessional.wings.tiny.task.database", "pro.fessional.wings.tiny.task.service"}) -@AutoConfigureOrder(WingsBeanOrdered.Lv4Application) +@EnableConfigurationProperties({ + TinyTaskDefineProp.class, + TinyTaskEnabledProp.class, + TinyTaskUrlmapProp.class +}) public class TinyTaskConfiguration { private static final Log log = LogFactory.getLog(TinyTaskConfiguration.class); @@ -37,7 +43,7 @@ public class TinyTaskConfiguration { @ConditionalOnProperty(name = TinyTaskEnabledProp.Key$autorun, havingValue = "true") public ApplicationReadyEventRunner runnerTinyTaskerAuto(@NotNull ApplicationContext context, ObjectProvider tinyTaskService) { log.info("TinyTask spring-runs runnerTinyTaskerAuto"); - return new ApplicationReadyEventRunner(WingsBeanOrdered.Lv3Service, ignored -> { + return new ApplicationReadyEventRunner(WingsOrdered.Lv3Service, ignored -> { final TinyTaskService service = tinyTaskService.getIfAvailable(); if (service == null) { log.warn("tinyTaskService is null, skip TinyTasker.Auto config "); diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/boot/WingsAutoConfiguration.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java similarity index 50% rename from radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/boot/WingsAutoConfiguration.java rename to radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java index c61a42fcb..e1a8a2461 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/boot/WingsAutoConfiguration.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java @@ -1,18 +1,17 @@ -package pro.fessional.wings.tiny.task.spring.boot; +package pro.fessional.wings.tiny.task.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationPropertiesScan; -import org.springframework.context.annotation.ComponentScan; +import pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; /** * @author trydofor * @since 2019-07-11 */ -@ComponentScan("pro.fessional.wings.tiny.task.spring.bean") -@ConfigurationPropertiesScan("pro.fessional.wings.tiny.task.spring.prop") @AutoConfiguration @ConditionalOnProperty(name = TinyTaskEnabledProp.Key$autoconf, havingValue = "true") -public class WingsAutoConfiguration { +@ImportAutoConfiguration(TinyTaskConfiguration.class) +public class TinyTaskAutoConfiguration { } diff --git a/radiant/tiny-task/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/radiant/tiny-task/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index ca4c2febc..24a74b2e6 100644 --- a/radiant/tiny-task/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/radiant/tiny-task/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1 @@ -pro.fessional.wings.tiny.task.spring.boot.WingsAutoConfiguration +pro.fessional.wings.tiny.task.spring.conf.TinyTaskAutoConfiguration diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/WingsTinyTaskApplication.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/WingsTinyTaskApplication.java similarity index 90% rename from radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/WingsTinyTaskApplication.java rename to radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/WingsTinyTaskApplication.java index 9555a54a9..645b98c92 100644 --- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/WingsTinyTaskApplication.java +++ b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/WingsTinyTaskApplication.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.tiny; +package pro.fessional.wings.tiny.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/wings/aegis/pom.xml b/wings/aegis/pom.xml deleted file mode 100644 index 58d577a00..000000000 --- a/wings/aegis/pom.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - 4.0.0 - - - pro.fessional - wings - ${revision}.${changelist} - - - pro.fessional.wings - aegis - jar - - Wings::Aegis - Aegis of the Immortal: common shared simple contracts - diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingFacelessConst.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingFacelessConst.java deleted file mode 100644 index 812753055..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingFacelessConst.java +++ /dev/null @@ -1,10 +0,0 @@ -package pro.fessional.wings.spring.consts; - - -/** - * @author trydofor - * @since 2022-12-05 - */ -public interface NamingFacelessConst extends WingsBeanNaming { - String jooqWingsConfigCustomizer = "jooqWingsConfigCustomizer"; -} diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingSlardarConst.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingSlardarConst.java deleted file mode 100644 index 54f9c7ffa..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingSlardarConst.java +++ /dev/null @@ -1,13 +0,0 @@ -package pro.fessional.wings.spring.consts; - - -/** - * @author trydofor - * @since 2022-12-05 - */ -public interface NamingSlardarConst extends WingsBeanNaming { - String slardarEventExecutor = "slardarEventExecutor"; - String slardarHeavyScheduler = "slardarHeavyScheduler"; - String doubleKillExceptionResolver = "doubleKillExceptionResolver"; - String righterExceptionResolver = "righterExceptionResolver"; -} diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingWarlockConst.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingWarlockConst.java deleted file mode 100644 index 3ba80697f..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/NamingWarlockConst.java +++ /dev/null @@ -1,12 +0,0 @@ -package pro.fessional.wings.spring.consts; - - -/** - * @author trydofor - * @since 2022-12-05 - */ -public interface NamingWarlockConst extends WingsBeanNaming { - String slowSqlJooqListener = "slowSqlJooqListener"; - String codeExceptionResolver = "codeExceptionResolver"; - String defaultExceptionResolver = "defaultExceptionResolver"; -} diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedBatriderConst.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedBatriderConst.java deleted file mode 100644 index c15c30285..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedBatriderConst.java +++ /dev/null @@ -1,10 +0,0 @@ -package pro.fessional.wings.spring.consts; - -/** - * @author trydofor - * @since 2023-01-19 - */ -public interface OrderedBatriderConst extends WingsBeanOrdered { - - int ServcombBaseline = Lv4Application + PriorityD; -} diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedFacelessConst.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedFacelessConst.java deleted file mode 100644 index f35b459bb..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedFacelessConst.java +++ /dev/null @@ -1,25 +0,0 @@ -package pro.fessional.wings.spring.consts; - -/** - * @author trydofor - * @since 2023-01-09 - */ -public interface OrderedFacelessConst extends WingsBeanOrdered { - - // ///////// Configuration ///////// - int DataSourceConfiguration = Lv2Resource + PriorityA; - int ShardingsphereConfiguration = Lv2Resource + PriorityA; - int EnumI18nConfiguration = Lv2Resource + PriorityD; - int JournalConfiguration = Lv2Resource + PriorityD; - int LightIdConfiguration = Lv2Resource + PriorityD; - int FlakeIdConfiguration = Lv2Resource + PriorityD; - int FlywaveConfiguration = Lv2Resource + PriorityD; - int JooqConfiguration = Lv2Resource + PriorityD; - - // ///////// Override ///////// - - // ///////// Beans ///////// - int JooqQualifyListener = Lv2Resource + 1_000; - int JooqTableCudListener = Lv2Resource + 2_000; - int RunnerRevisionChecker = Lv2Resource + 3_000; -} diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedSilencerConst.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedSilencerConst.java deleted file mode 100644 index bdafbba83..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedSilencerConst.java +++ /dev/null @@ -1,16 +0,0 @@ -package pro.fessional.wings.spring.consts; - -/** - * @author trydofor - * @since 2023-01-19 - */ -public interface OrderedSilencerConst extends WingsBeanOrdered { - - int AutoLogConfiguration = Lv2Resource; - int EncryptConfiguration = Lv2Resource + 10; - int InspectConfiguration = Lv5Supervisor; - int RuntimeConfiguration = Lv1Config; - int TweakConfiguration = Lv5Supervisor; - // - int RunnerInspectCommandLine = Lv5Supervisor + PriorityD; -} diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedSlardarConst.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedSlardarConst.java deleted file mode 100644 index 771dae1ed..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedSlardarConst.java +++ /dev/null @@ -1,80 +0,0 @@ -package pro.fessional.wings.spring.consts; - -/** - * @author trydofor - * @since 2022-09-03 - */ -public interface OrderedSlardarConst extends WingsBeanOrdered { - - // ///////// Configuration ///////// - int AsyncConfiguration = Lv2Resource + PriorityD; - int CacheConfiguration = Lv2Resource + PriorityD; - int DateTimeConfiguration = Lv1Config + PriorityD; - int DingNoticeConfiguration = Lv3Service + PriorityD; - int DoubleKillConfiguration = Lv2Resource + PriorityD; - int I18nConfiguration = Lv2Resource + PriorityD; - int JacksonConfiguration = Lv2Resource + PriorityD; - int MonitorConfiguration = Lv5Supervisor + PriorityD; - int OkhttpConfiguration = Lv2Resource + PriorityD; - int TweakingConfiguration = Lv2Resource + PriorityD; - int ActuatorConfiguration = Lv5Supervisor + PriorityD; - int BootAdminConfiguration = Lv5Supervisor + PriorityD; - int SecurityConfiguration = Lv2Resource + PriorityD; - int CookieConfiguration = Lv3Service + PriorityD; - int DebounceConfiguration = Lv3Service + PriorityD; - int DomainExtendConfiguration = Lv3Service + PriorityD; - int DoubleKillWebConfiguration = Lv3Service + PriorityD; - int FirstBloodConfiguration = Lv3Service + PriorityD; - int JacksonWebConfiguration = Lv3Service + PriorityD; - int LocaleConfiguration = Lv2Resource + PriorityD; - int OkhttpWebConfiguration = Lv3Service + PriorityD; - int OverloadConfiguration = Lv4Application + PriorityD; - int PageQueryConfiguration = Lv4Application + PriorityD; - int RemoteConfiguration = Lv2Resource + PriorityD; - int RestreamConfiguration = Lv2Resource + PriorityD; - int RighterConfiguration = Lv4Application + PriorityD; - int SessionConfiguration = Lv2Resource + PriorityD; - int SwaggerConfiguration = Lv4Application + PriorityD; - int TerminalConfiguration = Lv3Service + PriorityD; - int UndertowConfiguration = Lv2Resource + PriorityD; - int WebMvcConfiguration = Lv2Resource + PriorityD; - - int HazelcastCacheConfiguration = CacheConfiguration; - int HazelcastMockConfiguration = Lv2Resource + PriorityD; - int HazelcastPublisherConfiguration = Lv2Resource + PriorityD; - - int CachingConfigurerSupport = CacheConfiguration + 1_000; - - // ///////// Override ///////// - int HazelcastFlakeIdConfiguration = OrderedFacelessConst.FlakeIdConfiguration - 100; - - // ///////// Beans ///////// - - int WebFilterReStream = Lv4Application + 1_000; - int WebFilterReCookie = Lv4Application + 2_000; - int WebFilterDomainEx = Lv4Application + 3_000; - int WebFilterOverload = Lv4Application + 4_000; - - int MvcRighterInterceptor = Lv4Application + 1_000; - int MvcDebounceInterceptor = Lv4Application + 2_000; - int MvcFirstBloodInterceptor = Lv4Application + 3_000; - int MvcFirstBloodImageHandler = Lv4Application + 3_100; - int MvcTerminalInterceptor = Lv4Application + 5_000; - int MvcSlowResponseInterceptor = Lv5Supervisor + 1_000; - - int AopDoubleKillAround = Lv3Service; - - int WebMessageExceptionResolver = Lv4Application + 7_000; - int WebDoubleKillExceptionResolver = WebMessageExceptionResolver + 100; - int WebRighterExceptionResolver = WebMessageExceptionResolver + 200; - int WebSimpleExceptionResolver = Lv4Application + 8_000; - - int CnfSecurityBeanInitConfigurer = Lv1Config; - int AppSafelyShutdownListener = Lv4Application; - - int RunnerTerminalContextListener = Lv4Application; - int RunnerEventPublishHelper = Lv4Application + 1_000; - int RunnerJacksonHelper = Lv4Application + 1_010; - int RunnerAutoDtoHelper = Lv4Application + 1_020; - int RunnerOkHttpHelper = Lv4Application + 1_030; -} diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedWarlockConst.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedWarlockConst.java deleted file mode 100644 index 7ff12b171..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/OrderedWarlockConst.java +++ /dev/null @@ -1,62 +0,0 @@ -package pro.fessional.wings.spring.consts; - -import static pro.fessional.wings.spring.consts.OrderedSlardarConst.WebSimpleExceptionResolver; - -/** - * @author trydofor - * @since 2021-02-19 - */ -public interface OrderedWarlockConst extends WingsBeanOrdered { - - // ///////// Configuration ///////// - int AutoRunConfiguration = Lv4Application + PriorityD; - int AwesomeConfiguration = Lv3Service + PriorityD; - int LockBeanConfiguration = Lv4Application + PriorityD; - int TableChangeConfiguration = Lv4Application + PriorityD; - int WatchingConfiguration = Lv4Application + PriorityD; - int BondBeanConfiguration = Lv4Application + PriorityD; - int JustAuthConfiguration = Lv4Application + PriorityD; - int UnionAuthConfiguration = Lv4Application + PriorityD; - int OauthTicketConfiguration = Lv4Application + PriorityD; - int OtherBeanConfiguration = Lv4Application + PriorityD; - int HazelcastConfiguration = Lv4Application + PriorityD; - int SecurityBeanConfiguration = Lv4Application + PriorityD + 100; - int SecurityConfConfiguration = Lv4Application + PriorityD + 200; - int Watching2Configuration = Lv4Application + PriorityD; - - // ///////// Override ///////// - int TerminalJournalConfiguration = OrderedFacelessConst.JournalConfiguration - 100; - - // ///////// Beans ///////// - int SecJustAuthRequestBuilder = Lv4Application; - int SecJustAuthLoginPageCombo = Lv4Application; - int SecListAllLoginPageCombo = Lv4Application + 100; - - int MemoryUserDetailsCombo = Lv3Service + 100; - int NonceUserDetailsCombo = Lv3Service + 200; - int JustAuthUserDetailsCombo = Lv3Service + 300; - int DefaultUserDetailsCombo = Lv3Service + 900; - - int DefaultPermRoleCombo = Lv3Service; - int MemoryTypedAuthzCombo = Lv3Service + 100; - - int JustAuthUserAuthnAutoReg = Lv3Service; - int DefaultUserAuthnAutoReg = Lv3Service + 10; - - int DefaultDaoAuthnCombo = Lv4Application; - - int SecurityHttpBase = Lv4Application + 100; - int SecurityBindHttp = Lv4Application + 200; - int SecurityAuthHttp = Lv4Application + 300; - int SecurityAutoHttp = Lv4Application + 400; - int SecurityFilterChain = Lv4Application + 900; - - int DefaultExceptionResolver = WebSimpleExceptionResolver + 900; - - int BindExceptionAdvice = Lv4Application; - - int RunnerDatabaseChecker = Lv2Resource; - int RunnerRegisterRuntimeMode = Lv3Service; - int RunnerRegisterCacheConst = Lv3Service; - int RunnerRegisterEnumUtil = Lv4Application; -} diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/WingsBeanNaming.java b/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/WingsBeanNaming.java deleted file mode 100644 index f10584736..000000000 --- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/WingsBeanNaming.java +++ /dev/null @@ -1,8 +0,0 @@ -package pro.fessional.wings.spring.consts; - -/** - * @author trydofor - * @since 2022-12-05 - */ -public interface WingsBeanNaming { -} diff --git a/wings/batrider-test/pom.xml b/wings/batrider-test/pom.xml index 7b5e0e450..310cde480 100644 --- a/wings/batrider-test/pom.xml +++ b/wings/batrider-test/pom.xml @@ -27,5 +27,10 @@ slardar-webmvc test + + pro.fessional.wings + testing-database + test + diff --git a/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/WingsBatriderTestApplication.java b/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/WingsBatriderTestApplication.java similarity index 61% rename from wings/batrider-test/src/test/java/pro/fessional/wings/batrider/WingsBatriderTestApplication.java rename to wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/WingsBatriderTestApplication.java index 5bd8f0433..343d844bd 100644 --- a/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/WingsBatriderTestApplication.java +++ b/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/WingsBatriderTestApplication.java @@ -1,13 +1,18 @@ -package pro.fessional.wings.batrider; +package pro.fessional.wings.batrider.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; /** * @author trydofor * @since 2019-06-25 */ @SpringBootApplication +@ComponentScan({ + "pro.fessional.wings.batrider.controller", + "pro.fessional.wings.batrider.contractor" +}) public class WingsBatriderTestApplication { public static void main(String[] args) { SpringApplication.run(WingsBatriderTestApplication.class, args); diff --git a/wings/batrider-test/src/test/resources/wings-conf/spring-datasource-79.properties b/wings/batrider-test/src/test/resources/wings-conf/spring-datasource-79.properties deleted file mode 100644 index 247f937a6..000000000 --- a/wings/batrider-test/src/test/resources/wings-conf/spring-datasource-79.properties +++ /dev/null @@ -1,4 +0,0 @@ -spring.datasource.url=jdbc:h2:mem:wings-batrider\ -;USER=${spring.datasource.username};PASSWORD=${spring.datasource.password}\ -;MODE=MySQL;CASE_INSENSITIVE_IDENTIFIERS=TRUE;IGNORECASE=TRUE\ -;AUTO_RECONNECT=TRUE;AUTO_SERVER=TRUE diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java index d6ac06586..d9f4ece67 100644 --- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java +++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java @@ -1,9 +1,9 @@ package pro.fessional.wings.batrider.spring.bean; import org.apache.servicecomb.springboot2.starter.EnableServiceComb; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.spring.consts.OrderedBatriderConst; +import pro.fessional.wings.batrider.spring.prop.BatriderHandlerProp; /** * @author trydofor @@ -11,6 +11,6 @@ */ @Configuration @EnableServiceComb -@AutoConfigureOrder(OrderedBatriderConst.ServcombBaseline) +@EnableConfigurationProperties(BatriderHandlerProp.class) public class BatriderServcombConfiguration { } diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/boot/WingsAutoConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/boot/WingsAutoConfiguration.java deleted file mode 100644 index fec36a4c9..000000000 --- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/boot/WingsAutoConfiguration.java +++ /dev/null @@ -1,18 +0,0 @@ -package pro.fessional.wings.batrider.spring.boot; - -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.ConfigurationPropertiesScan; -import org.springframework.context.annotation.ComponentScan; -import pro.fessional.wings.batrider.spring.prop.BatriderEnabledProp; - -/** - * @author trydofor - * @since 2019-07-11 - */ -@ComponentScan("pro.fessional.wings.batrider.spring.bean") -@ConfigurationPropertiesScan("pro.fessional.wings.batrider.spring.prop") -@AutoConfiguration -@ConditionalOnProperty(name = BatriderEnabledProp.Key$autoconf, havingValue = "true") -public class WingsAutoConfiguration { -} diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java new file mode 100644 index 000000000..590305bea --- /dev/null +++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java @@ -0,0 +1,19 @@ +package pro.fessional.wings.batrider.spring.conf; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import pro.fessional.wings.batrider.spring.bean.BatriderServcombConfiguration; +import pro.fessional.wings.batrider.spring.prop.BatriderEnabledProp; + +/** + * @author trydofor + * @since 2019-07-11 + */ +@AutoConfiguration +@ConditionalOnProperty(name = BatriderEnabledProp.Key$autoconf, havingValue = "true") +@ImportAutoConfiguration(BatriderServcombConfiguration.class) +@EnableConfigurationProperties(BatriderEnabledProp.class) +public class BatriderAutoConfiguration { +} diff --git a/wings/batrider/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/batrider/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index df6c35fac..e76ca7eaf 100644 --- a/wings/batrider/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/batrider/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1 @@ -pro.fessional.wings.batrider.spring.boot.WingsAutoConfiguration +pro.fessional.wings.batrider.spring.conf.BatriderAutoConfiguration diff --git a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/WingsFacelessAwesomeApplication.java b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessAwesomeApplication.java similarity index 89% rename from wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/WingsFacelessAwesomeApplication.java rename to wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessAwesomeApplication.java index 095035957..59cdddc24 100644 --- a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/WingsFacelessAwesomeApplication.java +++ b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessAwesomeApplication.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.faceless; +package pro.fessional.wings.faceless.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java index 348a9a90a..26415ce19 100644 --- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java +++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java @@ -3,11 +3,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.config.ConfigurableBeanFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Scope; import pro.fessional.wings.faceless.database.DataSourceContext; import pro.fessional.wings.faceless.flywave.RevisionFitness; @@ -25,7 +26,7 @@ import pro.fessional.wings.faceless.spring.prop.FlywaveSqlProp; import pro.fessional.wings.faceless.spring.prop.FlywaveVerProp; import pro.fessional.wings.silencer.runner.ApplicationRunnerOrdered; -import pro.fessional.wings.spring.consts.OrderedFacelessConst; +import pro.fessional.wings.silencer.spring.WingsOrdered; import java.util.TreeSet; @@ -38,7 +39,8 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(name = "pro.fessional.wings.faceless.database.DataSourceContext") @ConditionalOnProperty(name = FlywaveEnabledProp.Key$module, havingValue = "true") -@AutoConfigureOrder(OrderedFacelessConst.FlywaveConfiguration) +@EnableConfigurationProperties({FlywaveFitProp.class, FlywaveSqlProp.class, FlywaveVerProp.class}) +@Import(FacelessDataSourceConfiguration.class) public class WingsFlywaveConfiguration { private static final Log log = LogFactory.getLog(WingsFlywaveConfiguration.class); @@ -153,7 +155,7 @@ public SchemaDefinitionLoader schemaDefinitionLoader(FlywaveSqlProp conf) { @ConditionalOnProperty(name = FlywaveEnabledProp.Key$checker, havingValue = "true") public ApplicationRunnerOrdered runnerRevisionChecker(DefaultRevisionManager manager, FlywaveFitProp prop) { log.info("FacelessFlywave spring-runs runnerRevisionChecker"); - return new ApplicationRunnerOrdered(OrderedFacelessConst.RunnerRevisionChecker, ignored -> { + return new ApplicationRunnerOrdered(WingsOrdered.Lv5Supervisor, ignored -> { log.info("FacelessFlywave check RevisionFitness"); final RevisionFitness fits = new RevisionFitness(); fits.addFits(prop.getFit()); diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java new file mode 100644 index 000000000..0f3025a0a --- /dev/null +++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java @@ -0,0 +1,21 @@ +package pro.fessional.wings.faceless.spring.conf; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import pro.fessional.wings.faceless.spring.bean.WingsFlywaveConfiguration; +import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; +import pro.fessional.wings.faceless.spring.prop.FlywaveEnabledProp; + +/** + * @author trydofor + * @since 2019-06-01 + */ + +@AutoConfiguration +@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true") +@EnableConfigurationProperties(FlywaveEnabledProp.class) +@ImportAutoConfiguration(WingsFlywaveConfiguration.class) +public class FlywaveAutoConfiguration { +} diff --git a/wings/faceless-flywave/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/faceless-flywave/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 000000000..5ba293593 --- /dev/null +++ b/wings/faceless-flywave/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessFlywaveApplication.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessFlywaveApplication.java new file mode 100644 index 000000000..0d71d72f8 --- /dev/null +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessFlywaveApplication.java @@ -0,0 +1,15 @@ +package pro.fessional.wings.faceless.app; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * @author trydofor + * @since 2019-06-25 + */ +@SpringBootApplication +public class WingsFacelessFlywaveApplication { + public static void main(String[] args) { + SpringApplication.run(WingsFacelessFlywaveApplication.class, args); + } +} diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsInitDatabaseSample.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsInitDatabaseSample.java index 74e4ec982..5e995f364 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsInitDatabaseSample.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsInitDatabaseSample.java @@ -9,7 +9,7 @@ import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.flywave.WingsRevision; -import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1; import static pro.fessional.wings.faceless.util.FlywaveRevisionScanner.REVISION_PATH_MASTER; import static pro.fessional.wings.faceless.util.FlywaveRevisionScanner.scan; diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaGenerator.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaGenerator.java index f258e538d..2fbbc46fe 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaGenerator.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaGenerator.java @@ -5,9 +5,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import pro.fessional.wings.faceless.WingsTestHelper; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.flywave.WingsRevision; +import pro.fessional.wings.faceless.helper.WingsTestHelper; import pro.fessional.wings.faceless.util.FlywaveRevisionScanner; import java.util.SortedMap; diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/WingsFacelessFlywaveApplication.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/WingsFacelessFlywaveApplication.kt deleted file mode 100644 index 671ddd3bd..000000000 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/WingsFacelessFlywaveApplication.kt +++ /dev/null @@ -1,15 +0,0 @@ -package pro.fessional.wings.faceless - -import org.springframework.boot.SpringApplication -import org.springframework.boot.autoconfigure.SpringBootApplication - -/** - * @author trydofor - * @since 2019-06-25 - */ -@SpringBootApplication -open class WingsFacelessFlywaveApplication - -fun main(args: Array) { - SpringApplication.run(WingsFacelessFlywaveApplication::class.java, *args) -} diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaFulldumpManagerTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaFulldumpManagerTest.kt index e4326d742..fb3f2806d 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaFulldumpManagerTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaFulldumpManagerTest.kt @@ -6,10 +6,10 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestMethodOrder import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest -import pro.fessional.wings.faceless.WingsTestHelper -import pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice import pro.fessional.wings.faceless.flywave.SchemaFulldumpManager.Companion.groupedRegexp import pro.fessional.wings.faceless.flywave.SchemaFulldumpManager.Companion.groupedTable +import pro.fessional.wings.faceless.helper.WingsTestHelper +import pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice import pro.fessional.wings.faceless.util.FlywaveRevisionScanner import java.io.File import javax.sql.DataSource diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt index f7a7331be..6d3b9f99b 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt @@ -9,13 +9,13 @@ import org.junit.jupiter.api.TestMethodOrder import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.jdbc.core.JdbcTemplate -import pro.fessional.wings.faceless.WingsTestHelper -import pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1 -import pro.fessional.wings.faceless.WingsTestHelper.breakpointDebug -import pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice import pro.fessional.wings.faceless.flywave.SchemaJournalManagerTest.Companion.HEAD import pro.fessional.wings.faceless.flywave.SchemaJournalManagerTest.Companion.TAIL import pro.fessional.wings.faceless.flywave.SchemaJournalManagerTest.Companion.TFMT +import pro.fessional.wings.faceless.helper.WingsTestHelper +import pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1 +import pro.fessional.wings.faceless.helper.WingsTestHelper.breakpointDebug +import pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice import pro.fessional.wings.faceless.util.FlywaveRevisionScanner /** diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt index c679c8d4a..473038a28 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt @@ -6,9 +6,9 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestMethodOrder import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest -import pro.fessional.wings.faceless.WingsTestHelper -import pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1 -import pro.fessional.wings.faceless.WingsTestHelper.breakpointDebug +import pro.fessional.wings.faceless.helper.WingsTestHelper +import pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1 +import pro.fessional.wings.faceless.helper.WingsTestHelper.breakpointDebug import pro.fessional.wings.faceless.util.FlywaveRevisionScanner /** diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveInitDatabaseSample.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveInitDatabaseSample.kt index 0f463ca64..edab8d960 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveInitDatabaseSample.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveInitDatabaseSample.kt @@ -4,9 +4,9 @@ import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest -import pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1 import pro.fessional.wings.faceless.flywave.SchemaRevisionManager import pro.fessional.wings.faceless.flywave.WingsRevision +import pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1 import pro.fessional.wings.faceless.util.FlywaveRevisionScanner /** diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveShardJournalSample.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveShardJournalSample.kt index 31999b3b3..16b371d52 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveShardJournalSample.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveShardJournalSample.kt @@ -4,12 +4,12 @@ import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest -import pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1 -import pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V2 import pro.fessional.wings.faceless.flywave.SchemaJournalManager import pro.fessional.wings.faceless.flywave.SchemaRevisionManager import pro.fessional.wings.faceless.flywave.SchemaShardingManager import pro.fessional.wings.faceless.flywave.WingsRevision +import pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1 +import pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V2 import pro.fessional.wings.faceless.util.FlywaveRevisionScanner /** diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt index 667e6cd8c..eaa494c73 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt @@ -9,9 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.jdbc.core.JdbcTemplate import pro.fessional.mirana.id.LightIdBufferedProvider -import pro.fessional.wings.faceless.WingsTestHelper import pro.fessional.wings.faceless.flywave.SchemaRevisionManager import pro.fessional.wings.faceless.flywave.WingsRevision +import pro.fessional.wings.faceless.helper.WingsTestHelper import pro.fessional.wings.faceless.service.journal.JournalService import pro.fessional.wings.faceless.service.lightid.LightIdService import pro.fessional.wings.faceless.util.FlywaveRevisionScanner diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java index 3a08b0bda..d39dcc283 100644 --- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java @@ -11,15 +11,14 @@ import org.jooq.impl.DefaultVisitListenerProvider; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.jooq.DefaultConfigurationCustomizer; import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.core.annotation.Order; import pro.fessional.wings.faceless.database.WingsTableCudHandler; import pro.fessional.wings.faceless.database.jooq.WingsJooqEnv; import pro.fessional.wings.faceless.database.jooq.converter.JooqConverterDelegate; @@ -29,13 +28,10 @@ import pro.fessional.wings.faceless.database.jooq.listener.TableCudListener; import pro.fessional.wings.faceless.spring.prop.FacelessJooqCudProp; import pro.fessional.wings.faceless.spring.prop.FacelessJooqEnabledProp; -import pro.fessional.wings.spring.consts.OrderedFacelessConst; import java.util.List; import java.util.stream.Collectors; -import static pro.fessional.wings.spring.consts.NamingFacelessConst.jooqWingsConfigCustomizer; - /** * @author trydofor * @see JooqAutoConfiguration @@ -44,9 +40,10 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = FacelessJooqEnabledProp.Key$module, havingValue = "true") @ConditionalOnClass(name = "org.jooq.conf.Settings") -@AutoConfigureOrder(OrderedFacelessConst.JooqConfiguration) +@EnableConfigurationProperties({FacelessJooqEnabledProp.class, FacelessJooqCudProp.class}) public class FacelessJooqConfiguration { + public static final String jooqWingsConfigCustomizer = "jooqWingsConfigCustomizer"; private static final Log log = LogFactory.getLog(FacelessJooqConfiguration.class); /** @@ -60,7 +57,6 @@ public class FacelessJooqConfiguration { */ @Bean @ConditionalOnProperty(name = FacelessJooqEnabledProp.Key$autoQualify, havingValue = "true") - @Order(OrderedFacelessConst.JooqQualifyListener) public VisitListenerProvider jooqAutoQualifyFieldListener() { log.info("FacelessJooq spring-bean jooqAutoQualifyFieldListener"); return new DefaultVisitListenerProvider(new AutoQualifyFieldListener()); @@ -68,7 +64,6 @@ public VisitListenerProvider jooqAutoQualifyFieldListener() { @Bean @ConditionalOnProperty(name = FacelessJooqEnabledProp.Key$listenTableCud, havingValue = "true") - @Order(OrderedFacelessConst.JooqTableCudListener) public VisitListenerProvider jooqTableCudListener(FacelessJooqCudProp prop, List handlers) { final TableCudListener listener = new TableCudListener(); diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java new file mode 100644 index 000000000..985cfddeb --- /dev/null +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java @@ -0,0 +1,22 @@ +package pro.fessional.wings.faceless.spring.conf; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import pro.fessional.wings.faceless.spring.bean.FacelessJooqConfiguration; +import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; +import pro.fessional.wings.faceless.spring.prop.FacelessJooqEnabledProp; + +/** + * @author trydofor + * @since 2019-06-01 + */ + +@AutoConfiguration(after = JooqAutoConfiguration.class) +@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true") +@EnableConfigurationProperties(FacelessJooqEnabledProp.class) +@ImportAutoConfiguration(FacelessJooqConfiguration.class) +public class FacelessJooqAutoConfiguration { +} diff --git a/wings/faceless-jooq/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/faceless-jooq/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 000000000..da2bd016d --- /dev/null +++ b/wings/faceless-jooq/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +pro.fessional.wings.faceless.spring.conf.FacelessJooqAutoConfiguration diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/WingsFacelessJooqApplication.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessJooqApplication.java similarity index 89% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/WingsFacelessJooqApplication.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessJooqApplication.java index f9289cf7f..29e68583f 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/WingsFacelessJooqApplication.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessJooqApplication.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.faceless; +package pro.fessional.wings.faceless.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/spring/bean/SlowSqlConfiguration.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/SlowSqlConfiguration.java similarity index 94% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/spring/bean/SlowSqlConfiguration.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/SlowSqlConfiguration.java index f61d6dfbb..6e608aa90 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/spring/bean/SlowSqlConfiguration.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/SlowSqlConfiguration.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.faceless.spring.bean; +package pro.fessional.wings.faceless.app.conf; import org.jooq.ExecuteListenerProvider; import org.jooq.impl.DefaultExecuteListenerProvider; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/spring/bean/TableCudConfiguration.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/TableCudConfiguration.java similarity index 89% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/spring/bean/TableCudConfiguration.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/TableCudConfiguration.java index af6320f97..a57b268d4 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/spring/bean/TableCudConfiguration.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/TableCudConfiguration.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.faceless.spring.bean; +package pro.fessional.wings.faceless.app.conf; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java index 5a1ee8ee6..6357554ff 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java @@ -10,13 +10,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; -import pro.fessional.wings.faceless.WingsTestHelper; import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao; import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.flywave.WingsRevision; +import pro.fessional.wings.faceless.helper.WingsTestHelper; import pro.fessional.wings.faceless.util.FlywaveRevisionScanner; import java.time.LocalDateTime; @@ -25,9 +25,9 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; -import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V2; -import static pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice; import static pro.fessional.wings.faceless.enums.autogen.StandardLanguage.ZH_CN; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V2; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice; import static pro.fessional.wings.faceless.util.FlywaveRevisionScanner.REVISION_PATH_MASTER; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java index c53d05987..d27640641 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java @@ -12,21 +12,21 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.ActiveProfiles; -import pro.fessional.wings.faceless.WingsTestHelper; import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.jooq.helper.JournalJooqHelper; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; +import pro.fessional.wings.faceless.helper.WingsTestHelper; import pro.fessional.wings.faceless.util.FlywaveRevisionScanner; import java.time.LocalDateTime; import java.util.Arrays; import java.util.SortedMap; -import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V2; -import static pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice; import static pro.fessional.wings.faceless.convention.EmptyValue.DATE_TIME; import static pro.fessional.wings.faceless.enums.autogen.StandardLanguage.ZH_CN; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V2; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice; import static pro.fessional.wings.faceless.util.FlywaveRevisionScanner.REVISION_PATH_MASTER; /** diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java index b4dc49285..4a2ef6a15 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java @@ -12,15 +12,15 @@ import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import pro.fessional.wings.faceless.WingsTestHelper; import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao; import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; +import pro.fessional.wings.faceless.helper.WingsTestHelper; import pro.fessional.wings.faceless.util.FlywaveRevisionScanner; -import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V2; -import static pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V2; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice; /** * @author trydofor diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java index 042e80307..2846d928b 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java @@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; -import pro.fessional.wings.faceless.WingsTestHelper; import pro.fessional.wings.faceless.convention.EmptyValue; import pro.fessional.wings.faceless.database.WingsTableCudHandler.Cud; import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; @@ -21,6 +20,7 @@ import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.jooq.listener.TableCudListener; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; +import pro.fessional.wings.faceless.helper.WingsTestHelper; import pro.fessional.wings.faceless.service.WingsTableCudHandlerTest; import pro.fessional.wings.faceless.util.FlywaveRevisionScanner; @@ -34,9 +34,9 @@ import java.util.function.BiConsumer; import static java.util.Collections.singletonList; -import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V2; -import static pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice; import static pro.fessional.wings.faceless.enums.autogen.StandardLanguage.ZH_CN; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V2; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice; import static pro.fessional.wings.faceless.util.FlywaveRevisionScanner.REVISION_PATH_MASTER; /** diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java index e3acf31ef..e92a5231f 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicLong; -import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1; /** * @author trydofor diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqDslAndDaoSample.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqDslAndDaoSample.java index 99bfafae7..fd0f41279 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqDslAndDaoSample.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqDslAndDaoSample.java @@ -32,10 +32,10 @@ import java.util.Map; import java.util.stream.Collectors; -import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1; -import static pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice; import static pro.fessional.wings.faceless.convention.EmptyValue.DATE_TIME; import static pro.fessional.wings.faceless.enums.autogen.StandardLanguage.ZH_CN; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice; import static pro.fessional.wings.faceless.service.journal.JournalService.Journal; /** diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqMostSelectSample.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqMostSelectSample.java index f2876179a..ea1f254ec 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqMostSelectSample.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqMostSelectSample.java @@ -57,8 +57,8 @@ import static org.jooq.Operator.AND; import static org.jooq.Operator.OR; import static org.junit.jupiter.api.Assertions.assertEquals; -import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V2; -import static pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V2; +import static pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice; /** *
diff --git a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingsphereConfiguration.java b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingsphereConfiguration.java
index 632c62afe..907c9b04c 100644
--- a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingsphereConfiguration.java
+++ b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingsphereConfiguration.java
@@ -7,13 +7,11 @@
 import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRootConfiguration;
 import org.apache.shardingsphere.infra.yaml.config.swapper.resource.YamlDataSourceConfigurationSwapper;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.DataSourceContext;
 import pro.fessional.wings.faceless.database.sharding.WriteRouteOnlyAround;
-import pro.fessional.wings.spring.consts.OrderedFacelessConst;
 
 import javax.sql.DataSource;
 import java.util.Map;
@@ -26,7 +24,6 @@
  */
 
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedFacelessConst.ShardingsphereConfiguration)
 public class FacelessShardingsphereConfiguration {
     private static final Log log = LogFactory.getLog(FacelessShardingsphereConfiguration.class);
 
diff --git a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessShardAutoConfiguration.java b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessShardAutoConfiguration.java
new file mode 100644
index 000000000..9923665a1
--- /dev/null
+++ b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessShardAutoConfiguration.java
@@ -0,0 +1,18 @@
+package pro.fessional.wings.faceless.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import pro.fessional.wings.faceless.spring.bean.FacelessShardingsphereConfiguration;
+import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-06-01
+ */
+
+@AutoConfiguration(before = FacelessAutoConfiguration.class)
+@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true")
+@ImportAutoConfiguration(FacelessShardingsphereConfiguration.class)
+public class FacelessShardAutoConfiguration {
+}
diff --git a/wings/faceless-shard/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/faceless-shard/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..918bc48dd
--- /dev/null
+++ b/wings/faceless-shard/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.faceless.spring.conf.FacelessShardAutoConfiguration
diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/WingsFacelessShardApplication.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessShardApplication.java
similarity index 89%
rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/WingsFacelessShardApplication.java
rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessShardApplication.java
index 3ae6bf5c6..1cfa1f489 100644
--- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/WingsFacelessShardApplication.java
+++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessShardApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.faceless;
+package pro.fessional.wings.faceless.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java
index 2e7949b58..73f6990e9 100644
--- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java
+++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java
@@ -7,16 +7,16 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.jdbc.core.JdbcTemplate;
-import pro.fessional.wings.faceless.WingsTestHelper;
 import pro.fessional.wings.faceless.database.DataSourceContext;
+import pro.fessional.wings.faceless.helper.WingsTestHelper;
 import pro.fessional.wings.faceless.util.FlywaveRevisionScanner;
 
 import java.util.SortedMap;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1;
-import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V2;
-import static pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice;
+import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1;
+import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V2;
+import static pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice;
 
 /**
  * @author trydofor
diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java
index a46380aff..df3791ccd 100644
--- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java
+++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java
@@ -12,7 +12,6 @@
 import org.junit.jupiter.api.TestMethodOrder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
-import pro.fessional.wings.faceless.WingsTestHelper;
 import pro.fessional.wings.faceless.convention.EmptyValue;
 import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable;
 import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao;
@@ -20,15 +19,16 @@
 import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord;
 import pro.fessional.wings.faceless.flywave.SchemaRevisionManager;
 import pro.fessional.wings.faceless.flywave.SchemaShardingManager;
+import pro.fessional.wings.faceless.helper.WingsTestHelper;
 import pro.fessional.wings.faceless.util.FlywaveRevisionScanner;
 
 import java.time.LocalDateTime;
 import java.util.Arrays;
 import java.util.SortedMap;
 
-import static pro.fessional.wings.faceless.WingsTestHelper.REVISION_TEST_V1;
-import static pro.fessional.wings.faceless.WingsTestHelper.testcaseNotice;
 import static pro.fessional.wings.faceless.enums.autogen.StandardLanguage.ZH_CN;
+import static pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1;
+import static pro.fessional.wings.faceless.helper.WingsTestHelper.testcaseNotice;
 
 /**
  * @author trydofor
@@ -234,7 +234,7 @@ public void test9BatchSeeLog() {
         }
         catch (Exception e) {
             testcaseNotice("Sharding unsupported, replace into https://github.com/apache/shardingsphere/issues/5330");
-            e.printStackTrace();
+            log.info("Sharding unsupported", e);
         }
 
         testcaseNotice("Batch Merge, check log, new 320, on dupkey 318,319, in 2 batch, duplicate");
@@ -251,7 +251,7 @@ public void test9BatchSeeLog() {
         catch (Exception e) {
             testcaseNotice("Sharding unsupported, on duplicate key update https://github.com/apache/shardingsphere/issues/5210");
             testcaseNotice("Sharding unsupported, https://github.com/apache/shardingsphere/pull/5423");
-            e.printStackTrace();
+            log.info("Sharding unsupported", e);
         }
     }
 }
diff --git a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/WingsTestHelper.java b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/helper/WingsTestHelper.java
similarity index 99%
rename from wings/faceless-test/src/main/java/pro/fessional/wings/faceless/WingsTestHelper.java
rename to wings/faceless-test/src/main/java/pro/fessional/wings/faceless/helper/WingsTestHelper.java
index a479adeb1..4dce0626c 100644
--- a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/WingsTestHelper.java
+++ b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/helper/WingsTestHelper.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.faceless;
+package pro.fessional.wings.faceless.helper;
 
 import lombok.Setter;
 import org.junit.jupiter.api.Assertions;
diff --git a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java
new file mode 100644
index 000000000..6147fe61e
--- /dev/null
+++ b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java
@@ -0,0 +1,19 @@
+package pro.fessional.wings.faceless.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+
+/**
+ * @author trydofor
+ * @since 2023-10-23
+ */
+@SuppressWarnings("SpringComponentScan")
+@AutoConfiguration
+@ComponentScan({
+        "pro.fessional.wings.faceless.helper",
+        "pro.fessional.wings.faceless.service",
+        "pro.fessional.wings.faceless.database.autogen",
+        "pro.fessional.wings.faceless.autoconf",
+})
+public class FacelessTestAutoConfiguration {
+}
diff --git a/wings/faceless-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/faceless-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..a27525379
--- /dev/null
+++ b/wings/faceless-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.faceless.spring.conf.FacelessTestAutoConfiguration
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java
index 1806d7174..0a2e71042 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java
@@ -3,11 +3,9 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.DataSourceContext;
-import pro.fessional.wings.spring.consts.OrderedFacelessConst;
 
 import javax.sql.DataSource;
 import java.util.Map;
@@ -20,7 +18,6 @@
  * @since 2019-06-25
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedFacelessConst.DataSourceConfiguration)
 public class FacelessDataSourceConfiguration {
 
     private static final Log log = LogFactory.getLog(FacelessDataSourceConfiguration.class);
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java
index 07f7906a0..8d77b84f1 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java
@@ -3,14 +3,12 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.jdbc.core.JdbcTemplate;
-import pro.fessional.wings.spring.consts.OrderedFacelessConst;
 import pro.fessional.wings.faceless.service.wini18n.StandardI18nService;
 import pro.fessional.wings.faceless.service.wini18n.impl.StandardI18nServiceJdbc;
 import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
@@ -23,7 +21,6 @@
 @Configuration
 @ConditionalOnProperty(name = FacelessEnabledProp.Key$enumi18n, havingValue = "true")
 @ConditionalOnClass(name = "pro.fessional.wings.silencer.message.CombinableMessageSource")
-@AutoConfigureOrder(OrderedFacelessConst.EnumI18nConfiguration)
 public class FacelessEnumI18nConfiguration {
 
     private static final Log log = LogFactory.getLog(FacelessEnumI18nConfiguration.class);
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessFlakeIdConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessFlakeIdConfiguration.java
index 08e23b0eb..a076016e1 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessFlakeIdConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessFlakeIdConfiguration.java
@@ -2,12 +2,10 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.spring.consts.OrderedFacelessConst;
 import pro.fessional.wings.faceless.service.flakeid.FlakeIdService;
 import pro.fessional.wings.faceless.service.flakeid.impl.FlakeIdLightIdImpl;
 import pro.fessional.wings.faceless.service.lightid.LightIdService;
@@ -19,7 +17,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = FacelessEnabledProp.Key$lightid, havingValue = "true")
-@AutoConfigureOrder(OrderedFacelessConst.FlakeIdConfiguration)
 public class FacelessFlakeIdConfiguration {
 
     private static final Log log = LogFactory.getLog(FacelessFlakeIdConfiguration.class);
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJournalConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJournalConfiguration.java
index 68a932e58..54ef6a88d 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJournalConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJournalConfiguration.java
@@ -2,13 +2,11 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.jdbc.core.JdbcTemplate;
-import pro.fessional.wings.spring.consts.OrderedFacelessConst;
 import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.CommitJournalModify;
 import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.impl.CommitJournalModifyJdbc;
 import pro.fessional.wings.faceless.service.journal.JournalService;
@@ -23,7 +21,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = FacelessEnabledProp.Key$journal, havingValue = "true")
-@AutoConfigureOrder(OrderedFacelessConst.JournalConfiguration)
 public class FacelessJournalConfiguration {
 
     private static final Log log = LogFactory.getLog(FacelessJournalConfiguration.class);
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java
index 3a515af43..591120a5f 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java
@@ -5,10 +5,10 @@
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -29,7 +29,6 @@
 import pro.fessional.wings.faceless.spring.prop.LightIdInsertProp;
 import pro.fessional.wings.faceless.spring.prop.LightIdLayoutProp;
 import pro.fessional.wings.faceless.spring.prop.LightIdProviderProp;
-import pro.fessional.wings.spring.consts.OrderedFacelessConst;
 
 /**
  * @author trydofor
@@ -37,7 +36,7 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = FacelessEnabledProp.Key$lightid, havingValue = "true")
-@AutoConfigureOrder(OrderedFacelessConst.LightIdConfiguration)
+@EnableConfigurationProperties({LightIdInsertProp.class, LightIdLayoutProp.class, LightIdProviderProp.class,})
 public class FacelessLightIdConfiguration {
 
     private static final Log log = LogFactory.getLog(FacelessLightIdConfiguration.class);
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/boot/WingsAutoConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/boot/WingsAutoConfiguration.java
deleted file mode 100644
index 0500cafc1..000000000
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/boot/WingsAutoConfiguration.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package pro.fessional.wings.faceless.spring.boot;
-
-import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
-import org.springframework.context.annotation.ComponentScan;
-import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
-
-/**
- * @author trydofor
- * @since 2019-06-01
- */
-@ComponentScan({"pro.fessional.wings.faceless.spring.bean"})
-@ConfigurationPropertiesScan("pro.fessional.wings.faceless.spring.prop")
-@AutoConfiguration
-@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true")
-public class WingsAutoConfiguration {
-}
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java
new file mode 100644
index 000000000..ba3f3e7ad
--- /dev/null
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java
@@ -0,0 +1,30 @@
+package pro.fessional.wings.faceless.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import pro.fessional.wings.faceless.spring.bean.FacelessDataSourceConfiguration;
+import pro.fessional.wings.faceless.spring.bean.FacelessEnumI18nConfiguration;
+import pro.fessional.wings.faceless.spring.bean.FacelessFlakeIdConfiguration;
+import pro.fessional.wings.faceless.spring.bean.FacelessJournalConfiguration;
+import pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration;
+import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-06-01
+ */
+
+@AutoConfiguration
+@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true")
+@EnableConfigurationProperties(FacelessEnabledProp.class)
+@ImportAutoConfiguration({
+        FacelessDataSourceConfiguration.class,
+        FacelessEnumI18nConfiguration.class,
+        FacelessFlakeIdConfiguration.class,
+        FacelessJournalConfiguration.class,
+        FacelessLightIdConfiguration.class,
+})
+public class FacelessAutoConfiguration {
+}
diff --git a/wings/faceless/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/faceless/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 1503cb7d2..bb4cbfe3d 100644
--- a/wings/faceless/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/faceless/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1 @@
-pro.fessional.wings.faceless.spring.boot.WingsAutoConfiguration
+pro.fessional.wings.faceless.spring.conf.FacelessAutoConfiguration
diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/WingsFacelessApplication.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessApplication.java
similarity index 89%
rename from wings/faceless/src/test/java/pro/fessional/wings/faceless/WingsFacelessApplication.java
rename to wings/faceless/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessApplication.java
index 72d97ffe7..fae5560cc 100644
--- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/WingsFacelessApplication.java
+++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/app/WingsFacelessApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.faceless;
+package pro.fessional.wings.faceless.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/pom.xml b/wings/pom.xml
index d621f3b08..4c1680e8a 100644
--- a/wings/pom.xml
+++ b/wings/pom.xml
@@ -18,7 +18,6 @@
     WingsBoot=BKB + BootsOfTravel + SpringBoot
 
     
-        aegis
         silencer
         silencer-curse
         silencer-jaxb
diff --git a/wings/silencer-curse/pom.xml b/wings/silencer-curse/pom.xml
index 814059131..1339b1533 100644
--- a/wings/silencer-curse/pom.xml
+++ b/wings/silencer-curse/pom.xml
@@ -17,10 +17,6 @@
     WingsBoot basic Features and Capabilities
 
     
-        
-            pro.fessional.wings
-            aegis
-        
         
             pro.fessional.wings
             silencer
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java
index 8a729378c..08e4a1b06 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java
@@ -8,16 +8,15 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.slf4j.LoggerFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.silencer.runner.ApplicationReadyEventRunner;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.silencer.spring.prop.SilencerAutoLogProp;
 import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
-import pro.fessional.wings.spring.consts.OrderedSilencerConst;
-import pro.fessional.wings.spring.consts.WingsBeanOrdered;
 
 import java.util.HashSet;
 import java.util.Iterator;
@@ -29,7 +28,7 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SilencerEnabledProp.Key$autoLog, havingValue = "true")
-@AutoConfigureOrder(OrderedSilencerConst.AutoLogConfiguration)
+@EnableConfigurationProperties(SilencerAutoLogProp.class)
 public class SilencerAutoLogConfiguration {
 
     private static final Log log = LogFactory.getLog(SilencerAutoLogConfiguration.class);
@@ -41,7 +40,7 @@ public class SilencerAutoLogConfiguration {
     @ConditionalOnClass(ConsoleAppender.class)
     public ApplicationReadyEventRunner runnerSilenceLogbackConsole(SilencerAutoLogProp autoLog) {
         log.info("SilencerCurse spring-runs runnerSilenceLogbackConsole");
-        return new ApplicationReadyEventRunner(WingsBeanOrdered.Lv1Config, ignored -> {
+        return new ApplicationReadyEventRunner(WingsOrdered.Lv1Config, ignored -> {
             final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
             final Set targets = autoLog.getTarget();
             final Set exists = autoLog.getExists();
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java
index 0c802735f..caa51e549 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java
@@ -3,8 +3,8 @@
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.mirana.bits.Aes256;
@@ -14,7 +14,6 @@
 import pro.fessional.wings.silencer.encrypt.SecretProvider;
 import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
 import pro.fessional.wings.silencer.spring.prop.SilencerEncryptProp;
-import pro.fessional.wings.spring.consts.OrderedSilencerConst;
 
 import java.util.Arrays;
 import java.util.Map;
@@ -25,8 +24,8 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SilencerEnabledProp.Key$encrypt, havingValue = "true")
+@EnableConfigurationProperties(SilencerEncryptProp.class)
 @RequiredArgsConstructor
-@AutoConfigureOrder(OrderedSilencerConst.EncryptConfiguration)
 public class SilencerEncryptConfiguration {
 
     private static final Log log = LogFactory.getLog(SilencerEncryptConfiguration.class);
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java
index 54ee96f47..bdc63d160 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java
@@ -2,14 +2,14 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.silencer.runner.ApplicationInspectRunner;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.silencer.spring.help.ApplicationContextHelper;
 import pro.fessional.wings.silencer.spring.prop.SilencerInspectProp;
-import pro.fessional.wings.spring.consts.OrderedSilencerConst;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
@@ -21,15 +21,15 @@
  * @since 2022-10-27
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedSilencerConst.InspectConfiguration)
+@ConditionalOnProperty(name = SilencerInspectProp.Key$properties, havingValue = "true")
+@EnableConfigurationProperties(SilencerInspectProp.class)
 public class SilencerInspectConfiguration {
     private static final Log log = LogFactory.getLog(SilencerInspectConfiguration.class);
 
     @Bean
-    @ConditionalOnProperty(name = SilencerInspectProp.Key$properties, havingValue = "true")
     public ApplicationInspectRunner inspectApplicationRunner() {
         log.info("SilencerCurse spring-bean inspectApplicationRunner");
-        return new ApplicationInspectRunner(OrderedSilencerConst.Lv5Supervisor, ignored -> {
+        return new ApplicationInspectRunner(WingsOrdered.Lv5Supervisor, ignored -> {
             final Map> map = ApplicationContextHelper.listPropertySource();
             final Map> key = new LinkedHashMap<>();
 
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRuntimeConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRuntimeConfiguration.java
index 3c8023e16..e3a259f08 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRuntimeConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRuntimeConfiguration.java
@@ -3,18 +3,17 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.silencer.modulate.RuntimeMode;
 import pro.fessional.wings.silencer.spring.prop.SilencerRuntimeProp;
-import pro.fessional.wings.spring.consts.OrderedSilencerConst;
 
 /**
  * @author trydofor
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedSilencerConst.RuntimeConfiguration)
+@EnableConfigurationProperties(SilencerRuntimeProp.class)
 public class SilencerRuntimeConfiguration {
 
     private final static Log log = LogFactory.getLog(SilencerRuntimeConfiguration.class);
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java
index c060404ed..b2e1fd28f 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java
@@ -8,7 +8,7 @@
 import org.slf4j.TtlMDCAdapter;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.logging.LogLevel;
 import org.springframework.boot.logging.LoggerGroups;
 import org.springframework.boot.logging.LoggingSystem;
@@ -18,7 +18,6 @@
 import pro.fessional.mirana.time.ThreadNow;
 import pro.fessional.wings.silencer.spring.prop.SilencerTweakProp;
 import pro.fessional.wings.silencer.tweak.TweakLogger;
-import pro.fessional.wings.spring.consts.OrderedSilencerConst;
 
 import java.time.Clock;
 import java.time.Duration;
@@ -28,7 +27,7 @@
  * @since 2022-10-27
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedSilencerConst.TweakConfiguration)
+@EnableConfigurationProperties(SilencerTweakProp.class)
 public class SilencerTweakConfiguration {
     private static final Log log = LogFactory.getLog(SilencerTweakConfiguration.class);
 
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java
new file mode 100644
index 000000000..0a86d3e34
--- /dev/null
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java
@@ -0,0 +1,27 @@
+package pro.fessional.wings.silencer.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import pro.fessional.wings.silencer.spring.bean.SilencerAutoLogConfiguration;
+import pro.fessional.wings.silencer.spring.bean.SilencerEncryptConfiguration;
+import pro.fessional.wings.silencer.spring.bean.SilencerInspectConfiguration;
+import pro.fessional.wings.silencer.spring.bean.SilencerRuntimeConfiguration;
+import pro.fessional.wings.silencer.spring.bean.SilencerTweakConfiguration;
+import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration
+@ConditionalOnProperty(name = SilencerEnabledProp.Key$autoconf, havingValue = "true")
+@ImportAutoConfiguration({
+        SilencerAutoLogConfiguration.class,
+        SilencerEncryptConfiguration.class,
+        SilencerInspectConfiguration.class,
+        SilencerRuntimeConfiguration.class,
+        SilencerTweakConfiguration.class,
+})
+public class SilencerCurseAutoConfiguration {
+}
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/watch/WatchingAround.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/watch/WatchingAround.java
index 853f9bf40..e91a80e8a 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/watch/WatchingAround.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/watch/WatchingAround.java
@@ -8,7 +8,7 @@
 import org.aspectj.lang.annotation.Aspect;
 import org.springframework.core.annotation.Order;
 import pro.fessional.mirana.time.StopWatch.Watch;
-import pro.fessional.wings.spring.consts.WingsBeanOrdered;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 
 /**
  * AOP-based, stopwatch timing of methods
@@ -17,10 +17,10 @@
  * @since 2022-11-21
  */
 @Aspect
-@Order(WingsBeanOrdered.Lv5Supervisor)
+@Order(WingsOrdered.Lv5Supervisor)
+@Getter @Setter
 public class WatchingAround {
 
-    @Getter @Setter
     private long thresholdMillis = -1;
 
     @Around(value = "@annotation(watching)", argNames = "joinPoint, watching")
diff --git a/wings/silencer-curse/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/silencer-curse/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..e8584da8e
--- /dev/null
+++ b/wings/silencer-curse/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.silencer.spring.conf.SilencerCurseAutoConfiguration
diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/WingsSilencerCurseApplication.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerCurseApplication.java
similarity index 92%
rename from wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/WingsSilencerCurseApplication.java
rename to wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerCurseApplication.java
index a34e6ecbf..461c97839 100644
--- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/WingsSilencerCurseApplication.java
+++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerCurseApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.silencer;
+package pro.fessional.wings.silencer.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/ApplicationEventLogger.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/ApplicationEventLogger.java
similarity index 83%
rename from wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/ApplicationEventLogger.java
rename to wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/ApplicationEventLogger.java
index a76b20800..33fb5b6b9 100644
--- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/ApplicationEventLogger.java
+++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/ApplicationEventLogger.java
@@ -1,10 +1,9 @@
-package pro.fessional.wings.silencer.spring;
+package pro.fessional.wings.silencer.app.conf;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.context.ApplicationEvent;
 import org.springframework.context.ApplicationListener;
-import pro.fessional.wings.silencer.spring.bean.SpringOrderConfiguration;
 
 /**
  * @author trydofor
diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SpringOrderConfiguration.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/SpringOrderConfiguration.java
similarity index 98%
rename from wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SpringOrderConfiguration.java
rename to wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/SpringOrderConfiguration.java
index bcb89403f..6cd4c3b1b 100644
--- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SpringOrderConfiguration.java
+++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/SpringOrderConfiguration.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.silencer.spring.bean;
+package pro.fessional.wings.silencer.app.conf;
 
 import jakarta.annotation.PostConstruct;
 import org.apache.commons.logging.Log;
diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerContextHelperTest.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerContextHelperTest.java
index 3d32723aa..026ec0937 100644
--- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerContextHelperTest.java
+++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerContextHelperTest.java
@@ -6,7 +6,7 @@
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
-import pro.fessional.wings.silencer.WingsSilencerCurseApplication;
+import pro.fessional.wings.silencer.app.WingsSilencerCurseApplication;
 import pro.fessional.wings.silencer.spring.help.ApplicationContextHelper;
 
 import java.util.List;
diff --git a/wings/silencer-curse/src/test/resources/META-INF/spring.factories b/wings/silencer-curse/src/test/resources/META-INF/spring.factories
index 9f67524c8..bb0322d61 100644
--- a/wings/silencer-curse/src/test/resources/META-INF/spring.factories
+++ b/wings/silencer-curse/src/test/resources/META-INF/spring.factories
@@ -1 +1 @@
-org.springframework.context.ApplicationListener=pro.fessional.wings.silencer.spring.ApplicationEventLogger
+org.springframework.context.ApplicationListener=pro.fessional.wings.silencer.app.conf.ApplicationEventLogger
diff --git a/wings/silencer-curse/src/test/resources/application.properties b/wings/silencer-curse/src/test/resources/application.properties
index 01b124e84..d37b0c7fd 100644
--- a/wings/silencer-curse/src/test/resources/application.properties
+++ b/wings/silencer-curse/src/test/resources/application.properties
@@ -1,2 +1,3 @@
 spring.application.name=curse
 debug=true
+#spring.wings.silencer.enabled.autoconf=false
\ No newline at end of file
diff --git a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/WingsBeanOrdered.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/WingsOrdered.java
similarity index 78%
rename from wings/aegis/src/main/java/pro/fessional/wings/spring/consts/WingsBeanOrdered.java
rename to wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/WingsOrdered.java
index 202f6726a..884a4cd80 100644
--- a/wings/aegis/src/main/java/pro/fessional/wings/spring/consts/WingsBeanOrdered.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/WingsOrdered.java
@@ -1,5 +1,4 @@
-package pro.fessional.wings.spring.consts;
-
+package pro.fessional.wings.silencer.spring;
 
 /**
  * spring Ordered
@@ -7,7 +6,8 @@
  * @author trydofor
  * @since 2022-11-03
  */
-public interface WingsBeanOrdered {
+public interface WingsOrdered {
+
 
     /**
      * Level Unit, 1M default
@@ -42,17 +42,18 @@ public interface WingsBeanOrdered {
     /**
      * Priority A = 2Unit
      */
-    int PriorityA = 2 * Unit;
+    int PrAnt = 2 * Unit;
     /**
      * Priority B = 4Unit
      */
-    int PriorityB = 4 * Unit;
+    int PrBee = 4 * Unit;
     /**
      * Priority C = 6Unit
      */
-    int PriorityC = 6 * Unit;
+    int PrCat = 6 * Unit;
     /**
      * Priority D = 8Unit
      */
-    int PriorityD = 8 * Unit;
+    int PrDog = 8 * Unit;
+
 }
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java
index c60b14710..c8b04ec7d 100644
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java
@@ -2,14 +2,14 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
+import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration;
 import org.springframework.context.HierarchicalMessageSource;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.core.Ordered;
 import pro.fessional.wings.silencer.message.CombinableMessageSource;
 import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
 
@@ -22,7 +22,7 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(MessageSource.class)
 @ConditionalOnProperty(name = SilencerEnabledProp.Key$message, havingValue = "true")
-@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
+@AutoConfigureAfter(MessageSourceAutoConfiguration.class) // mark
 public class SilencerMessageConfiguration {
 
     private static final Log log = LogFactory.getLog(SilencerMessageConfiguration.class);
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java
index 500c3529d..83cb554f1 100644
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java
@@ -3,7 +3,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.context.event.ApplicationReadyEvent;
 import org.springframework.boot.context.event.ApplicationStartedEvent;
 import org.springframework.context.ApplicationContext;
@@ -27,7 +26,6 @@
  * @since 2023-02-06
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
 public class SilencerRunnerConfiguration {
 
     private static final Log log = LogFactory.getLog(SilencerRunnerConfiguration.class);
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfiguration.java
deleted file mode 100644
index 643136996..000000000
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfiguration.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package pro.fessional.wings.silencer.spring.boot;
-
-import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
-import org.springframework.context.annotation.ComponentScan;
-import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
-
-/**
- * @author trydofor
- * @since 2019-07-11
- */
-@ComponentScan("pro.fessional.wings.silencer.spring.bean")
-@ConfigurationPropertiesScan("pro.fessional.wings.silencer.spring.prop")
-@AutoConfiguration
-@ConditionalOnProperty(name = SilencerEnabledProp.Key$autoconf, havingValue = "true")
-public class WingsAutoConfiguration {
-}
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java
new file mode 100644
index 000000000..8efb4efcb
--- /dev/null
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java
@@ -0,0 +1,31 @@
+package pro.fessional.wings.silencer.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.AutoConfigureOrder;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.core.Ordered;
+import pro.fessional.wings.silencer.spring.bean.SilencerMessageConfiguration;
+import pro.fessional.wings.silencer.spring.bean.SilencerRunnerConfiguration;
+import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
+import pro.fessional.wings.silencer.spring.prop.SilencerI18nProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration(after = MessageSourceAutoConfiguration.class)
+@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
+@ConditionalOnProperty(name = SilencerEnabledProp.Key$autoconf, havingValue = "true")
+@ImportAutoConfiguration({
+        SilencerMessageConfiguration.class,
+        SilencerRunnerConfiguration.class,
+})
+@EnableConfigurationProperties({
+        SilencerEnabledProp.class,
+        SilencerI18nProp.class,
+})
+public class SilencerAutoConfiguration {
+}
diff --git a/wings/silencer/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/silencer/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index d04e123ab..a2cc2d680 100644
--- a/wings/silencer/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/silencer/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1 @@
-pro.fessional.wings.silencer.spring.boot.WingsAutoConfiguration
+pro.fessional.wings.silencer.spring.conf.SilencerAutoConfiguration
diff --git a/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties
index ce1867e3b..ac219f4f2 100644
--- a/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties
+++ b/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties
@@ -9,8 +9,8 @@ spring.wings.silencer.enabled.verbose=false
 ## Whether to automatically load /wings-i18n/ messages, default true
 spring.wings.silencer.enabled.message=true
 
-## Whether to automatically load all classpaths `**/spring/bean/**`, default true
-spring.wings.silencer.enabled.scanner=true
+## Whether to automatically load all classpaths `**/spring/bean/**` (before other beans), default false
+spring.wings.silencer.enabled.scanner=false
 
 ## Whether to automatically switch the console log level when a log file is available, default true
 spring.wings.silencer.enabled.autolog=true
diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/WingsSilencerApplication.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerApplication.java
similarity index 60%
rename from wings/silencer/src/test/java/pro/fessional/wings/silencer/WingsSilencerApplication.java
rename to wings/silencer/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerApplication.java
index 809942024..6384fd349 100644
--- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/WingsSilencerApplication.java
+++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerApplication.java
@@ -1,13 +1,16 @@
-package pro.fessional.wings.silencer;
+package pro.fessional.wings.silencer.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import pro.fessional.wings.silencer.spring.prop.MergingProp;
 
 /**
  * @author trydofor
  * @since 2019-07-20
  */
 @SpringBootApplication
+@EnableConfigurationProperties(MergingProp.class)
 public class WingsSilencerApplication {
 
     public static void main(String[] args) {
diff --git a/wings/silencer/src/test/resources/application.properties b/wings/silencer/src/test/resources/application.properties
index 8123caea0..15d4ad202 100644
--- a/wings/silencer/src/test/resources/application.properties
+++ b/wings/silencer/src/test/resources/application.properties
@@ -2,3 +2,5 @@ server.port=8081
 spring.application.name=wings-silencer
 spring.application.name-empty=wings-silencer-empty
 debug=true
+#spring.wings.silencer.enabled.scanner=true
+logging.level.org.springframework=DEBUG
\ No newline at end of file
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastCacheConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastCacheConfiguration.java
index f537fa0fb..59dec4de4 100644
--- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastCacheConfiguration.java
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastCacheConfiguration.java
@@ -4,17 +4,15 @@
 import com.hazelcast.spring.cache.HazelcastCacheManager;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.hazelcast.HazelcastConfigCustomizer;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.slardar.cache.hazelcast.WingsHazelcastCacheCustomizer;
 import pro.fessional.wings.slardar.cache.hazelcast.WingsHazelcastCacheManager;
 import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 import static pro.fessional.wings.slardar.cache.WingsCache.Manager;
 
@@ -23,9 +21,8 @@
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureBefore(SlardarCacheConfiguration.class)
-@AutoConfigureOrder(OrderedSlardarConst.HazelcastCacheConfiguration)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$caching, havingValue = "true")
+@EnableConfigurationProperties(SlardarCacheProp.class)
 public class HazelcastCacheConfiguration {
 
     private static final Log log = LogFactory.getLog(HazelcastCacheConfiguration.class);
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastFlakeIdConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastFlakeIdConfiguration.java
index 4a1612403..fc056d13a 100644
--- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastFlakeIdConfiguration.java
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastFlakeIdConfiguration.java
@@ -3,13 +3,11 @@
 import com.hazelcast.core.HazelcastInstance;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.service.flakeid.FlakeIdService;
 import pro.fessional.wings.slardar.service.flakeid.FlakeIdHazelcastImpl;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 /**
  * @author trydofor
@@ -17,7 +15,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(FlakeIdService.class)
-@AutoConfigureOrder(OrderedSlardarConst.HazelcastFlakeIdConfiguration)
 public class HazelcastFlakeIdConfiguration {
 
     private static final Log log = LogFactory.getLog(HazelcastFlakeIdConfiguration.class);
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java
index b131ddf9b..33c24b800 100644
--- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java
@@ -3,7 +3,6 @@
 import com.hazelcast.core.HazelcastInstance;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -11,7 +10,6 @@
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.mirana.id.LightIdProvider;
 import pro.fessional.wings.faceless.service.flakeid.FlakeIdService;
-import pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration;
 import pro.fessional.wings.faceless.spring.prop.LightIdProviderProp;
 import pro.fessional.wings.slardar.service.lightid.HazelcastLightIdProvider;
 
@@ -21,7 +19,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(FlakeIdService.class)
-@AutoConfigureBefore(FacelessLightIdConfiguration.class)
 public class HazelcastLightIdConfiguration {
 
     private static final Log log = LogFactory.getLog(HazelcastLightIdConfiguration.class);
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastMockConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastMockConfiguration.java
index 994f5e2ca..06e2b00a1 100644
--- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastMockConfiguration.java
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastMockConfiguration.java
@@ -6,12 +6,10 @@
 import com.hazelcast.core.HazelcastInstance;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.util.StringUtils;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
@@ -20,7 +18,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$mockHazelcast, havingValue = "true")
-@AutoConfigureOrder(OrderedSlardarConst.HazelcastMockConfiguration)
 public class HazelcastMockConfiguration {
 
     private static final Log log = LogFactory.getLog(HazelcastMockConfiguration.class);
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastPublisherConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastPublisherConfiguration.java
index 0b44ee1ea..06ec04e48 100644
--- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastPublisherConfiguration.java
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastPublisherConfiguration.java
@@ -4,10 +4,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 import pro.fessional.wings.slardar.event.EventPublishHelper;
 import pro.fessional.wings.slardar.event.HazelcastSyncPublisher;
 
@@ -16,7 +14,6 @@
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedSlardarConst.HazelcastPublisherConfiguration)
 public class HazelcastPublisherConfiguration {
 
     private static final Log log = LogFactory.getLog(HazelcastPublisherConfiguration.class);
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java
new file mode 100644
index 000000000..b58f065e7
--- /dev/null
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java
@@ -0,0 +1,28 @@
+package pro.fessional.wings.slardar.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
+import pro.fessional.wings.slardar.spring.bean.HazelcastCacheConfiguration;
+import pro.fessional.wings.slardar.spring.bean.HazelcastFlakeIdConfiguration;
+import pro.fessional.wings.slardar.spring.bean.HazelcastLightIdConfiguration;
+import pro.fessional.wings.slardar.spring.bean.HazelcastMockConfiguration;
+import pro.fessional.wings.slardar.spring.bean.HazelcastPublisherConfiguration;
+import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration(before = {SlardarAutoConfiguration.class, HazelcastAutoConfiguration.class})
+@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
+@ImportAutoConfiguration({
+        HazelcastCacheConfiguration.class,
+        HazelcastFlakeIdConfiguration.class,
+        HazelcastLightIdConfiguration.class,
+        HazelcastMockConfiguration.class,
+        HazelcastPublisherConfiguration.class,
+})
+public class SlardarHazelCachingAutoConfiguration {
+}
diff --git a/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..a7c4f5ae3
--- /dev/null
+++ b/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.slardar.spring.conf.SlardarHazelCachingAutoConfiguration
\ No newline at end of file
diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/WingsSlardarHazelCachingApplication.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarHazelCachingApplication.java
similarity index 93%
rename from wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/WingsSlardarHazelCachingApplication.java
rename to wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarHazelCachingApplication.java
index 55e77930b..7e6d45796 100644
--- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/WingsSlardarHazelCachingApplication.java
+++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarHazelCachingApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.slardar;
+package pro.fessional.wings.slardar.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastSessionConfiguration.java b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastSessionConfiguration.java
index ff29dbd84..9c709de79 100644
--- a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastSessionConfiguration.java
+++ b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastSessionConfiguration.java
@@ -4,10 +4,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.session.SessionAutoConfiguration;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.security.core.session.SessionRegistry;
@@ -16,15 +13,12 @@
 import org.springframework.session.security.SpringSessionBackedSessionRegistry;
 import pro.fessional.wings.slardar.session.HazelcastSessionHelper;
 import pro.fessional.wings.slardar.session.WingsSessionHelper;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 /**
  * @author trydofor
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureAfter(SessionAutoConfiguration.class)
-@AutoConfigureOrder(OrderedSlardarConst.HazelcastPublisherConfiguration)
 public class HazelcastSessionConfiguration {
 
     private static final Log log = LogFactory.getLog(HazelcastSessionConfiguration.class);
diff --git a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java
new file mode 100644
index 000000000..9714d1ef7
--- /dev/null
+++ b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java
@@ -0,0 +1,18 @@
+package pro.fessional.wings.slardar.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.session.SessionAutoConfiguration;
+import pro.fessional.wings.slardar.spring.bean.HazelcastSessionConfiguration;
+import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration(after = SessionAutoConfiguration.class)
+@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
+@ImportAutoConfiguration(HazelcastSessionConfiguration.class)
+public class SlardarHazelSessionAutoConfiguration {
+}
diff --git a/wings/slardar-hazel-session/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-hazel-session/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..722e609d5
--- /dev/null
+++ b/wings/slardar-hazel-session/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.slardar.spring.conf.SlardarHazelSessionAutoConfiguration
\ No newline at end of file
diff --git a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/WingsSlardarHazelSessionApplication.java b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarHazelSessionApplication.java
similarity index 93%
rename from wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/WingsSlardarHazelSessionApplication.java
rename to wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarHazelSessionApplication.java
index b7e319b2f..627a2d052 100644
--- a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/WingsSlardarHazelSessionApplication.java
+++ b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarHazelSessionApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.slardar;
+package pro.fessional.wings.slardar.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/spring/bean/TestSecurityConfiguration.java b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java
similarity index 98%
rename from wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/spring/bean/TestSecurityConfiguration.java
rename to wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java
index d19af75df..249e79682 100644
--- a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/spring/bean/TestSecurityConfiguration.java
+++ b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.slardar.spring.bean;
+package pro.fessional.wings.slardar.app.conf;
 
 import lombok.Setter;
 import org.apache.commons.logging.Log;
diff --git a/wings/slardar-sprint/pom.xml b/wings/slardar-sprint/pom.xml
index c731b7a11..816b6ec3f 100644
--- a/wings/slardar-sprint/pom.xml
+++ b/wings/slardar-sprint/pom.xml
@@ -55,5 +55,11 @@
             micrometer-registry-prometheus
             true
         
+        
+        
+            pro.fessional.wings
+            slardar-test
+            test
+        
     
 
diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarActuatorConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarActuatorConfiguration.java
index e530211ae..f3bfd2a02 100644
--- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarActuatorConfiguration.java
+++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarActuatorConfiguration.java
@@ -3,11 +3,9 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.cache.CacheManager;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 import pro.fessional.wings.slardar.actuator.cache.SlardarCacheEndpoint;
 
 import java.util.Map;
@@ -18,7 +16,6 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedSlardarConst.ActuatorConfiguration)
 public class SlardarActuatorConfiguration {
 
     private final static Log log = LogFactory.getLog(SlardarActuatorConfiguration.class);
diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
index d5844104a..3dc4767f8 100644
--- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
+++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
@@ -1,6 +1,7 @@
 package pro.fessional.wings.slardar.spring.bean;
 
 import de.codecentric.boot.admin.client.config.ClientProperties;
+import de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration;
 import de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition;
 import de.codecentric.boot.admin.client.registration.BlockingRegistrationClient;
 import de.codecentric.boot.admin.server.config.AdminServerProperties;
@@ -21,10 +22,11 @@
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
+import org.springframework.boot.autoconfigure.AutoConfigureBefore;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.web.client.RestTemplateBuilder;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Conditional;
@@ -34,7 +36,6 @@
 import pro.fessional.wings.slardar.security.pass.BasicPasswordEncoder;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarPasscoderProp;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 import reactor.core.publisher.Mono;
 
 import java.util.ArrayList;
@@ -49,7 +50,9 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedSlardarConst.BootAdminConfiguration)
+@EnableConfigurationProperties(SlardarPasscoderProp.class)
+@ConditionalOnClass(SpringBootAdminClientAutoConfiguration.class)
+@AutoConfigureBefore(SpringBootAdminClientAutoConfiguration.class) // mark
 public class SlardarBootAdminConfiguration {
     private final static Log log = LogFactory.getLog(SlardarBootAdminConfiguration.class);
 
@@ -61,7 +64,7 @@ public static class ClientConfiguration {
          * 
          * org.apache.http.client.protocol.ResponseProcessCookies : Invalid cookie header: "Set-Cookie: ...".
          * Invalid 'expires' attribute: Sat, 19 Mar 2022 06:03:21 GMT
-          *
+         *
          * As it use 'EEE, dd-MMM-yyy HH:mm:ss z' format to validate cookie, cause faile
          * 
*/ diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java index 604437c54..d44ea8d19 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java @@ -3,9 +3,9 @@ import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -17,13 +17,13 @@ import org.springframework.security.web.session.HttpSessionEventPublisher; import pro.fessional.mirana.bits.MdHelp; import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.context.TerminalContext; import pro.fessional.wings.slardar.security.PasssaltEncoder; import pro.fessional.wings.slardar.security.pass.DefaultPasssaltEncoder; import pro.fessional.wings.slardar.security.pass.PasswordEncoders; import pro.fessional.wings.slardar.spring.conf.WingsSecBeanInitConfigurer; import pro.fessional.wings.slardar.spring.prop.SlardarPasscoderProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.Map; @@ -32,9 +32,9 @@ * @since 2020-08-10 */ @Configuration(proxyBeanMethods = false) -@RequiredArgsConstructor @ConditionalOnClass(SecurityConfigurer.class) -@AutoConfigureOrder(OrderedSlardarConst.SecurityConfiguration) +@EnableConfigurationProperties(SlardarPasscoderProp.class) +@RequiredArgsConstructor public class SlardarSecurityConfiguration { private static final Log log = LogFactory.getLog(SlardarSecurityConfiguration.class); @@ -119,7 +119,7 @@ public TerminalContext.Listener LocaleContextHolderTerminalContextListener() { @Bean public CommandLineRunnerOrdered runnerTerminalContextListener(Map listeners) { log.info("SlardarSprint spring-runs runnerTerminalContextListener"); - return new CommandLineRunnerOrdered(OrderedSlardarConst.RunnerTerminalContextListener, ignored -> { + return new CommandLineRunnerOrdered(WingsOrdered.Lv5Supervisor, ignored -> { for (Map.Entry en : listeners.entrySet()) { final String name = en.getKey(); log.info("SlardarSprint spring-conf runnerTerminalContextListener, name=" + name); diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java new file mode 100644 index 000000000..b969d59fb --- /dev/null +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java @@ -0,0 +1,23 @@ +package pro.fessional.wings.slardar.spring.conf; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import pro.fessional.wings.slardar.spring.bean.SlardarActuatorConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarBootAdminConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; + +/** + * @author trydofor + * @since 2019-07-11 + */ +@AutoConfiguration(beforeName = "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration") +@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true") +@ImportAutoConfiguration({ + SlardarActuatorConfiguration.class, + SlardarBootAdminConfiguration.class, + SlardarSecurityConfiguration.class, +}) +public class SlardarSprintAutoConfiguration { +} diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/WingsSecBeanInitConfigurer.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/WingsSecBeanInitConfigurer.java index 660ac81bc..ce20630cf 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/WingsSecBeanInitConfigurer.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/WingsSecBeanInitConfigurer.java @@ -6,7 +6,7 @@ import org.springframework.security.config.annotation.authentication.configuration.GlobalAuthenticationConfigurerAdapter; import org.springframework.security.core.userdetails.UserDetailsPasswordService; import org.springframework.security.crypto.password.PasswordEncoder; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.security.PasssaltEncoder; import pro.fessional.wings.slardar.security.WingsAuthCheckService; import pro.fessional.wings.slardar.security.WingsUserDetailsService; @@ -18,9 +18,11 @@ * @author trydofor * @since 2021-02-09 */ -@Order(OrderedSlardarConst.CnfSecurityBeanInitConfigurer) +@Order(WingsSecBeanInitConfigurer.ORDER) public class WingsSecBeanInitConfigurer extends GlobalAuthenticationConfigurerAdapter { + public static final int ORDER = WingsOrdered.Lv1Config; + private final ApplicationContext context; public WingsSecBeanInitConfigurer(ApplicationContext context) { diff --git a/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 000000000..39b0e4747 --- /dev/null +++ b/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +pro.fessional.wings.slardar.spring.conf.SlardarSprintAutoConfiguration \ No newline at end of file diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/WingsSlardarSprintApplication.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarSprintApplication.java similarity index 80% rename from wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/WingsSlardarSprintApplication.java rename to wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarSprintApplication.java index 1fe1efb20..d24fd6acc 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/WingsSlardarSprintApplication.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarSprintApplication.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar; +package pro.fessional.wings.slardar.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -10,8 +10,7 @@ * @since 2019-07-20 */ @SpringBootApplication -@ComponentScan({"pro.fessional.wings.slardar.service", - "pro.fessional.wings.slardar.controller",}) +@ComponentScan("pro.fessional.wings.slardar.webconf") public class WingsSlardarSprintApplication { public static void main(String[] args) { diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/spring/bean/TestSecurityConfiguration.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webconf/TestSecurityConfiguration.java similarity index 98% rename from wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/spring/bean/TestSecurityConfiguration.java rename to wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webconf/TestSecurityConfiguration.java index f488e1d5e..8f67c8c3f 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/spring/bean/TestSecurityConfiguration.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webconf/TestSecurityConfiguration.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.spring.bean; +package pro.fessional.wings.slardar.webconf; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/security/service/TestWingsUserDetailsService.java b/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/service/TestWingsUserDetailsService.java similarity index 97% rename from wings/slardar-test/src/main/java/pro/fessional/wings/slardar/security/service/TestWingsUserDetailsService.java rename to wings/slardar-test/src/main/java/pro/fessional/wings/slardar/service/TestWingsUserDetailsService.java index 2fc27a078..01bb64950 100644 --- a/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/security/service/TestWingsUserDetailsService.java +++ b/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/service/TestWingsUserDetailsService.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.security.service; +package pro.fessional.wings.slardar.service; import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; diff --git a/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/bean/TestSecurityBeans.java b/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarTestAutoConfiguration.java similarity index 57% rename from wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/bean/TestSecurityBeans.java rename to wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarTestAutoConfiguration.java index a0cad6f21..09ff3446c 100644 --- a/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/bean/TestSecurityBeans.java +++ b/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarTestAutoConfiguration.java @@ -1,7 +1,8 @@ -package pro.fessional.wings.slardar.spring.bean; +package pro.fessional.wings.slardar.spring.conf; +import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.ComponentScan; import pro.fessional.wings.slardar.security.WingsAuthDetailsSource; import pro.fessional.wings.slardar.security.handler.TestLoginHandler; import pro.fessional.wings.slardar.security.impl.DefaultWingsAuthDetails; @@ -10,8 +11,14 @@ * @author trydofor * @since 2022-01-29 */ -@Configuration(proxyBeanMethods = false) -public class TestSecurityBeans { +@SuppressWarnings("SpringComponentScan") +@AutoConfiguration +@ComponentScan({ + "pro.fessional.wings.slardar.helper", + "pro.fessional.wings.slardar.service", + "pro.fessional.wings.slardar.controller", +}) +public class SlardarTestAutoConfiguration { @Bean public TestLoginHandler testLoginHandler() { diff --git a/wings/slardar-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 000000000..13bbd45d2 --- /dev/null +++ b/wings/slardar-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +pro.fessional.wings.slardar.spring.conf.SlardarTestAutoConfiguration diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DebounceInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DebounceInterceptor.java index 0ba803461..074f17c97 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DebounceInterceptor.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DebounceInterceptor.java @@ -12,13 +12,13 @@ import org.springframework.web.servlet.ModelAndView; import pro.fessional.mirana.bits.Md5; import pro.fessional.mirana.time.ThreadNow; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k; import pro.fessional.wings.slardar.concur.Debounce; import pro.fessional.wings.slardar.servlet.request.RequestHelper; import pro.fessional.wings.slardar.servlet.response.ResponseHelper; import pro.fessional.wings.slardar.servlet.stream.ReuseStreamResponseWrapper; import pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.io.IOException; import java.io.InputStream; @@ -32,6 +32,7 @@ @Slf4j public class DebounceInterceptor implements AutoRegisterInterceptor { + public static final int ORDER = WingsOrdered.Lv4Application + 2_000; public static final String DebounceKey = DebounceInterceptor.class.getName() + "::DebounceKey"; private final AtomicLong seq = new AtomicLong(0); @@ -39,7 +40,7 @@ public class DebounceInterceptor implements AutoRegisterInterceptor { private final ModelAndView modelAndView; @Getter @Setter - private int order = OrderedSlardarConst.MvcDebounceInterceptor; + private int order = ORDER; public DebounceInterceptor(int capacity, int maxWait, ModelAndView res) { this.cache = WingsCache2k.builder(DebounceInterceptor.class, "cache", capacity, maxWait, -1, String.class, Dto.class).build(); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillExceptionResolver.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillExceptionResolver.java index c90456449..a55821a17 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillExceptionResolver.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillExceptionResolver.java @@ -2,8 +2,8 @@ import org.springframework.core.annotation.Order; import pro.fessional.mirana.text.StringTemplate; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.concur.DoubleKillException; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.webmvc.SimpleExceptionResolver; import pro.fessional.wings.slardar.webmvc.SimpleResponse; @@ -11,9 +11,11 @@ * @author trydofor * @since 2021-03-10 */ -@Order(OrderedSlardarConst.WebDoubleKillExceptionResolver) +@Order(DoubleKillExceptionResolver.ORDER) public class DoubleKillExceptionResolver extends SimpleExceptionResolver { + public static final int ORDER = WingsOrdered.Lv4Application + 7_100; + public DoubleKillExceptionResolver(SimpleResponse defaultResponse) { super(defaultResponse); } diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodImageHandler.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodImageHandler.java index 7c103c25a..dd8e2d670 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodImageHandler.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodImageHandler.java @@ -15,11 +15,11 @@ import pro.fessional.mirana.code.RandCode; import pro.fessional.mirana.data.Null; import pro.fessional.mirana.time.ThreadNow; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.concur.FirstBlood; import pro.fessional.wings.slardar.servlet.request.RequestHelper; import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver; import pro.fessional.wings.slardar.servlet.response.ResponseHelper; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; @@ -39,7 +39,8 @@ @Getter public class FirstBloodImageHandler implements FirstBloodHandler { - private int order = OrderedSlardarConst.MvcFirstBloodImageHandler; + public static final int ORDER = WingsOrdered.Lv4Application + 3_100; + private int order = ORDER; private String clientTicketKey = "Client-Ticket"; private String questCaptchaKey = "quest-captcha-image"; diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java index cf06be7e8..ded8b50e8 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java @@ -7,10 +7,10 @@ import org.cache2k.Cache; import org.jetbrains.annotations.NotNull; import org.springframework.web.method.HandlerMethod; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.concur.FirstBlood; import pro.fessional.wings.slardar.concur.ProgressContext; import pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.lang.reflect.Method; import java.util.List; @@ -21,10 +21,12 @@ */ public class FirstBloodInterceptor implements AutoRegisterInterceptor { + public static final int ORDER = WingsOrdered.Lv4Application + 3_000; + private final List handlers; @Getter @Setter - private int order = OrderedSlardarConst.MvcFirstBloodInterceptor; + private int order = ORDER; public FirstBloodInterceptor(List handlers) { this.handlers = handlers; diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterExceptionResolver.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterExceptionResolver.java index d1a275ddf..5e156c7d9 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterExceptionResolver.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterExceptionResolver.java @@ -1,7 +1,7 @@ package pro.fessional.wings.slardar.concur.impl; import org.springframework.core.annotation.Order; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.concur.RighterException; import pro.fessional.wings.slardar.webmvc.SimpleExceptionResolver; import pro.fessional.wings.slardar.webmvc.SimpleResponse; @@ -11,9 +11,11 @@ * @since 2021-03-10 */ -@Order(OrderedSlardarConst.WebRighterExceptionResolver) +@Order(RighterExceptionResolver.ORDER) public class RighterExceptionResolver extends SimpleExceptionResolver { + public static final int ORDER = WingsOrdered.Lv4Application + 7_200; + public RighterExceptionResolver(SimpleResponse defaultResponse) { super(defaultResponse); } diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterInterceptor.java index b2f8b3c46..27d9b6798 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterInterceptor.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterInterceptor.java @@ -15,12 +15,12 @@ import pro.fessional.mirana.bits.Base64; import pro.fessional.mirana.bits.MdHelp; import pro.fessional.mirana.code.RandCode; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.concur.Righter; import pro.fessional.wings.slardar.serialize.KryoSimple; import pro.fessional.wings.slardar.servlet.response.ResponseHelper; import pro.fessional.wings.slardar.spring.prop.SlardarRighterProp; import pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.function.Function; @@ -34,12 +34,14 @@ @Slf4j public class RighterInterceptor implements AutoRegisterInterceptor { + public static final int ORDER = WingsOrdered.Lv4Application + 1_000; + public static final String Secret = RandCode.strong(20); private final SlardarRighterProp prop; @Getter @Setter - private int order = OrderedSlardarConst.MvcRighterInterceptor; + private int order = ORDER; /** * Get the encryption password by HttpSession diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/context/TerminalInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/context/TerminalInterceptor.java index 8554f394f..58dc371cf 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/context/TerminalInterceptor.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/context/TerminalInterceptor.java @@ -8,10 +8,10 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import pro.fessional.mirana.best.DummyBlock; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.context.TerminalContext.Builder; import pro.fessional.wings.slardar.context.TerminalContext.Context; import pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.ArrayList; import java.util.Collections; @@ -27,9 +27,14 @@ @Getter public class TerminalInterceptor implements AutoRegisterInterceptor { + public static final int ORDER = WingsOrdered.Lv4Application + 5_000; + private final List terminalBuilders = new ArrayList<>(); private final List terminalLoggers = new ArrayList<>(); + @Setter + private int order = ORDER; + @Setter @NotNull private List excludePatterns = Collections.emptyList(); @@ -90,9 +95,6 @@ public Context logoutTerminal(@NotNull HttpServletRequest request) { } } - @Setter - private int order = OrderedSlardarConst.MvcTerminalInterceptor; - @Override public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/domainx/WingsDomainExtendFilter.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/domainx/WingsDomainExtendFilter.java index 3c7128a26..edf812ca5 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/domainx/WingsDomainExtendFilter.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/domainx/WingsDomainExtendFilter.java @@ -11,7 +11,7 @@ import org.springframework.core.Ordered; import org.springframework.web.filter.OncePerRequestFilter; import pro.fessional.mirana.text.Wildcard; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; +import pro.fessional.wings.silencer.spring.WingsOrdered; import java.io.IOException; import java.util.List; @@ -24,10 +24,12 @@ * @since 2019-11-16 */ @RequiredArgsConstructor +@Setter @Getter public class WingsDomainExtendFilter extends OncePerRequestFilter implements Ordered { - @Setter @Getter - private int order = OrderedSlardarConst.WebFilterDomainEx; + public static final int ORDER = WingsOrdered.Lv4Application + 3_000; + + private int order = ORDER; private final Map> hostWildcard; private final DomainRequestMatcher domainRequestMatcher; diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/WingsCookieFilter.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/WingsCookieFilter.java index c28f1b093..9361caf8a 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/WingsCookieFilter.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/WingsCookieFilter.java @@ -10,7 +10,7 @@ import org.jetbrains.annotations.NotNull; import org.springframework.core.Ordered; import org.springframework.web.filter.OncePerRequestFilter; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; +import pro.fessional.wings.silencer.spring.WingsOrdered; import java.io.IOException; @@ -19,11 +19,12 @@ * @since 2019-11-14 */ @RequiredArgsConstructor +@Setter @Getter public class WingsCookieFilter extends OncePerRequestFilter implements Ordered { - @Setter @Getter - private int order = OrderedSlardarConst.WebFilterReCookie; + public static final int ORDER = WingsOrdered.Lv4Application + 2_000; + private int order = ORDER; private final WingsCookieInterceptor interceptor; @Override diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/filter/WingsOverloadFilter.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/filter/WingsOverloadFilter.java index 64ca5d0fc..c65be4a59 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/filter/WingsOverloadFilter.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/filter/WingsOverloadFilter.java @@ -14,9 +14,9 @@ import org.cache2k.Cache; import org.springframework.boot.web.servlet.filter.OrderedFilter; import pro.fessional.mirana.time.ThreadNow; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k; import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.io.IOException; import java.time.Duration; @@ -32,11 +32,11 @@ * @since 2019-11-14 */ @Slf4j +@Setter @Getter @Deprecated public class WingsOverloadFilter implements OrderedFilter { - @Setter @Getter - private int order = OrderedSlardarConst.WebFilterOverload; + private int order = WingsOrdered.Lv4Application + 4_000; private final AtomicInteger requestCapacity = new AtomicInteger(0); private final AtomicInteger requestProcess = new AtomicInteger(0); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/stream/WingsReuseStreamFilter.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/stream/WingsReuseStreamFilter.java index a1ddbcccf..9c03fb147 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/stream/WingsReuseStreamFilter.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/stream/WingsReuseStreamFilter.java @@ -9,7 +9,7 @@ import org.jetbrains.annotations.NotNull; import org.springframework.core.Ordered; import org.springframework.web.filter.OncePerRequestFilter; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; +import pro.fessional.wings.silencer.spring.WingsOrdered; import java.io.IOException; @@ -17,12 +17,11 @@ * @author trydofor * @since 2019-11-14 */ +@Setter @Getter public class WingsReuseStreamFilter extends OncePerRequestFilter implements Ordered { - @Setter @Getter - private int order = OrderedSlardarConst.WebFilterReStream; - @Getter @Setter + private int order = WingsOrdered.Lv4Application; private RequestResponseLogging requestResponseLogging; @Override diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java index ac1b024d7..36ecbb68b 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java @@ -3,12 +3,11 @@ import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.encrypt.SecretProvider; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.servlet.cookie.WingsCookieFilter; import pro.fessional.wings.slardar.servlet.cookie.WingsCookieInterceptor; import pro.fessional.wings.slardar.servlet.cookie.impl.WingsCookieInterceptorImpl; @@ -28,8 +27,8 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$cookie, havingValue = "true") +@EnableConfigurationProperties(SlardarCookieProp.class) @RequiredArgsConstructor -@AutoConfigureOrder(OrderedSlardarConst.CookieConfiguration) public class SlardarCookieConfiguration { private static final Log log = LogFactory.getLog(SlardarCookieConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java index c49d67ae0..f8e7115ed 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java @@ -3,15 +3,14 @@ import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; import org.springframework.web.servlet.ModelAndView; import pro.fessional.wings.slardar.concur.impl.DebounceInterceptor; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.servlet.response.view.PlainTextView; import pro.fessional.wings.slardar.spring.prop.SlardarDebounceProp; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; @@ -21,9 +20,9 @@ * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@RequiredArgsConstructor @ConditionalOnProperty(name = SlardarEnabledProp.Key$debounce, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.DebounceConfiguration) +@EnableConfigurationProperties(SlardarDebounceProp.class) +@RequiredArgsConstructor public class SlardarDebounceConfiguration { private static final Log log = LogFactory.getLog(SlardarDebounceConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java index a4851c58b..4b178ec8d 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java @@ -3,15 +3,14 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanFactoryUtils; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.AnnotationAwareOrderComparator; import org.springframework.web.servlet.HandlerMapping; import pro.fessional.mirana.text.Wildcard; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.domainx.DefaultDomainRequestMatcher; import pro.fessional.wings.slardar.domainx.WingsDomainExtendFilter; import pro.fessional.wings.slardar.spring.prop.DomainExtendProp; @@ -30,7 +29,7 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$domainExtend, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.DomainExtendConfiguration) +@EnableConfigurationProperties(DomainExtendProp.class) public class SlardarDomainExtendConfiguration { private final static Log log = LogFactory.getLog(SlardarDomainExtendConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java index 55fe2694e..707553d3e 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java @@ -3,19 +3,15 @@ import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.HandlerExceptionResolver; import pro.fessional.wings.slardar.concur.impl.DoubleKillExceptionResolver; import pro.fessional.wings.slardar.spring.prop.SlardarDoubleKillProp; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; - -import static pro.fessional.wings.spring.consts.NamingSlardarConst.doubleKillExceptionResolver; /** * @author trydofor @@ -24,11 +20,12 @@ @Configuration(proxyBeanMethods = false) @RequiredArgsConstructor @ConditionalOnProperty(name = SlardarEnabledProp.Key$doubleKill, havingValue = "true") -@AutoConfigureAfter(SlardarDoubleKillConfiguration.class) -@AutoConfigureOrder(OrderedSlardarConst.DoubleKillWebConfiguration) +@EnableConfigurationProperties(SlardarDoubleKillProp.class) public class SlardarDoubleKillWebConfiguration { + public static final String doubleKillExceptionResolver = "doubleKillExceptionResolver"; private static final Log log = LogFactory.getLog(SlardarDoubleKillWebConfiguration.class); + private final SlardarDoubleKillProp doubleKillProp; @Bean(name = doubleKillExceptionResolver) diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java index e2a5bce60..c23e2343f 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java @@ -5,15 +5,14 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; import org.springframework.web.servlet.ModelAndView; import pro.fessional.mirana.code.RandCode; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.concur.impl.FirstBloodHandler; import pro.fessional.wings.slardar.concur.impl.FirstBloodImageHandler; import pro.fessional.wings.slardar.concur.impl.FirstBloodInterceptor; @@ -30,9 +29,9 @@ * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@RequiredArgsConstructor @ConditionalOnProperty(name = SlardarEnabledProp.Key$firstBlood, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.FirstBloodConfiguration) +@EnableConfigurationProperties(SlardarFirstBloodProp.class) +@RequiredArgsConstructor public class SlardarFirstBloodConfiguration { private static final Log log = LogFactory.getLog(SlardarFirstBloodConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java index 7a2a78c0b..27ef49464 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java @@ -10,12 +10,11 @@ import lombok.val; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureAfter; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -25,6 +24,7 @@ import pro.fessional.mirana.data.R; import pro.fessional.mirana.i18n.I18nString; import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.autozone.AutoZoneType; import pro.fessional.wings.slardar.autozone.json.JacksonLocalDateDeserializer; import pro.fessional.wings.slardar.autozone.json.JacksonLocalDateTimeDeserializer; @@ -46,7 +46,6 @@ import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarJacksonProp; import pro.fessional.wings.slardar.spring.prop.SlardarNumberProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.math.BigDecimal; import java.math.BigInteger; @@ -69,9 +68,8 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(DateSerializer.class) @ConditionalOnProperty(name = SlardarEnabledProp.Key$jackson, havingValue = "true") +@EnableConfigurationProperties({SlardarJacksonProp.class, SlardarDatetimeProp.class, SlardarNumberProp.class}) @RequiredArgsConstructor -@AutoConfigureAfter(SlardarJacksonConfiguration.class) -@AutoConfigureOrder(OrderedSlardarConst.JacksonWebConfiguration) public class SlardarJacksonWebConfiguration { private static final Log log = LogFactory.getLog(SlardarJacksonWebConfiguration.class); @@ -250,7 +248,7 @@ public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperFilterProvide @Bean public ApplicationStartedEventRunner runnerJacksonHelper(Jackson2ObjectMapperBuilder builder) { log.info("SlardarWebmvc spring-runs runnerJacksonHelper"); - return new ApplicationStartedEventRunner(OrderedSlardarConst.RunnerJacksonHelper, ignored -> { + return new ApplicationStartedEventRunner(WingsOrdered.Lv1Config, ignored -> { log.info("SlardarWebmvc spring-conf JacksonHelper.initGlobal"); JacksonHelper.initGlobal( builder.createXmlMapper(false).build(), diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java index 5fbe9d544..32dd478c4 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java @@ -2,16 +2,15 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; import pro.fessional.wings.slardar.servlet.resolver.WingsLocaleResolver; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarLocaleProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import static org.springframework.web.servlet.DispatcherServlet.LOCALE_RESOLVER_BEAN_NAME; @@ -21,7 +20,7 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$locale, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.LocaleConfiguration) +@EnableConfigurationProperties({SlardarLocaleProp.class}) public class SlardarLocaleConfiguration { private final Log log = LogFactory.getLog(SlardarLocaleConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java index d99d27f87..7e8d77f9b 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java @@ -3,7 +3,6 @@ import okhttp3.OkHttpClient; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -15,7 +14,6 @@ import org.springframework.http.client.OkHttp3ClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; /** * @author trydofor @@ -26,7 +24,6 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(OkHttpClient.class) @ConditionalOnProperty(name = SlardarEnabledProp.Key$okhttp, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.OkhttpWebConfiguration) public class SlardarOkhttpWebConfiguration { private static final Log log = LogFactory.getLog(SlardarOkhttpWebConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java index ddb896f05..bc510d9a6 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java @@ -6,10 +6,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jetbrains.annotations.NotNull; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -17,10 +17,11 @@ import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import pro.fessional.mirana.best.DummyBlock; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.servlet.filter.WingsOverloadFilter; import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; +import pro.fessional.wings.slardar.spring.prop.SlardarOverloadProp; import java.io.IOException; import java.io.PrintWriter; @@ -36,14 +37,14 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$overload, havingValue = "true") @ConditionalOnClass(Filter.class) -@AutoConfigureOrder(OrderedSlardarConst.OverloadConfiguration) +@EnableConfigurationProperties(SlardarOverloadProp.class) @Deprecated public class SlardarOverloadConfiguration { private final Log log = LogFactory.getLog(SlardarOverloadConfiguration.class); @Component - @Order(OrderedSlardarConst.AppSafelyShutdownListener) + @Order(WingsOrdered.Lv4Application) @RequiredArgsConstructor public class SafelyShutdown implements ApplicationListener { private final WingsOverloadFilter overloadFilter; diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java index 4759e77a5..83a465e4c 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java @@ -3,12 +3,11 @@ import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.mirana.data.Null; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarPagequeryProp; import pro.fessional.wings.slardar.webmvc.PageQueryArgumentResolver; @@ -19,8 +18,8 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$pagequery, havingValue = "true") +@EnableConfigurationProperties(SlardarPagequeryProp.class) @RequiredArgsConstructor -@AutoConfigureOrder(OrderedSlardarConst.PageQueryConfiguration) public class SlardarPageQueryConfiguration { private static final Log log = LogFactory.getLog(SlardarPageQueryConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java index 2d3117f3b..86f80533e 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java @@ -2,12 +2,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.spring.help.CommonPropHelper; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarRemoteProp; @@ -18,7 +17,7 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$remote, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.RemoteConfiguration) +@EnableConfigurationProperties(SlardarRemoteProp.class) public class SlardarRemoteConfiguration { private final Log log = LogFactory.getLog(SlardarRemoteConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRestreamConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRestreamConfiguration.java index 76e8a04ad..a264c14e3 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRestreamConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRestreamConfiguration.java @@ -3,12 +3,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.servlet.stream.RequestResponseLogging; import pro.fessional.wings.slardar.servlet.stream.WingsReuseStreamFilter; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; @@ -19,7 +17,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$restream, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.RestreamConfiguration) public class SlardarRestreamConfiguration { private static final Log log = LogFactory.getLog(SlardarRestreamConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java index b8f00f9ea..6621111d4 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java @@ -4,9 +4,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.HandlerExceptionResolver; @@ -14,21 +14,20 @@ import pro.fessional.wings.slardar.concur.impl.RighterInterceptor; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarRighterProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; - -import static pro.fessional.wings.spring.consts.NamingSlardarConst.righterExceptionResolver; /** * @author trydofor * @since 2019-06-29 */ -@RequiredArgsConstructor @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$righter, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.RighterConfiguration) +@EnableConfigurationProperties(SlardarRighterProp.class) +@RequiredArgsConstructor public class SlardarRighterConfiguration { + public static final String righterExceptionResolver = "righterExceptionResolver"; private final static Log log = LogFactory.getLog(SlardarRighterConfiguration.class); + private final SlardarRighterProp slardarRighterProp; @Bean diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSessionConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSessionConfiguration.java index be94392d3..a301b7f61 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSessionConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSessionConfiguration.java @@ -4,7 +4,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.session.DefaultCookieSerializerCustomizer; import org.springframework.boot.autoconfigure.web.ServerProperties; @@ -23,7 +22,6 @@ import pro.fessional.wings.slardar.session.WingsSessionIdResolver; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarSessionProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.ArrayList; import java.util.List; @@ -39,9 +37,8 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$session, havingValue = "true") -@EnableConfigurationProperties(ServerProperties.class) +@EnableConfigurationProperties({ServerProperties.class,SlardarSessionProp.class}) @RequiredArgsConstructor -@AutoConfigureOrder(OrderedSlardarConst.SessionConfiguration) public class SlardarSessionConfiguration { private static final Log log = LogFactory.getLog(SlardarSessionConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java index 2af138b39..9fafdfce9 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java @@ -15,15 +15,14 @@ import org.springdoc.core.configuration.SpringDocConfiguration; import org.springdoc.core.customizers.OpenApiCustomizer; import org.springdoc.core.utils.SpringDocUtils; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.mirana.page.PageQuery; import pro.fessional.wings.silencer.spring.help.CommonPropHelper; import pro.fessional.wings.slardar.spring.prop.SlardarPagequeryProp; import pro.fessional.wings.slardar.spring.prop.SlardarSwaggerProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.Map; @@ -34,7 +33,7 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(OpenAPI.class) -@AutoConfigureOrder(OrderedSlardarConst.SwaggerConfiguration) +@EnableConfigurationProperties(SlardarSwaggerProp.class) public class SlardarSwaggerConfiguration { private static final Log log = LogFactory.getLog(SlardarSwaggerConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java index 7f2970c50..5cafbbcd5 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java @@ -3,10 +3,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.core.Authentication; @@ -20,7 +20,6 @@ import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarTerminalProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.ArrayList; import java.util.Map; @@ -35,7 +34,7 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnProperty(name = SlardarEnabledProp.Key$terminal, havingValue = "true") -@AutoConfigureOrder(OrderedSlardarConst.TerminalConfiguration) +@EnableConfigurationProperties(SlardarTerminalProp.class) public class SlardarTerminalConfiguration { private final Log log = LogFactory.getLog(SlardarTerminalConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarUndertowConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarUndertowConfiguration.java index f922d6bf1..0267d5197 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarUndertowConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarUndertowConfiguration.java @@ -6,7 +6,6 @@ import io.undertow.websockets.jsr.WebSocketDeploymentInfo; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.web.ServerProperties; @@ -16,7 +15,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.util.unit.DataSize; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; /** @@ -26,7 +24,6 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(Undertow.class) -@AutoConfigureOrder(OrderedSlardarConst.UndertowConfiguration) public class SlardarUndertowConfiguration { private static final Log log = LogFactory.getLog(SlardarUndertowConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java index 6c70e8ad8..14c2d6fb2 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java @@ -5,7 +5,6 @@ import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.task.AsyncTaskExecutor; @@ -18,7 +17,6 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor; import pro.fessional.wings.slardar.webmvc.PageQueryArgumentResolver; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.List; @@ -29,7 +27,6 @@ * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@AutoConfigureOrder(OrderedSlardarConst.WebMvcConfiguration) public class SlardarWebMvcConfiguration implements WebMvcConfigurer { private static final Log log = LogFactory.getLog(SlardarWebMvcConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java new file mode 100644 index 000000000..444b82367 --- /dev/null +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java @@ -0,0 +1,54 @@ +package pro.fessional.wings.slardar.spring.conf; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarCookieConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarDebounceConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarDomainExtendConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarDoubleKillWebConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarLocaleConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarOkhttpWebConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarOverloadConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarPageQueryConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarRemoteConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarRestreamConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarRighterConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarSessionConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarSwaggerConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarTerminalConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarUndertowConfiguration; +import pro.fessional.wings.slardar.spring.bean.SlardarWebMvcConfiguration; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; + +/** + * @author trydofor + * @since 2019-07-11 + */ +@AutoConfiguration(before = WebMvcAutoConfiguration.class) +@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true") +@ImportAutoConfiguration({ + SlardarCookieConfiguration.class, + SlardarDebounceConfiguration.class, + SlardarDomainExtendConfiguration.class, + SlardarDoubleKillWebConfiguration.class, + SlardarFirstBloodConfiguration.class, + SlardarJacksonWebConfiguration.class, + SlardarLocaleConfiguration.class, + SlardarOkhttpWebConfiguration.class, + SlardarOverloadConfiguration.class, + SlardarPageQueryConfiguration.class, + SlardarRemoteConfiguration.class, + SlardarRestreamConfiguration.class, + SlardarRighterConfiguration.class, + SlardarSessionConfiguration.class, + SlardarSwaggerConfiguration.class, + SlardarTerminalConfiguration.class, + SlardarUndertowConfiguration.class, + SlardarWebMvcConfiguration.class, +}) +public class SlardarWebmvcAutoConfiguration { +} diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/webmvc/SlowResponseInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/webmvc/SlowResponseInterceptor.java index c9fd9eaa1..f16e5ad1c 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/webmvc/SlowResponseInterceptor.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/webmvc/SlowResponseInterceptor.java @@ -7,9 +7,9 @@ import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import pro.fessional.mirana.time.StopWatch.Watch; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.silencer.watch.Watches; import pro.fessional.wings.slardar.constants.SlardarServletConst; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.util.function.BiConsumer; @@ -18,23 +18,23 @@ * @since 2019-11-16 */ @Slf4j +@Getter @Setter public class SlowResponseInterceptor implements AutoRegisterInterceptor { + public static final int ORDER = WingsOrdered.Lv5Supervisor + 1_000; + + private int order = ORDER; + /** * The slow threshold in ms, `-1` means disable */ - @Getter @Setter private long thresholdMillis = -1; /** * Instead of logging, handle time-consuming and SQL yourself */ - @Getter @Setter private BiConsumer costAndReqConsumer = (c, r) -> log.warn("SLOW-RES cost={}ms, uri={}", c, r.getRequestURI()); - @Getter @Setter - private int order = OrderedSlardarConst.MvcSlowResponseInterceptor; - @Override public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, diff --git a/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 000000000..5453da925 --- /dev/null +++ b/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +pro.fessional.wings.slardar.spring.conf.SlardarWebmvcAutoConfiguration \ No newline at end of file diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/WingsSlardarWebmvcApplication.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarWebmvcApplication.java similarity index 72% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/WingsSlardarWebmvcApplication.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarWebmvcApplication.java index 6d26ba00a..390289ebf 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/WingsSlardarWebmvcApplication.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarWebmvcApplication.java @@ -1,17 +1,14 @@ -package pro.fessional.wings.slardar; +package pro.fessional.wings.slardar.app; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; -import org.springframework.context.annotation.ComponentScan; /** * @author trydofor * @since 2019-07-20 */ @SpringBootApplication -@ComponentScan({"pro.fessional.wings.slardar.service", - "pro.fessional.wings.slardar.controller",}) public class WingsSlardarWebmvcApplication { public static void main(String[] args) { diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/LoggingRequestConfiguration.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/LoggingRequestConfiguration.java similarity index 96% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/LoggingRequestConfiguration.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/LoggingRequestConfiguration.java index 2f77a3a95..5b2feed57 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/LoggingRequestConfiguration.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/LoggingRequestConfiguration.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.spring.bean; +package pro.fessional.wings.slardar.app.conf; import jakarta.servlet.http.Part; import lombok.SneakyThrows; @@ -11,6 +11,7 @@ import pro.fessional.wings.slardar.servlet.stream.AbstractRequestResponseLogging; import pro.fessional.wings.slardar.servlet.stream.RequestResponseLogging; import pro.fessional.wings.slardar.servlet.stream.ReuseStreamRequestWrapper; +import pro.fessional.wings.slardar.spring.bean.SlardarRestreamConfiguration; import java.util.Collection; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarAutoScanConfiguration.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarAutoScanConfiguration.java new file mode 100644 index 000000000..b28be949f --- /dev/null +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarAutoScanConfiguration.java @@ -0,0 +1,16 @@ +package pro.fessional.wings.slardar.app.conf; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +/** + * @author trydofor + * @since 2019-12-03 + */ +@Configuration(proxyBeanMethods = false) +@ComponentScan({ + "pro.fessional.wings.slardar.service", + "pro.fessional.wings.slardar.controller", +}) +public class SlardarAutoScanConfiguration { +} diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodTestConfiguration.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarFirstBloodTestConfiguration.java similarity index 91% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodTestConfiguration.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarFirstBloodTestConfiguration.java index 0e1be15cd..7d214bb59 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodTestConfiguration.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarFirstBloodTestConfiguration.java @@ -1,7 +1,6 @@ -package pro.fessional.wings.slardar.spring.bean; +package pro.fessional.wings.slardar.app.conf; import jakarta.servlet.http.HttpServletResponse; -import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.jetbrains.annotations.NotNull; @@ -23,16 +22,14 @@ * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@RequiredArgsConstructor public class SlardarFirstBloodTestConfiguration { private static final Log log = LogFactory.getLog(SlardarFirstBloodTestConfiguration.class); - private final SlardarFirstBloodProp firstBloodProp; - @Bean @ConditionalOnProperty(value = "spring.wings.slardar.enabled.first-blood-image-test", havingValue = "true") - public FirstBloodImageHandler firstBloodImageHandler(@Autowired(required = false) WingsRemoteResolver remoteResolver) { + public FirstBloodImageHandler firstBloodImageHandler(@Autowired(required = false) WingsRemoteResolver remoteResolver, + SlardarFirstBloodProp firstBloodProp) { log.info("Wings conf firstBloodImageHandler for test"); final FirstBloodImageHandler handler = new Test(); handler.setClientTicketKey(firstBloodProp.getClientTicketKey()); diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/async/TaskSchedulerHelper.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/async/TaskSchedulerHelper.java index 211ac84e0..74ee67a1c 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/async/TaskSchedulerHelper.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/async/TaskSchedulerHelper.java @@ -4,7 +4,6 @@ import org.springframework.scheduling.Trigger; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import pro.fessional.mirana.time.ThreadNow; -import pro.fessional.wings.spring.consts.NamingSlardarConst; import java.time.Instant; import java.util.concurrent.ScheduledFuture; @@ -30,7 +29,7 @@ public static ThreadPoolTaskScheduler Light() { } /** - * @see NamingSlardarConst#slardarHeavyScheduler + * see NamingSlardarConst#slardarHeavyScheduler */ @NotNull public static ThreadPoolTaskScheduler Heavy() { diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillAround.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillAround.java index 2210d14f4..878917dc0 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillAround.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillAround.java @@ -1,12 +1,14 @@ package pro.fessional.wings.slardar.concur.impl; import com.alibaba.ttl.threadpool.TtlExecutors; +import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.reflect.MethodSignature; +import org.jetbrains.annotations.Nullable; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -17,18 +19,17 @@ import org.springframework.core.annotation.Order; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; -import org.jetbrains.annotations.Nullable; import org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor; import org.springframework.util.StringUtils; import pro.fessional.mirana.lock.ArrayKey; import pro.fessional.mirana.lock.JvmStaticGlobalLock; import pro.fessional.mirana.time.ThreadNow; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.concur.DoubleKill; import pro.fessional.wings.slardar.concur.DoubleKillException; import pro.fessional.wings.slardar.concur.ProgressContext; import pro.fessional.wings.slardar.context.TerminalContext; import pro.fessional.wings.slardar.security.DefaultUserId; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.lang.reflect.Method; import java.util.Map; @@ -44,7 +45,7 @@ * @since 2021-03-09 */ @Aspect -@Order(OrderedSlardarConst.AopDoubleKillAround) +@Order(WingsOrdered.Lv3Service) @Slf4j public class DoubleKillAround { @@ -154,6 +155,7 @@ private Object syncProceed(ProceedingJoinPoint joinPoint, ProgressContext.Bar ba } // ////// + @Getter public static class Root { private final Method method; private final Object[] args; @@ -167,25 +169,10 @@ public Root(Method method, Object[] args, Object target) { this.targetClass = target.getClass(); } - public Method getMethod() { - return method; - } - public String getMethodName() { return method.getName(); } - public Object[] getArgs() { - return args; - } - - public Object getTarget() { - return target; - } - - public Class getTargetClass() { - return targetClass; - } } public static class Evaluator extends CachedExpressionEvaluator { diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java index b7b94858d..6003fb649 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java @@ -5,12 +5,14 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; +import org.springframework.boot.autoconfigure.AutoConfigureBefore; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration; import org.springframework.boot.autoconfigure.task.TaskExecutionProperties; import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration; import org.springframework.boot.autoconfigure.task.TaskSchedulingProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.task.TaskExecutorBuilder; import org.springframework.boot.task.TaskSchedulerBuilder; import org.springframework.context.ApplicationEventPublisher; @@ -24,12 +26,12 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner; +import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.async.TaskSchedulerHelper; import pro.fessional.wings.slardar.async.TtlThreadPoolTaskScheduler; import pro.fessional.wings.slardar.event.EventPublishHelper; import pro.fessional.wings.slardar.spring.prop.SlardarAsyncProp; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; -import pro.fessional.wings.spring.consts.OrderedSlardarConst; import java.lang.reflect.Method; import java.util.concurrent.Executor; @@ -37,8 +39,6 @@ import static org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME; import static org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor.DEFAULT_TASK_EXECUTOR_BEAN_NAME; import static org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor.DEFAULT_TASK_SCHEDULER_BEAN_NAME; -import static pro.fessional.wings.spring.consts.NamingSlardarConst.slardarEventExecutor; -import static pro.fessional.wings.spring.consts.NamingSlardarConst.slardarHeavyScheduler; /** *
@@ -52,14 +52,19 @@
  * @since 2019-12-03
  */
 @EnableAsync
-@Configuration(proxyBeanMethods = false)
+@Configuration
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$async, havingValue = "true")
-@AutoConfigureOrder(OrderedSlardarConst.AsyncConfiguration)
+@EnableConfigurationProperties(SlardarAsyncProp.class)
+@AutoConfigureBefore({TaskExecutionAutoConfiguration.class, TaskSchedulingAutoConfiguration.class}) // mark
 public class SlardarAsyncConfiguration {
 
+    public static final String slardarEventExecutor = "slardarEventExecutor";
+    public static final String slardarHeavyScheduler = "slardarHeavyScheduler";
+
     private static final Log log = LogFactory.getLog(SlardarAsyncConfiguration.class);
 
     @Bean(name = DEFAULT_TASK_EXECUTOR_BEAN_NAME)
+    @ConditionalOnMissingBean(name = DEFAULT_TASK_EXECUTOR_BEAN_NAME)
     public Executor taskExecutor(TaskExecutorBuilder builder) {
         final ThreadPoolTaskExecutor executor = builder.build();
         executor.initialize();
@@ -68,6 +73,7 @@ public Executor taskExecutor(TaskExecutorBuilder builder) {
     }
 
     @Bean(name = APPLICATION_TASK_EXECUTOR_BEAN_NAME)
+    @ConditionalOnMissingBean(name = APPLICATION_TASK_EXECUTOR_BEAN_NAME)
     public AsyncTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) {
         final ThreadPoolTaskExecutor executor = builder.build();
         executor.initialize();
@@ -78,6 +84,7 @@ public AsyncTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) {
 
     // Do NOT use @Primary to avoid overwriting the @Async thread pool.
     @Bean(name = DEFAULT_TASK_SCHEDULER_BEAN_NAME)
+    @ConditionalOnMissingBean(name = DEFAULT_TASK_SCHEDULER_BEAN_NAME)
     public ThreadPoolTaskScheduler taskScheduler(TaskSchedulerBuilder builder) {
         final TtlThreadPoolTaskScheduler scheduler = new TtlThreadPoolTaskScheduler();
         final TtlThreadPoolTaskScheduler bean = builder.configure(scheduler);
@@ -86,6 +93,7 @@ public ThreadPoolTaskScheduler taskScheduler(TaskSchedulerBuilder builder) {
     }
 
     @Bean(name = slardarEventExecutor)
+    @ConditionalOnMissingBean(name = slardarEventExecutor)
     public Executor slardarEventExecutor(SlardarAsyncProp prop) {
         TaskExecutorBuilder builder = new TaskExecutorBuilder();
         final TaskExecutionProperties event = prop.getEvent();
@@ -106,6 +114,7 @@ public Executor slardarEventExecutor(SlardarAsyncProp prop) {
     }
 
     @Bean(name = slardarHeavyScheduler)
+    @ConditionalOnMissingBean(name = slardarHeavyScheduler)
     public ThreadPoolTaskScheduler slardarHeavyScheduler(SlardarAsyncProp prop) {
         final TtlThreadPoolTaskScheduler scheduler = new TtlThreadPoolTaskScheduler();
         TaskSchedulerBuilder builder = new TaskSchedulerBuilder();
@@ -125,7 +134,7 @@ public ApplicationStartedEventRunner runnerEventPublishHelper(
             ApplicationEventMulticaster multicaster,
             @Qualifier(slardarEventExecutor) Executor executor) {
         log.info("Slardar spring-runs runnerEventPublishHelper");
-        return new ApplicationStartedEventRunner(OrderedSlardarConst.RunnerEventPublishHelper, ignored -> {
+        return new ApplicationStartedEventRunner(WingsOrdered.Lv4Application, ignored -> {
             EventPublishHelper.setExecutor(executor);
             log.info("Slardar conf eventPublishHelper ApplicationEventPublisher=" + publisher.getClass());
             EventPublishHelper.setSpringPublisher(publisher);
@@ -158,6 +167,7 @@ public ApplicationStartedEventRunner runnerEventPublishHelper(
     }
 
     @Bean
+    @ConditionalOnMissingBean
     public TaskSchedulerHelper taskSchedulerHelper(
             @Qualifier(DEFAULT_TASK_SCHEDULER_BEAN_NAME) ThreadPoolTaskScheduler light,
             @Qualifier(slardarHeavyScheduler) ThreadPoolTaskScheduler heavy) {
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java
index e2c9d0fb4..a44147de1 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java
@@ -6,10 +6,10 @@
 import org.cache2k.extra.spring.SpringCache2kCacheManager;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.cache.CacheManager;
 import org.springframework.cache.annotation.AbstractCachingConfiguration;
 import org.springframework.cache.annotation.CachingConfigurer;
@@ -32,7 +32,6 @@
 import pro.fessional.wings.slardar.cache.spring.WingsCacheResolver;
 import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -44,10 +43,10 @@
  * @see ProxyCachingConfiguration
  * @since 2019-12-03
  */
+@EnableCaching
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$caching, havingValue = "true")
-@EnableCaching
-@AutoConfigureOrder(OrderedSlardarConst.CacheConfiguration)
+@EnableConfigurationProperties(SlardarCacheProp.class)
 public class SlardarCacheConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarCacheConfiguration.class);
@@ -98,7 +97,6 @@ public CacheInterceptor wingsCacheInterceptor(CacheOperationSource cacheOperatio
     // //////////////////// cache ////////////////////
     @Configuration(proxyBeanMethods = false)
     @RequiredArgsConstructor
-    @AutoConfigureOrder(OrderedSlardarConst.CachingConfigurerSupport)
     public static class SlardarCachingConfigurerSupport implements CachingConfigurer {
         private final Map managers;
         private final Map resolvers;
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java
index a430ee489..0bfe15d4d 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java
@@ -4,8 +4,8 @@
 import lombok.val;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.convert.ApplicationConversionService;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -21,7 +21,6 @@
 import pro.fessional.wings.slardar.autozone.spring.ZonedDateTime2StringConverter;
 import pro.fessional.wings.slardar.spring.prop.SlardarDatetimeProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 import java.time.format.DateTimeFormatter;
 import java.util.stream.Collectors;
@@ -35,8 +34,8 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$datetime, havingValue = "true")
+@EnableConfigurationProperties(SlardarDatetimeProp.class)
 @RequiredArgsConstructor
-@AutoConfigureOrder(OrderedSlardarConst.DateTimeConfiguration)
 public class SlardarDateTimeConfiguration {
     private static final Log log = LogFactory.getLog(SlardarDateTimeConfiguration.class);
 
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
index 2bce1addd..a6df099ec 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
@@ -5,20 +5,19 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.slardar.notice.DingTalkNotice;
 import pro.fessional.wings.slardar.spring.prop.SlardarDingNoticeProp;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 /**
  * @author trydofor
  * @since 2019-06-29
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedSlardarConst.DingNoticeConfiguration)
+@EnableConfigurationProperties(SlardarDingNoticeProp.class)
 public class SlardarDingNoticeConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarDingNoticeConfiguration.class);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java
index 50d31feb9..db9d994f9 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java
@@ -3,12 +3,10 @@
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.slardar.concur.impl.DoubleKillAround;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
@@ -18,7 +16,6 @@
 @Configuration(proxyBeanMethods = false)
 @RequiredArgsConstructor
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$doubleKill, havingValue = "true")
-@AutoConfigureOrder(OrderedSlardarConst.DoubleKillConfiguration)
 public class SlardarDoubleKillConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarDoubleKillConfiguration.class);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
index bfb8f5253..bc66885ac 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
@@ -4,17 +4,16 @@
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
 import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.autodto.AutoDtoHelper;
 import pro.fessional.wings.slardar.autodto.AutoZoneVisitor;
 import pro.fessional.wings.slardar.autodto.I18nStringVisitor;
 import pro.fessional.wings.slardar.context.LocaleZoneIdUtil;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 /**
  * @author trydofor
@@ -24,7 +23,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @RequiredArgsConstructor
-@AutoConfigureOrder(OrderedSlardarConst.I18nConfiguration)
 public class SlardarI18nConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarI18nConfiguration.class);
@@ -40,7 +38,7 @@ public LocalValidatorFactoryBean localValidatorFactoryBean(MessageSource message
     @Bean
     public ApplicationStartedEventRunner runnerAutoDtoHelper(MessageSource messageSource) {
         log.info("Slardar spring-runs runnerAutoDtoHelper");
-        return new ApplicationStartedEventRunner(OrderedSlardarConst.RunnerAutoDtoHelper, ignored -> new AutoDtoHelper() {{
+        return new ApplicationStartedEventRunner(WingsOrdered.Lv1Config, ignored -> new AutoDtoHelper() {{
             final I18nStringVisitor i18nStringVisitor = new I18nStringVisitor(messageSource, LocaleZoneIdUtil.LocaleNonnull);
 
             RequestVisitor.add(AutoDtoHelper.AutoDtoVisitor);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java
index e3cdd3ba1..4cab4ce60 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java
@@ -5,10 +5,10 @@
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -18,7 +18,7 @@
 import pro.fessional.wings.slardar.jackson.I18nResultPropertyFilter;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarJacksonProp;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
+import pro.fessional.wings.slardar.spring.prop.SlardarNumberProp;
 
 import java.time.LocalDate;
 
@@ -31,8 +31,8 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(DateSerializer.class)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$jackson, havingValue = "true")
+@EnableConfigurationProperties({SlardarJacksonProp.class, SlardarNumberProp.class})
 @RequiredArgsConstructor
-@AutoConfigureOrder(OrderedSlardarConst.JacksonConfiguration)
 public class SlardarJacksonConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarJacksonConfiguration.class);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java
index 47608cd2c..c12fa8903 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java
@@ -8,11 +8,11 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.context.properties.bind.Binder;
 import org.springframework.context.EnvironmentAware;
 import org.springframework.context.annotation.Bean;
@@ -29,7 +29,6 @@
 import pro.fessional.wings.slardar.notice.DingTalkNotice;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarMonitorProp;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 import java.io.File;
 import java.util.Map;
@@ -38,10 +37,10 @@
  * @author trydofor
  * @since 2019-06-29
  */
+@EnableScheduling
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$monitor, havingValue = "true")
-@EnableScheduling
-@AutoConfigureOrder(OrderedSlardarConst.MonitorConfiguration)
+@EnableConfigurationProperties(SlardarMonitorProp.class)
 public class SlardarMonitorConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarMonitorConfiguration.class);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java
index 0ed0a3feb..dcef2921a 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java
@@ -10,15 +10,16 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpClientBuilder;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpClientHelper;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpHostCookie;
@@ -26,7 +27,6 @@
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpRedirectNopInterceptor;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarOkHttpProp;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 
 import java.io.File;
 import java.nio.file.Files;
@@ -42,7 +42,7 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(OkHttpClient.class)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$okhttp, havingValue = "true")
-@AutoConfigureOrder(OrderedSlardarConst.OkhttpConfiguration)
+@EnableConfigurationProperties(SlardarOkHttpProp.class)
 public class SlardarOkhttpConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarOkhttpConfiguration.class);
@@ -158,7 +158,7 @@ public OkHttpClient okHttpClient(Builder builder) {
     @Bean
     public CommandLineRunnerOrdered runnerOkHttpHelper(ObjectProvider opb, ObjectProvider ohc) {
         log.info("Slardar spring-runs runnerOkHttpHelper");
-        return new CommandLineRunnerOrdered(OrderedSlardarConst.RunnerOkHttpHelper, ignored -> {
+        return new CommandLineRunnerOrdered(WingsOrdered.Lv3Service, ignored -> {
             final Builder ob = opb.getIfAvailable();
             if (ob != null) {
                 log.info("Slardar spring-conf OkHttpClientBuilder");
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakingConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakingConfiguration.java
index 4b3d51cb5..282cac1cd 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakingConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakingConfiguration.java
@@ -2,11 +2,9 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.spring.consts.OrderedSlardarConst;
 import pro.fessional.wings.slardar.event.TweakEventListener;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpTweakLogInterceptor;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
@@ -17,7 +15,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$tweaking, havingValue = "true")
-@AutoConfigureOrder(OrderedSlardarConst.TweakingConfiguration)
 public class SlardarTweakingConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarTweakingConfiguration.class);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/boot/WingsAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/boot/WingsAutoConfiguration.java
deleted file mode 100644
index e88d720fa..000000000
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/boot/WingsAutoConfiguration.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package pro.fessional.wings.slardar.spring.boot;
-
-import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
-import org.springframework.context.annotation.ComponentScan;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
-
-/**
- * @author trydofor
- * @since 2019-07-11
- */
-@ComponentScan("pro.fessional.wings.slardar.spring.bean")
-@ConfigurationPropertiesScan("pro.fessional.wings.slardar.spring.prop")
-@AutoConfiguration
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
-public class WingsAutoConfiguration {
-}
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
new file mode 100644
index 000000000..4898344d6
--- /dev/null
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
@@ -0,0 +1,41 @@
+package pro.fessional.wings.slardar.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
+import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarCacheConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarDingNoticeConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarDoubleKillConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarI18nConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarMonitorConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarTweakingConfiguration;
+import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration(before = {TaskExecutionAutoConfiguration.class, TaskSchedulingAutoConfiguration.class})
+@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
+@EnableConfigurationProperties(SlardarEnabledProp.class)
+@ImportAutoConfiguration({
+        SlardarAsyncConfiguration.class,
+        SlardarCacheConfiguration.class,
+        SlardarDateTimeConfiguration.class,
+        SlardarDingNoticeConfiguration.class,
+        SlardarDoubleKillConfiguration.class,
+        SlardarI18nConfiguration.class,
+        SlardarJacksonConfiguration.class,
+        SlardarMonitorConfiguration.class,
+        SlardarOkhttpConfiguration.class,
+        SlardarTweakingConfiguration.class,
+})
+public class SlardarAutoConfiguration {
+}
diff --git a/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 8fc8ed345..7eefc650a 100644
--- a/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1 @@
-pro.fessional.wings.slardar.spring.boot.WingsAutoConfiguration
+pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration
\ No newline at end of file
diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/WingsSlardarApplication.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarApplication.java
similarity index 78%
rename from wings/slardar/src/test/java/pro/fessional/wings/slardar/WingsSlardarApplication.java
rename to wings/slardar/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarApplication.java
index b5b9fb210..55ad09ce6 100644
--- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/WingsSlardarApplication.java
+++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarApplication.java
@@ -1,14 +1,16 @@
-package pro.fessional.wings.slardar;
+package pro.fessional.wings.slardar.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
+import org.springframework.context.annotation.ComponentScan;
 
 /**
  * @author trydofor
  * @since 2019-07-20
  */
 @SpringBootApplication
+@ComponentScan("pro.fessional.wings.slardar.service")
 public class WingsSlardarApplication {
 
     public static void main(String[] args) {
diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/TaskSchedulerTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/TaskSchedulerTest.java
index 6772deb61..dbd40a374 100644
--- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/TaskSchedulerTest.java
+++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/TaskSchedulerTest.java
@@ -10,6 +10,7 @@
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
 import pro.fessional.wings.slardar.context.TerminalContext;
+import pro.fessional.wings.slardar.service.AsyncService;
 
 import java.time.Duration;
 import java.util.concurrent.CompletableFuture;
diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/AsyncService.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/service/AsyncService.java
similarity index 95%
rename from wings/slardar/src/test/java/pro/fessional/wings/slardar/async/AsyncService.java
rename to wings/slardar/src/test/java/pro/fessional/wings/slardar/service/AsyncService.java
index 2ee36f697..1922bf2fc 100644
--- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/AsyncService.java
+++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/service/AsyncService.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.slardar.async;
+package pro.fessional.wings.slardar.service;
 
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Async;
diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/ScheduleService.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/service/ScheduleService.java
similarity index 91%
rename from wings/slardar/src/test/java/pro/fessional/wings/slardar/async/ScheduleService.java
rename to wings/slardar/src/test/java/pro/fessional/wings/slardar/service/ScheduleService.java
index 966970823..fcc85faae 100644
--- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/ScheduleService.java
+++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/service/ScheduleService.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.slardar.async;
+package pro.fessional.wings.slardar.service;
 
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.scheduling.annotation.Scheduled;
diff --git a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
index 6aceca7a4..e1ecb4fbf 100644
--- a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
+++ b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
@@ -3,7 +3,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
@@ -14,9 +13,9 @@
 import pro.fessional.wings.silencer.modulate.RunMode;
 import pro.fessional.wings.silencer.modulate.RuntimeMode;
 import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.serialize.JsonConversion;
 import pro.fessional.wings.slardar.serialize.KryoConversion;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.database.autogen.tables.daos.SysConstantEnumDao;
 import pro.fessional.wings.warlock.service.conf.RuntimeConfService;
 import pro.fessional.wings.warlock.service.conf.impl.RuntimeConfServiceImpl;
@@ -28,7 +27,6 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedWarlockConst.AwesomeConfiguration)
 public class WarlockAwesomeConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockAwesomeConfiguration.class);
@@ -57,7 +55,7 @@ public RuntimeConfService runtimeConfService(ObjectProvider c
     @Bean
     public CommandLineRunnerOrdered runnerRegisterRuntimeMode(ObjectProvider provider) {
         log.info("Warlock spring-runs runnerRegisterRuntimeMode");
-        return new CommandLineRunnerOrdered(OrderedWarlockConst.RunnerRegisterRuntimeMode, ignored -> {
+        return new CommandLineRunnerOrdered(WingsOrdered.Lv3Service, ignored -> {
             final RuntimeConfService confService = provider.getIfAvailable();
             if (confService == null) {
                 log.info("Warlock conf skip registerRuntimeMode for NULL ");
diff --git a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java
new file mode 100644
index 000000000..1a222bbac
--- /dev/null
+++ b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java
@@ -0,0 +1,15 @@
+package pro.fessional.wings.warlock.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockAwesomeConfiguration;
+
+
+/**
+ * @author trydofor
+ * @since 2019-12-01
+ */
+@AutoConfiguration
+@ImportAutoConfiguration(WarlockAwesomeConfiguration.class)
+public class WarlockAwesomeAutoConfiguration {
+}
diff --git a/wings/warlock-awesome/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/warlock-awesome/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..ff88409b3
--- /dev/null
+++ b/wings/warlock-awesome/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.warlock.spring.conf.WarlockAwesomeAutoConfiguration
diff --git a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/WingsWarlockAwesomeApplication.java b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockAwesomeApplication.java
similarity index 90%
rename from wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/WingsWarlockAwesomeApplication.java
rename to wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockAwesomeApplication.java
index f82d66329..384cbe81b 100644
--- a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/WingsWarlockAwesomeApplication.java
+++ b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockAwesomeApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.warlock;
+package pro.fessional.wings.warlock.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
index 1d46c4dfd..d7f0b792b 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
@@ -10,11 +10,11 @@
 import org.springframework.context.MessageSource;
 import org.springframework.context.i18n.LocaleContextHolder;
 import pro.fessional.wings.faceless.service.journal.JournalService;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.context.GlobalAttributeHolder;
 import pro.fessional.wings.slardar.context.TerminalContext;
 import pro.fessional.wings.slardar.errcode.AuthnErrorEnum;
 import pro.fessional.wings.slardar.security.WingsAuthTypeParser;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.constants.WarlockGlobalAttribute;
 import pro.fessional.wings.warlock.database.autogen.tables.WinUserAuthnTable;
 import pro.fessional.wings.warlock.database.autogen.tables.WinUserBasisTable;
@@ -34,10 +34,11 @@
  * @since 2022-07-11
  */
 @Slf4j
+@Getter @Setter
 public class DefaultDaoAuthnCombo implements ComboWarlockAuthnService.Combo {
 
-    @Getter @Setter
-    private int order = OrderedWarlockConst.DefaultDaoAuthnCombo;
+    public static final int ORDER = WingsOrdered.Lv4Application;
+    private int order = ORDER;
 
     @Setter(onMethod_ = {@Autowired})
     protected WinUserBasisDao winUserBasisDao;
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
index 19b5ae412..c8313953f 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
@@ -3,13 +3,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.caching.CacheConst;
 import pro.fessional.wings.warlock.database.autogen.tables.WinPermEntryTable;
 import pro.fessional.wings.warlock.database.autogen.tables.WinRoleEntryTable;
@@ -38,8 +36,7 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityBean, havingValue = "true")
-@AutoConfigureBefore(WarlockSecurityBeanConfiguration.class)
-@AutoConfigureOrder(OrderedWarlockConst.BondBeanConfiguration)
+@EnableConfigurationProperties(WarlockDangerProp.class)
 public class WarlockBondBeanConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockBondBeanConfiguration.class);
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java
new file mode 100644
index 000000000..8de37aa64
--- /dev/null
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java
@@ -0,0 +1,15 @@
+package pro.fessional.wings.warlock.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration;
+
+
+/**
+ * @author trydofor
+ * @since 2019-12-01
+ */
+@AutoConfiguration(before = WarlockShadowAutoConfiguration.class)
+@ImportAutoConfiguration(WarlockBondBeanConfiguration.class)
+public class WarlockBondAutoConfiguration {
+}
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockDangerProp.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockDangerProp.java
similarity index 100%
rename from wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockDangerProp.java
rename to wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockDangerProp.java
diff --git a/wings/warlock-bond/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/warlock-bond/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..7d7b522ab
--- /dev/null
+++ b/wings/warlock-bond/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.warlock.spring.conf.WarlockBondAutoConfiguration
diff --git a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/WingsWarlockBondApplication.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockBondApplication.java
similarity index 89%
rename from wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/WingsWarlockBondApplication.java
rename to wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockBondApplication.java
index 7d6793cb1..04d211459 100644
--- a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/WingsWarlockBondApplication.java
+++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockBondApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.warlock;
+package pro.fessional.wings.warlock.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/WingsWarlockCodegenApplication.java b/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockCodegenApplication.java
similarity index 90%
rename from wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/WingsWarlockCodegenApplication.java
rename to wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockCodegenApplication.java
index 1a3f68779..305a65234 100644
--- a/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/WingsWarlockCodegenApplication.java
+++ b/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockCodegenApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.warlock;
+package pro.fessional.wings.warlock.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/errorhandle/DefaultExceptionResolver.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/errorhandle/DefaultExceptionResolver.java
index 14cdecff6..bdf14ed0a 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/errorhandle/DefaultExceptionResolver.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/errorhandle/DefaultExceptionResolver.java
@@ -4,7 +4,6 @@
 import lombok.SneakyThrows;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.MessageSource;
-import org.springframework.core.annotation.Order;
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.AccessDeniedException;
 import org.springframework.security.core.AuthenticationException;
@@ -21,7 +20,6 @@
 import pro.fessional.wings.slardar.errcode.AuthzErrorEnum;
 import pro.fessional.wings.slardar.webmvc.SimpleExceptionResolver;
 import pro.fessional.wings.slardar.webmvc.SimpleResponse;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 
 import java.util.Locale;
 
@@ -34,7 +32,6 @@
  * @since 2021-03-25
  */
 @Slf4j
-@Order(OrderedWarlockConst.DefaultExceptionResolver)
 public class DefaultExceptionResolver extends SimpleExceptionResolver {
 
     protected final MessageSource messageSource;
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/errorhandle/auto/BindExceptionAdvice.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/errorhandle/auto/BindExceptionAdvice.java
index 3eecb1fb7..f3ffa47d3 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/errorhandle/auto/BindExceptionAdvice.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/errorhandle/auto/BindExceptionAdvice.java
@@ -12,8 +12,8 @@
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.RestController;
 import pro.fessional.mirana.data.R;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.servlet.MessageHelper;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.errcode.CommonErrorEnum;
 
 import static pro.fessional.wings.slardar.servlet.request.RequestHelper.allErrors;
@@ -24,9 +24,11 @@
  */
 
 @ControllerAdvice(annotations = RestController.class)
-@Order(OrderedWarlockConst.BindExceptionAdvice)
+@Order(BindExceptionAdvice.ORDER)
 public class BindExceptionAdvice {
 
+    public static final int ORDER = WingsOrdered.Lv4Application;
+
     @Setter(onMethod_ = {@Autowired})
     protected MessageSource messageSource;
 
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/JustAuthRequestBuilder.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/JustAuthRequestBuilder.java
index b65fa01be..320e522c5 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/JustAuthRequestBuilder.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/JustAuthRequestBuilder.java
@@ -54,9 +54,9 @@
 import org.springframework.security.authentication.InsufficientAuthenticationException;
 import org.springframework.security.authentication.InternalAuthenticationServiceException;
 import pro.fessional.mirana.flow.FlowEnum;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.security.impl.ComboWingsAuthDetailsSource;
 import pro.fessional.wings.slardar.security.impl.DefaultWingsAuthDetails;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.security.session.NonceTokenSessionHelper;
 
 import java.util.ArrayList;
@@ -72,10 +72,11 @@
 @Getter
 public class JustAuthRequestBuilder implements ComboWingsAuthDetailsSource.Combo {
 
+    public static final int ORDER = WingsOrdered.Lv4Application;
     @Setter
-    private Map, AuthConfig> authConfigMap = Collections.emptyMap();
+    private int order = ORDER;
     @Setter
-    private int order = OrderedWarlockConst.SecJustAuthRequestBuilder;
+    private Map, AuthConfig> authConfigMap = Collections.emptyMap();
 
     @Setter(onMethod_ = {@Autowired})
     private AuthStateCache authStateCache;
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/loginpage/JustAuthLoginPageCombo.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/loginpage/JustAuthLoginPageCombo.java
index 91537f9ef..cb987d67f 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/loginpage/JustAuthLoginPageCombo.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/loginpage/JustAuthLoginPageCombo.java
@@ -13,9 +13,9 @@
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import pro.fessional.mirana.data.R;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.security.impl.ComboWingsAuthPageHandler;
 import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.security.justauth.AuthStateBuilder;
 import pro.fessional.wings.warlock.security.justauth.JustAuthRequestBuilder;
 import pro.fessional.wings.warlock.security.session.NonceTokenSessionHelper;
@@ -24,10 +24,11 @@
  * @author trydofor
  * @since 2021-02-19
  */
+@Setter @Getter
 public class JustAuthLoginPageCombo implements ComboWingsAuthPageHandler.Combo {
 
-    @Setter @Getter
-    private int order = OrderedWarlockConst.SecJustAuthLoginPageCombo;
+    public static final int ORDER = WingsOrdered.Lv4Application;
+    private int order = ORDER;
 
     @Setter(onMethod_ = {@Autowired})
     protected JustAuthRequestBuilder justAuthRequestBuilder;
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/loginpage/ListAllLoginPageCombo.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/loginpage/ListAllLoginPageCombo.java
index e7032ef80..0516e5414 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/loginpage/ListAllLoginPageCombo.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/loginpage/ListAllLoginPageCombo.java
@@ -11,18 +11,19 @@
 import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import pro.fessional.mirana.data.R;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.security.impl.ComboWingsAuthPageHandler;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.spring.prop.WarlockSecurityProp;
 
 /**
  * @author trydofor
  * @since 2021-02-19
  */
+@Setter @Getter
 public class ListAllLoginPageCombo implements ComboWingsAuthPageHandler.Combo {
 
-    @Setter @Getter
-    private int order = OrderedWarlockConst.SecListAllLoginPageCombo;
+    public static final int ORDER = WingsOrdered.Lv4Application + 100;
+    private int order = ORDER;
 
     @Setter(onMethod_ = {@Autowired})
     protected WarlockSecurityProp warlockSecurityProp;
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultPermRoleCombo.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultPermRoleCombo.java
index 3642ce6ec..c478a5cfc 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultPermRoleCombo.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultPermRoleCombo.java
@@ -5,8 +5,8 @@
 import lombok.extern.slf4j.Slf4j;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.security.impl.DefaultWingsUserDetails;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.enums.autogen.GrantType;
 import pro.fessional.wings.warlock.service.grant.WarlockGrantService;
 
@@ -19,10 +19,11 @@
  * @since 2021-03-05
  */
 @Slf4j
+@Getter @Setter
 public class DefaultPermRoleCombo implements ComboWarlockAuthzService.Combo {
 
-    @Getter @Setter
-    private int order = OrderedWarlockConst.DefaultPermRoleCombo;
+    public static final int ORDER = WingsOrdered.Lv3Service;
+    private int order = ORDER;
 
     @Setter(onMethod_ = {@Autowired})
     protected WarlockGrantService warlockGrantService;
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
index ca80c13c4..8f6cfa99a 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
@@ -8,10 +8,10 @@
 import org.springframework.transaction.annotation.Transactional;
 import pro.fessional.mirana.code.RandCode;
 import pro.fessional.wings.faceless.service.journal.JournalService;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.context.GlobalAttributeHolder;
 import pro.fessional.wings.slardar.context.TerminalContext;
 import pro.fessional.wings.slardar.security.WingsAuthDetails;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.constants.WarlockGlobalAttribute;
 import pro.fessional.wings.warlock.enums.autogen.UserGender;
 import pro.fessional.wings.warlock.enums.autogen.UserStatus;
@@ -29,10 +29,11 @@
  * @since 2021-02-25
  */
 @Slf4j
+@Getter @Setter
 public class DefaultUserAuthnAutoReg implements ComboWarlockAuthnService.AutoReg {
 
-    @Getter @Setter
-    private int order = OrderedWarlockConst.DefaultUserAuthnAutoReg;
+    public static final int ORDER = WingsOrdered. Lv3Service + 10;
+    private int order = ORDER;
 
     @Setter(onMethod_ = {@Autowired})
     protected WarlockUserBasisService warlockUserBasisService;
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserDetailsCombo.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserDetailsCombo.java
index 67532fc77..3cc7ad0c3 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserDetailsCombo.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserDetailsCombo.java
@@ -6,11 +6,11 @@
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.springframework.beans.factory.annotation.Autowired;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.slardar.event.EventPublishHelper;
 import pro.fessional.wings.slardar.security.WingsAuthDetails;
 import pro.fessional.wings.slardar.security.impl.ComboWingsUserDetailsService;
 import pro.fessional.wings.slardar.security.impl.DefaultWingsUserDetails;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.event.auth.WarlockAutoRegisterEvent;
 import pro.fessional.wings.warlock.service.auth.WarlockAuthnService;
 import pro.fessional.wings.warlock.service.auth.WarlockAuthnService.Details;
@@ -24,12 +24,13 @@
  * @since 2021-02-22
  */
 @Slf4j
+@Getter @Setter
 public class DefaultUserDetailsCombo implements ComboWingsUserDetailsService.Combo {
 
-    @Getter @Setter
-    private int order = OrderedWarlockConst.DefaultUserDetailsCombo;
+    public static final int ORDER = WingsOrdered.Lv3Service + 900;
+
+    private int order = ORDER;
 
-    @Getter @Setter
     private Set> autoRegisterType = new HashSet<>();
 
     @Setter(onMethod_ = {@Autowired})
@@ -71,7 +72,7 @@ public final DefaultWingsUserDetails loadOrNull(String username, @NotNull Enum en : securityProp.getMemUser().entrySet()) {
             log.info("WarlockShadow conf add MemUser=" + en.getKey());
             final Mu mu = en.getValue();
@@ -354,7 +354,7 @@ public ComboWingsAuthCheckService comboWingsAuthCheckService(ObjectProvider h
 
     @Bean
     @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityHttpBind, havingValue = "true")
-    @Order(OrderedWarlockConst.SecurityBindHttp)
+    @Order(WingsOrdered.Lv4Application + 200)
     public HttpSecurityCustomizer warlockSecurityBindHttpConfigure(
             ObjectProvider authenticationSuccessHandler,
             ObjectProvider authenticationFailureHandler,
@@ -154,7 +152,7 @@ public HttpSecurityCustomizer warlockSecurityBindHttpConfigure(
 
     @Bean
     @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityHttpAuth, havingValue = "true")
-    @Order(OrderedWarlockConst.SecurityAuthHttp)
+    @Order(WingsOrdered.Lv4Application + 300)
     public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(ObjectProvider mvcMatcher) {
         log.info("WarlockShadow spring-bean warlockSecurityAuthHttpConfigure");
         MvcRequestMatcher.Builder mvc = mvcMatcher.getIfAvailable();
@@ -200,7 +198,7 @@ public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(ObjectProvider csrf,
             ObjectProvider cache) {
@@ -259,7 +257,7 @@ public HttpSecurityCustomizer warlockSecurityAutoHttpConfigure(
      */
     @Bean
     @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityHttpChain, havingValue = "true")
-    @Order(OrderedWarlockConst.SecurityFilterChain)
+    @Order(WingsOrdered.Lv4Application + 900)
     public SecurityFilterChain securityFilterChain(HttpSecurity http, Map configures) throws Exception {
         log.info("WarlockShadow conf securityFilterChain, begin");
         for (Map.Entry en : configures.entrySet()) {
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java
index 4222adba6..ff44894f5 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java
@@ -2,13 +2,11 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.slardar.webmvc.SlowResponseInterceptor;
 import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockWatchingProp;
@@ -20,7 +18,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = WarlockEnabledProp.Key$watching, havingValue = "true")
-@AutoConfigureOrder(OrderedWarlockConst.Watching2Configuration)
 public class WarlockWatching2Configuration {
 
     private final static Log log = LogFactory.getLog(WarlockWatching2Configuration.class);
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java
new file mode 100644
index 000000000..d33450c5a
--- /dev/null
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java
@@ -0,0 +1,39 @@
+package pro.fessional.wings.warlock.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.AutoConfigureBefore;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import pro.fessional.wings.warlock.spring.bean.WarlockExceptionConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockHazelcastConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockJournalConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockJustAuthConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockOauthTicketConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockOtherBeanConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockWatching2Configuration;
+import pro.fessional.wings.warlock.spring.prop.WarlockApiAuthProp;
+import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp;
+
+
+/**
+ * @author trydofor
+ * @since 2019-12-01
+ */
+@AutoConfiguration
+@AutoConfigureBefore(WarlockSecurityBeanConfiguration.class)
+@EnableConfigurationProperties({WarlockApiAuthProp.class, WarlockUrlmapProp.class})
+@ImportAutoConfiguration({
+        WarlockExceptionConfiguration.class,
+        WarlockHazelcastConfiguration.class,
+        WarlockJournalConfiguration.class,
+        WarlockJustAuthConfiguration.class,
+        WarlockOauthTicketConfiguration.class,
+        WarlockOtherBeanConfiguration.class,
+        WarlockSecurityBeanConfiguration.class,
+        WarlockSecurityConfConfiguration.class,
+        WarlockWatching2Configuration.class,
+})
+public class WarlockShadowAutoConfiguration {
+}
diff --git a/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..64e7b739b
--- /dev/null
+++ b/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.warlock.spring.conf.WarlockShadowAutoConfiguration
diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/WingsWarlockShadowApplication.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockShadowApplication.java
similarity index 92%
rename from wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/WingsWarlockShadowApplication.java
rename to wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockShadowApplication.java
index 02eb8dd7f..81779d05f 100644
--- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/WingsWarlockShadowApplication.java
+++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockShadowApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.warlock;
+package pro.fessional.wings.warlock.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/wings/warlock-test/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockTestAutoConfiguration.java b/wings/warlock-test/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockTestAutoConfiguration.java
new file mode 100644
index 000000000..a0973d642
--- /dev/null
+++ b/wings/warlock-test/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockTestAutoConfiguration.java
@@ -0,0 +1,18 @@
+package pro.fessional.wings.warlock.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.context.annotation.ComponentScan;
+
+/**
+ * @author trydofor
+ * @since 2022-01-29
+ */
+@SuppressWarnings("SpringComponentScan")
+@AutoConfiguration
+@ComponentScan({
+        "pro.fessional.wings.warlock.helper",
+        "pro.fessional.wings.warlock.service",
+        "pro.fessional.wings.warlock.controller",
+})
+public class WarlockTestAutoConfiguration {
+}
diff --git a/wings/warlock-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/warlock-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
new file mode 100644
index 000000000..576328cf5
--- /dev/null
+++ b/wings/warlock-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -0,0 +1 @@
+pro.fessional.wings.warlock.spring.conf.WarlockTestAutoConfiguration
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
index 32a067880..73592579a 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
@@ -3,8 +3,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.helper.DatabaseChecker;
@@ -14,7 +14,7 @@
 import pro.fessional.wings.faceless.enums.TimezoneEnumUtil;
 import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner;
 import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
+import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.warlock.spring.prop.WarlockCheckProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockI18nProp;
@@ -26,7 +26,7 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureOrder(OrderedWarlockConst.AutoRunConfiguration)
+@EnableConfigurationProperties({WarlockCheckProp.class, WarlockI18nProp.class})
 public class WarlockAutoRunConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockAutoRunConfiguration.class);
@@ -34,7 +34,7 @@ public class WarlockAutoRunConfiguration {
     @Bean
     public ApplicationStartedEventRunner runnerRegisterEnumUtil(ObjectProvider provider) {
         log.info("Warlock spring-runs runnerRegisterEnumUtil");
-        return new ApplicationStartedEventRunner(OrderedWarlockConst.RunnerRegisterEnumUtil, ignored -> {
+        return new ApplicationStartedEventRunner(WingsOrdered.Lv4Application, ignored -> {
             final WarlockI18nProp warlockI18nProp = provider.getIfAvailable();
             if (warlockI18nProp == null) {
                 log.info("Warlock conf skip registerEnumUtil for NULL ");
@@ -69,7 +69,7 @@ public ApplicationStartedEventRunner runnerRegisterEnumUtil(ObjectProvider {
+        return new CommandLineRunnerOrdered(WingsOrdered.Lv2Resource, ignored -> {
             DatabaseChecker.version(dataSource);
             DatabaseChecker.timezone(dataSource, prop.getTzOffset(), prop.isTzFail());
         });
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java
index c01592d35..9f7a6b58b 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java
@@ -3,7 +3,6 @@
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
@@ -11,7 +10,6 @@
 import org.springframework.jdbc.core.JdbcTemplate;
 import pro.fessional.mirana.lock.JvmStaticGlobalLock;
 import pro.fessional.wings.faceless.concur.DatabaseGlobalLock;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 
 
@@ -21,7 +19,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @RequiredArgsConstructor
-@AutoConfigureOrder(OrderedWarlockConst.LockBeanConfiguration)
 public class WarlockLockBeanConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockLockBeanConfiguration.class);
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java
index 0edc71cf6..77d6a5e7a 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java
@@ -2,7 +2,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -11,7 +10,6 @@
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.WingsTableCudHandler;
 import pro.fessional.wings.slardar.event.EventPublishHelper;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.service.event.TableChangePublisher;
 import pro.fessional.wings.warlock.service.event.impl.TableChangePublisherImpl;
 import pro.fessional.wings.warlock.service.event.impl.WingsTableCudHandlerImpl;
@@ -24,7 +22,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = WarlockEnabledProp.Key$tableChange, havingValue = "true")
-@AutoConfigureOrder(OrderedWarlockConst.TableChangeConfiguration)
 public class WarlockTableChangeConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockTableChangeConfiguration.class);
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java
index 2adc01c9a..171e64032 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java
@@ -4,20 +4,17 @@
 import org.apache.commons.logging.LogFactory;
 import org.jooq.ExecuteListenerProvider;
 import org.jooq.impl.DefaultExecuteListenerProvider;
-import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.jooq.listener.SlowSqlListener;
 import pro.fessional.wings.silencer.watch.WatchingAround;
-import pro.fessional.wings.spring.consts.OrderedWarlockConst;
 import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockWatchingProp;
 
-import static pro.fessional.wings.spring.consts.NamingWarlockConst.slowSqlJooqListener;
-
 
 /**
  * @author trydofor
@@ -25,9 +22,11 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = WarlockEnabledProp.Key$watching, havingValue = "true")
-@AutoConfigureOrder(OrderedWarlockConst.WatchingConfiguration)
+@EnableConfigurationProperties(WarlockWatchingProp.class)
 public class WarlockWatchingConfiguration {
 
+    public static final String slowSqlJooqListener = "slowSqlJooqListener";
+
     private final static Log log = LogFactory.getLog(WarlockWatchingConfiguration.class);
 
     @Bean
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/boot/WingsAutoConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/boot/WingsAutoConfiguration.java
deleted file mode 100644
index bb5f3c141..000000000
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/boot/WingsAutoConfiguration.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package pro.fessional.wings.warlock.spring.boot;
-
-import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
-import org.springframework.context.annotation.ComponentScan;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
-
-/**
- * @author trydofor
- * @since 2019-07-11
- */
-@ComponentScan("pro.fessional.wings.warlock.spring.bean")
-@ConfigurationPropertiesScan("pro.fessional.wings.warlock.spring.prop")
-@AutoConfiguration
-@ConditionalOnProperty(name = WarlockEnabledProp.Key$autoconf, havingValue = "true")
-public class WingsAutoConfiguration {
-}
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java
new file mode 100644
index 000000000..bd997c136
--- /dev/null
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java
@@ -0,0 +1,27 @@
+package pro.fessional.wings.warlock.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import pro.fessional.wings.warlock.spring.bean.WarlockAutoRunConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockLockBeanConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockTableChangeConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockWatchingConfiguration;
+import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration
+@ConditionalOnProperty(name = WarlockEnabledProp.Key$autoconf, havingValue = "true")
+@EnableConfigurationProperties(WarlockEnabledProp.class)
+@ImportAutoConfiguration({
+        WarlockAutoRunConfiguration.class,
+        WarlockLockBeanConfiguration.class,
+        WarlockTableChangeConfiguration.class,
+        WarlockWatchingConfiguration.class,
+})
+public class WarlockAutoConfiguration {
+}
diff --git a/wings/warlock/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/warlock/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index edb558472..3e1e689fd 100644
--- a/wings/warlock/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/warlock/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1 @@
-pro.fessional.wings.warlock.spring.boot.WingsAutoConfiguration
+pro.fessional.wings.warlock.spring.conf.WarlockAutoConfiguration
diff --git a/wings/warlock/src/test/java/pro/fessional/wings/warlock/WingsWarlockApplication.java b/wings/warlock/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockApplication.java
similarity index 89%
rename from wings/warlock/src/test/java/pro/fessional/wings/warlock/WingsWarlockApplication.java
rename to wings/warlock/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockApplication.java
index e7ae7b8b1..579745443 100644
--- a/wings/warlock/src/test/java/pro/fessional/wings/warlock/WingsWarlockApplication.java
+++ b/wings/warlock/src/test/java/pro/fessional/wings/warlock/app/WingsWarlockApplication.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.warlock;
+package pro.fessional.wings.warlock.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;

From 643ecb7228a82ff62b0a94177208d99039c665ac Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Tue, 24 Oct 2023 14:28:35 +0800
Subject: [PATCH 03/23] =?UTF-8?q?=F0=9F=94=A7=20import=20rule,=20sorting?=
 =?UTF-8?q?=20by=20deps=20on=20#142?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../conf/TinyMailAutoConfiguration.java       |  4 ++--
 .../app/conf/StatusHookConfiguration.java     |  2 +-
 .../tiny/{ => project}/BootDatabaseTest.java  |  2 +-
 .../conf/TinyTaskAutoConfiguration.java       |  3 ++-
 .../tiny/{ => project}/BootDatabaseTest.java  |  2 +-
 .../bean/BatriderServcombConfiguration.java   |  5 ++--
 .../conf/BatriderAutoConfiguration.java       |  2 --
 .../bean/WingsFlywaveConfiguration.java       |  7 +++++-
 .../spring/conf/FlywaveAutoConfiguration.java |  5 +---
 .../bean/FacelessJooqConfiguration.java       |  5 +++-
 .../conf/FacelessJooqAutoConfiguration.java   |  6 +----
 .../conf/FacelessTestAutoConfiguration.java   |  1 -
 .../bean/FacelessDataSourceConfiguration.java |  3 +++
 .../bean/FacelessEnumI18nConfiguration.java   |  2 +-
 .../conf/FacelessAutoConfiguration.java       |  2 --
 .../bean/SilencerMessageConfiguration.java    |  3 ---
 .../bean/SilencerRunnerConfiguration.java     |  7 ++++++
 .../conf/SilencerAutoConfiguration.java       |  9 +------
 .../bean/HazelcastLightIdConfiguration.java   |  2 --
 .../SlardarHazelCachingAutoConfiguration.java |  4 ----
 .../SlardarHazelDistIdAutoConfiguration.java  | 24 +++++++++++++++++++
 ...ot.autoconfigure.AutoConfiguration.imports |  3 ++-
 .../SlardarHazelSessionAutoConfiguration.java |  3 +--
 wings/slardar-sprint/pom.xml                  |  8 -------
 .../bean/SlardarBootAdminConfiguration.java   |  2 --
 .../SlardarBootAdminAutoConfiguration.java    | 20 ++++++++++++++++
 .../conf/SlardarSprintAutoConfiguration.java  |  4 +---
 ...ot.autoconfigure.AutoConfiguration.imports |  1 +
 .../conf/SlardarWebmvcAutoConfiguration.java  |  2 +-
 .../app/conf/LoggingRequestConfiguration.java |  3 ---
 .../bean/SlardarAsyncConfiguration.java       |  4 +---
 .../bean/SlardarDingNoticeConfiguration.java  |  1 +
 .../spring/bean/SlardarI18nConfiguration.java |  3 +++
 .../conf/SlardarAsyncAutoConfiguration.java   | 19 +++++++++++++++
 .../spring/conf/SlardarAutoConfiguration.java |  8 +------
 ...ot.autoconfigure.AutoConfiguration.imports |  1 +
 .../bean/WarlockAwesomeConfiguration.java     |  1 -
 .../conf/WarlockAwesomeAutoConfiguration.java |  2 +-
 .../bean/WarlockBondBeanConfiguration.java    |  4 ++--
 .../bean/WarlockExceptionConfiguration.java   |  4 +++-
 .../WarlockSecurityBeanConfiguration.java     |  3 ---
 .../conf/WarlockShadowAutoConfiguration.java  | 10 +++-----
 .../bean/WarlockAutoRunConfiguration.java     |  2 +-
 .../spring/conf/WarlockAutoConfiguration.java |  6 ++---
 44 files changed, 123 insertions(+), 91 deletions(-)
 rename radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/{ => project}/BootDatabaseTest.java (98%)
 rename radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/{ => project}/BootDatabaseTest.java (98%)
 create mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelDistIdAutoConfiguration.java
 create mode 100644 wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java
 create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAsyncAutoConfiguration.java

diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java
index 2e1b6eadb..7a4e69418 100644
--- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java
+++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java
@@ -3,7 +3,7 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration;
+import pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration;
 import pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration;
 import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp;
 
@@ -11,7 +11,7 @@
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(after = MailSenderAutoConfiguration.class)
+@AutoConfiguration(before = SlardarAutoConfiguration.class)
 @ConditionalOnProperty(name = TinyMailEnabledProp.Key$autoconf, havingValue = "true")
 @ImportAutoConfiguration(TinyMailConfiguration.class)
 public class TinyMailAutoConfiguration {
diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/conf/StatusHookConfiguration.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/conf/StatusHookConfiguration.java
index efc43b30a..c8e6348c1 100644
--- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/conf/StatusHookConfiguration.java
+++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/app/conf/StatusHookConfiguration.java
@@ -11,7 +11,7 @@
  * @author trydofor
  * @since 2023-03-07
  */
-@Configuration
+@Configuration(proxyBeanMethods = false)
 @Slf4j
 public class StatusHookConfiguration {
 
diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/BootDatabaseTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
similarity index 98%
rename from radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/BootDatabaseTest.java
rename to radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
index f921aac54..442191e2d 100644
--- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/BootDatabaseTest.java
+++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.tiny;
+package pro.fessional.wings.tiny.project;
 
 import lombok.Setter;
 import org.junit.jupiter.api.Disabled;
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java
index e1a8a2461..2ac986bd3 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java
@@ -3,6 +3,7 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration;
 import pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration;
 import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp;
 
@@ -10,7 +11,7 @@
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration
+@AutoConfiguration(before = SlardarAutoConfiguration.class)
 @ConditionalOnProperty(name = TinyTaskEnabledProp.Key$autoconf, havingValue = "true")
 @ImportAutoConfiguration(TinyTaskConfiguration.class)
 public class TinyTaskAutoConfiguration {
diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/BootDatabaseTest.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
similarity index 98%
rename from radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/BootDatabaseTest.java
rename to radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
index f921aac54..442191e2d 100644
--- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/BootDatabaseTest.java
+++ b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
@@ -1,4 +1,4 @@
-package pro.fessional.wings.tiny;
+package pro.fessional.wings.tiny.project;
 
 import lombok.Setter;
 import org.junit.jupiter.api.Disabled;
diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java
index d9f4ece67..4a8a9068c 100644
--- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java
+++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java
@@ -3,14 +3,15 @@
 import org.apache.servicecomb.springboot2.starter.EnableServiceComb;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.batrider.spring.prop.BatriderEnabledProp;
 import pro.fessional.wings.batrider.spring.prop.BatriderHandlerProp;
 
 /**
  * @author trydofor
  * @since 2022-08-03
  */
-@Configuration
+@Configuration(proxyBeanMethods = false)
 @EnableServiceComb
-@EnableConfigurationProperties(BatriderHandlerProp.class)
+@EnableConfigurationProperties({BatriderEnabledProp.class,BatriderHandlerProp.class})
 public class BatriderServcombConfiguration {
 }
diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java
index 590305bea..ba305f41b 100644
--- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java
+++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java
@@ -3,7 +3,6 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import pro.fessional.wings.batrider.spring.bean.BatriderServcombConfiguration;
 import pro.fessional.wings.batrider.spring.prop.BatriderEnabledProp;
 
@@ -14,6 +13,5 @@
 @AutoConfiguration
 @ConditionalOnProperty(name = BatriderEnabledProp.Key$autoconf, havingValue = "true")
 @ImportAutoConfiguration(BatriderServcombConfiguration.class)
-@EnableConfigurationProperties(BatriderEnabledProp.class)
 public class BatriderAutoConfiguration {
 }
diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java
index 26415ce19..3106f32f1 100644
--- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java
+++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java
@@ -39,7 +39,12 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(name = "pro.fessional.wings.faceless.database.DataSourceContext")
 @ConditionalOnProperty(name = FlywaveEnabledProp.Key$module, havingValue = "true")
-@EnableConfigurationProperties({FlywaveFitProp.class, FlywaveSqlProp.class, FlywaveVerProp.class})
+@EnableConfigurationProperties({
+        FlywaveEnabledProp.class,
+        FlywaveFitProp.class,
+        FlywaveSqlProp.class,
+        FlywaveVerProp.class,
+})
 @Import(FacelessDataSourceConfiguration.class)
 public class WingsFlywaveConfiguration {
 
diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java
index 0f3025a0a..b840488f8 100644
--- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java
+++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java
@@ -3,19 +3,16 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import pro.fessional.wings.faceless.spring.bean.WingsFlywaveConfiguration;
 import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
-import pro.fessional.wings.faceless.spring.prop.FlywaveEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-06-01
  */
 
-@AutoConfiguration
+@AutoConfiguration(before = FacelessAutoConfiguration.class)
 @ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true")
-@EnableConfigurationProperties(FlywaveEnabledProp.class)
 @ImportAutoConfiguration(WingsFlywaveConfiguration.class)
 public class FlywaveAutoConfiguration {
 }
diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java
index d39dcc283..f562da76e 100644
--- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java
+++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java
@@ -40,7 +40,10 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = FacelessJooqEnabledProp.Key$module, havingValue = "true")
 @ConditionalOnClass(name = "org.jooq.conf.Settings")
-@EnableConfigurationProperties({FacelessJooqEnabledProp.class, FacelessJooqCudProp.class})
+@EnableConfigurationProperties({
+        FacelessJooqCudProp.class,
+        FacelessJooqEnabledProp.class,
+})
 public class FacelessJooqConfiguration {
 
     public static final String jooqWingsConfigCustomizer = "jooqWingsConfigCustomizer";
diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java
index 985cfddeb..7d2cfb18d 100644
--- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java
+++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java
@@ -3,20 +3,16 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import pro.fessional.wings.faceless.spring.bean.FacelessJooqConfiguration;
 import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
-import pro.fessional.wings.faceless.spring.prop.FacelessJooqEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-06-01
  */
 
-@AutoConfiguration(after = JooqAutoConfiguration.class)
+@AutoConfiguration(before = FacelessAutoConfiguration.class)
 @ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true")
-@EnableConfigurationProperties(FacelessJooqEnabledProp.class)
 @ImportAutoConfiguration(FacelessJooqConfiguration.class)
 public class FacelessJooqAutoConfiguration {
 }
diff --git a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java
index 6147fe61e..f17523d96 100644
--- a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java
+++ b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java
@@ -13,7 +13,6 @@
         "pro.fessional.wings.faceless.helper",
         "pro.fessional.wings.faceless.service",
         "pro.fessional.wings.faceless.database.autogen",
-        "pro.fessional.wings.faceless.autoconf",
 })
 public class FacelessTestAutoConfiguration {
 }
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java
index 0a2e71042..ab6c26354 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java
@@ -3,9 +3,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.DataSourceContext;
+import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
 
 import javax.sql.DataSource;
 import java.util.Map;
@@ -18,6 +20,7 @@
  * @since 2019-06-25
  */
 @Configuration(proxyBeanMethods = false)
+@EnableConfigurationProperties(FacelessEnabledProp.class)
 public class FacelessDataSourceConfiguration {
 
     private static final Log log = LogFactory.getLog(FacelessDataSourceConfiguration.class);
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java
index 8d77b84f1..89762ef59 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java
@@ -18,7 +18,7 @@
  * @author trydofor
  * @since 2019-06-01
  */
-@Configuration
+@Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = FacelessEnabledProp.Key$enumi18n, havingValue = "true")
 @ConditionalOnClass(name = "pro.fessional.wings.silencer.message.CombinableMessageSource")
 public class FacelessEnumI18nConfiguration {
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java
index ba3f3e7ad..96f92431f 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java
@@ -3,7 +3,6 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import pro.fessional.wings.faceless.spring.bean.FacelessDataSourceConfiguration;
 import pro.fessional.wings.faceless.spring.bean.FacelessEnumI18nConfiguration;
 import pro.fessional.wings.faceless.spring.bean.FacelessFlakeIdConfiguration;
@@ -18,7 +17,6 @@
 
 @AutoConfiguration
 @ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true")
-@EnableConfigurationProperties(FacelessEnabledProp.class)
 @ImportAutoConfiguration({
         FacelessDataSourceConfiguration.class,
         FacelessEnumI18nConfiguration.class,
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java
index c8b04ec7d..d5a6f2dd4 100644
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java
@@ -2,10 +2,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.AutoConfigureAfter;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration;
 import org.springframework.context.HierarchicalMessageSource;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
@@ -22,7 +20,6 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(MessageSource.class)
 @ConditionalOnProperty(name = SilencerEnabledProp.Key$message, havingValue = "true")
-@AutoConfigureAfter(MessageSourceAutoConfiguration.class) // mark
 public class SilencerMessageConfiguration {
 
     private static final Log log = LogFactory.getLog(SilencerMessageConfiguration.class);
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java
index 83cb554f1..061fd2554 100644
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java
@@ -5,6 +5,7 @@
 import org.springframework.boot.ApplicationArguments;
 import org.springframework.boot.context.event.ApplicationReadyEvent;
 import org.springframework.boot.context.event.ApplicationStartedEvent;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.context.annotation.Bean;
@@ -15,6 +16,8 @@
 import pro.fessional.wings.silencer.runner.ApplicationReadyEventRunner;
 import pro.fessional.wings.silencer.runner.ApplicationRunnerOrdered;
 import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner;
+import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
+import pro.fessional.wings.silencer.spring.prop.SilencerI18nProp;
 
 import java.util.Map;
 
@@ -26,6 +29,10 @@
  * @since 2023-02-06
  */
 @Configuration(proxyBeanMethods = false)
+@EnableConfigurationProperties({
+        SilencerEnabledProp.class,
+        SilencerI18nProp.class,
+})
 public class SilencerRunnerConfiguration {
 
     private static final Log log = LogFactory.getLog(SilencerRunnerConfiguration.class);
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java
index 8efb4efcb..e0342df6a 100644
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java
@@ -4,28 +4,21 @@
 import org.springframework.boot.autoconfigure.AutoConfigureOrder;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.core.Ordered;
 import pro.fessional.wings.silencer.spring.bean.SilencerMessageConfiguration;
 import pro.fessional.wings.silencer.spring.bean.SilencerRunnerConfiguration;
 import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
-import pro.fessional.wings.silencer.spring.prop.SilencerI18nProp;
 
 /**
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(after = MessageSourceAutoConfiguration.class)
+@AutoConfiguration
 @AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
 @ConditionalOnProperty(name = SilencerEnabledProp.Key$autoconf, havingValue = "true")
 @ImportAutoConfiguration({
         SilencerMessageConfiguration.class,
         SilencerRunnerConfiguration.class,
 })
-@EnableConfigurationProperties({
-        SilencerEnabledProp.class,
-        SilencerI18nProp.class,
-})
 public class SilencerAutoConfiguration {
 }
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java
index 33c24b800..d4bf3336b 100644
--- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java
@@ -4,7 +4,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -24,7 +23,6 @@ public class HazelcastLightIdConfiguration {
     private static final Log log = LogFactory.getLog(HazelcastLightIdConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(LightIdProvider.class)
     @ConditionalOnProperty(name = LightIdProviderProp.Key$monotonic, havingValue = "hz")
     public LightIdProvider lightIdProvider(LightIdProvider.Loader lightIdLoader, LightIdProviderProp providerProp, HazelcastInstance hazelcastInstance) {
         final String mono = providerProp.getMonotonic();
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java
index b58f065e7..81187f636 100644
--- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java
@@ -5,8 +5,6 @@
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration;
 import pro.fessional.wings.slardar.spring.bean.HazelcastCacheConfiguration;
-import pro.fessional.wings.slardar.spring.bean.HazelcastFlakeIdConfiguration;
-import pro.fessional.wings.slardar.spring.bean.HazelcastLightIdConfiguration;
 import pro.fessional.wings.slardar.spring.bean.HazelcastMockConfiguration;
 import pro.fessional.wings.slardar.spring.bean.HazelcastPublisherConfiguration;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
@@ -19,8 +17,6 @@
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
 @ImportAutoConfiguration({
         HazelcastCacheConfiguration.class,
-        HazelcastFlakeIdConfiguration.class,
-        HazelcastLightIdConfiguration.class,
         HazelcastMockConfiguration.class,
         HazelcastPublisherConfiguration.class,
 })
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelDistIdAutoConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelDistIdAutoConfiguration.java
new file mode 100644
index 000000000..84b5d3e46
--- /dev/null
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelDistIdAutoConfiguration.java
@@ -0,0 +1,24 @@
+package pro.fessional.wings.slardar.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import pro.fessional.wings.faceless.spring.conf.FacelessAutoConfiguration;
+import pro.fessional.wings.slardar.spring.bean.HazelcastFlakeIdConfiguration;
+import pro.fessional.wings.slardar.spring.bean.HazelcastLightIdConfiguration;
+import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration(before = {SlardarAutoConfiguration.class, FacelessAutoConfiguration.class})
+@ConditionalOnClass(FacelessAutoConfiguration.class)
+@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
+@ImportAutoConfiguration({
+        HazelcastFlakeIdConfiguration.class,
+        HazelcastLightIdConfiguration.class,
+})
+public class SlardarHazelDistIdAutoConfiguration {
+}
diff --git a/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index a7c4f5ae3..17e12cfa8 100644
--- a/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1,2 @@
-pro.fessional.wings.slardar.spring.conf.SlardarHazelCachingAutoConfiguration
\ No newline at end of file
+pro.fessional.wings.slardar.spring.conf.SlardarHazelCachingAutoConfiguration
+pro.fessional.wings.slardar.spring.conf.SlardarHazelDistIdAutoConfiguration
\ No newline at end of file
diff --git a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java
index 9714d1ef7..07507dcb7 100644
--- a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java
+++ b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java
@@ -3,7 +3,6 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.session.SessionAutoConfiguration;
 import pro.fessional.wings.slardar.spring.bean.HazelcastSessionConfiguration;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
@@ -11,7 +10,7 @@
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(after = SessionAutoConfiguration.class)
+@AutoConfiguration(before = {SlardarHazelCachingAutoConfiguration.class, SlardarWebmvcAutoConfiguration.class})
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
 @ImportAutoConfiguration(HazelcastSessionConfiguration.class)
 public class SlardarHazelSessionAutoConfiguration {
diff --git a/wings/slardar-sprint/pom.xml b/wings/slardar-sprint/pom.xml
index 816b6ec3f..c2b631eb3 100644
--- a/wings/slardar-sprint/pom.xml
+++ b/wings/slardar-sprint/pom.xml
@@ -17,18 +17,10 @@
     Integration of WebMvc/hazelcast/security-conf/admin/actuator
 
     
-        
-            pro.fessional.wings
-            slardar-hazel-caching
-        
         
             pro.fessional.wings
             slardar-hazel-session
         
-        
-            pro.fessional.wings
-            slardar-webmvc
-        
         
         
             org.springframework.boot
diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
index 3dc4767f8..b3affa0fd 100644
--- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
+++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
@@ -22,7 +22,6 @@
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -52,7 +51,6 @@
 @Configuration(proxyBeanMethods = false)
 @EnableConfigurationProperties(SlardarPasscoderProp.class)
 @ConditionalOnClass(SpringBootAdminClientAutoConfiguration.class)
-@AutoConfigureBefore(SpringBootAdminClientAutoConfiguration.class) // mark
 public class SlardarBootAdminConfiguration {
     private final static Log log = LogFactory.getLog(SlardarBootAdminConfiguration.class);
 
diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java
new file mode 100644
index 000000000..18cead5ce
--- /dev/null
+++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java
@@ -0,0 +1,20 @@
+package pro.fessional.wings.slardar.spring.conf;
+
+import de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration;
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import pro.fessional.wings.slardar.spring.bean.SlardarBootAdminConfiguration;
+import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration(before = {SlardarHazelSessionAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class})
+@ConditionalOnClass(SpringBootAdminClientAutoConfiguration.class)
+@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
+@ImportAutoConfiguration(SlardarBootAdminConfiguration.class)
+public class SlardarBootAdminAutoConfiguration {
+}
diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java
index b969d59fb..b5d8cee4c 100644
--- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java
+++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java
@@ -4,7 +4,6 @@
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import pro.fessional.wings.slardar.spring.bean.SlardarActuatorConfiguration;
-import pro.fessional.wings.slardar.spring.bean.SlardarBootAdminConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
@@ -12,11 +11,10 @@
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(beforeName = "de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration")
+@AutoConfiguration(before = SlardarHazelSessionAutoConfiguration.class)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
 @ImportAutoConfiguration({
         SlardarActuatorConfiguration.class,
-        SlardarBootAdminConfiguration.class,
         SlardarSecurityConfiguration.class,
 })
 public class SlardarSprintAutoConfiguration {
diff --git a/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 39b0e4747..9e161c959 100644
--- a/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1,2 @@
+pro.fessional.wings.slardar.spring.conf.SlardarBootAdminAutoConfiguration
 pro.fessional.wings.slardar.spring.conf.SlardarSprintAutoConfiguration
\ No newline at end of file
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java
index 444b82367..3f4d653df 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java
@@ -28,7 +28,7 @@
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(before = WebMvcAutoConfiguration.class)
+@AutoConfiguration(before = {SlardarAutoConfiguration.class, WebMvcAutoConfiguration.class})
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
 @ImportAutoConfiguration({
         SlardarCookieConfiguration.class,
diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/LoggingRequestConfiguration.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/LoggingRequestConfiguration.java
index 5b2feed57..29db9a7e9 100644
--- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/LoggingRequestConfiguration.java
+++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/LoggingRequestConfiguration.java
@@ -5,13 +5,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jetbrains.annotations.NotNull;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.slardar.servlet.stream.AbstractRequestResponseLogging;
 import pro.fessional.wings.slardar.servlet.stream.RequestResponseLogging;
 import pro.fessional.wings.slardar.servlet.stream.ReuseStreamRequestWrapper;
-import pro.fessional.wings.slardar.spring.bean.SlardarRestreamConfiguration;
 
 import java.util.Collection;
 
@@ -22,7 +20,6 @@
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@AutoConfigureBefore(SlardarRestreamConfiguration.class)
 public class LoggingRequestConfiguration {
 
     private static final Log log = LogFactory.getLog(LoggingRequestConfiguration.class);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java
index 6003fb649..ad48962bc 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java
@@ -5,7 +5,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
@@ -52,10 +51,9 @@
  * @since 2019-12-03
  */
 @EnableAsync
-@Configuration
+@Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$async, havingValue = "true")
 @EnableConfigurationProperties(SlardarAsyncProp.class)
-@AutoConfigureBefore({TaskExecutionAutoConfiguration.class, TaskSchedulingAutoConfiguration.class}) // mark
 public class SlardarAsyncConfiguration {
 
     public static final String slardarEventExecutor = "slardarEventExecutor";
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
index a6df099ec..7b55a8fb1 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
@@ -25,6 +25,7 @@ public class SlardarDingNoticeConfiguration {
     @Setter(onMethod_ = {@Autowired})
     private SlardarDingNoticeProp slardarDingNoticeProp;
 
+    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
     @Bean
     @ConditionalOnMissingBean(DingTalkNotice.class)
     public DingTalkNotice dingTalkNotice(OkHttpClient okHttpClient) {
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
index bc66885ac..1a110c794 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
@@ -4,6 +4,7 @@
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -14,6 +15,7 @@
 import pro.fessional.wings.slardar.autodto.AutoZoneVisitor;
 import pro.fessional.wings.slardar.autodto.I18nStringVisitor;
 import pro.fessional.wings.slardar.context.LocaleZoneIdUtil;
+import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
@@ -22,6 +24,7 @@
  * @since 2019-06-26
  */
 @Configuration(proxyBeanMethods = false)
+@EnableConfigurationProperties(SlardarEnabledProp.class)
 @RequiredArgsConstructor
 public class SlardarI18nConfiguration {
 
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAsyncAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAsyncAutoConfiguration.java
new file mode 100644
index 000000000..d56423390
--- /dev/null
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAsyncAutoConfiguration.java
@@ -0,0 +1,19 @@
+package pro.fessional.wings.slardar.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
+import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration;
+import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration(before = {SlardarAutoConfiguration.class, TaskExecutionAutoConfiguration.class, TaskSchedulingAutoConfiguration.class})
+@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
+@ImportAutoConfiguration(SlardarAsyncConfiguration.class)
+public class SlardarAsyncAutoConfiguration {
+}
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
index 4898344d6..cbc2293bd 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
@@ -3,10 +3,6 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
-import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarCacheConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDingNoticeConfiguration;
@@ -22,11 +18,9 @@
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(before = {TaskExecutionAutoConfiguration.class, TaskSchedulingAutoConfiguration.class})
+@AutoConfiguration
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
-@EnableConfigurationProperties(SlardarEnabledProp.class)
 @ImportAutoConfiguration({
-        SlardarAsyncConfiguration.class,
         SlardarCacheConfiguration.class,
         SlardarDateTimeConfiguration.class,
         SlardarDingNoticeConfiguration.class,
diff --git a/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 7eefc650a..b226b3dbd 100644
--- a/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1,2 @@
+pro.fessional.wings.slardar.spring.conf.SlardarAsyncAutoConfiguration
 pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration
\ No newline at end of file
diff --git a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
index e1ecb4fbf..a7d240731 100644
--- a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
+++ b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
@@ -48,7 +48,6 @@ public RuntimeConfService runtimeConfService(ObjectProvider c
         return bean;
     }
 
-
     /**
      * Database values override project config
      */
diff --git a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java
index 1a222bbac..347938362 100644
--- a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java
+++ b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java
@@ -9,7 +9,7 @@
  * @author trydofor
  * @since 2019-12-01
  */
-@AutoConfiguration
+@AutoConfiguration(before = WarlockAutoConfiguration.class)
 @ImportAutoConfiguration(WarlockAwesomeConfiguration.class)
 public class WarlockAwesomeAutoConfiguration {
 }
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
index c8313953f..0d88f3e0b 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
@@ -1,8 +1,8 @@
 package pro.fessional.wings.warlock.spring.bean;
 
+import jakarta.annotation.PostConstruct;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -41,7 +41,7 @@ public class WarlockBondBeanConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockBondBeanConfiguration.class);
 
-    @Autowired
+    @PostConstruct
     public void autoRegisterCacheConst() {
         CacheConst.WarlockPermService.EventTables.add(WinPermEntryTable.WinPermEntry.getName());
         log.info("WarlockBond spring-conf WarlockPermService.EventTables");
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java
index 30bc3057f..9201b35ee 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java
@@ -11,8 +11,10 @@
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.HandlerExceptionResolver;
 import pro.fessional.wings.warlock.errorhandle.DefaultExceptionResolver;
+import pro.fessional.wings.warlock.spring.prop.WarlockApiAuthProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockErrorProp;
+import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp;
 
 
 /**
@@ -20,7 +22,7 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@EnableConfigurationProperties(WarlockErrorProp.class)
+@EnableConfigurationProperties({WarlockApiAuthProp.class, WarlockUrlmapProp.class, WarlockErrorProp.class})
 public class WarlockExceptionConfiguration {
 
     public static final String defaultExceptionResolver = "defaultExceptionResolver";
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
index 1603e254b..7b8800d72 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
@@ -5,12 +5,10 @@
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.cache.CacheManager;
 import org.springframework.context.ApplicationContext;
@@ -97,7 +95,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityBean, havingValue = "true")
-@AutoConfigureBefore(SecurityAutoConfiguration.class)
 @EnableConfigurationProperties(WarlockSecurityProp.class)
 @RequiredArgsConstructor
 public class WarlockSecurityBeanConfiguration {
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java
index d33450c5a..959d81887 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java
@@ -1,9 +1,9 @@
 package pro.fessional.wings.warlock.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.AutoConfigureBefore;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
+import pro.fessional.wings.slardar.spring.conf.SlardarSprintAutoConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockExceptionConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockHazelcastConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockJournalConfiguration;
@@ -13,17 +13,13 @@
 import pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockWatching2Configuration;
-import pro.fessional.wings.warlock.spring.prop.WarlockApiAuthProp;
-import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp;
 
 
 /**
  * @author trydofor
  * @since 2019-12-01
  */
-@AutoConfiguration
-@AutoConfigureBefore(WarlockSecurityBeanConfiguration.class)
-@EnableConfigurationProperties({WarlockApiAuthProp.class, WarlockUrlmapProp.class})
+@AutoConfiguration(before = {SlardarSprintAutoConfiguration.class, WarlockAutoConfiguration.class, SecurityAutoConfiguration.class})
 @ImportAutoConfiguration({
         WarlockExceptionConfiguration.class,
         WarlockHazelcastConfiguration.class,
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
index 73592579a..b4a55e1a7 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
@@ -26,7 +26,7 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@EnableConfigurationProperties({WarlockCheckProp.class, WarlockI18nProp.class})
+@EnableConfigurationProperties({WarlockEnabledProp.class, WarlockCheckProp.class, WarlockI18nProp.class})
 public class WarlockAutoRunConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockAutoRunConfiguration.class);
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java
index bd997c136..382ac9e36 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java
@@ -3,7 +3,8 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import pro.fessional.wings.faceless.spring.conf.FacelessJooqAutoConfiguration;
+import pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockAutoRunConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockLockBeanConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockTableChangeConfiguration;
@@ -14,9 +15,8 @@
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration
+@AutoConfiguration(before = {FacelessJooqAutoConfiguration.class, SlardarAutoConfiguration.class})
 @ConditionalOnProperty(name = WarlockEnabledProp.Key$autoconf, havingValue = "true")
-@EnableConfigurationProperties(WarlockEnabledProp.class)
 @ImportAutoConfiguration({
         WarlockAutoRunConfiguration.class,
         WarlockLockBeanConfiguration.class,

From a109db5187d19f744ab7593d0d5be75453507e02 Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Wed, 25 Oct 2023 18:09:35 +0800
Subject: [PATCH 04/23] =?UTF-8?q?=E2=9C=85=20Add=20IDEA=20TMS=20#147?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 WingsBoot.t.md                                | 390 ++++++++++++++++++
 pom.xml                                       |   6 +
 .../devs/codegen/AutogenDependencyTest.java   |   4 +-
 radiant/pom.xml                               |   5 +
 .../tiny/mail/sender/MailNoticeTest.java      |   4 +
 .../mail/sender/MailSenderManagerTest.java    |   2 +
 .../tiny/mail/service/ResourceMapTest.java    |   2 +
 .../mail/service/TinyMailServiceTest.java     |   5 +
 .../wings/tiny/project/BootDatabaseTest.java  |   2 +
 .../tiny/project/TinyMailCodeGenTest.java     |   3 +
 .../service/TestServiceAuto.java              |   2 +-
 .../service/TestServiceManual.java            |   2 +-
 .../wings/tiny/project/BootDatabaseTest.java  |  62 ---
 .../tiny/task/other/ExecutorServiceTest.java  |   2 +
 .../task/service/TinyTaskServiceTest.java     |  14 +-
 .../wings-conf/wings-tinytask-test.properties |   8 +-
 .../{ => app}/contract/HelloContract.java     |   2 +-
 .../contractor/BatriderContractor.java        |   4 +-
 .../controller/BatriderController.java        |   4 +-
 .../faceless/enums/ConstantEnumI18nTest.java  |  22 +-
 .../faceless/enums/ConstantEnumUtilTest.java  |   9 +
 .../faceless/enums/LanguageEnumUtilTest.java  |   6 +
 .../codegen/ConstantNaviGeneratorTest.java    |   2 +
 .../jooqgen/WingsJooqGenHelperTest.java       |   6 +-
 .../ConstantEnumGenSample.java                |   4 +-
 .../ConstantEnumGeneratorSample.java}         |   6 +-
 .../sample/JooqCodeAutoGenSample.java         |   6 +-
 ....java => TestWingsInitDatabaseSample.java} |   5 +-
 ....java => TestWingsSchemaDumperSample.java} |   5 +-
 ...va => TestWingsSchemaGeneratorSample.java} |   5 +-
 ...java => TestWingsSchemaJournalSample.java} |   5 +-
 .../util/FlywaveRevisionScannerTest.java      |   5 +
 .../flywave/SchemaFulldumpManagerTest.kt      |   4 +
 .../flywave/SchemaJournalManagerTest.kt       |   9 +
 .../flywave/SchemaRevisionMangerTest.kt       |  14 +-
 .../flywave/SimpleJdbcTemplateTest.kt         |   2 +
 .../faceless/flywave/SqlSegmentParserTest.kt  |   3 +
 .../flywave/SqlSegmentProcessorTest.kt        |   8 +
 ...sShardingTests.kt => WingsShardingTest.kt} |  11 +-
 .../faceless/flywave/util/TemplateUtilTest.kt |   5 +
 ... => TestWingsFlywaveInitDatabaseSample.kt} |   4 +-
 ... => TestWingsFlywaveShardJournalSample.kt} |   4 +-
 .../lightid/impl/LightIdServiceImplTest.kt    |   6 +
 .../jooq/listener/TableCudListener.java       |   6 +-
 .../app/conf/TableCudConfiguration.java       |   6 +-
 .../database/autogen/DefaultCatalog.java      |   2 +-
 .../database/autogen/DefaultSchema.java       |  10 +-
 .../{ => app}/database/autogen/Tables.java    |  10 +-
 .../autogen/tables/SysConstantEnumTable.java  |   6 +-
 .../autogen/tables/SysStandardI18nTable.java  |   6 +-
 .../autogen/tables/TstNormalTableTable.java   |   6 +-
 .../autogen/tables/TstShardingTable.java      |   6 +-
 .../tables/daos/SysConstantEnumDao.java       |   8 +-
 .../tables/daos/SysStandardI18nDao.java       |   8 +-
 .../tables/daos/TstNormalTableDao.java        |   8 +-
 .../autogen/tables/daos/TstShardingDao.java   |   8 +-
 .../tables/interfaces/ISysConstantEnum.java   |   2 +-
 .../tables/interfaces/ISysStandardI18n.java   |   2 +-
 .../tables/interfaces/ITstNormalTable.java    |   2 +-
 .../tables/interfaces/ITstSharding.java       |   2 +-
 .../autogen/tables/pojos/SysConstantEnum.java |   4 +-
 .../autogen/tables/pojos/SysStandardI18n.java |   4 +-
 .../autogen/tables/pojos/TstNormalTable.java  |   4 +-
 .../autogen/tables/pojos/TstSharding.java     |   4 +-
 .../tables/records/SysConstantEnumRecord.java |   8 +-
 .../tables/records/SysStandardI18nRecord.java |   8 +-
 .../tables/records/TstNormalTableRecord.java  |   8 +-
 .../tables/records/TstShardingRecord.java     |   8 +-
 .../service/TestingTableCudHandler.java}      |   4 +-
 .../service/TransactionalBusinessService.java |   2 +-
 .../service/TransactionalClauseService.java   |   2 +-
 .../TransactionalBusinessServiceImpl.java     |   6 +-
 .../impl/TransactionalClauseServiceImpl.java  |  10 +-
 .../jooq/WingsJooqDaoAliasImplTest.java       |  18 +-
 .../database/jooq/WingsJooqUtilTest.java      |   8 +-
 .../converter/JooqLocaleConverterTest.java    |   2 +
 .../faceless/jooq/JooqDeleteListenerTest.java |   8 +-
 .../jooq/JooqMapperCompatibleTest.java        |  13 +-
 .../jooq/JooqTableCudListenerTest.java        |  25 +-
 .../jooq/TransactionalServiceTest.java        |   9 +-
 ...mple.java => TestJooqDslAndDaoSample.java} |  19 +-
 ...ple.java => TestJooqMostSelectSample.java} |  23 +-
 .../database/autogen/DefaultCatalog.java      |   2 +-
 .../database/autogen/DefaultSchema.java       |   6 +-
 .../{ => app}/database/autogen/Tables.java    |   6 +-
 .../autogen/tables/TstNormalTableTable.java   |   6 +-
 .../autogen/tables/TstShardingTable.java      |   6 +-
 .../tables/daos/TstNormalTableDao.java        |   8 +-
 .../autogen/tables/daos/TstShardingDao.java   |   8 +-
 .../tables/interfaces/ITstNormalTable.java    |   2 +-
 .../tables/interfaces/ITstSharding.java       |   2 +-
 .../autogen/tables/pojos/TstNormalTable.java  |   4 +-
 .../autogen/tables/pojos/TstSharding.java     |   4 +-
 .../tables/records/TstNormalTableRecord.java  |   8 +-
 .../tables/records/TstShardingRecord.java     |   8 +-
 .../faceless/flywave/FlywaveShardingTest.java |   5 +
 .../wings/faceless/jooq/JooqShardingTest.java |  18 +-
 .../faceless/helper/WingsTestHelper.java      |   2 -
 .../conf/FacelessTestAutoConfiguration.java   |  15 +-
 .../concur/DatabaseGlobalLockTest.java        |   6 +-
 .../database/DataSourceContextTest.java       |   2 +
 .../database/helper/DatabaseCheckerTest.java  |   2 +
 .../database/helper/DatabaseNamingTest.java   |   2 +
 .../wings/faceless/druid/DruidStatTest.java   |   2 +
 wings/pom.xml                                 |   5 +
 .../silencer/modulate/RuntimeModeTest.java    |   3 +
 .../silencer/other/CollectionInjectTest.java  |   3 +
 .../bean/SilencerContextHelperTest.java       |   5 +
 .../SilencerEncryptConfigurationTest.java     |   2 +
 .../silencer/tweak/SilenceDebugTest.java      |   4 +
 .../silencer/jaxb/StringMapXmlWriterTest.java |   3 +
 .../app/WingsSilencerApplication.java         |   2 +-
 .../prop => app/conf}/MergingProp.java        |   2 +-
 .../silencer/i18n/MessageModuleTest.java      |   4 +
 .../wings/silencer/info/InfoPrintTest.java    |   2 +
 .../spring/boot/WingsSilencerMergeTest.java   |   4 +-
 .../boot/WingsSilencerProfile0Test.java       |   2 +
 .../boot/WingsSilencerProfile1Test.java       |   2 +
 .../boot/WingsSilencerProfile2Test.java       |   2 +
 .../spring/boot/WingsSilencerSpringTest.java  |   2 +
 .../help/CombinableMessageSourceTest.java     |   2 +
 ...ot.autoconfigure.AutoConfiguration.imports |   2 +-
 .../{ => app}/event/TestApplicationEvent.java |   2 +-
 .../slardar/{ => app}/event/TestEvent.java    |   2 +-
 .../{ => app}/service/TestEventListener.java  |   6 +-
 .../{ => app}/service/TestMyCacheService.java |   2 +-
 .../concur/HazelcastGlobalLockTest.java       |   2 +
 .../slardar/event/EventPublishHelperTest.java |   5 +
 .../bean/SlardarCacheConfigurationTest.java   |   6 +-
 ...ot.autoconfigure.AutoConfiguration.imports |   2 +-
 ...est.java => WingsSessionLangZoneTest.java} |   5 +-
 .../SlardarBootAdminAutoConfiguration.java    |   2 +-
 ...ot.autoconfigure.AutoConfiguration.imports |   2 +-
 .../app/WingsSlardarSprintApplication.java    |   2 -
 .../conf}/TestSecurityConfiguration.java      |   2 +-
 .../controller/TestRighterController.java     |   2 +-
 .../slardar/webmvc/Cve2023T34035Test.java     |   4 +
 .../slardar/webmvc/RighterControllerTest.java |   3 +-
 .../service/TestWingsUserDetailsService.java  |   2 -
 .../conf/SlardarTestAutoConfiguration.java    |  16 +-
 ...ot.autoconfigure.AutoConfiguration.imports |   2 +-
 .../controller/TestAuthedController.java      |   2 +-
 .../controller/TestCaptchaController.java     |   2 +-
 .../controller/TestCookieController.java      |   2 +-
 .../controller/TestDataBindingController.java |   2 +-
 .../controller/TestDateTimeController.java    |   2 +-
 .../controller/TestDebounceController.java    |   2 +-
 .../controller/TestDomainAController.java     |   2 +-
 .../controller/TestDomainBController.java     |   2 +-
 .../controller/TestDoubleKillController.java  |   4 +-
 .../controller/TestForwardController.java     |   2 +-
 .../controller/TestJsonController.java        |   2 +-
 .../controller/TestLocaleController.java      |   2 +-
 .../controller/TestPageQueryController.java   |   2 +-
 .../controller/TestReqresLogController.java   |   2 +-
 .../controller/TestRestTmplController.java    |   2 +-
 .../{ => app}/service/DoubleKillService.java  |  24 +-
 .../task}/TestCpuHeavyTask.java               |   2 +-
 .../wings/slardar/concur/DebounceTest.java    |   5 +
 .../wings/slardar/concur/DoubleKillTest.java  |   8 +-
 .../wings/slardar/concur/FirstBloodTest.java  |   3 +
 ...gTest.java => SpringRandomConfigTest.java} |   4 +-
 .../slardar/domain/DomainExtendTest.java      |   5 +
 .../httprest/OkHttpClientHelperTest.java      |   5 +
 .../OkHttpTweakLogInterceptorTest.java        |   2 +
 .../httprest/RestTemplateHelperTest.java      |   9 +-
 .../slardar/httprest/RetrofitCaller.java      |   2 +-
 .../wings/slardar/httprest/RetrofitTest.java  |  10 +-
 .../wings/slardar/json/DecimalFormatTest.java |   9 +
 .../slardar/json/WingsJacksonMapperTest.java  |  13 +
 .../monitor/report/DingTalkReportTest.java    |   3 +
 .../bind/DefaultWingsAuthTypeSourceTest.java  |   3 +
 .../pass/DefaultPasssaltEncoderTest.java      |   4 +
 .../bean/SlardarOkhttp3ConfigurationTest.java |   2 +
 .../slardar/webmvc/DateTimeConverterTest.java |  17 +
 .../webmvc/I18nLocaleResolverTest.java        |   4 +
 .../slardar/webmvc/PageQueryResolverTest.java |  15 +-
 .../webmvc/RequestMappingHelperTest.java      |   2 +
 .../slardar/webmvc/SpringPageHelperTest.java  |   3 +
 .../wings/slardar/webmvc/WingsCookieTest.java |   5 +-
 ...ot.autoconfigure.AutoConfiguration.imports |   2 +-
 .../slardar/app/WingsSlardarApplication.java  |   2 -
 .../{ => app}/service/AsyncService.java       |   2 +-
 .../{ => app}/service/ScheduleService.java    |   2 +-
 .../slardar/async/TaskSchedulerTest.java      |   4 +-
 .../slardar/autodto/AutoDtoHelperTest.java    |   3 +
 .../context/GlobalAttributeHolderTest.java    |  11 +-
 .../wings/slardar/context/NowTest.java        |   3 +
 .../wings/slardar/datatime/FormatterMain.java |  18 -
 .../slardar/datatime/SmartFormatterTest.java  |  60 +--
 .../slardar/fastjson/FastJsonHelperTest.java  |   7 +-
 .../slardar/jackson/JacksonHelperTest.java    |   2 +
 .../slardar/json/JsonConversionTest.java      |   4 +
 .../service/conf/RuntimeConfCacheTest.java    |  47 ---
 .../service/conf/RuntimeConfServiceTest.java  |  13 +-
 .../conf/WarlockBondAutoConfiguration.java    |   2 +-
 .../controller}/TestLoginPageController.java  |   2 +-
 .../warlock/security/NoncePermLoginTest.java  |   3 +
 .../service/perm/WarlockPermServiceTest.java  |   2 +
 ...eTest.java => WarlockRoleServiceTest.java} |   4 +-
 ...a => TestWarlock1SchemaManagerSample.java} |   6 +-
 ...a => TestWarlock2CodeGeneratorSample.java} |   6 +-
 .../conf/WarlockShadowAutoConfiguration.java  |  10 +-
 ...arlockShadowSecurityAutoConfiguration.java |  25 ++
 ...ot.autoconfigure.AutoConfiguration.imports |   1 +
 .../controller}/TestLoginController.java      |   2 +-
 .../controller}/TestOtherController.java      |   4 +-
 .../controller}/TestParam1Controller.java     |   2 +-
 .../controller}/TestToyApiController.java     |   5 +-
 .../controller}/TestTweakController.java      |   2 +-
 .../service}/WatchingService.java             |   2 +-
 .../controller/api/ApiAuthControllerTest.java |  33 +-
 .../controller/api/OkHttpTokenizeTest.java    |   4 +
 .../auth/SimpleOauthControllerTest.java       |   3 +
 .../warlock/other/Md5HmacSha256Test.java      |   3 +
 .../warlock/other/Param1ControllerTest.java   |   3 +
 .../warlock/other/WarlockWatchingTest.java    |   4 +-
 .../warlock/security/AccessDeny302Test.java   |   2 +
 .../warlock/security/AccessDeny401Test.java   |   4 +
 .../warlock/security/AccessDeny403Test.java   |   4 +
 .../warlock/security/GuestSessionTest.java    |   3 +
 .../wings/warlock/security/MemLoginTest.java  |   4 +
 .../warlock/security/NonceLoginTest.java      |   2 +
 .../warlock/security/SafeHttpHelperTest.java  |   3 +
 .../justauth/AuthStateBuilderTest.java        |   2 +
 .../service/auth/PasswordEncoderTest.java     |   2 +
 .../auth/WarlockTicketServiceTest.java        |   3 +-
 .../impl/FlakeIdHazelcastImplTest.java        |   2 +
 .../service/grant/PermGrantHelperTest.java    |   3 +
 .../impl/AllLightIdProviderPerformTest.java   |   4 +
 .../lightid/impl/DbLightIdProviderTest.java   |   2 +
 .../lightid/impl/HzLightIdProviderTest.java   |   2 +
 .../lightid/impl/JvmLightIdProviderTest.java  |   2 +
 .../perm/WarlockPermCacheListenerTest.java    |   2 +
 .../perm/WarlockPermNormalizerTest.java       |   2 +
 .../bean/WarlockJournalConfigurationTest.java |   2 +
 .../webmvc/BindExceptionAdviceTest.java       |   7 +-
 .../webmvc/CodeExceptionHandlerTest.java      |   6 +
 .../conf/WarlockTestAutoConfiguration.java    |  18 -
 ...ot.autoconfigure.AutoConfiguration.imports |   1 -
 .../event/impl/WingsTableCudHandlerImpl.java  |  11 +-
 .../wings/warlock/BootDatabaseTest.java       |   2 +
 .../JooqJournalDiffConverterTest.java         |   2 +
 ...sultTest.java => ResultSerializeTest.java} |   8 +-
 244 files changed, 1308 insertions(+), 514 deletions(-)
 create mode 100644 WingsBoot.t.md
 rename radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/{task => app}/service/TestServiceAuto.java (95%)
 rename radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/{task => app}/service/TestServiceManual.java (93%)
 delete mode 100644 radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
 rename wings/batrider-test/src/test/java/pro/fessional/wings/batrider/{ => app}/contract/HelloContract.java (70%)
 rename wings/batrider-test/src/test/java/pro/fessional/wings/batrider/{ => app}/contractor/BatriderContractor.java (88%)
 rename wings/batrider-test/src/test/java/pro/fessional/wings/batrider/{ => app}/controller/BatriderController.java (93%)
 rename wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/{enums => sample}/ConstantEnumGenSample.java (94%)
 rename wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/{util/ConstantEnumGeneratorTest.java => sample/ConstantEnumGeneratorSample.java} (97%)
 rename wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/{WingsInitDatabaseSample.java => TestWingsInitDatabaseSample.java} (92%)
 rename wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/{WingsSchemaDumper.java => TestWingsSchemaDumperSample.java} (95%)
 rename wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/{WingsSchemaGenerator.java => TestWingsSchemaGeneratorSample.java} (94%)
 rename wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/{WingsSchemaJournal.java => TestWingsSchemaJournalSample.java} (96%)
 rename wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/{WingsShardingTests.kt => WingsShardingTest.kt} (92%)
 rename wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/{WingsFlywaveInitDatabaseSample.kt => TestWingsFlywaveInitDatabaseSample.kt} (90%)
 rename wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/{WingsFlywaveShardJournalSample.kt => TestWingsFlywaveShardJournalSample.kt} (96%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/DefaultCatalog.java (95%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/DefaultSchema.java (82%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/Tables.java (72%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/SysConstantEnumTable.java (96%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/SysStandardI18nTable.java (96%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/TstNormalTableTable.java (97%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/TstShardingTable.java (97%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/daos/SysConstantEnumDao.java (94%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/daos/SysStandardI18nDao.java (93%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/daos/TstNormalTableDao.java (98%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/daos/TstShardingDao.java (97%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/interfaces/ISysConstantEnum.java (96%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/interfaces/ISysStandardI18n.java (96%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/interfaces/ITstNormalTable.java (98%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/interfaces/ITstSharding.java (97%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/pojos/SysConstantEnum.java (96%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/pojos/SysStandardI18n.java (97%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/pojos/TstNormalTable.java (98%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/pojos/TstSharding.java (98%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/records/SysConstantEnumRecord.java (95%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/records/SysStandardI18nRecord.java (95%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/records/TstNormalTableRecord.java (97%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/records/TstShardingRecord.java (96%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{service/WingsTableCudHandlerTest.java => app/service/TestingTableCudHandler.java} (92%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/service/TransactionalBusinessService.java (91%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/service/TransactionalClauseService.java (93%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/service/impl/TransactionalBusinessServiceImpl.java (94%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/{ => app}/service/impl/TransactionalClauseServiceImpl.java (89%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/{JooqDslAndDaoSample.java => TestJooqDslAndDaoSample.java} (95%)
 rename wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/{JooqMostSelectSample.java => TestJooqMostSelectSample.java} (97%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/DefaultCatalog.java (95%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/DefaultSchema.java (86%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/Tables.java (76%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/TstNormalTableTable.java (97%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/TstShardingTable.java (97%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/daos/TstNormalTableDao.java (98%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/daos/TstShardingDao.java (97%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/interfaces/ITstNormalTable.java (98%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/interfaces/ITstSharding.java (97%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/pojos/TstNormalTable.java (98%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/pojos/TstSharding.java (98%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/records/TstNormalTableRecord.java (97%)
 rename wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/{ => app}/database/autogen/tables/records/TstShardingRecord.java (96%)
 rename wings/silencer/src/test/java/pro/fessional/wings/silencer/{spring/prop => app/conf}/MergingProp.java (95%)
 rename wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/{ => app}/event/TestApplicationEvent.java (83%)
 rename wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/{ => app}/event/TestEvent.java (74%)
 rename wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/{ => app}/service/TestEventListener.java (85%)
 rename wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/{ => app}/service/TestMyCacheService.java (97%)
 rename wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/{WingsSessionTest.java => WingsSessionLangZoneTest.java} (96%)
 rename wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/{webconf => app/conf}/TestSecurityConfiguration.java (98%)
 rename wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestRighterController.java (95%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestAuthedController.java (90%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestCaptchaController.java (95%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestCookieController.java (97%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestDataBindingController.java (93%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestDateTimeController.java (99%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestDebounceController.java (97%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestDomainAController.java (88%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestDomainBController.java (89%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestDoubleKillController.java (89%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestForwardController.java (94%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestJsonController.java (98%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestLocaleController.java (94%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestPageQueryController.java (97%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestReqresLogController.java (96%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/controller/TestRestTmplController.java (97%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{ => app}/service/DoubleKillService.java (75%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/{monitor => app/task}/TestCpuHeavyTask.java (92%)
 rename wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/context/{ExternalConfigTest.java => SpringRandomConfigTest.java} (88%)
 rename wings/slardar/src/test/java/pro/fessional/wings/slardar/{ => app}/service/AsyncService.java (95%)
 rename wings/slardar/src/test/java/pro/fessional/wings/slardar/{ => app}/service/ScheduleService.java (91%)
 delete mode 100644 wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/FormatterMain.java
 delete mode 100644 wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfCacheTest.java
 rename wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/{controller/auth => app/controller}/TestLoginPageController.java (97%)
 rename wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/{WarlockRoleServiceCacheTest.java => WarlockRoleServiceTest.java} (92%)
 rename wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/{Warlock1SchemaManagerTest.java => TestWarlock1SchemaManagerSample.java} (93%)
 rename wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/{Warlock2CodeGeneratorTest.java => TestWarlock2CodeGeneratorSample.java} (91%)
 create mode 100644 wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowSecurityAutoConfiguration.java
 rename wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/{controller/auth => app/controller}/TestLoginController.java (98%)
 rename wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/{controller/other => app/controller}/TestOtherController.java (97%)
 rename wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/{controller/other => app/controller}/TestParam1Controller.java (95%)
 rename wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/{controller/api => app/controller}/TestToyApiController.java (96%)
 rename wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/{controller/other => app/controller}/TestTweakController.java (95%)
 rename wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/{service/watching => app/service}/WatchingService.java (98%)
 delete mode 100644 wings/warlock-test/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockTestAutoConfiguration.java
 delete mode 100644 wings/warlock-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
 rename wings/warlock/src/test/java/pro/fessional/wings/warlock/other/{ResultTest.java => ResultSerializeTest.java} (96%)

diff --git a/WingsBoot.t.md b/WingsBoot.t.md
new file mode 100644
index 000000000..2e4bccdd8
--- /dev/null
+++ b/WingsBoot.t.md
@@ -0,0 +1,390 @@
+# WingsBoot Test Management
+
+Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-management-systems.html)
+
+## 11 Silencer
+
+* 11001 MessageModuleTest: module prop and lang-tag
+* 11002 MessageModuleTest: i18n-message with typed object
+* 11003 MessageModuleTest: i18n-message with lang-tag string
+* 11004 InfoPrintTest: print build and git info
+* 11005 WingsSilencerMergeTest: prop List is replaced, Map/Pojo is merged
+* 11006 WingsSilencerProfile0Test: profile default
+* 11007 WingsSilencerProfile1Test: profile dev
+* 11008 WingsSilencerProfile2Test: profile dev and test
+* 11009 WingsSilencerSpringTest: profile dev but not autoconf
+* 11010 CombinableMessageSourceTest: combinableMessageSource vs messageSource
+* 11011 RuntimeModeTest: isRunMode
+* 11012 RuntimeModeTest: isApiMode
+* 11013 CollectionInjectTest: inject List
+* 11014 CollectionInjectTest: inject Map
+* 11015 SilencerContextHelperTest: inject Inner interface, class.forName
+* 11016 SilencerContextHelperTest: list all prop key-value map
+* 11017 SilencerContextHelperTest: list all prop resource
+* 11018 SilencerContextHelperTest: list all prop key and get its value
+* 11019 SilencerEncryptConfigurationTest: crc8Long and leapCode encryption
+* 11020 SilenceDebugTest: tweak clock by Now
+* 11021 SilenceDebugTest: tweak exception stacktrace
+* 11022 SilenceDebugTest: tweak logback logger
+* 11023 StringMapXmlWriterTest: jaxb object to Map object
+* 11024 StringMapXmlWriterTest: jaxb object to xml string
+
+## 12 Faceless
+
+* 12001 DatabaseGlobalLockTest: globalLock via mysql
+* 12002 DatabaseCheckerTest: database timezone and flywave revision
+* 12003 DatabaseNamingTest: naming conversion of database
+* 12004 DataSourceContextTest: datasource context on single
+* 12005 DruidStatTest: print druid stat
+* 12006 ConstantEnumI18nTest: StandardLanguage code
+* 12007 ConstantEnumI18nTest: StandardLanguage message via database
+* 12008 ConstantEnumI18nTest: spring all bean name
+* 12009 ConstantEnumUtilTest: id or else
+* 12010 ConstantEnumUtilTest: name or else
+* 12011 ConstantEnumUtilTest: code or else
+* 12012 ConstantEnumUtilTest: code in
+* 12013 ConstantEnumUtilTest: name in
+* 12014 ConstantEnumUtilTest: id in
+* 12015 ConstantEnumUtilTest: group by info
+* 12016 ConstantEnumUtilTest: auto split name to match
+* 12017 LanguageEnumUtilTest: locale or null
+* 12018 ConstantNaviGeneratorTest: gen PermConstant via hardcode
+* 12019 ConstantEnumGenSample: gen ConstantEnum sample
+* 12020 WingsJooqGenHelperTest: replace simple jooq codegen dao
+* 12021 WingsJooqGenHelperTest: replace embed jooq codegen dao
+* 12022 JooqCodeAutoGenSample: jooq codegen sample
+* 12023 ConstantEnumGeneratorSample: const enum codegen sample
+* 12024 TestWingsInitDatabaseSample: init database at revision TestV1 sample
+* 12025 TestWingsSchemaDumperSample: dump DDL and data to file sample
+* 12026 TestWingsSchemaGeneratorSample: init database at revision TestV2 sample
+* 12027 TestWingsSchemaJournalSample: manage journal on table sample
+* 12028 FlywaveRevisionScannerTest: branch
+* 12029 FlywaveRevisionScannerTest: trim path in comment
+* 12030 FlywaveRevisionScannerTest: helper and builder
+* 12031 FlywaveRevisionScannerTest: format revision
+* 12032 TemplateUtilTest: merge 1st one
+* 12033 TemplateUtilTest: merge 1st one with boundary
+* 12034 TemplateUtilTest: merge more partial token
+* 12035 TemplateUtilTest: is boundary
+* 12036 SchemaFulldumpManagerTest: clean and init schema itself
+* 12037 SchemaFulldumpManagerTest: dump DDL to file
+* 12038 SchemaFulldumpManagerTest: dump record to file
+* 12039 SchemaJournalManagerTest: clean and init schema itself
+* 12040 SchemaJournalManagerTest: create table with prefix
+* 12041 SchemaJournalManagerTest: create sharding
+* 12042 SchemaJournalManagerTest: create after-insert trigger
+* 12043 SchemaJournalManagerTest: create after-update trigger
+* 12044 SchemaJournalManagerTest: create before-delete trigger
+* 12045 SchemaJournalManagerTest: create/delete all trigger
+* 12046 SchemaJournalManagerTest: alter table then alter sharding and trigger
+* 12047 SchemaRevisionMangerTest: clean and init schema itself
+* 12048 SchemaRevisionMangerTest: publish to revision 520
+* 12049 SchemaRevisionMangerTest: check current revision
+* 12050 SchemaRevisionMangerTest: print datasource and revision lines
+* 12051 SchemaRevisionMangerTest: downgrade 1st, upgrade 2nd, downgrade 1st
+* 12052 SchemaRevisionMangerTest: force update sql 615
+* 12053 SchemaRevisionMangerTest: force apply up/down break 615
+* 12054 SchemaRevisionMangerTest: publish 2nd, break 2nd, publish 2nd
+* 12055 SchemaRevisionMangerTest: force execute sql
+* 12056 SchemaRevisionMangerTest: publish branch enum-i18n
+* 12057 SchemaRevisionMangerTest: force execute, publish, execute, publish
+* 12058 SimpleJdbcTemplateTest: simple jdbc template wrapper
+* 12059 SqlSegmentParserTest: manually check parsing
+* 12060 SqlSegmentParserTest: rename shadow table
+* 12061 SqlSegmentProcessorTest: parse apply `@nut`
+* 12062 SqlSegmentProcessorTest: parse apply `@log`
+* 12063 SqlSegmentProcessorTest: parse all in multiple comment
+* 12064 SqlSegmentProcessorTest: parse ds, apply, err in single comment
+* 12065 SqlSegmentProcessorTest: parse apply, err in single comment
+* 12066 SqlSegmentProcessorTest: parse err in single comment
+* 12067 SqlSegmentProcessorTest: parse ask in multiple comment
+* 12068 WingsShardingTest: print drop table wg_order in sharding
+* 12069 WingsShardingTest: print create table wg_order in sharding
+* 12070 WingsShardingTest: print insert into wg_order in sharding
+* 12071 WingsShardingTest: print alter table wg_order in sharding
+* 12072 WingsShardingTest: print trigger wg_order in sharding
+* 12073 TestWingsFlywaveInitDatabaseSample: force update sample
+* 12074 TestWingsFlywaveShardJournalSample: revision shard and journal sample
+* 12075 LightIdServiceImplTest: clean and init schema itself
+* 12076 LightIdServiceImplTest: fetch lightId by jdbcTemplate
+* 12077 LightIdServiceImplTest: fetch lightId by journalService
+* 12078 LightIdServiceImplTest: fetch lightId in 5000x100 CountDownLatch
+* 12079 LightIdServiceImplTest: check lightId range
+* 12080 JooqLocaleConverterTest: jooq locale converter
+* 12081 WingsJooqDaoAliasImplTest: clean and init schema itself
+* 12082 WingsJooqDaoAliasImplTest: print batch load
+* 12083 WingsJooqDaoAliasImplTest: batch insert
+* 12084 WingsJooqDaoAliasImplTest: batch merge
+* 12085 WingsJooqDaoAliasImplTest: batch store
+* 12086 WingsJooqDaoAliasImplTest: batch update
+* 12087 WingsJooqDaoAliasImplTest: single merge
+* 12088 WingsJooqDaoAliasImplTest: batch merge 3
+* 12089 WingsJooqDaoAliasImplTest: logic delete
+* 12090 WingsJooqUtilTest: jooq condition with map
+* 12091 WingsJooqUtilTest: jooq condition builder
+* 12092 WingsJooqUtilTest: jooq condition if or false
+* 12093 WingsJooqUtilTest: jooq condition eq or skip
+* 12094 WingsJooqUtilTest: jooq condition in or skip
+* 12095 JooqDeleteListenerTest: clean and init schema itself
+* 12096 JooqDeleteListenerTest: print JournalJooqHelper delete listener
+* 12097 JooqDeleteListenerTest: print dsl DELETE/UPDATE listener
+* 12098 JooqMapperCompatibleTest: clean and init schema itself
+* 12099 JooqMapperCompatibleTest: jooq table exist
+* 12100 JooqMapperCompatibleTest: jooq case-sensitive alias
+* 12101 JooqMapperCompatibleTest: jooq underscore alias
+* 12102 JooqMapperCompatibleTest: jooq new record into array
+* 12103 JooqMapperCompatibleTest: jooq fetch record into array
+* 12104 JooqTableCudListenerTest: clean and init schema itself
+* 12105 JooqTableCudListenerTest: cud listener for create
+* 12106 JooqTableCudListenerTest: cud listener for update
+* 12107 JooqTableCudListenerTest: cud listener for delete
+* 12108 TransactionalServiceTest: clean and init schema itself
+* 12109 TransactionalServiceTest: declarative transaction
+* 12110 TransactionalServiceTest: without transaction
+* 12111 TransactionalServiceTest: programmatic transaction
+* 12112 TestJooqDslAndDaoSample: clean and init schema itself
+* 12113 TestJooqDslAndDaoSample: jooq dao sample
+* 12114 TestJooqDslAndDaoSample: jooq dsl sample
+* 12115 TestJooqDslAndDaoSample: JournalJooqHelper sample
+* 12116 TestJooqDslAndDaoSample: check Logic delete sample
+* 12117 TestJooqDslAndDaoSample: new shadow table sample
+* 12118 TestJooqDslAndDaoSample: dao diff insert/update/delete sample
+* 12119 TestJooqDslAndDaoSample: JournalDiffHelper insert/update/delete sample
+* 12120 TestJooqMostSelectSample: clean and init schema itself
+* 12121 TestJooqMostSelectSample: select on-demand sample
+* 12122 TestJooqMostSelectSample: insert pojo sample
+* 12123 TestJooqMostSelectSample: mixing sql sample
+* 12124 TestJooqMostSelectSample: named binding sample
+* 12125 TestJooqMostSelectSample: dynamic sql sample
+* 12126 TestJooqMostSelectSample: jdbc template sample
+* 12127 TestJooqMostSelectSample: paginate jooq sample
+* 12128 TestJooqMostSelectSample: paginate jdbc sample
+* 12129 TestJooqMostSelectSample: enum mapper sample
+* 12130 TestJooqMostSelectSample: dsl function sample
+* 12131 FlywaveShardingTest: clean and init schema itself
+* 12132 FlywaveShardingTest: insert data in the writer
+* 12133 FlywaveShardingTest: check sharding on writer and reader
+* 12134 FlywaveShardingTest: move sharding data
+* 12135 JooqShardingTest: clean and init schema itself
+* 12136 JooqShardingTest: publish TestV1
+* 12137 JooqShardingTest: shard 5 tables
+* 12138 JooqShardingTest: print sprint sharding insert
+* 12139 JooqShardingTest: print sprint sharding update
+* 12140 JooqShardingTest: print sprint sharding select
+* 12141 JooqShardingTest: print sprint sharding delete
+* 12142 JooqShardingTest: print sprint sharding batch insert
+* 12143 JooqShardingTest: print sprint sharding batch merge
+
+## 13 Slardar
+
+* 13001 TaskSchedulerTest: TtlScheduler and TtlExecutor
+* 13002 AutoDtoHelperTest: AutoDto in request
+* 13003 AutoDtoHelperTest: AutoDto in response
+* 13004 GlobalAttributeHolderTest: try attr with loader
+* 13005 NowTest: tweak system clock-offset
+* 13006 NowTest: tweak client clock and timezone
+* 13007 SmartFormatterTest: print date format of pattern
+* 13008 SmartFormatterTest: parse LocalDateTime of smart pattern
+* 13009 SmartFormatterTest: parse LocalDateTime by smart pattern with timezone
+* 13010 FastJsonHelperTest: json object by default
+* 13011 FastJsonHelperTest: json number as string
+* 13012 FastJsonHelperTest: json number as string with thousands
+* 13013 FastJsonHelperTest: json number as string issue 1537
+* 13014 JacksonHelperTest: json and xml mapper
+* 13015 JsonConversionTest: can convert to TypeDescriptor
+* 13016 JsonConversionTest: convert Dto, Map, List
+* 13017 JsonConversionTest: parse with generics
+* 13018 HazelcastGlobalLockTest: hazelcast global lock
+* 13019 EventPublishHelperTest: sync spring event
+* 13020 EventPublishHelperTest: async spring event
+* 13021 EventPublishHelperTest: sync global event
+* 13022 SlardarCacheConfigurationTest: memory, server, primary cache
+* 13023 SlardarCacheConfigurationTest: memory, server with ttl 20s
+* 13024 SlardarCacheConfigurationTest: direct call without cache
+* 13025 WingsSessionLangZoneTest: login with en-CA and Canada/Central
+* 13026 WingsSessionLangZoneTest: login with zh-CN and Asia/Shanghai
+* 13027 Cve2023T34035Test: cve-2023-34035 with `/mvc` and `/mvc/test/*.json`
+* 13028 Cve2023T34035Test: cve-2023-34035 with `/` and `/test/*.json`
+* 13029 Cve2023T34035Test: cve-2023-34035 with `/` and `/mvc/test/*.json`
+* 13030 RighterControllerTest: prevent forgery editing
+* 13031 DebounceTest: no-resue and debounced
+* 13032 DebounceTest: resue and waiting for
+* 13033 DebounceTest: resue with exception
+* 13034 DebounceTest: resue with json body
+* 13035 DoubleKillTest: double at Controller sync
+* 13036 DoubleKillTest: double at Controller with async Service
+* 13037 DoubleKillTest: double at Service
+* 13038 DoubleKillTest: double at Service with fixed key
+* 13039 DoubleKillTest: double at Service with SpEL
+* 13040 FirstBloodTest: captcha every time
+* 13041 FirstBloodTest: captcha between 30s
+* 13042 SpringRandomConfigTest: print `random.value` and `random.uuid`
+* 13043 DomainExtendTest: hostA direct
+* 13044 DomainExtendTest: hostB via hostA
+* 13045 DomainExtendTest: hostB direct
+* 13046 DomainExtendTest: hostB override hostA
+* 13047 OkHttpClientHelperTest: post json
+* 13048 OkHttpClientHelperTest: post json with `Bad` naming (1-letter prefix)
+* 13049 OkHttpClientHelperTest: post file
+* 13050 OkHttpClientHelperTest: download file
+* 13051 OkHttpTweakLogInterceptorTest: print okhttp tweaking log
+* 13052 RestTemplateHelperTest: post json
+* 13053 RestTemplateHelperTest: post form key-value
+* 13054 RestTemplateHelperTest: post file
+* 13055 RestTemplateHelperTest: download file
+* 13056 RetrofitTest: jackson and file with built client
+* 13057 RetrofitTest: jackson and file with autowired client
+* 13058 RetrofitTest: print fastjson and jackson with `Bad` naming
+* 13059 DecimalFormatTest: float with customized format
+* 13060 DecimalFormatTest: integer with customized format
+* 13061 DecimalFormatTest: number as string
+* 13062 DecimalFormatTest: number in literal
+* 13063 DecimalFormatTest: number with customized format
+* 13064 DecimalFormatTest: number with js safe
+* 13065 DecimalFormatTest: date format
+* 13066 DecimalFormatTest: response pojo by restful
+* 13067 WingsJacksonMapperTest: print pojo and lombok
+* 13068 WingsJacksonMapperTest: read and write object, check equal
+* 13069 WingsJacksonMapperTest: write i18n-string
+* 13070 WingsJacksonMapperTest: write i18n-result
+* 13071 WingsJacksonMapperTest: xml mapper of pojo and i18n
+* 13072 WingsJacksonMapperTest: write pojo to treemap
+* 13073 WingsJacksonMapperTest: json and jaxb to map
+* 13074 WingsJacksonMapperTest: write number as string and literal
+* 13075 WingsJacksonMapperTest: write resource as url
+* 13076 WingsJacksonMapperTest: read and write aes256 string
+* 13077 WingsJacksonMapperTest: read and write Ms style xml
+* 13078 DingTalkReportTest: post warn report
+* 13079 DingTalkReportTest: post small notice
+* 13080 DefaultWingsAuthTypeSourceTest: PathPatternParser with path-var
+* 13081 DefaultWingsAuthTypeSourceTest: PathPatternParser with RegExp
+* 13082 DefaultPasssaltEncoderTest: print time-cost of PasswordEncoder
+* 13083 DefaultPasssaltEncoderTest: sha256 salt
+* 13084 DefaultPasssaltEncoderTest: mysql password function
+* 13085 SlardarOkhttp3ConfigurationTest: restTemplate with okHttpClient
+* 13086 DateTimeConverterTest: smart date format
+* 13087 DateTimeConverterTest: smart date time format
+* 13088 DateTimeConverterTest: smart LocalDate format
+* 13089 DateTimeConverterTest: smart LocalTime format
+* 13090 DateTimeConverterTest: smart LocalDateTime to ZonedDateTime by query
+* 13091 DateTimeConverterTest: smart LocalDateTime to ZonedDateTime by body
+* 13092 DateTimeConverterTest: smart ZonedDateTime to LocalDateTime by query
+* 13093 DateTimeConverterTest: smart ZonedDateTime to LocalDateTime by body
+* 13094 DateTimeConverterTest: smart LocalDateTime to OffsetDateTime by query
+* 13095 DateTimeConverterTest: smart LocalDateTime to OffsetDateTime by body
+* 13096 DateTimeConverterTest: smart OffsetDateTime to LocalDateTime by query
+* 13097 DateTimeConverterTest: smart OffsetDateTime to LocalDateTime by body
+* 13098 DateTimeConverterTest: smart LocalDate by body
+* 13099 DateTimeConverterTest: smart LocalTime by body
+* 13100 DateTimeConverterTest: smart local data time by body
+* 13101 DateTimeConverterTest: smart local data time by query
+* 13102 I18nLocaleResolverTest: pass local by header
+* 13103 I18nLocaleResolverTest: pass local by cookie
+* 13104 I18nLocaleResolverTest: pass local by query
+* 13105 PageQueryResolverTest: by `@ModelAttribute`
+* 13106 PageQueryResolverTest: by plain parameter
+* 13107 PageQueryResolverTest: by `@PageDefault`
+* 13108 PageQueryResolverTest: by `@PageDefault` with default
+* 13109 PageQueryResolverTest: by `@PageDefault` with value
+* 13110 PageQueryResolverTest: by `@RequestBody`
+* 13111 PageQueryResolverTest: by `@RequestBody` and `@PageDefault`
+* 13112 RequestMappingHelperTest: print all RequestMapping
+* 13113 SpringPageHelperTest: PageQuery to PageRequest to PageQuery
+* 13114 SpringPageHelperTest: PageRequest to PageQuery to PageRequest
+* 13115 WingsCookieTest: encrypt cookie in request
+* 13116 WingsCookieTest: encrypt cookie by forward
+
+## 14 Warlock
+
+* 14001 JooqJournalDiffConverterTest: JournalDiff from/to string
+* 14002 ResultSerializeTest: print timezone offset seconds
+* 14003 ResultSerializeTest: jackson transient field of R
+* 14004 ResultSerializeTest: fastjson transient field of R
+* 14005 ResultSerializeTest: kryo transient field of R
+* 14006 ResultSerializeTest: java Serializable transient field of R
+* 14007 BootDatabaseTest: clean and init warlock schema
+* 14008 RuntimeConfServiceTest: simple type in runtime config
+* 14009 RuntimeConfServiceTest: List, Map in runtime config
+* 14010 RuntimeConfServiceTest: json in runtime config
+* 14011 RuntimeConfServiceTest: kryo in runtime config
+* 14012 RuntimeConfServiceTest: enum type in runtime config
+* 14013 RuntimeConfServiceTest: caching of runtime config, check log
+* 14014 NoncePermLoginTest: root login with nonce
+* 14015 NoncePermLoginTest: lock account on danger
+* 14016 WarlockPermServiceTest: load all perm and caching
+* 14017 WarlockRoleServiceTest: load all role and caching
+* 14018 TestWarlock1SchemaManagerSample: init auth schema for main
+* 14019 TestWarlock1SchemaManagerSample: init auth schema from test
+* 14020 TestWarlock1SchemaManagerSample: execute sql from somefix
+* 14021 TestWarlock2CodeGeneratorSample: code gen for enum
+* 14022 TestWarlock2CodeGeneratorSample: code gen for jooq
+* 14023 TestWarlock2CodeGeneratorSample: code gen for auth
+* 14024 ApiAuthControllerTest: api post json and reply json
+* 14025 ApiAuthControllerTest: api upload file and reply json
+* 14026 ApiAuthControllerTest: api post json and download file
+* 14027 ApiAuthControllerTest: api upload file and download file
+* 14028 OkHttpTokenizeTest: oauth with AuthorizationCode
+* 14029 OkHttpTokenizeTest: oauth with ClientCredentials
+* 14030 OkHttpTokenizeTest: login with username and password vid post form
+* 14031 SimpleOauthControllerTest: mvc mock AuthorizationCode
+* 14032 SimpleOauthControllerTest: mvc mock ClientCredentials
+* 14033 Md5HmacSha256Test: signature for post json
+* 14034 Md5HmacSha256Test: signature for post file
+* 14035 Param1ControllerTest: test json type by mvc response
+* 14036 Param1ControllerTest: diff jackson and fastjson type
+* 14037 WarlockWatchingTest: stopwatch timeline
+* 14038 AuthStateBuilderTest: check authStateBuilder by mock
+* 14039 AccessDeny302Test: 302 redirect
+* 14040 AccessDeny401Test: 401 forward via post form login
+* 14041 AccessDeny401Test: 401 forward via basic auth login
+* 14042 AccessDeny403Test: 403 on anonymous
+* 14043 AccessDeny403Test: 403 on login user
+* 14044 AccessDeny403Test: 403 on logout user
+* 14045 GuestSessionTest: guest get session
+* 14046 GuestSessionTest: 401 on authenticated
+* 14047 MemLoginTest: username login with memory config user and perm
+* 14048 MemLoginTest: email login with memory config user and perm
+* 14049 MemLoginTest: list session for username and email login
+* 14050 NonceLoginTest: test_ny login and check timezone
+* 14051 SafeHttpHelperTest: safe redirect on host and ipv6
+* 14052 SafeHttpHelperTest: parse host and port
+* 14053 PasswordEncoderTest: print encoded password with salt
+* 14054 WarlockTicketServiceTest: encode and decode Term
+* 14055 FlakeIdHazelcastImplTest: 100x5000 for FlakeIdHazelcast
+* 14056 PermGrantHelperTest: can perm inherit
+* 14057 PermGrantHelperTest: gran role on refer
+* 14058 AllLightIdProviderPerformTest: jvm performance
+* 14059 AllLightIdProviderPerformTest: hazelcast performance
+* 14060 AllLightIdProviderPerformTest: database performance
+* 14061 DbLightIdProviderTest: database impl instance
+* 14062 HzLightIdProviderTest: hazelcast impl instance
+* 14063 JvmLightIdProviderTest: jvm impl instance
+* 14064 WarlockPermCacheListenerTest: load perm and role caching, check log
+* 14065 WarlockPermNormalizerTest: normalize role naming prefix
+* 14066 WarlockJournalConfigurationTest: assert TerminalJournalService overriding
+* 14067 BindExceptionAdviceTest: name binding error via post form
+* 14068 BindExceptionAdviceTest: email binding error via post form
+* 14069 BindExceptionAdviceTest: name binding error via post json
+* 14070 BindExceptionAdviceTest: json parse error via post bad-json
+* 14071 CodeExceptionHandlerTest: code exception in english
+* 14072 CodeExceptionHandlerTest: code exception in chinese
+* 14073 CodeExceptionHandlerTest: message exception in english
+* 14074 CodeExceptionHandlerTest: message exception in chinese
+* 14075 CodeExceptionHandlerTest: CompletableFuture exception in chinese
+
+## 15 Tiny
+
+* 15001 MailNoticeTest: post mail via qqmail
+* 15002 MailNoticeTest: stopwatch emit/post/send timeline
+* 15003 MailNoticeTest: send mail via gmail
+* 15004 MailSenderManagerTest: stopwatch batch sending
+* 15005 ResourceMapTest: resource from/into string
+* 15006 TinyMailServiceTest: send mail now
+* 15007 TinyMailServiceTest: emit mail after 60s
+* 15008 TinyMailServiceTest: 501 Mail from with authorization user
+* 15009 TinyMailServiceTest: AddressException address contains dot-dot
+* 15010 BootDatabaseTest: clean and init schema for tiny
+* 15011 TinyMailCodeGenTest: insert and update trigger
+* 15012 ExecutorServiceTest: cancel task, check log
+* 15013 TinyTaskServiceTest: task from bean method reference
+* 15014 TinyTaskServiceTest: nothing but keep running 180s to see log
diff --git a/pom.xml b/pom.xml
index b1f2c788b..12d43dc62 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,6 +64,7 @@
         3.0.4 
         6.23.0 
         2.9.0 
+        2.24.0 
         
         1.3.0 
         3.0.1 
@@ -481,6 +482,11 @@
                     
                 
             
+            
+                io.qameta.allure
+                allure-java-commons
+                ${allure.version}
+            
             
         
     
diff --git a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/codegen/AutogenDependencyTest.java b/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/codegen/AutogenDependencyTest.java
index 6db9d7bc1..71ffe41d3 100644
--- a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/codegen/AutogenDependencyTest.java
+++ b/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/codegen/AutogenDependencyTest.java
@@ -73,7 +73,7 @@ void test10FacelessAutogen() {
     void test11FacelessJooqTest() {
         Warlock3JooqGenerator generator = new Warlock3JooqGenerator();
         generator.setTargetDir(projectRoot + "wings/faceless-jooq/src/test/java/");
-        generator.setTargetPkg("pro.fessional.wings.faceless.database.autogen");
+        generator.setTargetPkg("pro.fessional.wings.faceless.app.database.autogen");
         generator.gen(jdbcUrl, jdbcUser, jdbcPass,
                 h -> h.databaseIncludes("sys_constant_enum", "sys_standard_i18n", "tst_sharding", "tst_normal_table")
                       .forcedIntConsEnum(StandardLanguage.class, "tst_sharding.language")
@@ -85,7 +85,7 @@ void test11FacelessJooqTest() {
     void test11FacelessShardTest() {
         Warlock3JooqGenerator generator = new Warlock3JooqGenerator();
         generator.setTargetDir(projectRoot + "wings/faceless-shard/src/test/java/");
-        generator.setTargetPkg("pro.fessional.wings.faceless.database.autogen");
+        generator.setTargetPkg("pro.fessional.wings.faceless.app.database.autogen");
         generator.gen(jdbcUrl, jdbcUser, jdbcPass,
                 h -> h.databaseIncludes("tst_sharding", "tst_normal_table"));
     }
diff --git a/radiant/pom.xml b/radiant/pom.xml
index 194cf065c..cf98f04fb 100644
--- a/radiant/pom.xml
+++ b/radiant/pom.xml
@@ -73,6 +73,11 @@
             spring-security-test
             test
         
+        
+            io.qameta.allure
+            allure-java-commons
+            test
+        
     
 
     
diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/sender/MailNoticeTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/sender/MailNoticeTest.java
index 0aa22349c..7c2e49c58 100644
--- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/sender/MailNoticeTest.java
+++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/sender/MailNoticeTest.java
@@ -1,5 +1,6 @@
 package pro.fessional.wings.tiny.mail.sender;
 
+import io.qameta.allure.TmsLink;
 import lombok.Setter;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Assertions;
@@ -41,6 +42,7 @@ public class MailNoticeTest {
     protected String gmailPass;
 
     @Test
+    @TmsLink("C15001")
     public void testPost() {
         final boolean snd = mailNotice.post("test tiny mail send", "test send");
         Assertions.assertTrue(snd, "need env QQ_MAIL_USER, QQ_MAIL_PASS, current user=" + mailUser + ", pass=" + mailPass);
@@ -48,6 +50,7 @@ public void testPost() {
 
     @Test
     @Disabled("Statistics time cost")
+    @TmsLink("C15002")
     public void testDefault() {
         final StopWatch stopWatch = new StopWatch();
         try (final StopWatch.Watch ignored = stopWatch.start("emit")) {
@@ -64,6 +67,7 @@ public void testDefault() {
 
     @Test
     @Disabled("gmail")
+    @TmsLink("C15003")
     public void testGmail() {
         // dynamic config
         final String name = "gmailx";
diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/sender/MailSenderManagerTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/sender/MailSenderManagerTest.java
index be0744b65..272c5cc00 100644
--- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/sender/MailSenderManagerTest.java
+++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/sender/MailSenderManagerTest.java
@@ -1,5 +1,6 @@
 package pro.fessional.wings.tiny.mail.sender;
 
+import io.qameta.allure.TmsLink;
 import lombok.Setter;
 import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Disabled;
@@ -46,6 +47,7 @@ public class MailSenderManagerTest {
      * 
*/ @Test + @TmsLink("C15004") public void testBatch() { final TinyMailConfig config = mailConfigProvider.defaultConfig(); final StopWatch stopWatch = new StopWatch(); diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/ResourceMapTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/ResourceMapTest.java index 5c4c1ec10..366af6b78 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/ResourceMapTest.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/ResourceMapTest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.core.io.DefaultResourceLoader; @@ -21,6 +22,7 @@ public class ResourceMapTest { @Test + @TmsLink("C15005") public void testString() throws IOException { ObjectMapper objectMapper = new ObjectMapper(); ResourceLoader resourceLoader = new DefaultResourceLoader(); diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/TinyMailServiceTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/TinyMailServiceTest.java index 402fcba8a..537dd61de 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/TinyMailServiceTest.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/mail/service/TinyMailServiceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.tiny.mail.service; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -22,6 +23,7 @@ class TinyMailServiceTest { protected TinyMailService tinyMailService; @Test + @TmsLink("C15006") void sendOk() { TinyMail message = new TinyMail(); message.setSubject("Mail Service Test"); @@ -31,6 +33,7 @@ void sendOk() { } @Test + @TmsLink("C15007") void sendNxt() { TinyMail message = new TinyMail(); message.setSubject("Mail Service Test"); @@ -43,6 +46,7 @@ void sendNxt() { // 501 Mail from address must be same as authorization user. @Test + @TmsLink("C15008") void sendNgFrom() { TinyMail message = new TinyMail(); message.setSubject("Mail Service Test"); @@ -53,6 +57,7 @@ void sendNgFrom() { // javax.mail.internet.AddressException: Local address contains dot-dot @Test + @TmsLink("C15009") void sendBadTo() { TinyMail message = new TinyMail(); message.setSubject("Mail Service Test"); diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java index 442191e2d..03816b38f 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.tiny.project; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -38,6 +39,7 @@ public class BootDatabaseTest { private SchemaRevisionManager schemaRevisionManager; @Test + @TmsLink("C15010") void testDropAndInit() { JdbcTemplate tmpl = new JdbcTemplate(dataSource); tmpl.query("SHOW TABLES", rs -> { diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java index 8fb4b2fd9..5b70d97f6 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.tiny.project; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -19,10 +20,12 @@ }) @Disabled("Code gen, managed by devops") public class TinyMailCodeGenTest { + @Setter(onMethod_ = {@Autowired}) private SchemaJournalManager schemaJournalManager; @Test + @TmsLink("C15011") public void trigger() { schemaJournalManager.checkAndInitDdl("win_mail_sender", -1); schemaJournalManager.publishInsert("win_mail_sender", true, -1); diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TestServiceAuto.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/service/TestServiceAuto.java similarity index 95% rename from radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TestServiceAuto.java rename to radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/service/TestServiceAuto.java index 310244483..25871c407 100644 --- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TestServiceAuto.java +++ b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/service/TestServiceAuto.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.tiny.task.service; +package pro.fessional.wings.tiny.app.service; import lombok.extern.slf4j.Slf4j; import pro.fessional.wings.tiny.task.schedule.TinyTasker; diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TestServiceManual.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/service/TestServiceManual.java similarity index 93% rename from radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TestServiceManual.java rename to radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/service/TestServiceManual.java index 8e3ca3161..63e9598ae 100644 --- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TestServiceManual.java +++ b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/app/service/TestServiceManual.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.tiny.task.service; +package pro.fessional.wings.tiny.app.service; import lombok.extern.slf4j.Slf4j; import pro.fessional.wings.tiny.task.schedule.TinyTasker; diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java deleted file mode 100644 index 442191e2d..000000000 --- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package pro.fessional.wings.tiny.project; - -import lombok.Setter; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.jdbc.core.JdbcTemplate; -import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; -import pro.fessional.wings.faceless.project.ProjectSchemaManager; - -import javax.sql.DataSource; - -import static pro.fessional.wings.faceless.flywave.WingsRevision.V00_19_0512_01_Schema; -import static pro.fessional.wings.faceless.flywave.WingsRevision.V01_19_0520_01_IdLog; -import static pro.fessional.wings.faceless.flywave.WingsRevision.V01_19_0521_01_EnumI18n; -import static pro.fessional.wings.faceless.flywave.WingsRevision.V03_20_1023_01_AuthEnum; -import static pro.fessional.wings.faceless.flywave.WingsRevision.V04_20_1024_01_UserLogin; -import static pro.fessional.wings.faceless.flywave.WingsRevision.V04_20_1024_02_RolePermit; -import static pro.fessional.wings.faceless.flywave.WingsRevision.V05_20_1025_01_ConfRuntime; -import static pro.fessional.wings.faceless.flywave.WingsRevision.V06_20_1026_01_TinyTask; -import static pro.fessional.wings.faceless.flywave.WingsRevision.V07_20_1027_01_TinyMail; - - -/** - * @author trydofor - * @since 2021-02-22 - */ -@SpringBootTest(properties = { - "spring.wings.faceless.flywave.enabled.module=true", - "spring.wings.faceless.flywave.enabled.checker=false", -}) -@Disabled("manual initialization") -public class BootDatabaseTest { - @Setter(onMethod_ = {@Autowired}) - private DataSource dataSource; - @Setter(onMethod_ = {@Autowired}) - private SchemaRevisionManager schemaRevisionManager; - - @Test - void testDropAndInit() { - JdbcTemplate tmpl = new JdbcTemplate(dataSource); - tmpl.query("SHOW TABLES", rs -> { - String tbl = rs.getString(1); - tmpl.execute("DROP TABLE `" + tbl + "`"); - }); - - final ProjectSchemaManager manager = new ProjectSchemaManager(schemaRevisionManager); - manager.mergePublish(V07_20_1027_01_TinyMail.revision(), helper -> - helper.master().path( - V00_19_0512_01_Schema, - V01_19_0520_01_IdLog, - V01_19_0521_01_EnumI18n, - V03_20_1023_01_AuthEnum, - V04_20_1024_01_UserLogin, - V04_20_1024_02_RolePermit, - V05_20_1025_01_ConfRuntime, - V06_20_1026_01_TinyTask, - V07_20_1027_01_TinyMail) - ); - } -} diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java index 3360b0422..45d5b1dff 100644 --- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java +++ b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.tiny.task.other; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -20,6 +21,7 @@ class ExecutorServiceTest { @Test + @TmsLink("C15012") void schedule() throws InterruptedException { final ThreadPoolTaskScheduler scheduler = TaskSchedulerHelper.referScheduler(false); final ScheduledFuture f1 = scheduler.schedule(() -> log.info("-1 run={}", System.currentTimeMillis()), diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TinyTaskServiceTest.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TinyTaskServiceTest.java index f74d113e8..f48a76570 100644 --- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TinyTaskServiceTest.java +++ b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/service/TinyTaskServiceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.tiny.task.service; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; @@ -7,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.mirana.func.Lam; +import pro.fessional.wings.tiny.app.service.TestServiceManual; import pro.fessional.wings.tiny.task.schedule.conf.TaskerProp; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskDefineProp; @@ -19,10 +21,10 @@ * @since 2022-12-13 */ @SpringBootTest(properties = { - "wings.tiny.task.define[pro.fessional.wings.tiny.task.service.TestServiceManual#strStr].enabled=" + enabled, - "wings.tiny.task.define[pro.fessional.wings.tiny.task.service.TestServiceManual#strStr].autorun=" + autorun, - "wings.tiny.task.define[pro.fessional.wings.tiny.task.service.TestServiceManual#strStr].timing-cron=" + timingCron, - "wings.tiny.task.define[pro.fessional.wings.tiny.task.service.TestServiceManual#strStr].version=1", + "wings.tiny.task.define[pro.fessional.wings.tiny.app.service.TestServiceManual#strStr].enabled=" + enabled, + "wings.tiny.task.define[pro.fessional.wings.tiny.app.service.TestServiceManual#strStr].autorun=" + autorun, + "wings.tiny.task.define[pro.fessional.wings.tiny.app.service.TestServiceManual#strStr].timing-cron=" + timingCron, + "wings.tiny.task.define[pro.fessional.wings.tiny.app.service.TestServiceManual#strStr].version=1", // "wings.tiny.task.enabled.dryrun=true", "wings.slardar.ding-notice.default.access-token=${DING_TALK_TOKEN:}" }) @@ -42,13 +44,14 @@ class TinyTaskServiceTest { protected TinyTaskDefineProp tinyTaskDefineProp; @Test + @TmsLink("C15013") void schedule() { TestServiceManual bean = new TestServiceManual(); final TinyTaskService.Task task = tinyTaskService.schedule(Lam.ref(bean::strStr), "trydofor test string"); final TaskerProp prop = tinyTaskConfService.database(task.getId(), true); Assertions.assertEquals("\"trydofor test string\"", prop.getTaskerPara()); Assertions.assertEquals("TestServiceManual#strStr", prop.getTaskerName()); - Assertions.assertEquals("pro.fessional.wings.tiny.task.service.TestServiceManual#strStr", prop.getTaskerBean()); + Assertions.assertEquals("pro.fessional.wings.tiny.app.service.TestServiceManual#strStr", prop.getTaskerBean()); Assertions.assertEquals(timingCron, prop.getTimingCron()); Assertions.assertEquals(enabled, prop.isEnabled(),"should use higher version, conf=1,db=0"); Assertions.assertEquals(autorun, prop.isAutorun()); @@ -56,6 +59,7 @@ void schedule() { @Test @Disabled("Simulate slow process,sleep 180s") + @TmsLink("C15014") void sleep180() throws InterruptedException { Thread.sleep(180 * 1000L); } diff --git a/radiant/tiny-task/src/test/resources/wings-conf/wings-tinytask-test.properties b/radiant/tiny-task/src/test/resources/wings-conf/wings-tinytask-test.properties index b9c99ca24..3b19786fe 100644 --- a/radiant/tiny-task/src/test/resources/wings-conf/wings-tinytask-test.properties +++ b/radiant/tiny-task/src/test/resources/wings-conf/wings-tinytask-test.properties @@ -1,12 +1,12 @@ -wings.tiny.task.define[pro.fessional.wings.tiny.task.service.TestServiceAuto#strVoid].timing-rate=30 +wings.tiny.task.define[pro.fessional.wings.tiny.app.service.TestServiceAuto#strVoid].timing-rate=30 wings.tiny.task.define[voidVoidAuto].enabled=false wings.tiny.task.define[voidVoidAuto].timing-rate=30 ### -wings.tiny.task.define[pro.fessional.wings.tiny.task.service.TestServiceManual#strVoid].enabled=true -wings.tiny.task.define[pro.fessional.wings.tiny.task.service.TestServiceManual#strVoid].autorun=false -wings.tiny.task.define[pro.fessional.wings.tiny.task.service.TestServiceManual#strVoid].timing-idle=30 +wings.tiny.task.define[pro.fessional.wings.tiny.app.service.TestServiceManual#strVoid].enabled=true +wings.tiny.task.define[pro.fessional.wings.tiny.app.service.TestServiceManual#strVoid].autorun=false +wings.tiny.task.define[pro.fessional.wings.tiny.app.service.TestServiceManual#strVoid].timing-idle=30 wings.tiny.task.define[voidStrManual].enabled=true wings.tiny.task.define[voidStrManual].tasker-name=voidStrManual diff --git a/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/contract/HelloContract.java b/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/contract/HelloContract.java similarity index 70% rename from wings/batrider-test/src/test/java/pro/fessional/wings/batrider/contract/HelloContract.java rename to wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/contract/HelloContract.java index e30e9122b..4e8d359dc 100644 --- a/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/contract/HelloContract.java +++ b/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/contract/HelloContract.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.batrider.contract; +package pro.fessional.wings.batrider.app.contract; /** * @author trydofor diff --git a/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/contractor/BatriderContractor.java b/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/contractor/BatriderContractor.java similarity index 88% rename from wings/batrider-test/src/test/java/pro/fessional/wings/batrider/contractor/BatriderContractor.java rename to wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/contractor/BatriderContractor.java index 90139a358..e645873b7 100644 --- a/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/contractor/BatriderContractor.java +++ b/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/contractor/BatriderContractor.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.batrider.contractor; +package pro.fessional.wings.batrider.app.contractor; import org.apache.servicecomb.provider.rest.common.RestSchema; import org.springframework.http.MediaType; @@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; -import pro.fessional.wings.batrider.contract.HelloContract; +import pro.fessional.wings.batrider.app.contract.HelloContract; /** * Mvc Style, Customize SchemaId, basePath without SchemaId diff --git a/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/controller/BatriderController.java b/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/controller/BatriderController.java similarity index 93% rename from wings/batrider-test/src/test/java/pro/fessional/wings/batrider/controller/BatriderController.java rename to wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/controller/BatriderController.java index b6bc4bad1..e012805f6 100644 --- a/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/controller/BatriderController.java +++ b/wings/batrider-test/src/test/java/pro/fessional/wings/batrider/app/controller/BatriderController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.batrider.controller; +package pro.fessional.wings.batrider.app.controller; import lombok.Setter; import org.apache.servicecomb.provider.pojo.Invoker; @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.RestTemplate; -import pro.fessional.wings.batrider.contract.HelloContract; +import pro.fessional.wings.batrider.app.contract.HelloContract; /** * @author trydofor diff --git a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java index 53b5eebc3..f37836923 100644 --- a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java +++ b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.enums; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.MethodOrderer.MethodName; import org.junit.jupiter.api.Test; @@ -10,12 +11,12 @@ import org.springframework.context.MessageSource; import org.springframework.jdbc.core.JdbcTemplate; import pro.fessional.mirana.data.Null; -import pro.fessional.mirana.io.InputStreams; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; import pro.fessional.wings.faceless.enums.autogen.StandardTimezone; import pro.fessional.wings.faceless.service.wini18n.StandardI18nService; import static org.junit.jupiter.api.Assertions.assertEquals; +import static pro.fessional.wings.testing.database.ExecSql.execWingsSql; /** * @author trydofor @@ -39,6 +40,7 @@ public class ConstantEnumI18nTest { private JdbcTemplate jdbcTemplate; @Test + @TmsLink("C12006") public void test3Code() { StandardLanguage zhCN = StandardLanguage.ZH_CN; StandardTimezone tzUs = StandardTimezone.AMERICA_CHICAGO; @@ -47,6 +49,7 @@ public void test3Code() { } @Test + @TmsLink("C12007") public void test4I18n() { execWingsSql(jdbcTemplate, "master/01-light/2019-05-20u01-light-commit.sql"); execWingsSql(jdbcTemplate, "master/01-light/2019-05-20v01-light-commit.sql"); @@ -63,26 +66,11 @@ public void test4I18n() { } @Test + @TmsLink("C12008") public void printAllBean() { int i = 1; for (String bean : applicationContext.getBeanDefinitionNames()) { System.out.printf("[%d] %s\n", i++, bean); } } - - public void execWingsSql(JdbcTemplate jdbcTemplate, String path) { - String sqls = InputStreams.readText(this.getClass().getResourceAsStream("/wings-flywave/" + path)); - for (String sql : sqls.split( - ";+[ \\t]*[\\r\\n]+" - + "|" - + ";+[ \\t]*--[^\\r\\n]+[\\r\\n]+" - + "|" - + ";+[ \\t]*/\\*[^\\r\\n]+\\*/[ \\t]*[\\r\\n]+" - )) { - String s = sql.trim(); - if (!s.isEmpty()) { - jdbcTemplate.execute(s); - } - } - } } diff --git a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumUtilTest.java b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumUtilTest.java index 6db60a230..2b1aaaa87 100644 --- a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumUtilTest.java +++ b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumUtilTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.enums; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Test; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; import pro.fessional.wings.faceless.enums.autogen.StandardTimezone; @@ -17,6 +18,7 @@ public class ConstantEnumUtilTest { @Test + @TmsLink("C12009") public void idOrElse() { StandardLanguage zhCn = StandardLanguage.ZH_CN; assertEquals(zhCn, ConstantEnumUtil.idOrNull(zhCn.getId(), StandardLanguage.values())); @@ -24,6 +26,7 @@ public void idOrElse() { } @Test + @TmsLink("C12010") public void nameOrElse() { StandardLanguage zhCn = StandardLanguage.ZH_CN; assertEquals(zhCn, ConstantEnumUtil.nameOrNull(zhCn.name(), StandardLanguage.values())); @@ -31,6 +34,7 @@ public void nameOrElse() { } @Test + @TmsLink("C12011") public void codeOrElse() { StandardLanguage zhCn = StandardLanguage.ZH_CN; assertEquals(zhCn, ConstantEnumUtil.codeOrNull(zhCn.getCode(), StandardLanguage.values())); @@ -38,24 +42,28 @@ public void codeOrElse() { } @Test + @TmsLink("C12012") public void codeIn() { StandardLanguage zhCn = StandardLanguage.ZH_CN; assertTrue(ConstantEnumUtil.codeIn(zhCn.getCode(), StandardLanguage.values())); } @Test + @TmsLink("C12013") public void nameIn() { StandardLanguage zhCn = StandardLanguage.ZH_CN; assertTrue(ConstantEnumUtil.nameIn(zhCn.name(), StandardLanguage.values())); } @Test + @TmsLink("C12014") public void idIn() { StandardLanguage zhCn = StandardLanguage.ZH_CN; assertTrue(ConstantEnumUtil.idIn(zhCn.getId(), StandardLanguage.values())); } @Test + @TmsLink("C12015") public void groupInfo() { List usTimezone = ConstantEnumUtil.groupInfo(StandardTimezone.AMERICA_CHICAGO, StandardTimezone.values()); List objects = Arrays.asList( @@ -69,6 +77,7 @@ public void groupInfo() { } @Test + @TmsLink("C12016") public void namesAuto() { List usTimezone = ConstantEnumUtil.namesAuto(StandardTimezone.values(), "AMERICA_CHICAGO, " diff --git a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/LanguageEnumUtilTest.java b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/LanguageEnumUtilTest.java index f1ed218d1..d8f3ce7e3 100644 --- a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/LanguageEnumUtilTest.java +++ b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/LanguageEnumUtilTest.java @@ -1,11 +1,14 @@ package pro.fessional.wings.faceless.enums; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; import java.util.Locale; +import static org.junit.jupiter.api.Assertions.assertEquals; + /** * @author trydofor * @since 2020-06-13 @@ -14,8 +17,11 @@ public class LanguageEnumUtilTest { @Test + @TmsLink("C12017") public void test() { Locale locale = StandardLanguage.ZH_CN.toLocale(); log.info("locale={}", locale.toLanguageTag()); + StandardLanguage al = LanguageEnumUtil.localeOrNull(locale, StandardLanguage.values()); + assertEquals(StandardLanguage.ZH_CN, al); } } diff --git a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/codegen/ConstantNaviGeneratorTest.java b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/codegen/ConstantNaviGeneratorTest.java index 70af09773..4e6f33d40 100644 --- a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/codegen/ConstantNaviGeneratorTest.java +++ b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/codegen/ConstantNaviGeneratorTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.codegen; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import pro.fessional.wings.faceless.codegen.ConstantNaviGenerator.Entry; @@ -15,6 +16,7 @@ class ConstantNaviGeneratorTest { @Test + @TmsLink("C12018") void generate() { Collection entries = new ArrayList<>(); entries.add(create(1000L, "root", "super privilege, NOT for external use")); diff --git a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelperTest.java b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelperTest.java index 326fcb4f5..9960f0003 100644 --- a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelperTest.java +++ b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.jooqgen; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; @@ -11,6 +12,7 @@ class WingsJooqGenHelperTest { @Test + @TmsLink("C12020") public void testReplaceDaoJavaSimple(){ StringBuilder java = new StringBuilder(""" /* @@ -136,8 +138,10 @@ public List fetchById(Collection values) { } } """,repl); - } @Test + } + @Test + @TmsLink("C12021") public void testReplaceDaoJavaEmbeddable(){ StringBuilder java = new StringBuilder(""" /* diff --git a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumGenSample.java b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/ConstantEnumGenSample.java similarity index 94% rename from wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumGenSample.java rename to wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/ConstantEnumGenSample.java index 5e2680c93..54d499d39 100644 --- a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumGenSample.java +++ b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/ConstantEnumGenSample.java @@ -1,5 +1,6 @@ -package pro.fessional.wings.faceless.enums; +package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import org.springframework.jdbc.core.JdbcTemplate; import pro.fessional.wings.faceless.codegen.ConstantEnumGenerator; import pro.fessional.wings.faceless.codegen.ConstantEnumJdbcLoader; @@ -17,6 +18,7 @@ public class ConstantEnumGenSample { + @TmsLink("C12019") public static void main(String[] args) { String jdbc = "jdbc:mysql://localhost/wings"; String user = "trydofor"; diff --git a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/util/ConstantEnumGeneratorTest.java b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/ConstantEnumGeneratorSample.java similarity index 97% rename from wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/util/ConstantEnumGeneratorTest.java rename to wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/ConstantEnumGeneratorSample.java index cf9c751d1..f6e78028b 100644 --- a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/util/ConstantEnumGeneratorTest.java +++ b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/ConstantEnumGeneratorSample.java @@ -1,5 +1,6 @@ -package pro.fessional.wings.faceless.util; +package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import pro.fessional.wings.faceless.codegen.ConstantEnumGenerator; import pro.fessional.wings.faceless.codegen.ConstantEnumGenerator.ConstantEnum; @@ -10,7 +11,7 @@ * @author trydofor * @since 2020-11-11 */ -class ConstantEnumGeneratorTest { +class ConstantEnumGeneratorSample { private static List mockPos() { List result = new ArrayList<>(); @@ -61,6 +62,7 @@ private static List mockPos() { return result; } + @TmsLink("C12023") public static void main(String[] args) { ConstantEnumGenerator.builder() .targetDirectory("wings/faceless/src/test/java/") diff --git a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/JooqCodeAutoGenSample.java b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/JooqCodeAutoGenSample.java index 71f674eaa..f5cf2b64d 100644 --- a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/JooqCodeAutoGenSample.java +++ b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/sample/JooqCodeAutoGenSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; import pro.fessional.wings.faceless.jooqgen.WingsCodeGenerator; @@ -15,6 +16,7 @@ public class JooqCodeAutoGenSample { * Pay attention to the path, should be the project top-level directory (pro.fessional.wings). * Note that in the target project, you should comment out `.springRepository(false)` to auto load the `Dao` */ + @TmsLink("C12022") public static void main(String[] args) { // === Must Drop And Init === // WingsJooqDaoAliasImplTest#test0DropAndInit @@ -40,7 +42,7 @@ private static void genJooq() { "|tst_normal_table" + "|tst_sharding") .databaseVersionProvider("SELECT MAX(revision) FROM sys_schema_version WHERE apply_dt > '1000-01-01'") - .targetPackage("pro.fessional.wings.faceless.database.autogen") + .targetPackage("pro.fessional.wings.faceless.app.database.autogen") .targetDirectory("wings/faceless-jooq/src/test/java/") // Disable spring auto scan // .springRepository(false) @@ -64,7 +66,7 @@ private static void genShard() { // support Regexp comment .databaseIncludes("tst_sharding", "tst_normal_table") .databaseVersionProvider(null) - .targetPackage("pro.fessional.wings.faceless.database.autogen") + .targetPackage("pro.fessional.wings.faceless.app.database.autogen") .targetDirectory("wings/faceless-shard/src/test/java/") .buildAndGenerate(); } diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsInitDatabaseSample.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsInitDatabaseSample.java similarity index 92% rename from wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsInitDatabaseSample.java rename to wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsInitDatabaseSample.java index 5e995f364..3fd4260cf 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsInitDatabaseSample.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsInitDatabaseSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.val; import org.junit.jupiter.api.Disabled; @@ -20,13 +21,13 @@ @SpringBootTest @Disabled("Init database, have handled by devs") -@SuppressWarnings("NewClassNamingConvention") -public class WingsInitDatabaseSample { +public class TestWingsInitDatabaseSample { @Setter(onMethod_ = {@Autowired}) private SchemaRevisionManager schemaRevisionManager; @Test + @TmsLink("C12024") public void init0601() { // init val sqls = scan(REVISION_PATH_MASTER, WingsRevision.V01_19_0521_01_EnumI18n.classpath()); diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaDumper.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaDumperSample.java similarity index 95% rename from wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaDumper.java rename to wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaDumperSample.java index da453823c..4fa250c37 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaDumper.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaDumperSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import kotlin.jvm.functions.Function1; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -21,8 +22,7 @@ @Slf4j @SpringBootTest @Disabled("Dump schema structure, used to backup and restore") -@SuppressWarnings("NewClassNamingConvention") -public class WingsSchemaDumper { +public class TestWingsSchemaDumperSample { @Setter(onMethod_ = {@Autowired}) private DataSource dataSource; @@ -31,6 +31,7 @@ public class WingsSchemaDumper { private SchemaFulldumpManager schemaFulldumpManager; @Test + @TmsLink("C12025") public void dump() { Function1, List> ddl = SchemaFulldumpManager.groupedTable(false, "-- ==================== Basement-4(B4/10#):basic =======================", diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaGenerator.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaGeneratorSample.java similarity index 94% rename from wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaGenerator.java rename to wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaGeneratorSample.java index 2fbbc46fe..0b554d7d8 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaGenerator.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaGeneratorSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -27,8 +28,7 @@ // "spring.shardingsphere.datasource.writer.password=moilioncircle", }) @Disabled("Init database, have handled by devs") -@SuppressWarnings("NewClassNamingConvention") -public class WingsSchemaGenerator { +public class TestWingsSchemaGeneratorSample { @Setter(onMethod_ = {@Autowired}) private WingsTestHelper wingsTestHelper; @@ -37,6 +37,7 @@ public class WingsSchemaGenerator { private SchemaRevisionManager schemaRevisionManager; @Test + @TmsLink("C12026") public void init() { wingsTestHelper.cleanTable(); final SortedMap sqls = FlywaveRevisionScanner diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaJournal.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaJournalSample.java similarity index 96% rename from wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaJournal.java rename to wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaJournalSample.java index 73e8890a4..beec32243 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/WingsSchemaJournal.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaJournalSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Disabled; @@ -19,13 +20,13 @@ @SpringBootTest @Disabled("Manage trace table, use to maintain data") @Slf4j -@SuppressWarnings("NewClassNamingConvention") -public class WingsSchemaJournal { +public class TestWingsSchemaJournalSample { @Setter(onMethod_ = {@Autowired}) private SchemaJournalManager schemaJournalManager; @Test + @TmsLink("C12027") public void journal() { long cid = -1; List tables = Arrays.asList( diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/util/FlywaveRevisionScannerTest.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/util/FlywaveRevisionScannerTest.java index 091217f1f..2a63e7115 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/util/FlywaveRevisionScannerTest.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/util/FlywaveRevisionScannerTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.util; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Test; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; @@ -17,6 +18,7 @@ public class FlywaveRevisionScannerTest { @Test + @TmsLink("C12028") public void branchPath() { String path = REVISION_PATH_BRANCH_HEAD + "feature/01-enum-i18n/" + REVISION_PATH_REVIFILE_TAIL; assertEquals(path, FlywaveRevisionScanner.branchPath("feature/01-enum-i18n")); @@ -32,6 +34,7 @@ public void branchPath() { } @Test + @TmsLink("C12029") public void commentPath() { assertEquals("master/2019-0601_01-test.sql", FlywaveRevisionScanner.commentInfo( "/Users/trydofor/Workspace/github.com/pro.fessional.wings/wings/faceless/src/test/resources/wings-flywave/master/20190601u01-test.sql", @@ -40,6 +43,7 @@ public void commentPath() { } @Test + @TmsLink("C12030") public void builder() { final SortedMap sql = FlywaveRevisionScanner .helper() @@ -54,6 +58,7 @@ public void builder() { } @Test + @TmsLink("C12031") void formatRevi() { assertEquals("1234-5678-9", FlywaveRevisionScanner.formatRevi("123456789-")); assertEquals("1234-5678-9", FlywaveRevisionScanner.formatRevi("1234-56-78-9")); diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaFulldumpManagerTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaFulldumpManagerTest.kt index fb3f2806d..21da44ff4 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaFulldumpManagerTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaFulldumpManagerTest.kt @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.flywave +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.MethodOrderer.MethodName import org.junit.jupiter.api.Test @@ -39,12 +40,14 @@ class SchemaFulldumpManagerTest { lateinit var wingsTestHelper: WingsTestHelper @Test + @TmsLink("C12036") fun test0CleanTables() { wingsTestHelper.cleanTable() schemaRevisionManager.checkAndInitSql(FlywaveRevisionScanner.scanMaster(), 0, true) } @Test + @TmsLink("C12037") fun test1DumpDdlSeeFile() { File(fold).mkdirs() val dlls = schemaFulldumpManager.dumpDdl(dataSource, groupedRegexp(false, @@ -62,6 +65,7 @@ class SchemaFulldumpManagerTest { } @Test + @TmsLink("C12038") fun test2DumpRecSeeFile() { File(fold).mkdirs() val recs = schemaFulldumpManager.dumpRec(dataSource, groupedTable(true, diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt index 6d3b9f99b..bc1ef4be2 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.flywave +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue @@ -133,6 +134,7 @@ class SchemaJournalManagerTest { } @Test + @TmsLink("C12039") fun test0CleanTables() { wingsTestHelper.cleanTable() val sqls = FlywaveRevisionScanner @@ -150,6 +152,7 @@ class SchemaJournalManagerTest { } @Test + @TmsLink("C12040") fun test1CreateTables() { schemaRevisionManager.publishRevision(WingsRevision.V01_19_0520_01_IdLog.revision(), 0) wingsTestHelper.assertSame( @@ -175,6 +178,7 @@ class SchemaJournalManagerTest { } @Test + @TmsLink("C12041") fun test2Sharding() { schemaJournalManager.checkAndInitDdl("tst_sharding", 0) wingsTestHelper.assertNot( @@ -198,6 +202,7 @@ class SchemaJournalManagerTest { } @Test + @TmsLink("C12042") fun test4AiTrigger() { if (wingsTestHelper.isH2) { testcaseNotice("h2 database skip") @@ -227,6 +232,7 @@ class SchemaJournalManagerTest { } @Test + @TmsLink("C12043") fun test4AuTrigger() { if (wingsTestHelper.isH2) { testcaseNotice("h2 database skip") @@ -253,6 +259,7 @@ class SchemaJournalManagerTest { } @Test + @TmsLink("C12044") fun test5BdTrigger() { if (wingsTestHelper.isH2) { testcaseNotice("h2 database skip") @@ -278,6 +285,7 @@ class SchemaJournalManagerTest { } @Test + @TmsLink("C12045") fun test6Trigger() { if (wingsTestHelper.isH2) { testcaseNotice("h2 database skip") @@ -320,6 +328,7 @@ class SchemaJournalManagerTest { } @Test + @TmsLink("C12046") fun test7AltTable() { if (wingsTestHelper.isH2) { testcaseNotice("h2 database skip") diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt index 473038a28..4898e0060 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.flywave +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.MethodOrderer.MethodName import org.junit.jupiter.api.Test @@ -37,6 +38,7 @@ open class SchemaRevisionMangerTest { private val schemaVersion = "win_schema_version" @Test + @TmsLink("C12047") fun test0CleanTables() { wingsTestHelper.cleanTable() val sqls = FlywaveRevisionScanner.helper() @@ -54,12 +56,14 @@ open class SchemaRevisionMangerTest { } @Test + @TmsLink("C12048") fun test1Publish520() { breakpointDebug("Publish to REVISION_2ND_IDLOGS💰") schemaRevisionManager.publishRevision(revi2IdLog, 0) } @Test + @TmsLink("C12049") fun test2CurrentRevi() { breakpointDebug("Check current revision💰") val databaseVersion = schemaRevisionManager.currentRevision() @@ -69,6 +73,7 @@ open class SchemaRevisionMangerTest { } @Test + @TmsLink("C12050") fun test2ReviLine() { breakpointDebug("Check current revision line💰") val databaseVersion = schemaRevisionManager.statusRevisions() @@ -85,10 +90,11 @@ open class SchemaRevisionMangerTest { } @Test + @TmsLink("C12051") fun test3DownThenUp() { breakpointDebug("Downgrade to 1st💰") schemaRevisionManager.publishRevision(revi1Schema, -1) - breakpointDebug("Upgrade to 2st💰") + breakpointDebug("Upgrade to 2nd💰") schemaRevisionManager.publishRevision(revi2IdLog, -1) breakpointDebug("Again downgrade to 1st💰") schemaRevisionManager.publishRevision(revi1Schema, -1) @@ -97,6 +103,7 @@ open class SchemaRevisionMangerTest { private val test3rdRevision = 20190615_01L @Test + @TmsLink("C12052") fun test4Force615() { breakpointDebug("Force to add 615💰, but do NOT publish") schemaRevisionManager.forceUpdateSql( @@ -123,6 +130,7 @@ open class SchemaRevisionMangerTest { } @Test + @TmsLink("C12053") fun test5ForceBreak() { breakpointDebug("Publish 615💰") wingsTestHelper.assertNot(WingsTestHelper.Type.Table, "test_temp", "test_temp_0", "test_temp_1") @@ -135,6 +143,7 @@ open class SchemaRevisionMangerTest { @Test + @TmsLink("C12054") fun test6Republish520() { breakpointDebug("Publish 520💰") schemaRevisionManager.publishRevision(revi2IdLog, 0) @@ -145,6 +154,7 @@ open class SchemaRevisionMangerTest { } @Test + @TmsLink("C12055") fun test7ForceExecSql() { breakpointDebug("Force to execute the Sql💰") schemaRevisionManager.forceExecuteSql( @@ -161,6 +171,7 @@ open class SchemaRevisionMangerTest { } @Test + @TmsLink("C12056") fun test8PublishBranch() { breakpointDebug("scan branch feature/01-enum-i18n💰") val sqls = FlywaveRevisionScanner.scanBranch("feature/01-enum-i18n") @@ -170,6 +181,7 @@ open class SchemaRevisionMangerTest { } @Test + @TmsLink("C12057") fun test9MaintainBreak() { breakpointDebug("Prepare a breakpoint revision to mock a failure💰") schemaRevisionManager.forceExecuteSql( diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SimpleJdbcTemplateTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SimpleJdbcTemplateTest.kt index 8488f0d45..df1f38e8e 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SimpleJdbcTemplateTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SimpleJdbcTemplateTest.kt @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.flywave +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest @@ -17,6 +18,7 @@ class SimpleJdbcTemplateTest { lateinit var dataSources: DataSourceContext @Test + @TmsLink("C12058") fun metadata() { val tmpl = SimpleJdbcTemplate(dataSources.current, "first") tmpl.execute("show tables") diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentParserTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentParserTest.kt index 0d3ec05f8..ffedc89ac 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentParserTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentParserTest.kt @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.flywave +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test @@ -21,6 +22,7 @@ class SqlSegmentParserTest { lateinit var sqlStatementParser: SqlStatementParser @Test + @TmsLink("C12059") @Disabled("Use for debugging in case of parsing problems") fun test1ManualCheck() { val scan = FlywaveRevisionScanner.scanMaster() @@ -53,6 +55,7 @@ class SqlSegmentParserTest { } @Test + @TmsLink("C12060") fun test2RenameShadow() { val segs = sqlSegmentProcessor.parse(sqlStatementParser, "ALTER TABLE `table_a` RENAME TO `table_b`") val segment = segs[0] diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentProcessorTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentProcessorTest.kt index 97d08ad4a..50046fef3 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentProcessorTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentProcessorTest.kt @@ -1,6 +1,7 @@ package pro.fessional.wings.faceless.flywave +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertNotNull @@ -14,6 +15,7 @@ class SqlSegmentProcessorTest { val parser = MySqlStatementParser() @Test + @TmsLink("C12061") fun applyNut() { val mt = processor.parse(parser, """ /* apply @@ -44,6 +46,7 @@ class SqlSegmentProcessorTest { } @Test + @TmsLink("C12062") fun applyLog() { val mt = processor.parse(parser, """ /* apply@log error@skip */ @@ -71,6 +74,7 @@ class SqlSegmentProcessorTest { } @Test + @TmsLink("C12063") fun parseCmd0() { val mt = SqlSegmentProcessor.parseCmd( """ /* wgs_order @@ -91,6 +95,7 @@ class SqlSegmentProcessorTest { } @Test + @TmsLink("C12064") fun parseCmd1() { val mt = SqlSegmentProcessor.parseCmd("-- @plain apply@ctr_clerk[_0-0]* error@skip // other comment","--") assertNotNull(mt) @@ -104,6 +109,7 @@ class SqlSegmentProcessorTest { } @Test + @TmsLink("C12065") fun parseCmd2() { val mt = SqlSegmentProcessor.parseCmd("-- apply@ctr_clerk[_0-0]* error@skip // other comment","--") assertNotNull(mt) @@ -116,6 +122,7 @@ class SqlSegmentProcessorTest { } @Test + @TmsLink("C12066") fun parseCmd3() { val mt = SqlSegmentProcessor.parseCmd("-- error@skip // other comment","--") assertNotNull(mt) @@ -128,6 +135,7 @@ class SqlSegmentProcessorTest { } @Test + @TmsLink("C12067") fun parseCmd4() { val mt = SqlSegmentProcessor.parseCmd("/* ask@danger // other comment */","/*") assertNotNull(mt) diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTests.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTest.kt similarity index 92% rename from wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTests.kt rename to wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTest.kt index 27a7f395e..92d34bfa5 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTests.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTest.kt @@ -1,5 +1,7 @@ package pro.fessional.wings.faceless.flywave +import io.qameta.allure.TmsLink +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.MethodOrderer import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestMethodOrder @@ -9,12 +11,13 @@ import javax.sql.DataSource @SpringBootTest @TestMethodOrder(MethodOrderer.MethodName::class) -open class WingsShardingTests { +open class WingsShardingTest { @Autowired lateinit var datasource: DataSource @Test + @TmsLink("C12068") fun test1DropTable() { val statement = datasource.connection.prepareStatement(""" drop table if exists `wg_order`; @@ -25,6 +28,7 @@ open class WingsShardingTests { } @Test + @TmsLink("C12069") fun test2CreateTable() { val statement = datasource.connection.prepareStatement(""" create table `wg_order` @@ -43,6 +47,7 @@ open class WingsShardingTests { } @Test + @TmsLink("C12070") fun test3InsertDate() { val statement = datasource.connection.prepareStatement(""" insert into `wg_order` (`id`,`commit_id`) values @@ -55,6 +60,7 @@ open class WingsShardingTests { } @Test + @TmsLink("C12071") fun test4AlterTable() { val statement = datasource.connection.prepareStatement(""" alter table `wg_order` @@ -66,6 +72,9 @@ open class WingsShardingTests { } + @Test + @TmsLink("C12072") + @Disabled("no sharding datasource configed") fun trigger() { val sts1 = datasource.connection.prepareStatement(""" create table `wg_order${"$"}log` diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/util/TemplateUtilTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/util/TemplateUtilTest.kt index 9426cf192..863fa8458 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/util/TemplateUtilTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/util/TemplateUtilTest.kt @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.flywave.util +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue @@ -12,6 +13,7 @@ import org.junit.jupiter.api.Test class TemplateUtilTest { @Test + @TmsLink("C12032") fun one() { val txt = """CREATE TABLE `SYS_LIGHT_SEQUENCE` "SYS_LIGHT_SEQUENCE is \" good" 'SYS_LIGHT_SEQUENCE \'is ''good'""" val tkn = "SYS_LIGHT_SEQUENCE" @@ -21,6 +23,7 @@ class TemplateUtilTest { } @Test + @TmsLink("C12033") fun bnd() { val txt = """CREATE TABLE `SYS_LIGHT_SEQUENCE_01` "SYS_LIGHT_SEQUENCE is \" good" 'SYS_LIGHT_SEQUENCE \'is ''good'""" val tkn = "SYS_LIGHT_SEQUENCE" @@ -30,6 +33,7 @@ class TemplateUtilTest { } @Test + @TmsLink("C12034") fun more() { val txt = """CREATE TABLE `SYS_LIGHT_SEQUENCE` "SYS_LIGHT_SEQUENCE is \" good" 'SYS_LIGHT_SEQUENCE \'is ''good'""" val tkn = listOf("SYS_LIGHT_SEQUENCE","LIGHT_SEQUENCE","SEQUENCE`") @@ -42,6 +46,7 @@ class TemplateUtilTest { } @Test + @TmsLink("C12035") fun isb(){ val txt = """CREATE TABLE `SYS_LIGHT_SEQUENCE` "SYS_LIGHT_SEQUENCE is \" good" 'SYS_LIGHT_SEQUENCE \'is ''good'""" assertTrue(TemplateUtil.isBoundary(txt,"SYS_LIGHT_SEQUENCE")) diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveInitDatabaseSample.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/TestWingsFlywaveInitDatabaseSample.kt similarity index 90% rename from wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveInitDatabaseSample.kt rename to wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/TestWingsFlywaveInitDatabaseSample.kt index edab8d960..b149cd1ef 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveInitDatabaseSample.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/TestWingsFlywaveInitDatabaseSample.kt @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired @@ -15,12 +16,13 @@ import pro.fessional.wings.faceless.util.FlywaveRevisionScanner */ @SpringBootTest @Disabled("Manually, tested by SchemaRevisionMangerTest") -class WingsFlywaveInitDatabaseSample { +class TestWingsFlywaveInitDatabaseSample { @Autowired lateinit var schemaRevisionManager: SchemaRevisionManager @Test + @TmsLink("C12073") fun force() { val sqls = FlywaveRevisionScanner.scanMaster() schemaRevisionManager.forceUpdateSql(sqls[WingsRevision.V00_19_0512_01_Schema.revision()]!!, 0) diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveShardJournalSample.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/TestWingsFlywaveShardJournalSample.kt similarity index 96% rename from wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveShardJournalSample.kt rename to wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/TestWingsFlywaveShardJournalSample.kt index 16b371d52..8f8691dbe 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/WingsFlywaveShardJournalSample.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/sample/TestWingsFlywaveShardJournalSample.kt @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired @@ -18,7 +19,7 @@ import pro.fessional.wings.faceless.util.FlywaveRevisionScanner */ @SpringBootTest(properties = ["debug = true"]) @Disabled("Manually, tested by SchemaJournalManagerTest, SchemaShardingManagerTest") -class WingsFlywaveShardJournalSample { +class TestWingsFlywaveShardJournalSample { @Autowired lateinit var schemaShardingManager: SchemaShardingManager @@ -30,6 +31,7 @@ class WingsFlywaveShardJournalSample { lateinit var schemaJournalManager: SchemaJournalManager @Test + @TmsLink("C12074") fun revisionShardJournal() { // init val sqls = FlywaveRevisionScanner.scanMaster() diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt index eaa494c73..54f394151 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt @@ -1,6 +1,7 @@ package pro.fessional.wings.faceless.service.lightid.impl +import io.qameta.allure.TmsLink import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.MethodOrderer import org.junit.jupiter.api.Test @@ -50,12 +51,14 @@ open class LightIdServiceImplTest { private val seqName = "sys_commit_journal" @Test + @TmsLink("C12075") fun test0CleanTables() { wingsTestHelper.cleanTable() schemaRevisionManager.checkAndInitSql(FlywaveRevisionScanner.scanMaster(), 0, true) } @Test + @TmsLink("C12076") fun test1FetchId() { schemaRevisionManager.publishRevision(WingsRevision.V01_19_0520_01_IdLog.revision(), 0) @@ -72,6 +75,7 @@ open class LightIdServiceImplTest { } @Test + @TmsLink("C12077") fun test2FetchId() { // consumer journalService.commit(this.javaClass) { @@ -83,6 +87,7 @@ open class LightIdServiceImplTest { } @Test + @TmsLink("C12078") fun test3CompeteId() { val threadCnt = 100 val loopCount = 5000 @@ -104,6 +109,7 @@ open class LightIdServiceImplTest { } @Test + @TmsLink("C12079") fun test4RangeId() { val rg = 999_000_000_000L val id = lightIdService.getId(seqName, 0) diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/listener/TableCudListener.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/listener/TableCudListener.java index c108183f7..aa023b0a5 100644 --- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/listener/TableCudListener.java +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/listener/TableCudListener.java @@ -47,6 +47,7 @@ */ @SuppressWarnings("removal") @Slf4j +@Setter @Getter public class TableCudListener implements VisitListener, WingsTableCudHandler.Auto { /** @@ -54,15 +55,10 @@ public class TableCudListener implements VisitListener, WingsTableCudHandler.Aut */ public static boolean WarnVisit = false; - @Setter @Getter private boolean create = true; - @Setter @Getter private boolean update = true; - @Setter @Getter private boolean delete = true; - @Setter @Getter private List handlers = Collections.emptyList(); - @Setter @Getter private Map> tableField = new HashMap<>(); public enum ContextKey { diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/TableCudConfiguration.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/TableCudConfiguration.java index a57b268d4..221244490 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/TableCudConfiguration.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/TableCudConfiguration.java @@ -2,7 +2,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.faceless.service.WingsTableCudHandlerTest; +import pro.fessional.wings.faceless.app.service.TestingTableCudHandler; /** * @author trydofor @@ -12,8 +12,8 @@ public class TableCudConfiguration { @Bean - public WingsTableCudHandlerTest wingsTableCudHandler() { - return new WingsTableCudHandlerTest(); + public TestingTableCudHandler wingsTableCudHandler() { + return new TestingTableCudHandler(); } } diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultCatalog.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultCatalog.java similarity index 95% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultCatalog.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultCatalog.java index 82949df44..e2cd731a7 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultCatalog.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultCatalog.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen; +package pro.fessional.wings.faceless.app.database.autogen; import org.jooq.Constants; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultSchema.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultSchema.java similarity index 82% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultSchema.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultSchema.java index 7a9e9ed85..c39cdfcee 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultSchema.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultSchema.java @@ -1,16 +1,16 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen; +package pro.fessional.wings.faceless.app.database.autogen; import org.jooq.Catalog; import org.jooq.Table; import org.jooq.impl.SchemaImpl; -import pro.fessional.wings.faceless.database.autogen.tables.SysConstantEnumTable; -import pro.fessional.wings.faceless.database.autogen.tables.SysStandardI18nTable; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysConstantEnumTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysStandardI18nTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import javax.annotation.processing.Generated; import java.util.Arrays; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/Tables.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/Tables.java similarity index 72% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/Tables.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/Tables.java index fe583c53d..78177e458 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/Tables.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/Tables.java @@ -1,13 +1,13 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen; +package pro.fessional.wings.faceless.app.database.autogen; -import pro.fessional.wings.faceless.database.autogen.tables.SysConstantEnumTable; -import pro.fessional.wings.faceless.database.autogen.tables.SysStandardI18nTable; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysConstantEnumTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysStandardI18nTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/SysConstantEnumTable.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/SysConstantEnumTable.java similarity index 96% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/SysConstantEnumTable.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/SysConstantEnumTable.java index 4a8c8ca0e..6256f5ab6 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/SysConstantEnumTable.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/SysConstantEnumTable.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables; +package pro.fessional.wings.faceless.app.database.autogen.tables; import org.jetbrains.annotations.NotNull; @@ -20,8 +20,8 @@ import org.jooq.impl.Internal; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; -import pro.fessional.wings.faceless.database.autogen.DefaultSchema; -import pro.fessional.wings.faceless.database.autogen.tables.records.SysConstantEnumRecord; +import pro.fessional.wings.faceless.app.database.autogen.DefaultSchema; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.SysConstantEnumRecord; import pro.fessional.wings.faceless.database.jooq.WingsJournalTable; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/SysStandardI18nTable.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/SysStandardI18nTable.java similarity index 96% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/SysStandardI18nTable.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/SysStandardI18nTable.java index 75aa2df77..e6aa1fab4 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/SysStandardI18nTable.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/SysStandardI18nTable.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables; +package pro.fessional.wings.faceless.app.database.autogen.tables; import org.jetbrains.annotations.NotNull; @@ -20,8 +20,8 @@ import org.jooq.impl.Internal; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; -import pro.fessional.wings.faceless.database.autogen.DefaultSchema; -import pro.fessional.wings.faceless.database.autogen.tables.records.SysStandardI18nRecord; +import pro.fessional.wings.faceless.app.database.autogen.DefaultSchema; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.SysStandardI18nRecord; import pro.fessional.wings.faceless.database.jooq.WingsJournalTable; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstNormalTableTable.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstNormalTableTable.java similarity index 97% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstNormalTableTable.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstNormalTableTable.java index e093b41ea..771aa5943 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstNormalTableTable.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstNormalTableTable.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables; +package pro.fessional.wings.faceless.app.database.autogen.tables; import org.jetbrains.annotations.NotNull; @@ -22,8 +22,8 @@ import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; import pro.fessional.wings.faceless.convention.EmptyValue; -import pro.fessional.wings.faceless.database.autogen.DefaultSchema; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstNormalTableRecord; +import pro.fessional.wings.faceless.app.database.autogen.DefaultSchema; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstNormalTableRecord; import pro.fessional.wings.faceless.database.jooq.WingsJournalTable; import pro.fessional.wings.faceless.database.jooq.converter.JooqConsEnumConverter; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstShardingTable.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstShardingTable.java similarity index 97% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstShardingTable.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstShardingTable.java index 2db587c49..39ec3156a 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstShardingTable.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstShardingTable.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables; +package pro.fessional.wings.faceless.app.database.autogen.tables; import org.jetbrains.annotations.NotNull; @@ -22,8 +22,8 @@ import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; import pro.fessional.wings.faceless.convention.EmptyValue; -import pro.fessional.wings.faceless.database.autogen.DefaultSchema; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.DefaultSchema; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.jooq.WingsJournalTable; import pro.fessional.wings.faceless.database.jooq.converter.JooqConsEnumConverter; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/SysConstantEnumDao.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysConstantEnumDao.java similarity index 94% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/SysConstantEnumDao.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysConstantEnumDao.java index b72754ecb..2cf89de25 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/SysConstantEnumDao.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysConstantEnumDao.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.daos; +package pro.fessional.wings.faceless.app.database.autogen.tables.daos; import java.util.Collection; @@ -14,9 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import pro.fessional.wings.faceless.database.autogen.tables.SysConstantEnumTable; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.SysConstantEnum; -import pro.fessional.wings.faceless.database.autogen.tables.records.SysConstantEnumRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysConstantEnumTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.SysConstantEnum; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.SysConstantEnumRecord; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/SysStandardI18nDao.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysStandardI18nDao.java similarity index 93% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/SysStandardI18nDao.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysStandardI18nDao.java index f1eb9fc8b..ebe88cfd1 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/SysStandardI18nDao.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysStandardI18nDao.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.daos; +package pro.fessional.wings.faceless.app.database.autogen.tables.daos; import java.util.Collection; @@ -14,9 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import pro.fessional.wings.faceless.database.autogen.tables.SysStandardI18nTable; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.SysStandardI18n; -import pro.fessional.wings.faceless.database.autogen.tables.records.SysStandardI18nRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysStandardI18nTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.SysStandardI18n; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.SysStandardI18nRecord; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstNormalTableDao.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java similarity index 98% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstNormalTableDao.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java index b800262f6..f5859e1df 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstNormalTableDao.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.daos; +package pro.fessional.wings.faceless.app.database.autogen.tables.daos; import java.math.BigDecimal; @@ -18,9 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstNormalTable; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstNormalTableRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstNormalTableRecord; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstShardingDao.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java similarity index 97% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstShardingDao.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java index e1e8503c2..11e9429a4 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstShardingDao.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.daos; +package pro.fessional.wings.faceless.app.database.autogen.tables.daos; import java.time.LocalDateTime; @@ -15,9 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ISysConstantEnum.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ISysConstantEnum.java similarity index 96% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ISysConstantEnum.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ISysConstantEnum.java index 1e903bbd5..179f6fbd7 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ISysConstantEnum.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ISysConstantEnum.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.interfaces; +package pro.fessional.wings.faceless.app.database.autogen.tables.interfaces; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ISysStandardI18n.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ISysStandardI18n.java similarity index 96% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ISysStandardI18n.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ISysStandardI18n.java index d97574707..e7da148b8 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ISysStandardI18n.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ISysStandardI18n.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.interfaces; +package pro.fessional.wings.faceless.app.database.autogen.tables.interfaces; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstNormalTable.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstNormalTable.java similarity index 98% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstNormalTable.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstNormalTable.java index b799971be..aabee1ba3 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstNormalTable.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstNormalTable.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.interfaces; +package pro.fessional.wings.faceless.app.database.autogen.tables.interfaces; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstSharding.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstSharding.java similarity index 97% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstSharding.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstSharding.java index 7a52a1800..8817be547 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstSharding.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstSharding.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.interfaces; +package pro.fessional.wings.faceless.app.database.autogen.tables.interfaces; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/SysConstantEnum.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/SysConstantEnum.java similarity index 96% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/SysConstantEnum.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/SysConstantEnum.java index 60bdf0144..e4ef58031 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/SysConstantEnum.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/SysConstantEnum.java @@ -1,10 +1,10 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.pojos; +package pro.fessional.wings.faceless.app.database.autogen.tables.pojos; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ISysConstantEnum; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ISysConstantEnum; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/SysStandardI18n.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/SysStandardI18n.java similarity index 97% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/SysStandardI18n.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/SysStandardI18n.java index d7c8ccf7c..2cc11d233 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/SysStandardI18n.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/SysStandardI18n.java @@ -1,10 +1,10 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.pojos; +package pro.fessional.wings.faceless.app.database.autogen.tables.pojos; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ISysStandardI18n; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ISysStandardI18n; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstNormalTable.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstNormalTable.java similarity index 98% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstNormalTable.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstNormalTable.java index ea8c2da8e..e55ef22c8 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstNormalTable.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstNormalTable.java @@ -1,10 +1,10 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.pojos; +package pro.fessional.wings.faceless.app.database.autogen.tables.pojos; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ITstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ITstNormalTable; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstSharding.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstSharding.java similarity index 98% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstSharding.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstSharding.java index 1e4b184a2..e73e74286 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstSharding.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstSharding.java @@ -1,10 +1,10 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.pojos; +package pro.fessional.wings.faceless.app.database.autogen.tables.pojos; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ITstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ITstSharding; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/SysConstantEnumRecord.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/SysConstantEnumRecord.java similarity index 95% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/SysConstantEnumRecord.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/SysConstantEnumRecord.java index 5e4407c01..5177ba08d 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/SysConstantEnumRecord.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/SysConstantEnumRecord.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.records; +package pro.fessional.wings.faceless.app.database.autogen.tables.records; import org.jooq.Field; @@ -9,9 +9,9 @@ import org.jooq.Record5; import org.jooq.Row5; import org.jooq.impl.UpdatableRecordImpl; -import pro.fessional.wings.faceless.database.autogen.tables.SysConstantEnumTable; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ISysConstantEnum; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.SysConstantEnum; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysConstantEnumTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ISysConstantEnum; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.SysConstantEnum; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/SysStandardI18nRecord.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/SysStandardI18nRecord.java similarity index 95% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/SysStandardI18nRecord.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/SysStandardI18nRecord.java index 4041a0e03..e6fa4e3c7 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/SysStandardI18nRecord.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/SysStandardI18nRecord.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.records; +package pro.fessional.wings.faceless.app.database.autogen.tables.records; import org.jooq.Field; @@ -9,9 +9,9 @@ import org.jooq.Record5; import org.jooq.Row5; import org.jooq.impl.UpdatableRecordImpl; -import pro.fessional.wings.faceless.database.autogen.tables.SysStandardI18nTable; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ISysStandardI18n; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.SysStandardI18n; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysStandardI18nTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ISysStandardI18n; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.SysStandardI18n; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstNormalTableRecord.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstNormalTableRecord.java similarity index 97% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstNormalTableRecord.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstNormalTableRecord.java index 47cbfa77f..2429dd979 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstNormalTableRecord.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstNormalTableRecord.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.records; +package pro.fessional.wings.faceless.app.database.autogen.tables.records; import org.jooq.Field; @@ -9,9 +9,9 @@ import org.jooq.Record13; import org.jooq.Row13; import org.jooq.impl.UpdatableRecordImpl; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ITstNormalTable; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ITstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstNormalTable; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstShardingRecord.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstShardingRecord.java similarity index 96% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstShardingRecord.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstShardingRecord.java index adb39faec..34f550dac 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstShardingRecord.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstShardingRecord.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.records; +package pro.fessional.wings.faceless.app.database.autogen.tables.records; import org.jooq.Field; @@ -9,9 +9,9 @@ import org.jooq.Record8; import org.jooq.Row8; import org.jooq.impl.UpdatableRecordImpl; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ITstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ITstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; import javax.annotation.processing.Generated; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/WingsTableCudHandlerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TestingTableCudHandler.java similarity index 92% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/WingsTableCudHandlerTest.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TestingTableCudHandler.java index 00dd97f4d..8e8a82e68 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/WingsTableCudHandlerTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TestingTableCudHandler.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.faceless.service; +package pro.fessional.wings.faceless.app.service; import lombok.Getter; import lombok.extern.slf4j.Slf4j; @@ -17,7 +17,7 @@ */ @Slf4j @Getter -public class WingsTableCudHandlerTest implements WingsTableCudHandler { +public class TestingTableCudHandler implements WingsTableCudHandler { private final List cud = new ArrayList<>(); private final List table = new ArrayList<>(); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/TransactionalBusinessService.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TransactionalBusinessService.java similarity index 91% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/TransactionalBusinessService.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TransactionalBusinessService.java index 51563bbd3..8a7be3807 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/TransactionalBusinessService.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TransactionalBusinessService.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.faceless.service; +package pro.fessional.wings.faceless.app.service; import org.springframework.transaction.annotation.Transactional; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/TransactionalClauseService.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TransactionalClauseService.java similarity index 93% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/TransactionalClauseService.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TransactionalClauseService.java index c98868ef8..090e7c15a 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/TransactionalClauseService.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/TransactionalClauseService.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.faceless.service; +package pro.fessional.wings.faceless.app.service; import org.jetbrains.annotations.Nullable; import org.springframework.transaction.annotation.Transactional; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/impl/TransactionalBusinessServiceImpl.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/impl/TransactionalBusinessServiceImpl.java similarity index 94% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/impl/TransactionalBusinessServiceImpl.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/impl/TransactionalBusinessServiceImpl.java index 6d0564da0..41cf5b9a2 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/impl/TransactionalBusinessServiceImpl.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/impl/TransactionalBusinessServiceImpl.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.faceless.service.impl; +package pro.fessional.wings.faceless.app.service.impl; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -9,8 +9,8 @@ import org.springframework.transaction.TransactionStatus; import org.springframework.transaction.support.DefaultTransactionDefinition; import pro.fessional.wings.faceless.database.helper.DaoAssert; -import pro.fessional.wings.faceless.service.TransactionalBusinessService; -import pro.fessional.wings.faceless.service.TransactionalClauseService; +import pro.fessional.wings.faceless.app.service.TransactionalBusinessService; +import pro.fessional.wings.faceless.app.service.TransactionalClauseService; import java.util.concurrent.atomic.AtomicLong; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/impl/TransactionalClauseServiceImpl.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/impl/TransactionalClauseServiceImpl.java similarity index 89% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/impl/TransactionalClauseServiceImpl.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/impl/TransactionalClauseServiceImpl.java index df5432119..1ab8dc47b 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/service/impl/TransactionalClauseServiceImpl.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/service/impl/TransactionalClauseServiceImpl.java @@ -1,14 +1,14 @@ -package pro.fessional.wings.faceless.service.impl; +package pro.fessional.wings.faceless.app.service.impl; import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import pro.fessional.wings.faceless.convention.EmptyValue; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.daos.TstNormalTableDao; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstNormalTableDao; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstNormalTable; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; -import pro.fessional.wings.faceless.service.TransactionalClauseService; +import pro.fessional.wings.faceless.app.service.TransactionalClauseService; import pro.fessional.wings.faceless.service.lightid.LightIdService; import java.math.BigDecimal; diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java index 6357554ff..b0771795d 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.database.jooq; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.val; import org.jooq.Field; @@ -10,10 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.flywave.WingsRevision; import pro.fessional.wings.faceless.helper.WingsTestHelper; @@ -55,6 +56,7 @@ public class WingsJooqDaoAliasImplTest { private final LocalDateTime now = LocalDateTime.now(); @Test + @TmsLink("C12081") public void test0DropAndInit() { wingsTestHelper.cleanTable(); final SortedMap sqls = FlywaveRevisionScanner.scan(REVISION_PATH_MASTER, WingsRevision.V01_19_0521_01_EnumI18n.classpath()); @@ -63,6 +65,7 @@ public void test0DropAndInit() { } @Test + @TmsLink("C12082") public void test1BatchLoadSeeLog() { if (WingsJooqEnv.daoBatchMysql) { testcaseNotice("Skip the inefficient SQL and use mysql `replace into` syntax, see batchMerge"); @@ -81,6 +84,7 @@ public void test1BatchLoadSeeLog() { } @Test + @TmsLink("C12083") public void test2BatchInsertSeeLog() { val rds = Arrays.asList( new TstShardingRecord(304L, now, now, now, 9L, "batch load 304", "", ZH_CN), @@ -93,6 +97,7 @@ public void test2BatchInsertSeeLog() { } @Test + @TmsLink("C12084") public void test3BatchMergeSeeLog() { val rds = Arrays.asList( new TstShardingRecord(307L, now, now, now, 9L, "batch load 307", "", ZH_CN), @@ -114,6 +119,7 @@ public void test3BatchMergeSeeLog() { } @Test + @TmsLink("C12085") public void test4BatchStoreSeeLog() { val rds = Arrays.asList( new TstShardingRecord(310L, now, now, now, 9L, "batch load 310", "", ZH_CN), @@ -126,6 +132,7 @@ public void test4BatchStoreSeeLog() { } @Test + @TmsLink("C12086") public void test5BatchUpdateSeeLog() { val rds = Arrays.asList( new TstShardingRecord(309L, now, now, now, 9L, "batch load 309", "update", ZH_CN), @@ -141,6 +148,7 @@ public void test5BatchUpdateSeeLog() { } @Test + @TmsLink("C12087") public void test6SingleMergeSeeLog() { testcaseNotice("insert into `tst_sharding` (`id`, .., `other_info`) values (?,..., ?) on duplicate key update `login_info` = ?, `other_info` = ?"); TstSharding pojo = new TstSharding(312L, now, now, now, 9L, "batch load 312", "update-bymerge", ZH_CN); @@ -149,6 +157,7 @@ public void test6SingleMergeSeeLog() { } @Test + @TmsLink("C12088") public void test7BatchMergeSeeLog() { val rds = Arrays.asList( new TstShardingRecord(313L, now, now, now, 9L, "batch 313-merge", "update-merge", ZH_CN), @@ -161,6 +170,7 @@ public void test7BatchMergeSeeLog() { } @Test + @TmsLink("C12089") public void test8LogicDeleteSeeLog() { dao.fetchById(1L); dao.fetchOneById(1L); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqUtilTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqUtilTest.java index fd37b536a..7daac2999 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqUtilTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqUtilTest.java @@ -1,8 +1,9 @@ package pro.fessional.wings.faceless.database.jooq; +import io.qameta.allure.TmsLink; import org.jooq.Condition; import org.junit.jupiter.api.Test; -import pro.fessional.wings.faceless.database.autogen.tables.SysStandardI18nTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.SysStandardI18nTable; import java.util.Arrays; import java.util.Collections; @@ -19,6 +20,7 @@ class WingsJooqUtilTest { @Test + @TmsLink("C12090") public void condMap() { Map map = new LinkedHashMap<>(); map.put("id", new int[]{1, 2, 3}); @@ -32,6 +34,7 @@ public void condMap() { @Test + @TmsLink("C12091") public void builderNormal() { Condition d1 = WingsJooqUtil.condition("1=1"); Condition d2 = WingsJooqUtil.condition("2=2"); @@ -78,6 +81,7 @@ public void builderNormal() { } @Test + @TmsLink("C12092") public void builderIfFalse() { Condition d1 = WingsJooqUtil.condition("1=1"); Condition d2 = WingsJooqUtil.condition("2=2"); @@ -108,6 +112,7 @@ public void builderIfFalse() { } @Test + @TmsLink("C12093") void condEqSkip() { SysStandardI18nTable t = SysStandardI18nTable.SysStandardI18n; final Condition c1 = WingsJooqUtil.condEqSkip(t.Base, Arrays.asList("a", "b", null)); @@ -130,6 +135,7 @@ void condEqSkip() { } @Test + @TmsLink("C12094") void condInSkip() { SysStandardI18nTable t = SysStandardI18nTable.SysStandardI18n; final Condition c1 = WingsJooqUtil.condInSkip(t.Base, Arrays.asList("a", "b", null)); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/converter/JooqLocaleConverterTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/converter/JooqLocaleConverterTest.java index d1a33a39b..f96207ae1 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/converter/JooqLocaleConverterTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/converter/JooqLocaleConverterTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.database.jooq.converter; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -12,6 +13,7 @@ class JooqLocaleConverterTest { @Test + @TmsLink("C12080") void from() { JooqLocaleConverter jlc = new JooqLocaleConverter(); final Locale lc = jlc.from("en-us"); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java index d27640641..e42e152a7 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.jooq; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.jooq.BatchBindStep; @@ -12,8 +13,8 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.ActiveProfiles; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.jooq.helper.JournalJooqHelper; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.helper.WingsTestHelper; @@ -54,6 +55,7 @@ public class JooqDeleteListenerTest { private SchemaRevisionManager schemaRevisionManager; @Test + @TmsLink("C12095") public void test0CleanTables() { wingsTestHelper.cleanTable(); final SortedMap sqls = FlywaveRevisionScanner.scan(REVISION_PATH_MASTER); @@ -63,6 +65,7 @@ public void test0CleanTables() { // 🦁🦁🦁<=<< @Test + @TmsLink("C12096") public void test2HelperSeeLog() { JournalJooqHelper.deleteByIds(dsl, TstShardingTable.TstSharding, 12L, 1L, 2L); JournalJooqHelper.deleteByIds(tmpl, "`tst_sharding`", 34L, 3L, 4L); @@ -74,6 +77,7 @@ public void test2HelperSeeLog() { } @Test + @TmsLink("C12097") public void test3JooqDslSeeLog() { // handle dsl.execute("DELETE FROM `tst_sharding` WHERE ID =5 AND COMMIT_ID = 5"); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java index 4a2ef6a15..1def03835 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.jooq; +import io.qameta.allure.TmsLink; import lombok.Data; import lombok.Setter; import lombok.val; @@ -12,9 +13,9 @@ import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.helper.WingsTestHelper; import pro.fessional.wings.faceless.util.FlywaveRevisionScanner; @@ -41,6 +42,7 @@ public class JooqMapperCompatibleTest { private TstShardingDao dao; @Test + @TmsLink("C12098") public void test0Init() { wingsTestHelper.cleanTable(); val sqls = FlywaveRevisionScanner.scanMaster(); @@ -49,6 +51,7 @@ public void test0Init() { } @Test + @TmsLink("C12099") public void test1Exist() { final boolean b = dao.notTableExist(); Assertions.assertFalse(b); @@ -61,6 +64,7 @@ public static class SameName { } @Test + @TmsLink("C12100") public void test1Lower() { DSLContext ctx = dao.ctx(); TstShardingTable t = dao.getTable(); @@ -78,6 +82,7 @@ public void test1Lower() { } @Test + @TmsLink("C12101") public void test1Snake() { DSLContext ctx = dao.ctx(); TstShardingTable t = dao.getTable(); @@ -95,6 +100,7 @@ public void test1Snake() { } @Test + @TmsLink("C12102") public void test1Array() { testcaseNotice("sfm has bug"); @@ -111,6 +117,7 @@ public void test1Array() { } @Test + @TmsLink("C12103") public void test2Array() { TstShardingTable t = dao.getTable(); Condition c = t.Id.eq(105L); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java index 2846d928b..e00d7bf45 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.jooq; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -14,14 +15,14 @@ import org.springframework.test.context.ActiveProfiles; import pro.fessional.wings.faceless.convention.EmptyValue; import pro.fessional.wings.faceless.database.WingsTableCudHandler.Cud; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.jooq.listener.TableCudListener; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.helper.WingsTestHelper; -import pro.fessional.wings.faceless.service.WingsTableCudHandlerTest; +import pro.fessional.wings.faceless.app.service.TestingTableCudHandler; import pro.fessional.wings.faceless.util.FlywaveRevisionScanner; import java.time.LocalDateTime; @@ -71,9 +72,10 @@ public class JooqTableCudListenerTest { private SchemaRevisionManager schemaRevisionManager; @Setter(onMethod_ = {@Autowired}) - private WingsTableCudHandlerTest wingsTableCudHandlerTest; + private TestingTableCudHandler testingTableCudHandler; @Test + @TmsLink("C12104") public void test0Init() { wingsTestHelper.cleanTable(); final SortedMap sqls = FlywaveRevisionScanner.scan(REVISION_PATH_MASTER); @@ -82,6 +84,7 @@ public void test0Init() { } @Test + @TmsLink("C12105") public void test1Create() { final LocalDateTime now = LocalDateTime.now(); @@ -135,6 +138,7 @@ public void test1Create() { } @Test + @TmsLink("C12106") public void test2Update() { final TstShardingTable t = testDao.getTable(); @@ -165,6 +169,7 @@ public void test2Update() { } @Test + @TmsLink("C12107") public void test4Delete() { final TstShardingTable t = testDao.getTable(); testcaseNotice("single delete"); @@ -191,16 +196,16 @@ public void test4Delete() { } private void assertCud(boolean wv, Cud cud, List> ids, Runnable run, String sqlPart) { - wingsTableCudHandlerTest.reset(); + testingTableCudHandler.reset(); TableCudListener.WarnVisit = wv; run.run(); final String sql = LastSql.get(); Assertions.assertTrue(StringUtils.containsIgnoreCase(sql, sqlPart)); TableCudListener.WarnVisit = false; - final List d = wingsTableCudHandlerTest.getCud(); - final List t = wingsTableCudHandlerTest.getTable(); - List>> f = wingsTableCudHandlerTest.getField(); + final List d = testingTableCudHandler.getCud(); + final List t = testingTableCudHandler.getTable(); + List>> f = testingTableCudHandler.getField(); if (cud == null) { Assertions.assertTrue(d.isEmpty()); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java index e92a5231f..274f57fca 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.jooq; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -11,8 +12,8 @@ import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.mirana.id.LightIdBufferedProvider; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; -import pro.fessional.wings.faceless.service.TransactionalBusinessService; -import pro.fessional.wings.faceless.service.TransactionalClauseService; +import pro.fessional.wings.faceless.app.service.TransactionalBusinessService; +import pro.fessional.wings.faceless.app.service.TransactionalClauseService; import pro.fessional.wings.faceless.util.FlywaveRevisionScanner; import java.util.concurrent.atomic.AtomicLong; @@ -41,6 +42,7 @@ public class TransactionalServiceTest { protected LightIdBufferedProvider lightIdBufferedProvider; @Test + @TmsLink("C12108") public void test0Init() { val sqls = FlywaveRevisionScanner.scanMaster(); schemaRevisionManager.checkAndInitSql(sqls, 0, false); @@ -48,6 +50,7 @@ public void test0Init() { } @Test + @TmsLink("C12109") public void testDeclarativeTx() { final AtomicLong id = new AtomicLong(-1); lightIdBufferedProvider.setFixCount(1); @@ -106,6 +109,7 @@ public void testDeclarativeTx() { } @Test + @TmsLink("C12110") public void testWithoutTx() { lightIdBufferedProvider.setFixCount(1); final AtomicLong id = new AtomicLong(-1); @@ -162,6 +166,7 @@ public void testWithoutTx() { } @Test + @TmsLink("C12111") public void testProgrammaticTx() { lightIdBufferedProvider.setFixCount(1); testProgrammaticTx(false); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqDslAndDaoSample.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java similarity index 95% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqDslAndDaoSample.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java index fd0f41279..cfa12e92b 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqDslAndDaoSample.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -14,10 +15,10 @@ import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.jooq.helper.JournalDiffHelper; import pro.fessional.wings.faceless.database.jooq.helper.JournalJooqHelper; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; @@ -47,7 +48,7 @@ @SpringBootTest @TestMethodOrder(MethodOrderer.MethodName.class) @Slf4j -public class JooqDslAndDaoSample { +public class TestJooqDslAndDaoSample { @Setter(onMethod_ = {@Autowired}) private SchemaRevisionManager schemaRevisionManager; @@ -56,6 +57,7 @@ public class JooqDslAndDaoSample { private TstShardingDao dao; @Test + @TmsLink("C12112") public void test0Init() { val sqls = FlywaveRevisionScanner.scanMaster(); schemaRevisionManager.checkAndInitSql(sqls, 0, true); @@ -63,6 +65,7 @@ public void test0Init() { } @Test + @TmsLink("C12113") public void test1Dao() { testcaseNotice("Use alias"); @@ -99,6 +102,7 @@ public void test1Dao() { } @Test + @TmsLink("C12114") public void test2Dsl() { testcaseNotice("Get Dsl by dao.ctx()"); Condition nullCond = null; @@ -121,6 +125,7 @@ public void test2Dsl() { } @Test + @TmsLink("C12115") public void test3Journal() { testcaseNotice("Journal Feature"); @@ -154,6 +159,7 @@ public void test3Journal() { } @Test + @TmsLink("C12116") public void test4DeleteDt() { testcaseNotice("Logic delete"); val c1 = dao.count(); @@ -163,6 +169,7 @@ public void test4DeleteDt() { } @Test + @TmsLink("C12117") public void test4Shadow() { testcaseNotice("Shadow table"); TstShardingTable upd = dao.newTable("", "_postfix"); @@ -171,6 +178,7 @@ public void test4Shadow() { } @Test + @TmsLink("C12118") public void test5DiffDao() { testcaseNotice("Diff Dao"); TstSharding po = new TstSharding(); @@ -232,6 +240,7 @@ public void test5DiffDao() { } @Test + @TmsLink("C12119") public void test5DiffDsl() { testcaseNotice("Diff Dsl"); TstSharding po = new TstSharding(); diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqMostSelectSample.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqMostSelectSample.java similarity index 97% rename from wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqMostSelectSample.java rename to wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqMostSelectSample.java index ea1f254ec..5b12b09eb 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/JooqMostSelectSample.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqMostSelectSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.sample; +import io.qameta.allure.TmsLink; import lombok.Data; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -35,10 +36,10 @@ import pro.fessional.mirana.page.PageQuery; import pro.fessional.mirana.page.PageResult; import pro.fessional.wings.faceless.converter.WingsEnumConverters; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.helper.RowMapperHelper; import pro.fessional.wings.faceless.database.jooq.WingsJooqUtil; import pro.fessional.wings.faceless.database.jooq.converter.JooqConsEnumConverter; @@ -74,8 +75,7 @@ @SpringBootTest @TestMethodOrder(MethodOrderer.MethodName.class) @Slf4j -@SuppressWarnings("NewClassNamingConvention") -public class JooqMostSelectSample { +public class TestJooqMostSelectSample { @Setter(onMethod_ = {@Autowired}) private SchemaRevisionManager schemaRevisionManager; @@ -84,6 +84,7 @@ public class JooqMostSelectSample { private TstShardingDao dao; @Test + @TmsLink("C12120") public void test0Init() { val sqls = FlywaveRevisionScanner.scanMaster(); schemaRevisionManager.checkAndInitSql(sqls, 0, false); @@ -91,6 +92,7 @@ public void test0Init() { } @Test + @TmsLink("C12121") public void test1SelectOnDemand() { DSLContext ctx = dao.ctx(); TstShardingTable t = dao.getTable(); @@ -169,6 +171,7 @@ static void into(@Nullable Record2 source, @NotNull DiffName targe } @Test + @TmsLink("C12122") public void test2InsertPojo() { DSLContext ctx = dao.ctx(); TstShardingTable t = dao.getTable(); @@ -212,6 +215,7 @@ public void test2InsertPojo() { } @Test + @TmsLink("C12123") public void test3MixingSql() { //////////////////////// description //////////////////////// testcaseNotice("where {0} is, for 0-base, a direct string replacement. If used incorrectly, this can lead to SQL Injection."); @@ -265,6 +269,7 @@ public void test3MixingSql() { } @Test + @TmsLink("C12124") public void test3BindSql() { DSLContext ctx = dao.ctx(); @@ -316,6 +321,7 @@ public void test3BindSql() { } @Test + @TmsLink("C12125") public void test3DynamicSql() { // condition and `cond*` TstShardingTable t = dao.getTable(); @@ -400,6 +406,7 @@ public void test3DynamicSql() { private JdbcTemplate jdbcTemplate; @Test + @TmsLink("C12126") public void test4JdbcTemplate() { // single field select Integer cnt = jdbcTemplate.queryForObject( @@ -427,6 +434,7 @@ public void test4JdbcTemplate() { } @Test + @TmsLink("C12127") public void test5PaginateJooq() { DSLContext dsl = dao.ctx(); TstShardingTable t = dao.getTable(); @@ -541,6 +549,7 @@ public void test5PaginateJooq() { } @Test + @TmsLink("C12128") public void test5PaginateJdbc() { // testcaseNotice("use helperJdbc wrap", @@ -581,6 +590,7 @@ public static class EnumDto { } @Test + @TmsLink("C12129") public void test6MapperEnum() { final TstShardingTable t = dao.getTable(); DataType lang = SQLDataType.INTEGER.asConvertedDataType(JooqConsEnumConverter.of(StandardLanguage.class)); @@ -602,6 +612,7 @@ public void test6MapperEnum() { } @Test + @TmsLink("C12130") public void test7Function() { testcaseNotice("by DSL, get function of dialect", "select `id` from `tst_sharding` where (`modify_dt` > date_add(?, interval ? day) and substring(`other_info`, ?, ?) like ?)"); diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultCatalog.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultCatalog.java similarity index 95% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultCatalog.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultCatalog.java index e33e895da..aad21ecdd 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultCatalog.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultCatalog.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen; +package pro.fessional.wings.faceless.app.database.autogen; import javax.annotation.processing.Generated; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultSchema.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultSchema.java similarity index 86% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultSchema.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultSchema.java index d428b6fc9..626b3190f 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/DefaultSchema.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/DefaultSchema.java @@ -1,14 +1,14 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen; +package pro.fessional.wings.faceless.app.database.autogen; import org.jooq.Catalog; import org.jooq.Table; import org.jooq.impl.SchemaImpl; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import javax.annotation.processing.Generated; import java.util.Arrays; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/Tables.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/Tables.java similarity index 76% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/Tables.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/Tables.java index 851c3cc89..2a9bb780d 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/Tables.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/Tables.java @@ -1,11 +1,11 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen; +package pro.fessional.wings.faceless.app.database.autogen; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import javax.annotation.processing.Generated; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstNormalTableTable.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstNormalTableTable.java similarity index 97% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstNormalTableTable.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstNormalTableTable.java index ce6953f9a..989baa11e 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstNormalTableTable.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstNormalTableTable.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables; +package pro.fessional.wings.faceless.app.database.autogen.tables; import org.jetbrains.annotations.NotNull; @@ -21,9 +21,9 @@ import org.jooq.impl.Internal; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstNormalTableRecord; import pro.fessional.wings.faceless.convention.EmptyValue; -import pro.fessional.wings.faceless.database.autogen.DefaultSchema; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstNormalTableRecord; +import pro.fessional.wings.faceless.app.database.autogen.DefaultSchema; import pro.fessional.wings.faceless.database.jooq.WingsJournalTable; import pro.fessional.wings.faceless.service.journal.JournalService; import pro.fessional.wings.faceless.service.lightid.LightIdAware; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstShardingTable.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstShardingTable.java similarity index 97% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstShardingTable.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstShardingTable.java index 3a99b85fc..545745106 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/TstShardingTable.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/TstShardingTable.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables; +package pro.fessional.wings.faceless.app.database.autogen.tables; import org.jetbrains.annotations.NotNull; @@ -21,9 +21,9 @@ import org.jooq.impl.Internal; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.convention.EmptyValue; -import pro.fessional.wings.faceless.database.autogen.DefaultSchema; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.DefaultSchema; import pro.fessional.wings.faceless.database.jooq.WingsJournalTable; import pro.fessional.wings.faceless.service.journal.JournalService; import pro.fessional.wings.faceless.service.lightid.LightIdAware; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstNormalTableDao.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java similarity index 98% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstNormalTableDao.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java index 979324be6..3c4102d31 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstNormalTableDao.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.daos; +package pro.fessional.wings.faceless.app.database.autogen.tables.daos; import java.math.BigDecimal; @@ -18,9 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstNormalTable; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstNormalTableRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstNormalTableRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstShardingDao.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java similarity index 97% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstShardingDao.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java index 651332dc5..d26488e09 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/daos/TstShardingDao.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.daos; +package pro.fessional.wings.faceless.app.database.autogen.tables.daos; import java.time.LocalDateTime; @@ -15,9 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstNormalTable.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstNormalTable.java similarity index 98% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstNormalTable.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstNormalTable.java index 1a450964f..b4a996fac 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstNormalTable.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstNormalTable.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.interfaces; +package pro.fessional.wings.faceless.app.database.autogen.tables.interfaces; import pro.fessional.wings.faceless.service.journal.JournalAware; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstSharding.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstSharding.java similarity index 97% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstSharding.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstSharding.java index 2a5a9736f..57ad45a7d 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/interfaces/ITstSharding.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/interfaces/ITstSharding.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.interfaces; +package pro.fessional.wings.faceless.app.database.autogen.tables.interfaces; import pro.fessional.wings.faceless.service.journal.JournalAware; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstNormalTable.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstNormalTable.java similarity index 98% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstNormalTable.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstNormalTable.java index 7f316695c..4ce936e87 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstNormalTable.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstNormalTable.java @@ -1,10 +1,10 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.pojos; +package pro.fessional.wings.faceless.app.database.autogen.tables.pojos; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ITstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ITstNormalTable; import javax.annotation.processing.Generated; import java.math.BigDecimal; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstSharding.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstSharding.java similarity index 98% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstSharding.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstSharding.java index 6d47cecf4..928ecb099 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/pojos/TstSharding.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/pojos/TstSharding.java @@ -1,10 +1,10 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.pojos; +package pro.fessional.wings.faceless.app.database.autogen.tables.pojos; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ITstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ITstSharding; import javax.annotation.processing.Generated; import java.time.LocalDateTime; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstNormalTableRecord.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstNormalTableRecord.java similarity index 97% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstNormalTableRecord.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstNormalTableRecord.java index 5d3646539..afaa98f3c 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstNormalTableRecord.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstNormalTableRecord.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.records; +package pro.fessional.wings.faceless.app.database.autogen.tables.records; import org.jooq.Field; @@ -9,9 +9,9 @@ import org.jooq.Record13; import org.jooq.Row13; import org.jooq.impl.UpdatableRecordImpl; -import pro.fessional.wings.faceless.database.autogen.tables.TstNormalTableTable; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ITstNormalTable; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ITstNormalTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstNormalTable; import javax.annotation.processing.Generated; import java.math.BigDecimal; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstShardingRecord.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstShardingRecord.java similarity index 96% rename from wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstShardingRecord.java rename to wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstShardingRecord.java index d1e14c5e5..694632a58 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/database/autogen/tables/records/TstShardingRecord.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/records/TstShardingRecord.java @@ -1,7 +1,7 @@ /* * This file is generated by jOOQ. */ -package pro.fessional.wings.faceless.database.autogen.tables.records; +package pro.fessional.wings.faceless.app.database.autogen.tables.records; import org.jooq.Field; @@ -9,9 +9,9 @@ import org.jooq.Record8; import org.jooq.Row8; import org.jooq.impl.UpdatableRecordImpl; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.interfaces.ITstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.interfaces.ITstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; import javax.annotation.processing.Generated; import java.time.LocalDateTime; diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java index 73f6990e9..c3ae219ff 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.flywave; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Test; @@ -38,6 +39,7 @@ public class FlywaveShardingTest { private WingsTestHelper wingsTestHelper; @Test + @TmsLink("C12131") public void test0CleanTables() { wingsTestHelper.cleanTable(); final SortedMap sqls = FlywaveRevisionScanner.scanMaster(); @@ -45,6 +47,7 @@ public void test0CleanTables() { } @Test + @TmsLink("C12132") public void test1Single() { schemaRevisionManager.publishRevision(REVISION_TEST_V1, 0); wingsTestHelper.assertHas(WingsTestHelper.Type.Table, "tst_sharding"); @@ -57,6 +60,7 @@ public void test1Single() { } @Test + @TmsLink("C12133") public void test2Sharding() { schemaShardingManager.publishShard("sys_schema_journal", 2); wingsTestHelper.assertHas(WingsTestHelper.Type.Table, "sys_schema_journal_0", "sys_schema_journal_1"); @@ -66,6 +70,7 @@ public void test2Sharding() { } @Test + @TmsLink("C12134") public void test3ShardMove() { schemaShardingManager.publishShard("tst_sharding", 5); wingsTestHelper.assertHas(WingsTestHelper.Type.Table, "tst_sharding", diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java index df3791ccd..e12014055 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.jooq; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -13,10 +14,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.wings.faceless.convention.EmptyValue; -import pro.fessional.wings.faceless.database.autogen.tables.TstShardingTable; -import pro.fessional.wings.faceless.database.autogen.tables.daos.TstShardingDao; -import pro.fessional.wings.faceless.database.autogen.tables.pojos.TstSharding; -import pro.fessional.wings.faceless.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; +import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.flywave.SchemaShardingManager; import pro.fessional.wings.faceless.helper.WingsTestHelper; @@ -55,6 +56,7 @@ public class JooqShardingTest { private WingsTestHelper wingsTestHelper; @Test + @TmsLink("C12135") public void test0CleanTables() { wingsTestHelper.cleanTable(); final SortedMap sqls = FlywaveRevisionScanner.scanMaster(); @@ -62,11 +64,13 @@ public void test0CleanTables() { } @Test + @TmsLink("C12136") public void test1PublishTest() { schemaRevisionManager.publishRevision(REVISION_TEST_V1, 0); } @Test + @TmsLink("C12137") public void test3SplitTable5() { schemaShardingManager.publishShard("tst_sharding", 5); } @@ -74,6 +78,7 @@ public void test3SplitTable5() { private Long id = 1L;//lightIdService.getId(TstShardingTable.class); @Test + @TmsLink("C12138") public void test4InsertSeeLog() { val rd = new TstSharding(id, LocalDateTime.now(), @@ -96,6 +101,7 @@ public void test4InsertSeeLog() { } @Test + @TmsLink("C12139") public void test5UpdateSeeLog() { val tp = TstShardingTable.TstSharding; // update `tst_sharding` set `modify_dt` = ?, `login_info` = ? where `id` <= ? @@ -135,6 +141,7 @@ public void test5UpdateSeeLog() { } @Test + @TmsLink("C12140") public void test6SelectSeeLog() { try (HintManager it = HintManager.getInstance()) { it.setWriteRouteOnly(); @@ -173,6 +180,7 @@ public void test6SelectSeeLog() { } @Test + @TmsLink("C12141") public void test7DeleteSeeLog() { val tp = TstShardingTable.TstSharding; val rp = dao.ctx().delete(tp) @@ -200,6 +208,7 @@ public void test7DeleteSeeLog() { private TstShardingTable tbl = TstShardingTable.TstSharding; @Test + @TmsLink("C12142") public void test8BatchSeeLog() { val rds = Arrays.asList( new TstShardingRecord(119L, now, now, now, 9L, "Batch merge 119", "test8", ZH_CN.getId()), @@ -220,6 +229,7 @@ public void test8BatchSeeLog() { } @Test + @TmsLink("C12143") public void test9BatchSeeLog() { val rds = Arrays.asList( new TstShardingRecord(119L, now, now, now, 9L, "Batch load 307", "test9", ZH_CN.getId()), diff --git a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/helper/WingsTestHelper.java b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/helper/WingsTestHelper.java index 4dce0626c..8c26c7275 100644 --- a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/helper/WingsTestHelper.java +++ b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/helper/WingsTestHelper.java @@ -6,7 +6,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.stereotype.Component; import pro.fessional.mirana.data.Diff; import pro.fessional.wings.faceless.database.DataSourceContext; @@ -24,7 +23,6 @@ * @author trydofor * @since 2020-05-22 */ -@Component public class WingsTestHelper { public static final long REVISION_TEST_V1 = 2019_0601_01L; diff --git a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java index f17523d96..4dfcfe7c6 100644 --- a/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java +++ b/wings/faceless-test/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessTestAutoConfiguration.java @@ -1,18 +1,19 @@ package pro.fessional.wings.faceless.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Bean; +import pro.fessional.wings.faceless.helper.WingsTestHelper; /** * @author trydofor * @since 2023-10-23 */ -@SuppressWarnings("SpringComponentScan") @AutoConfiguration -@ComponentScan({ - "pro.fessional.wings.faceless.helper", - "pro.fessional.wings.faceless.service", - "pro.fessional.wings.faceless.database.autogen", -}) public class FacelessTestAutoConfiguration { + + @Bean + public WingsTestHelper wingsTestHelper() { + return new WingsTestHelper(); + } + } diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java index edfdf678e..12e9a540c 100644 --- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java +++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java @@ -1,6 +1,8 @@ package pro.fessional.wings.faceless.concur; +import io.qameta.allure.TmsLink; import lombok.Setter; +import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -19,6 +21,7 @@ * @since 2021-03-09 */ @SpringBootTest +@Slf4j class DatabaseGlobalLockTest { @Setter(onMethod_ = {@Autowired}) @@ -27,6 +30,7 @@ class DatabaseGlobalLockTest { // private JdbcTemplate jdbcTemplate; @Test + @TmsLink("C12001") void lock() throws InterruptedException { DatabaseGlobalLock globalLock = new DatabaseGlobalLock(namedJdbcTemplate.getJdbcTemplate()); Lock lock = globalLock.getLock("test-lock"); @@ -53,7 +57,7 @@ void lockFail(CountDownLatch latch) { assertFalse(b); } catch (InterruptedException e) { - e.printStackTrace(); + log.info("ignore", e); } latch.countDown(); }).start(); diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/DataSourceContextTest.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/DataSourceContextTest.java index bceec882b..82b430251 100644 --- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/DataSourceContextTest.java +++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/DataSourceContextTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.database; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +24,7 @@ class DataSourceContextTest { private DataSourceContext sourceContext; @Test + @TmsLink("C12004") void test() { assertNotNull(sourceContext); final DataSource primary = sourceContext.getCurrent(); diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseCheckerTest.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseCheckerTest.java index 4a0c1a7d0..a6085b33d 100644 --- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseCheckerTest.java +++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseCheckerTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.database.helper; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; @@ -31,6 +32,7 @@ class DatabaseCheckerTest { @Test + @TmsLink("C12002") void timezone() { log.warn("spring.datasource.url={}", jdbcUrl); DatabaseChecker.version(dataSource); diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseNamingTest.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseNamingTest.java index da49a7796..6da7d9bef 100644 --- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseNamingTest.java +++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseNamingTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.faceless.database.helper; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -10,6 +11,7 @@ class DatabaseNamingTest { @Test + @TmsLink("C12003") void tableName() { Assertions.assertEquals("database_naming_test", DatabaseNaming.tableName(DatabaseNamingTest.class)); Assertions.assertEquals("ab_cd_efg", DatabaseNaming.lowerSnake("AbCdEFG")); diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/druid/DruidStatTest.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/druid/DruidStatTest.java index 05b0315bd..1b094b454 100644 --- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/druid/DruidStatTest.java +++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/druid/DruidStatTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.faceless.druid; import com.alibaba.druid.stat.DruidStatManagerFacade; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @@ -16,6 +17,7 @@ @Slf4j public class DruidStatTest { @Test + @TmsLink("C12005") public void druidStat() { final List> stat = DruidStatManagerFacade.getInstance().getDataSourceStatDataList(); log.info("druidStat={}", stat); diff --git a/wings/pom.xml b/wings/pom.xml index 4c1680e8a..c576e6b8d 100644 --- a/wings/pom.xml +++ b/wings/pom.xml @@ -94,6 +94,11 @@ spring-security-test test + + io.qameta.allure + allure-java-commons + test + diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/modulate/RuntimeModeTest.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/modulate/RuntimeModeTest.java index 79fac4213..9618fb663 100644 --- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/modulate/RuntimeModeTest.java +++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/modulate/RuntimeModeTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.modulate; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @@ -12,6 +13,7 @@ public class RuntimeModeTest { @Test + @TmsLink("C11011") void isRunMode() { final RunMode rm = RuntimeMode.getRunMode(); Assertions.assertEquals(RunMode.Local, rm); @@ -25,6 +27,7 @@ void isRunMode() { } @Test + @TmsLink("C11012") void isApiMode() { final ApiMode am = RuntimeMode.getApiMode(); Assertions.assertEquals(ApiMode.Nothing, am); diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/other/CollectionInjectTest.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/other/CollectionInjectTest.java index a938f7be8..f168810bd 100644 --- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/other/CollectionInjectTest.java +++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/other/CollectionInjectTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.other; +import io.qameta.allure.TmsLink; import lombok.Data; import lombok.Getter; import lombok.Setter; @@ -48,6 +49,7 @@ public void setMapValue1(Map mapValue1) { } @Test + @TmsLink("C11013") public void testList() { Assertions.assertEquals(1, listEmpty.size()); Assertions.assertEquals(1, listValue0.size()); @@ -58,6 +60,7 @@ public void testList() { } @Test + @TmsLink("C11014") public void testMap() { Assertions.assertEquals(1, mapEmpty.size()); Assertions.assertEquals(1, mapValue0.size()); diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerContextHelperTest.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerContextHelperTest.java index 026ec0937..352f9dbbb 100644 --- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerContextHelperTest.java +++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerContextHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.spring.bean; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -30,6 +31,7 @@ public class SilencerContextHelperTest { private WingsSilencerCurseApplication.InnerFace innerFace; @Test + @TmsLink("C11015") public void testInnerFace() throws Exception { final String app = ApplicationContextHelper.getApplicationName(); Assertions.assertEquals("curse", app); @@ -52,6 +54,7 @@ public void testInnerFace() throws Exception { } @Test + @TmsLink("C11016") public void testListProperties() { final Map prop = ApplicationContextHelper.listProperties(); log.info("=== properties size={} ===", prop.size()); @@ -62,6 +65,7 @@ public void testListProperties() { } @Test + @TmsLink("C11017") public void testListPropertySource() { final Map> prop = ApplicationContextHelper.listPropertySource(); log.info("=== properties size={} ===", prop.size()); @@ -73,6 +77,7 @@ public void testListPropertySource() { } @Test + @TmsLink("C11018") public void testListPropertiesKeys() { final Map prop = ApplicationContextHelper.listPropertiesKeys(); log.info("=== properties size={} ===", prop.size()); diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfigurationTest.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfigurationTest.java index 8f3c86553..cc3ea4ae3 100644 --- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfigurationTest.java +++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfigurationTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.spring.bean; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -39,6 +40,7 @@ public void testUnit() { } @Test + @TmsLink("C11019") public void testCode() { long number = 1979L; long encode = crc8Long.encode(number); diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/tweak/SilenceDebugTest.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/tweak/SilenceDebugTest.java index 40aa19450..26dff30fa 100644 --- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/tweak/SilenceDebugTest.java +++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/tweak/SilenceDebugTest.java @@ -3,6 +3,7 @@ import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.AppenderBase; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -29,6 +30,7 @@ public class SilenceDebugTest { @Test + @TmsLink("C11020") public void testNow() { final LocalDateTime n0 = ThreadNow.localDateTime(); TweakClock.tweakThread(Duration.ofSeconds(60)); @@ -40,6 +42,7 @@ public void testNow() { } @Test + @TmsLink("C11021") public void testStack() { TweakStack.tweakGlobal(true); final MessageException me0 = new MessageException("test message"); @@ -59,6 +62,7 @@ public void testStack() { } @Test + @TmsLink("C11022") public void testLogger() { final Map map = new HashMap<>(); final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); diff --git a/wings/silencer-jaxb/src/test/java/pro/fessional/wings/silencer/jaxb/StringMapXmlWriterTest.java b/wings/silencer-jaxb/src/test/java/pro/fessional/wings/silencer/jaxb/StringMapXmlWriterTest.java index 24944beb3..9a3cea988 100644 --- a/wings/silencer-jaxb/src/test/java/pro/fessional/wings/silencer/jaxb/StringMapXmlWriterTest.java +++ b/wings/silencer-jaxb/src/test/java/pro/fessional/wings/silencer/jaxb/StringMapXmlWriterTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.jaxb; +import io.qameta.allure.TmsLink; import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBException; import jakarta.xml.bind.Marshaller; @@ -41,6 +42,7 @@ public static class TestXml { } @Test + @TmsLink("C11023") public void map() throws JAXBException { JAXBContext contextObj = JAXBContext.newInstance(TestXml.class); Marshaller marshallerObj = contextObj.createMarshaller(); @@ -55,6 +57,7 @@ public void map() throws JAXBException { } @Test + @TmsLink("C11024") public void xml() throws JAXBException { JAXBContext contextObj = JAXBContext.newInstance(TestXml.class); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerApplication.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerApplication.java index 6384fd349..401708313 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerApplication.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerApplication.java @@ -3,7 +3,7 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import pro.fessional.wings.silencer.spring.prop.MergingProp; +import pro.fessional.wings.silencer.app.conf.MergingProp; /** * @author trydofor diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/prop/MergingProp.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/conf/MergingProp.java similarity index 95% rename from wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/prop/MergingProp.java rename to wings/silencer/src/test/java/pro/fessional/wings/silencer/app/conf/MergingProp.java index c4a5cbc1a..861514027 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/prop/MergingProp.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/conf/MergingProp.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.silencer.spring.prop; +package pro.fessional.wings.silencer.app.conf; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/i18n/MessageModuleTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/i18n/MessageModuleTest.java index ebb19dfbb..3442d4ea0 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/i18n/MessageModuleTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/i18n/MessageModuleTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.i18n; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -26,12 +27,14 @@ public class MessageModuleTest { private String module; @Test + @TmsLink("C11001") void testModule() { assertEquals("Silencer", module); assertEquals(Locale.forLanguageTag("en-US"), Locale.getDefault()); } @Test + @TmsLink("C11002") void testMessageStandard() { // use lang String cn = messageSource.getMessage("base.not-empty", Arr.of("姓名"), Locale.CHINA); @@ -49,6 +52,7 @@ void testMessageStandard() { } @Test + @TmsLink("C11003") void testMessagePartial() { // use lang String zh = messageSource.getMessage("base.not-empty", Arr.of("姓名"), Locale.forLanguageTag("zh")); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/info/InfoPrintTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/info/InfoPrintTest.java index eadd3e2e1..5a4457fc0 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/info/InfoPrintTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/info/InfoPrintTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.info; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Disabled; @@ -25,6 +26,7 @@ public class InfoPrintTest { private GitProperties gitProperties; @Test + @TmsLink("C11004") public void printTest() { log.info("{}", buildProperties); log.info("{}", gitProperties); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerMergeTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerMergeTest.java index ca5c91435..cee121082 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerMergeTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerMergeTest.java @@ -1,11 +1,12 @@ package pro.fessional.wings.silencer.spring.boot; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import pro.fessional.wings.silencer.spring.prop.MergingProp; +import pro.fessional.wings.silencer.app.conf.MergingProp; import java.util.List; import java.util.Map; @@ -23,6 +24,7 @@ public class WingsSilencerMergeTest { private MergingProp mergingProp; @Test + @TmsLink("C11005") public void merge() { // replace Assertions.assertEquals(List.of("a"), mergingProp.getLst1()); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile0Test.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile0Test.java index b4ac2acd6..b68a1b81f 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile0Test.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile0Test.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.spring.boot; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; @@ -32,6 +33,7 @@ public class WingsSilencerProfile0Test { private String moduleTest; @Test + @TmsLink("C11006") public void profile() { assertEquals("Silencer", module); assertEquals("wings-silencer", name); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile1Test.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile1Test.java index 8369a0758..c4dce946a 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile1Test.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile1Test.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.spring.boot; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; @@ -34,6 +35,7 @@ public class WingsSilencerProfile1Test { private String moduleTest; @Test + @TmsLink("C11007") public void profile() { assertEquals("Silencer-dev", module); assertEquals("wings-silencer-dev", name); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile2Test.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile2Test.java index bdc044690..bd7fdcdb9 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile2Test.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerProfile2Test.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.spring.boot; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; @@ -34,6 +35,7 @@ public class WingsSilencerProfile2Test { private String moduleTest; @Test + @TmsLink("C11008") public void profile() { assertEquals("Silencer-test30", moduleTest); assertEquals("wings-silencer-test", nameTest); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java index 07e6d23f7..079c83d1f 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.spring.boot; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; @@ -34,6 +35,7 @@ public class WingsSilencerSpringTest { private String moduleTest; @Test + @TmsLink("C11009") public void profile() { assertEquals("empty", module); assertEquals("wings-silencer-dev", name); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java index 46c5ce791..63b0f9b26 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.silencer.spring.help; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -25,6 +26,7 @@ public class CombinableMessageSourceTest { private CombinableMessageSource combinableMessageSource; @Test + @TmsLink("C11010") public void combine() { Object[] args = {}; diff --git a/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 17e12cfa8..68a34a6da 100644 --- a/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,2 +1,2 @@ pro.fessional.wings.slardar.spring.conf.SlardarHazelCachingAutoConfiguration -pro.fessional.wings.slardar.spring.conf.SlardarHazelDistIdAutoConfiguration \ No newline at end of file +pro.fessional.wings.slardar.spring.conf.SlardarHazelDistIdAutoConfiguration diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/TestApplicationEvent.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/event/TestApplicationEvent.java similarity index 83% rename from wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/TestApplicationEvent.java rename to wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/event/TestApplicationEvent.java index 0365ee468..327410d28 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/TestApplicationEvent.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/event/TestApplicationEvent.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.event; +package pro.fessional.wings.slardar.app.event; import org.springframework.context.ApplicationEvent; diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/TestEvent.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/event/TestEvent.java similarity index 74% rename from wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/TestEvent.java rename to wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/event/TestEvent.java index b5adb0a64..a8f5c5fda 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/TestEvent.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/event/TestEvent.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.event; +package pro.fessional.wings.slardar.app.event; import lombok.Data; diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/service/TestEventListener.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestEventListener.java similarity index 85% rename from wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/service/TestEventListener.java rename to wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestEventListener.java index 903c5b2dc..17f337af3 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/service/TestEventListener.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestEventListener.java @@ -1,12 +1,12 @@ -package pro.fessional.wings.slardar.service; +package pro.fessional.wings.slardar.app.service; import lombok.extern.slf4j.Slf4j; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import pro.fessional.mirana.pain.DebugException; -import pro.fessional.wings.slardar.event.TestApplicationEvent; -import pro.fessional.wings.slardar.event.TestEvent; +import pro.fessional.wings.slardar.app.event.TestApplicationEvent; +import pro.fessional.wings.slardar.app.event.TestEvent; /** * @author trydofor diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/service/TestMyCacheService.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestMyCacheService.java similarity index 97% rename from wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/service/TestMyCacheService.java rename to wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestMyCacheService.java index c3c0b4639..867b4d2d4 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/service/TestMyCacheService.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/app/service/TestMyCacheService.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.service; +package pro.fessional.wings.slardar.app.service; import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.Cacheable; diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/concur/HazelcastGlobalLockTest.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/concur/HazelcastGlobalLockTest.java index 006a657cd..8461d9510 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/concur/HazelcastGlobalLockTest.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/concur/HazelcastGlobalLockTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.slardar.concur; import com.hazelcast.core.HazelcastInstance; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; @@ -26,6 +27,7 @@ class HazelcastGlobalLockTest { private HazelcastInstance hazelcastInstance; @Test + @TmsLink("C13018") void lock() throws InterruptedException { HazelcastGlobalLock globalLock = new HazelcastGlobalLock(hazelcastInstance); Lock lock = globalLock.getLock("test-lock"); diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java index be31d2af0..e5c810ba2 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java @@ -1,9 +1,11 @@ package pro.fessional.wings.slardar.event; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; +import pro.fessional.wings.slardar.app.event.TestEvent; /** * @author trydofor @@ -14,6 +16,7 @@ public class EventPublishHelperTest { @Test + @TmsLink("C13019") public void testSyncSpring() { try { EventPublishHelper.SyncSpring.publishEvent(new TestEvent("SyncSpring")); @@ -25,11 +28,13 @@ public void testSyncSpring() { } @Test + @TmsLink("C13020") public void testAsyncSpring() { EventPublishHelper.AsyncSpring.publishEvent(new TestEvent("AsyncSpring")); } @Test + @TmsLink("C13021") public void testAsyncGlobal() { EventPublishHelper.AsyncGlobal.publishEvent(new TestEvent("AsyncHazelcast")); } diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfigurationTest.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfigurationTest.java index da44258d4..45d2e7023 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfigurationTest.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfigurationTest.java @@ -1,12 +1,13 @@ package pro.fessional.wings.slardar.spring.bean; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import pro.fessional.wings.slardar.service.TestMyCacheService; +import pro.fessional.wings.slardar.app.service.TestMyCacheService; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -24,6 +25,7 @@ public class SlardarCacheConfigurationTest { private TestMyCacheService cacheService; @Test + @TmsLink("C13022") public void cacheCall() { int c1 = cacheService.cacheMemory("cacheCall"); assertEquals(1, c1); @@ -42,6 +44,7 @@ public void cacheCall() { } @Test + @TmsLink("C13023") @Disabled("Mock slow handling ttl=20") public void testTtl() throws InterruptedException { int c1 = cacheService.cacheMemory("cacheCall"); @@ -66,6 +69,7 @@ public void testTtl() throws InterruptedException { } @Test + @TmsLink("C13024") public void directCall() { int c1 = cacheService.directMemory("directCall"); assertEquals(1, c1); diff --git a/wings/slardar-hazel-session/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-hazel-session/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 722e609d5..e7e1abee3 100644 --- a/wings/slardar-hazel-session/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/slardar-hazel-session/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1 @@ -pro.fessional.wings.slardar.spring.conf.SlardarHazelSessionAutoConfiguration \ No newline at end of file +pro.fessional.wings.slardar.spring.conf.SlardarHazelSessionAutoConfiguration diff --git a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionTest.java b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java similarity index 96% rename from wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionTest.java rename to wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java index 76c038bf0..d1b1827d9 100644 --- a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionTest.java +++ b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.webmvc; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -27,7 +28,7 @@ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = "spring.wings.slardar.enabled.mock-hazelcast=false") @AutoConfigureMockMvc -public class WingsSessionTest { +public class WingsSessionLangZoneTest { @Setter(onMethod_ = {@Autowired}) private MockMvc mockMvc; @@ -36,6 +37,7 @@ public class WingsSessionTest { protected SlardarSessionProp slardarSessionProp; @Test + @TmsLink("C13025") public void test1LoginUserLangZone() throws Exception { mockMvc.perform( post("/user/login-proc.json") @@ -53,6 +55,7 @@ public void test1LoginUserLangZone() throws Exception { } @Test + @TmsLink("C13026") public void test2LoginWithLangZone() throws Exception { mockMvc.perform( post("/user/login-proc.json") diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java index 18cead5ce..7fb1aa82c 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java @@ -12,7 +12,7 @@ * @author trydofor * @since 2019-07-11 */ -@AutoConfiguration(before = {SlardarHazelSessionAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class}) +@AutoConfiguration(before = {SlardarSprintAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class}) @ConditionalOnClass(SpringBootAdminClientAutoConfiguration.class) @ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true") @ImportAutoConfiguration(SlardarBootAdminConfiguration.class) diff --git a/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 9e161c959..10cf34179 100644 --- a/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/slardar-sprint/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,2 +1,2 @@ pro.fessional.wings.slardar.spring.conf.SlardarBootAdminAutoConfiguration -pro.fessional.wings.slardar.spring.conf.SlardarSprintAutoConfiguration \ No newline at end of file +pro.fessional.wings.slardar.spring.conf.SlardarSprintAutoConfiguration diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarSprintApplication.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarSprintApplication.java index d24fd6acc..d66bac213 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarSprintApplication.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarSprintApplication.java @@ -3,14 +3,12 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; -import org.springframework.context.annotation.ComponentScan; /** * @author trydofor * @since 2019-07-20 */ @SpringBootApplication -@ComponentScan("pro.fessional.wings.slardar.webconf") public class WingsSlardarSprintApplication { public static void main(String[] args) { diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webconf/TestSecurityConfiguration.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java similarity index 98% rename from wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webconf/TestSecurityConfiguration.java rename to wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java index 8f67c8c3f..3effbb26e 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webconf/TestSecurityConfiguration.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.webconf; +package pro.fessional.wings.slardar.app.conf; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/controller/TestRighterController.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/controller/TestRighterController.java similarity index 95% rename from wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/controller/TestRighterController.java rename to wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/controller/TestRighterController.java index bc5851642..e6621870d 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/controller/TestRighterController.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/controller/TestRighterController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import lombok.Data; import lombok.extern.slf4j.Slf4j; diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/Cve2023T34035Test.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/Cve2023T34035Test.java index 5ca456064..ee16d3db9 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/Cve2023T34035Test.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/Cve2023T34035Test.java @@ -1,6 +1,7 @@ package pro.fessional.wings.slardar.webmvc; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +31,7 @@ public class Cve2023T34035Test { private MockMvc mockMvc; @Test + @TmsLink("C13027") void withServletPath() throws Exception { // get /test/Cve2023T34035Test.json this.mockMvc.perform(get("/mvc/test/Cve2023T34035Test.json").servletPath("/mvc")) @@ -39,6 +41,7 @@ void withServletPath() throws Exception { } @Test + @TmsLink("C13028") void withoutServletPath() throws Exception { // get /test/Cve2023T34035Test.json this.mockMvc.perform(get("/test/Cve2023T34035Test.json")) @@ -48,6 +51,7 @@ void withoutServletPath() throws Exception { } @Test + @TmsLink("C13029") void withoutServletPath1() throws Exception { // get /mvc/test/Cve2023T34035Test.json this.mockMvc.perform(get("/mvc/test/Cve2023T34035Test.json")) diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/RighterControllerTest.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/RighterControllerTest.java index 682a8b2e5..4b02e5a82 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/RighterControllerTest.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/RighterControllerTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.webmvc; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeEach; @@ -49,8 +50,8 @@ public void setup() { .build(); } - @Test + @TmsLink("C13030") @WithMockUser("wings-admin") public void righter() throws Exception { final MvcResult result = mvc.perform(get("/test/righter.json") diff --git a/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/service/TestWingsUserDetailsService.java b/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/service/TestWingsUserDetailsService.java index 01bb64950..0adc6c3b8 100644 --- a/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/service/TestWingsUserDetailsService.java +++ b/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/service/TestWingsUserDetailsService.java @@ -8,7 +8,6 @@ import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.stereotype.Service; import pro.fessional.mirana.bits.Md5; import pro.fessional.wings.slardar.security.WingsAuthDetails; import pro.fessional.wings.slardar.security.WingsUserDetailsService; @@ -23,7 +22,6 @@ * @author trydofor * @since 2019-11-14 */ -@Service @Slf4j public class TestWingsUserDetailsService implements WingsUserDetailsService { diff --git a/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarTestAutoConfiguration.java b/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarTestAutoConfiguration.java index 09ff3446c..581eeff44 100644 --- a/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarTestAutoConfiguration.java +++ b/wings/slardar-test/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarTestAutoConfiguration.java @@ -1,23 +1,18 @@ package pro.fessional.wings.slardar.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; import pro.fessional.wings.slardar.security.WingsAuthDetailsSource; import pro.fessional.wings.slardar.security.handler.TestLoginHandler; import pro.fessional.wings.slardar.security.impl.DefaultWingsAuthDetails; +import pro.fessional.wings.slardar.service.TestWingsUserDetailsService; /** * @author trydofor * @since 2022-01-29 */ -@SuppressWarnings("SpringComponentScan") -@AutoConfiguration -@ComponentScan({ - "pro.fessional.wings.slardar.helper", - "pro.fessional.wings.slardar.service", - "pro.fessional.wings.slardar.controller", -}) +@AutoConfiguration(before = UserDetailsServiceAutoConfiguration.class) public class SlardarTestAutoConfiguration { @Bean @@ -25,6 +20,11 @@ public TestLoginHandler testLoginHandler() { return new TestLoginHandler(); } + @Bean + public TestWingsUserDetailsService testWingsUserDetailsService() { + return new TestWingsUserDetailsService(); + } + @Bean public WingsAuthDetailsSource wingsBindAuthnDetailsSource() { return (authType, request) -> new DefaultWingsAuthDetails(); diff --git a/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 5453da925..29cf6478e 100644 --- a/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1 @@ -pro.fessional.wings.slardar.spring.conf.SlardarWebmvcAutoConfiguration \ No newline at end of file +pro.fessional.wings.slardar.spring.conf.SlardarWebmvcAutoConfiguration diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestAuthedController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestAuthedController.java similarity index 90% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestAuthedController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestAuthedController.java index 3f7fac9fd..71a58b9ef 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestAuthedController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestAuthedController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestCaptchaController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestCaptchaController.java similarity index 95% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestCaptchaController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestCaptchaController.java index 81d722659..cfda8e775 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestCaptchaController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestCaptchaController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import jakarta.servlet.http.HttpServletResponse; import org.springframework.stereotype.Controller; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestCookieController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestCookieController.java similarity index 97% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestCookieController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestCookieController.java index 27aabb221..65bd6753e 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestCookieController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestCookieController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import jakarta.servlet.ServletException; import jakarta.servlet.http.Cookie; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDataBindingController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDataBindingController.java similarity index 93% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDataBindingController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDataBindingController.java index d59aa3cc0..7f4ed7c64 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDataBindingController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDataBindingController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import lombok.AllArgsConstructor; import lombok.Data; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDateTimeController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDateTimeController.java similarity index 99% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDateTimeController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDateTimeController.java index 37f29038e..0c91723a9 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDateTimeController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDateTimeController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import lombok.Data; import lombok.extern.slf4j.Slf4j; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDebounceController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDebounceController.java similarity index 97% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDebounceController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDebounceController.java index 8d89d59bf..602108319 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDebounceController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDebounceController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ExceptionHandler; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDomainAController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDomainAController.java similarity index 88% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDomainAController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDomainAController.java index df3bbf355..3dc151090 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDomainAController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDomainAController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDomainBController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDomainBController.java similarity index 89% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDomainBController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDomainBController.java index 7a1d41c2e..55b3d09a7 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDomainBController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDomainBController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDoubleKillController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDoubleKillController.java similarity index 89% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDoubleKillController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDoubleKillController.java index 9df02dc21..2ecd23801 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestDoubleKillController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestDoubleKillController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import jakarta.servlet.http.HttpServletRequest; import lombok.Setter; @@ -7,7 +7,7 @@ import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.data.R; import pro.fessional.wings.slardar.concur.DoubleKill; -import pro.fessional.wings.slardar.service.DoubleKillService; +import pro.fessional.wings.slardar.app.service.DoubleKillService; /** * @author trydofor diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestForwardController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestForwardController.java similarity index 94% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestForwardController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestForwardController.java index c1419d373..dc7191ea7 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestForwardController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestForwardController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestJsonController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestJsonController.java similarity index 98% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestJsonController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestJsonController.java index 67dc7ee3f..be0917a0e 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestJsonController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestJsonController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestLocaleController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestLocaleController.java similarity index 94% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestLocaleController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestLocaleController.java index e9a561ab8..e1ec8a172 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestLocaleController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestLocaleController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestPageQueryController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestPageQueryController.java similarity index 97% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestPageQueryController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestPageQueryController.java index e32967ee7..65e9b6255 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestPageQueryController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestPageQueryController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestReqresLogController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestReqresLogController.java similarity index 96% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestReqresLogController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestReqresLogController.java index dde51a5ab..bc2615a1f 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestReqresLogController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestReqresLogController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import lombok.SneakyThrows; import org.apache.commons.io.IOUtils; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestRestTmplController.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestRestTmplController.java similarity index 97% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestRestTmplController.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestRestTmplController.java index 674287b9b..ad02a1a03 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/controller/TestRestTmplController.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/controller/TestRestTmplController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.controller; +package pro.fessional.wings.slardar.app.controller; import lombok.Data; import org.springframework.core.io.FileSystemResource; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/service/DoubleKillService.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/service/DoubleKillService.java similarity index 75% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/service/DoubleKillService.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/service/DoubleKillService.java index 5ac35bc7a..12086f19a 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/service/DoubleKillService.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/service/DoubleKillService.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.service; +package pro.fessional.wings.slardar.app.service; import lombok.extern.slf4j.Slf4j; import org.springframework.cache.annotation.Cacheable; @@ -19,8 +19,9 @@ public class DoubleKillService { public String sleepCache(String type, int s) { try { Thread.sleep(s * 1000L); - } catch (InterruptedException e) { - e.printStackTrace(); + } + catch (InterruptedException e) { + log.info("ignore", e); } final String r = type + "-" + s; log.info(">>>>>> sleepCache " + r); @@ -31,8 +32,9 @@ public String sleepCache(String type, int s) { public String sleepSecond(String type, int s) { try { Thread.sleep(s * 1000L); - } catch (InterruptedException e) { - e.printStackTrace(); + } + catch (InterruptedException e) { + log.info("ignore", e); } final String r = type + "-" + s; log.info(">>>>>> sleepSecond " + r); @@ -43,22 +45,24 @@ public String sleepSecond(String type, int s) { public String sleepSecondStr(String type, int s) { try { Thread.sleep(s * 1000L); - } catch (InterruptedException e) { - e.printStackTrace(); + } + catch (InterruptedException e) { + log.info("ignore", e); } final String r = type + "-" + s; log.info(">>>>>> sleepSecondStr " + r); return r; } -// @DoubleKill(expression = "#root.methodName + #root.targetClass + #type + '-' + #p1 * 1000") + // @DoubleKill(expression = "#root.methodName + #root.targetClass + #type + '-' + #p1 * 1000") // @DoubleKill(expression = "{#type, #p1}") @DoubleKill(expression = "#root.args") public String sleepSecondExp(String type, int s) { try { Thread.sleep(s * 1000L); - } catch (InterruptedException e) { - e.printStackTrace(); + } + catch (InterruptedException e) { + log.info("ignore", e); } final String r = type + "-" + s; log.info(">>>>>> sleepSecondExp " + r); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/monitor/TestCpuHeavyTask.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/task/TestCpuHeavyTask.java similarity index 92% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/monitor/TestCpuHeavyTask.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/task/TestCpuHeavyTask.java index b052f7ed9..bb1a6bc26 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/monitor/TestCpuHeavyTask.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/task/TestCpuHeavyTask.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.monitor; +package pro.fessional.wings.slardar.app.task; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/DebounceTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/DebounceTest.java index 02047d7a5..0c2d19ea8 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/DebounceTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/DebounceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.concur; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; @@ -36,23 +37,27 @@ class DebounceTest { private RestTemplate restTemplate; @Test + @TmsLink("C13031") void debounceNore() throws InterruptedException { debounce(false, "/test/debounce-nore.json?p=p1"); debounce(false, "/test/debounce-nore.json?p=p2"); } @Test + @TmsLink("C13032") void debounceView() throws InterruptedException { debounce(true, "/test/debounce-view.json?p=p1"); debounce(true, "/test/debounce-view.json?p=p2"); } @Test + @TmsLink("C13033") void debounceError() throws InterruptedException { debounce(true, "/test/debounce-error.json?p=seq"); } @Test + @TmsLink("C13034") void debounceBody() throws InterruptedException { debounce(true, "/test/debounce-body.json?p=p1"); debounce(true, "/test/debounce-body.json?p=p2"); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/DoubleKillTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/DoubleKillTest.java index 384773796..3b2b380e3 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/DoubleKillTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/DoubleKillTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.concur; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; @@ -9,7 +10,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestTemplate; -import pro.fessional.wings.slardar.service.DoubleKillService; +import pro.fessional.wings.slardar.app.service.DoubleKillService; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -41,6 +42,7 @@ class DoubleKillTest { private RestTemplate restTemplate; @Test + @TmsLink("C13035") void doubleKillUrl() throws InterruptedException { final String url = this.doubleKillHost + "/test/double-kill.json"; new Thread(() -> { @@ -64,6 +66,7 @@ void doubleKillUrl() throws InterruptedException { } @Test + @TmsLink("C13036") void doubleKillAsync() throws InterruptedException { final String url = this.doubleKillHost + "/test/double-kill-async.json"; new Thread(() -> { @@ -87,6 +90,7 @@ void doubleKillAsync() throws InterruptedException { } @Test + @TmsLink("C13037") void doubleKillArg() throws InterruptedException { new Thread(() -> { log.info("before thread call"); @@ -106,6 +110,7 @@ void doubleKillArg() throws InterruptedException { } @Test + @TmsLink("C13038") void doubleKillStr() throws InterruptedException { new Thread(() -> { log.info("before thread call"); @@ -125,6 +130,7 @@ void doubleKillStr() throws InterruptedException { } @Test + @TmsLink("C13039") void doubleKillExp() throws InterruptedException { new Thread(() -> { log.info("before thread call"); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java index 5d9ca6a28..512c498a8 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.concur; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.Call; @@ -43,11 +44,13 @@ class FirstBloodTest { private Call.Factory okHttpClient; @Test + @TmsLink("C13040") public void testFirstBlood0() { checkFirstBlood(firstBloodUrl0); } @Test + @TmsLink("C13041") public void testFirstBlood30() throws InterruptedException { new Thread(() -> { try (Response r1 = OkHttpClientHelper.execute(okHttpClient, new Request.Builder().url(firstBloodUrl30), false)) { diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/context/ExternalConfigTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/context/SpringRandomConfigTest.java similarity index 88% rename from wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/context/ExternalConfigTest.java rename to wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/context/SpringRandomConfigTest.java index 303642066..0075509ce 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/context/ExternalConfigTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/context/SpringRandomConfigTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.context; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; @@ -13,7 +14,7 @@ */ @SpringBootTest @Slf4j -public class ExternalConfigTest { +public class SpringRandomConfigTest { @Value("${random.value}") private String randomValue; @@ -21,6 +22,7 @@ public class ExternalConfigTest { private String randomUuid; @Test + @TmsLink("C13042") public void testRandom() { log.info("random-value=" + randomValue); log.info("random-uuid=" + randomUuid); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java index 6ed1e20d1..65439d538 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.domain; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +31,7 @@ public class DomainExtendTest { private RestTemplate restTemplate; @Test + @TmsLink("C13043") public void testDomainA() { String json = restTemplate.getForObject(domainA + "/user-list.json", String.class); assertEquals("a.com/user-list.json", json); @@ -42,6 +44,7 @@ public void testDomainA() { } @Test + @TmsLink("C13044") public void testDomainBA() { String json = restTemplate.getForObject(domainA + "/domain/b/user-list.json", String.class); assertEquals("b.com/user-list.json", json); @@ -54,6 +57,7 @@ public void testDomainBA() { } @Test + @TmsLink("C13045") public void testDomainBB() { String json = restTemplate.getForObject(domainB + "/domain/b/user-list.json", String.class); assertEquals("b.com/user-list.json", json); @@ -66,6 +70,7 @@ public void testDomainBB() { } @Test + @TmsLink("C13046") public void testDomainBE() { String json = restTemplate.getForObject(domainB + "/user-list.json", String.class); assertEquals("b.com/user-list.json", json); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/OkHttpClientHelperTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/OkHttpClientHelperTest.java index 29027513d..a5c8f254a 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/OkHttpClientHelperTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/OkHttpClientHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.httprest; +import io.qameta.allure.TmsLink; import lombok.Setter; import okhttp3.OkHttpClient; import org.junit.jupiter.api.Test; @@ -32,6 +33,7 @@ public class OkHttpClientHelperTest { @Test + @TmsLink("C13047") public void testPostJson() { String j1 = "{}"; String j2 = postJson(okHttpClient, host + "/test/rest-template-helper-body.htm", j1); @@ -39,6 +41,7 @@ public void testPostJson() { } @Test + @TmsLink("C13048") public void testPostBad() { String j1 = "{\"bad\":[{\"ssStr\":\"ssStr\",\"sStr\":\"sStr\"}]}"; String j2 = postJson(okHttpClient, host + "/test/rest-bad-json.htm", j1); @@ -46,6 +49,7 @@ public void testPostBad() { } @Test + @TmsLink("C13049") public void testPostFile() { String txt = "123456\nasdfgh"; String j2 = postFile(okHttpClient, host + "/test/rest-template-helper-file.htm", "up", txt.getBytes(), "test.txt"); @@ -53,6 +57,7 @@ public void testPostFile() { } @Test + @TmsLink("C13050") public void testDownload() throws IOException { byte[] bytes = download(okHttpClient, host + "/test/rest-template-helper-down.htm"); String pom = InputStreams.readText(new FileInputStream("./pom.xml")); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/OkHttpTweakLogInterceptorTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/OkHttpTweakLogInterceptorTest.java index 743d8576f..49cd0d5ea 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/OkHttpTweakLogInterceptorTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/OkHttpTweakLogInterceptorTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.httprest; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.Call; @@ -23,6 +24,7 @@ class OkHttpTweakLogInterceptorTest { private Call.Factory okHttpClient; @Test + @TmsLink("C13051") void intercept() { final String name = log.getName(); log.warn(">>>> default"); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RestTemplateHelperTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RestTemplateHelperTest.java index b2ed37642..af491bbf5 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RestTemplateHelperTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RestTemplateHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.httprest; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -11,13 +12,13 @@ import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; import pro.fessional.mirana.io.InputStreams; -import pro.fessional.wings.slardar.controller.TestRestTmplController; +import pro.fessional.wings.slardar.app.controller.TestRestTmplController; import java.io.FileInputStream; import java.io.IOException; import static org.junit.jupiter.api.Assertions.assertEquals; -import static pro.fessional.wings.slardar.controller.TestRestTmplController.json; +import static pro.fessional.wings.slardar.app.controller.TestRestTmplController.json; /** * @author trydofor @@ -34,6 +35,7 @@ public class RestTemplateHelperTest { @Test + @TmsLink("C13052") public void jsonEntity() { TestRestTmplController.Json j1 = json(); HttpEntity entity = RestTemplateHelper.jsonEntity(j1); @@ -42,6 +44,7 @@ public void jsonEntity() { } @Test + @TmsLink("C13053") public void formEntity() { HttpEntity> form = RestTemplateHelper.formEntity(); RestTemplateHelper.body(form).add("k1", "v1"); @@ -50,6 +53,7 @@ public void formEntity() { } @Test + @TmsLink("C13054") public void fileEntity() { HttpEntity> form = RestTemplateHelper.fileEntity(); String txt = "123456\nasdfgh"; @@ -59,6 +63,7 @@ public void fileEntity() { } @Test + @TmsLink("C13055") public void download() throws IOException { byte[] bytes = RestTemplateHelper.download(restTemplate, host + "/test/rest-template-helper-down.htm"); String pom = InputStreams.readText(new FileInputStream("./pom.xml")); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitCaller.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitCaller.java index 08344e462..01a4a1e72 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitCaller.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitCaller.java @@ -5,7 +5,7 @@ import okhttp3.MultipartBody; import okhttp3.RequestBody; import okhttp3.ResponseBody; -import pro.fessional.wings.slardar.controller.TestRestTmplController; +import pro.fessional.wings.slardar.app.controller.TestRestTmplController; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.GET; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitTest.java index e79d696df..fc1dceb4c 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/httprest/RetrofitTest.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson2.JSON; import com.fasterxml.jackson.databind.ObjectMapper; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.SneakyThrows; import okhttp3.MultipartBody; @@ -47,7 +48,8 @@ public class RetrofitTest { @Test - public void testJackson() { + @TmsLink("C13056") + public void testJacksonBuilder() { final OkHttpClient.Builder bd = okHttpClient.newBuilder(); bd.addInterceptor(chain -> { Request request = chain.request(); @@ -59,7 +61,8 @@ public void testJackson() { } @Test - public void testFastjson() { + @TmsLink("C13057") + public void testJacksonAutowired() { RetrofitCaller caller = RetrofitHelper.jacksonPlain(RetrofitCaller.class, host, okHttpClient); testAll(caller); } @@ -101,7 +104,8 @@ private void testAll(RetrofitCaller caller) { @SneakyThrows @Test - public void test() { + @TmsLink("C13058") + public void printFastjsonAndJackson() { Bad bad = new Bad(); bad.setSsStr("ssStr"); bad.setSStr("sStr"); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/DecimalFormatTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/DecimalFormatTest.java index 6ed7d43ba..4666dd9e1 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/DecimalFormatTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/DecimalFormatTest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import io.qameta.allure.TmsLink; import lombok.Data; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -50,6 +51,7 @@ public class DecimalFormatTest { @Test + @TmsLink("C13059") public void testFloat() { DecimalFormat df = new DecimalFormat("¥,####.00"); DecimalFormatSymbols customSymbols = new DecimalFormatSymbols(); @@ -61,6 +63,7 @@ public void testFloat() { } @Test + @TmsLink("C13060") public void testInteger() { DecimalFormat df = new DecimalFormat("#"); DecimalFormatSymbols customSymbols = new DecimalFormatSymbols(); @@ -142,6 +145,7 @@ public static class DecRaw { } @Test + @TmsLink("C13061") public void testDecStr() throws JsonProcessingException { final String decStr = objectMapper.writeValueAsString(new DecStr()); log.info(decStr); @@ -159,6 +163,7 @@ public void testDecStr() throws JsonProcessingException { } @Test + @TmsLink("C13062") public void testDecRaw() throws JsonProcessingException { final String decRaw = objectMapper.writeValueAsString(new DecRaw()); log.info(decRaw); @@ -177,6 +182,7 @@ public void testDecRaw() throws JsonProcessingException { } @Test + @TmsLink("C13063") public void testDecFmt() throws JsonProcessingException { final String decFmt = objectMapper.writeValueAsString(new DecFmt()); log.info(decFmt); @@ -196,6 +202,7 @@ public void testDecFmt() throws JsonProcessingException { } @Test + @TmsLink("C13064") public void testJsSafe() throws JsonProcessingException { TreeMap js = new TreeMap<>(); js.put("maxSafe0", 9007199254740990L); @@ -232,6 +239,7 @@ public static class DateWrp { } @Test + @TmsLink("C13065") public void testDateFmt() throws JsonProcessingException { final DateFmt df = new DateFmt(); Assertions.assertEquals("{\"ldt\":\"2022-02-02\",\"str\":\"string\"}", objectMapper.writeValueAsString(df)); @@ -241,6 +249,7 @@ public void testDateFmt() throws JsonProcessingException { } @Test + @TmsLink("C13066") public void testViewDec() { final String dec = restTemplate.getForObject(domain + "/test/json-dec.json", String.class); final String sub = restTemplate.getForObject(domain + "/test/json-sub.json", String.class); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/WingsJacksonMapperTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/WingsJacksonMapperTest.java index 427265ff1..94aecfbe3 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/WingsJacksonMapperTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/WingsJacksonMapperTest.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; +import io.qameta.allure.TmsLink; import jakarta.xml.bind.annotation.XmlRootElement; import lombok.AllArgsConstructor; import lombok.Data; @@ -108,6 +109,7 @@ public boolean isPrimaryType() { } } + @SuppressWarnings("LombokGetterMayBeUsed") public static class NamingManual { private boolean primaryType = true; private Boolean objectType = true; @@ -130,6 +132,7 @@ public void setObjectType(Boolean objectType) { } @Test + @TmsLink("C13067") public void testNaming() throws JsonProcessingException { NamingManual n1 = new NamingManual(); String s1 = objectMapper.writeValueAsString(n1); @@ -140,6 +143,7 @@ public void testNaming() throws JsonProcessingException { } @Test + @TmsLink("C13068") public void testEquals() throws IOException { log.info("=== ZoneId= " + ThreadNow.sysZoneId()); JsonIt it = new JsonIt(); @@ -205,6 +209,7 @@ public static class JsonIt { } @Test + @TmsLink("C13069") public void testI18nString() throws IOException { I18nJson obj = new I18nJson(); ObjectWriter jackson = objectMapper.writerWithDefaultPrettyPrinter(); @@ -258,6 +263,7 @@ public static class I18nJson { @Test + @TmsLink("C13070") public void testI18nResult() throws IOException { ObjectWriter jackson = objectMapper.writerWithDefaultPrettyPrinter(); @@ -327,6 +333,7 @@ public void testI18nResult() throws IOException { } @Test + @TmsLink("C13071") public void testXml() throws IOException { ObjectMapper xmlMapper = jackson2ObjectMapperBuilder .createXmlMapper(true) @@ -393,6 +400,7 @@ public void testXml() throws IOException { } @Test + @TmsLink("C13072") public void testTreeMapGenerator() throws IOException { I18nJson i18nJson = new I18nJson(); JsonIt jsonIt = new JsonIt(); @@ -407,6 +415,7 @@ public void testTreeMapGenerator() throws IOException { } @Test + @TmsLink("C13073") public void testHelper() { I18nJson i18nJson = new I18nJson(); JsonIt jsonIt = new JsonIt(); @@ -444,6 +453,7 @@ public static class NumberAsNumber { } @Test + @TmsLink("C13074") public void testNumber() throws JsonProcessingException { NumberAsString nas = new NumberAsString(); NumberAsNumber nan = new NumberAsNumber(); @@ -456,6 +466,7 @@ public void testNumber() throws JsonProcessingException { @Test + @TmsLink("C13075") public void testResource() throws JsonProcessingException { Map res = new HashMap<>(); res.put("wings-jackson-79.properties", new ClassPathResource("wings-conf/wings-jackson-79.properties")); @@ -477,6 +488,7 @@ public static class Aes256String { @Test + @TmsLink("C13076") public void testAes256String() throws JsonProcessingException { Aes256String aes = new Aes256String(); final String txt = "1234567890"; @@ -514,6 +526,7 @@ public static class MsNamingXml { } @Test + @TmsLink("C13077") public void testMsNamingXml() throws JsonProcessingException { final XmlMapper xmlMapper = jackson2ObjectMapperBuilder .createXmlMapper(true) diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/monitor/report/DingTalkReportTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/monitor/report/DingTalkReportTest.java index 77c382cf6..7197834ac 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/monitor/report/DingTalkReportTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/monitor/report/DingTalkReportTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.monitor.report; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -32,6 +33,7 @@ class DingTalkReportTest { private DingTalkNotice dingTalkNotice; @Test + @TmsLink("C13078") void postReport() { Map> warns = new TreeMap<>(); List list = new ArrayList<>(); @@ -46,6 +48,7 @@ void postReport() { } @Test + @TmsLink("C13079") void postNotice() { final DingTalkConf conf = dingTalkNotice.provideConfig("monitor", true); conf.setNoticeMobiles(Map.of("a9", "155XXXX1992")); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/security/bind/DefaultWingsAuthTypeSourceTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/security/bind/DefaultWingsAuthTypeSourceTest.java index 180451663..a25c3a16a 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/security/bind/DefaultWingsAuthTypeSourceTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/security/bind/DefaultWingsAuthTypeSourceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.security.bind; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Test; import org.springframework.http.server.PathContainer; import org.springframework.web.util.pattern.PathPattern; @@ -19,6 +20,7 @@ class DefaultWingsAuthTypeSourceTest { private final PathPatternParser patternParser = PathPatternParser.defaultInstance; @Test + @TmsLink("C13080") void parse1() { final PathPattern ptn = patternParser.parse("/auth/{authType}/login.json"); final PathPattern.PathMatchInfo f1 = ptn.matchAndExtract(PathContainer.parsePath("/auth/username/login.json")); @@ -30,6 +32,7 @@ void parse1() { } @Test + @TmsLink("C13081") void parse2() { final PathPattern ptn = patternParser.parse("/auth/{authType:[^-]+}{splitter:-?}{authZone:[^-]*}/login.json"); final PathPattern.PathMatchInfo f1 = ptn.matchAndExtract(PathContainer.parsePath("/auth/username-admin/login.json")); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/security/pass/DefaultPasssaltEncoderTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/security/pass/DefaultPasssaltEncoderTest.java index ddb4ee1fa..d149a315d 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/security/pass/DefaultPasssaltEncoderTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/security/pass/DefaultPasssaltEncoderTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.security.pass; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.springframework.security.crypto.argon2.Argon2PasswordEncoder; @@ -39,6 +40,7 @@ class DefaultPasssaltEncoderTest { * $argon2id$v=19$m=4096,t=3,p=1$N6bHhzVC9cZEWvhvy9n6pQ$3LgBEM5Hu/6KFjX1WXKxrxWTZRpL0ayZWuBFd5dp3IM */ @Test + @TmsLink("C13082") void print() { final String str = RandCode.strong(100); time(bcrypt, str); @@ -60,6 +62,7 @@ private void time(PasswordEncoder enc, String str) { } @Test + @TmsLink("C13083") void testSalt() { final String pass = RandCode.strong(5); final String salt = RandCode.strong(100); @@ -76,6 +79,7 @@ void testSalt() { * SELECT password("milioncircle"); -- *48E834F2D5A6762230DF2DC976FD1712793ED6D8 */ @Test + @TmsLink("C13084") void testMysql() { String text1 = "wingsboot"; String text2 = "milioncircle"; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttp3ConfigurationTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttp3ConfigurationTest.java index d16079d8b..4448ab596 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttp3ConfigurationTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttp3ConfigurationTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.spring.bean; +import io.qameta.allure.TmsLink; import lombok.Setter; import okhttp3.OkHttpClient; import org.junit.jupiter.api.Test; @@ -33,6 +34,7 @@ public class SlardarOkhttp3ConfigurationTest { private OkHttpClient okHttpClient; @Test + @TmsLink("C13085") public void test() throws Exception { ClientHttpRequestFactory requestFactory = restTemplate.getRequestFactory(); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/DateTimeConverterTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/DateTimeConverterTest.java index 59e039e18..4cda4e6cd 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/DateTimeConverterTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/DateTimeConverterTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.webmvc; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -33,6 +34,7 @@ public class DateTimeConverterTest { * Test for Format and Auto Completion */ @Test + @TmsLink("C13086") public void testFmtDate() throws Exception { assertFmtDate("Jan_01_2020", "2020-01-01"); assertFmtDate("Jan_2_2020", "2020-01-02"); @@ -49,6 +51,7 @@ private void assertFmtDate(String d, String v) throws Exception { * Test for Format and Auto Completion */ @Test + @TmsLink("C13087") public void testFullDate() throws Exception { assertFullDate("2020-", "2020-01-01 00:00:00.000"); assertFullDate("2020-12-", "2020-12-01 00:00:00.000"); @@ -69,6 +72,7 @@ private void assertFullDate(String d, String v) throws Exception { * Test for Format and Auto Completion */ @Test + @TmsLink("C13088") public void testLocalDate() throws Exception { assertLocalDate("January/1/20", "2020-01-01"); assertLocalDate("Jan/1/20", "2020-01-01"); @@ -93,6 +97,7 @@ private void assertLocalDate(String d, String v) throws Exception { * Test for Format and Auto Completion */ @Test + @TmsLink("C13089") public void testLocalTime() throws Exception { assertLocalTime("12", "12:00:00.000"); assertLocalTime("12:34", "12:34:00.000"); @@ -114,6 +119,7 @@ private void assertLocalTime(String d, String v) throws Exception { * @see pro.fessional.wings.slardar.json.WingsJacksonMapperTest */ @Test + @TmsLink("C13090") public void testLdtZdt() throws Exception { // GMT+9 -> GMT+8 testLdtZdt("2020-12-30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 13:34:56", "Asia/Tokyo"); @@ -146,6 +152,7 @@ private void testLdtZdt(String udt, String cdt, String zdt, String utz) throws E * when response the json, auto convert system timezone to user timezone, that is +1 hour. */ @Test + @TmsLink("C13091") public void testLdtZdtBody() throws Exception { // GMT+9 -> GMT+8 testLdtZdtBody("2020-12-30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 13:34:56", "Asia/Tokyo"); @@ -181,6 +188,7 @@ private void testLdtZdtBody(String udt, String cdt, String zdt, String utz) thro * Do not test with a time zone that has daylight saving time to avoid switching. */ @Test + @TmsLink("C13092") public void testZdtLdt() throws Exception { testZdtLdt("2020-12-30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 11:34:56", "Asia/Tokyo"); testZdtLdt("2020/12/30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 11:34:56", "Asia/Tokyo"); @@ -212,6 +220,7 @@ private void testZdtLdt(String udt, String zdt, String cdt, String utz) throws E * Do not test with a time zone that has daylight saving time to avoid switching. */ @Test + @TmsLink("C13093") public void testZdtLdtBody() throws Exception { testZdtLdtBody("2020-12-30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 11:34:56", "Asia/Tokyo"); testZdtLdtBody("2020/12/30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 11:34:56", "Asia/Tokyo"); @@ -244,6 +253,7 @@ private void testZdtLdtBody(String udt, String zdt, String cdt, String utz) thro * when response the json, auto convert system timezone to user timezone, that is +1 hour. */ @Test + @TmsLink("C13094") public void testLdtOdt() throws Exception { // GMT+9 -> GMT+8 testLdtOdt("2020-12-30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 13:34:56", "Asia/Tokyo", "+09:00"); @@ -278,6 +288,7 @@ private void testLdtOdt(String udt, String ldt, String odt, String utz, String o */ @Test + @TmsLink("C13095") public void testLdtOdtBody() throws Exception { // GMT+9 -> GMT+8 testLdtOdtBody("2020-12-30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 13:34:56", "Asia/Tokyo", "+09:00"); @@ -314,6 +325,7 @@ private void testLdtOdtBody(String udt, String ldt, String odt, String utz, Stri * Do not test with a time zone that has daylight saving time to avoid switching. */ @Test + @TmsLink("C13096") public void testOdtLdt() throws Exception { testOdtLdt("2020-12-30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 11:34:56", "Asia/Tokyo", "+09:00"); testOdtLdt("2020/12/30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 11:34:56", "Asia/Tokyo", "+09:00"); @@ -346,6 +358,7 @@ private void testOdtLdt(String udt, String odt, String cdt, String utz, String o * Do not test with a time zone that has daylight saving time to avoid switching. */ @Test + @TmsLink("C13097") public void testOdtLdtBody() throws Exception { testOdtLdtBody("2020-12-30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 11:34:56", "Asia/Tokyo", "+09:00"); testOdtLdtBody("2020/12/30 12:34:56", "2020-12-30 12:34:56", "2020-12-30 11:34:56", "Asia/Tokyo", "+09:00"); @@ -375,6 +388,7 @@ private void testOdtLdtBody(String udt, String odt, String cdt, String utz, Stri } @Test + @TmsLink("C13098") public void testLdLdBody() throws Exception { testLdLdBody("2020-11-30", "2020-11-30"); testLdLdBody("2020/12/30", "2020-12-30"); @@ -393,6 +407,7 @@ private void testLdLdBody(String d, String v) throws Exception { } @Test + @TmsLink("C13099") public void testLtLtBody() throws Exception { testLtLtBody("12:34:56", "12:34:56"); testLtLtBody("12:34", "12:34:00"); @@ -411,6 +426,7 @@ private void testLtLtBody(String d, String v) throws Exception { } @Test + @TmsLink("C13100") public void testLdxAuto1() throws Exception { final String utz = "Asia/Tokyo"; // User +9 zone, 12 o'clock, convert to system +8 zone, 11 o'clock @@ -431,6 +447,7 @@ public void testLdxAuto1() throws Exception { } @Test + @TmsLink("C13101") public void testLdxAuto2() throws Exception { final String utz = "Asia/Tokyo"; diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/I18nLocaleResolverTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/I18nLocaleResolverTest.java index 33c6016b0..93d4e6a89 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/I18nLocaleResolverTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/I18nLocaleResolverTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.webmvc; +import io.qameta.allure.TmsLink; import jakarta.servlet.http.Cookie; import lombok.Setter; import org.junit.jupiter.api.Test; @@ -29,6 +30,7 @@ public class I18nLocaleResolverTest { private MockMvc mockMvc; @Test + @TmsLink("C13102") public void testHeader() throws Exception { testHeader("en", "Bad credentials|en"); testHeader("en_US", "Bad credentials|en-US"); @@ -50,6 +52,7 @@ private void testHeader(String lang, String output) throws Exception { } @Test + @TmsLink("C13103") public void testCookie() throws Exception { testCookie("en", "Bad credentials|en"); testCookie("en_US", "Bad credentials|en-US"); @@ -70,6 +73,7 @@ private void testCookie(String lang, String output) throws Exception { } @Test + @TmsLink("C13104") public void testParam() throws Exception { testParam("en", "Bad credentials|en"); testParam("en_US", "Bad credentials|en-US"); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/PageQueryResolverTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/PageQueryResolverTest.java index 4fe523370..57f09e8f4 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/PageQueryResolverTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/PageQueryResolverTest.java @@ -1,7 +1,7 @@ package pro.fessional.wings.slardar.webmvc; +import io.qameta.allure.TmsLink; import lombok.Data; -import lombok.EqualsAndHashCode; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -9,9 +9,11 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.web.client.RestTemplate; import pro.fessional.mirana.page.PageQuery; -import pro.fessional.wings.slardar.controller.TestPageQueryController; +import pro.fessional.wings.slardar.app.controller.TestPageQueryController; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; /** * @author trydofor @@ -31,6 +33,7 @@ public class PageQueryResolverTest { private RestTemplate restTemplate; @Test + @TmsLink("C13105") public void testModelAttribute() { int page = 44; int size = 55; @@ -45,6 +48,7 @@ public void testModelAttribute() { } @Test + @TmsLink("C13106") public void testPageQuery() { int page = 44; int size = 55; @@ -59,6 +63,7 @@ public void testPageQuery() { } @Test + @TmsLink("C13107") public void testPageDefault1() { int page = 33; int size = 44; @@ -72,6 +77,7 @@ public void testPageDefault1() { assertEquals(sort, pq.getSort()); } @Test + @TmsLink("C13108") public void testPageDefault2() { int page = 33; int size = 44; @@ -86,6 +92,7 @@ public void testPageDefault2() { } @Test + @TmsLink("C13109") public void testPageDefault3() { String sort = "k1,-k2"; PageQuery pq = restTemplate.getForObject(host + "/test/page-request-2.html?sb=" + sort, PageQuery.class); @@ -96,6 +103,7 @@ public void testPageDefault3() { } @Test + @TmsLink("C13110") public void testPageBody3() { TestPageQueryController.Ins ins = new TestPageQueryController.Ins(); ins.setPage(2); @@ -111,6 +119,7 @@ public static class Is{ private String name; } @Test + @TmsLink("C13111") public void testPageBody4() { Is is = new Is(); is.setName("name"); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/RequestMappingHelperTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/RequestMappingHelperTest.java index fe672c705..ce62bdf87 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/RequestMappingHelperTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/RequestMappingHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.webmvc; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; @@ -17,6 +18,7 @@ public class RequestMappingHelperTest { private ApplicationContext context; @Test + @TmsLink("C13112") public void infoAllMapping() { List infos = RequestMappingHelper.infoAllMapping(context); for (RequestMappingHelper.Info info : infos) { diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/SpringPageHelperTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/SpringPageHelperTest.java index fe3513b0f..337505918 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/SpringPageHelperTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/SpringPageHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.webmvc; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Test; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Sort; @@ -17,6 +18,7 @@ public class SpringPageHelperTest { @Test + @TmsLink("C13113") void from() { PageQuery pq = new PageQuery(2, 3, "id,-name"); final PageRequest pr = SpringPageHelper.from(pq); @@ -25,6 +27,7 @@ void from() { } @Test + @TmsLink("C13114") void into() { final List ods = Arrays.asList(Sort.Order.asc("id"), Sort.Order.desc("name")); PageRequest pr = PageRequest.of(3, 4, Sort.by(ods)); diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java index 009ed2ff2..31965d5e1 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.slardar.webmvc; import com.fasterxml.jackson.databind.ObjectMapper; +import io.qameta.allure.TmsLink; import jakarta.servlet.http.Cookie; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -19,7 +20,7 @@ import pro.fessional.mirana.bits.Aes; import pro.fessional.mirana.bits.Base64; import pro.fessional.wings.silencer.encrypt.Aes256Provider; -import pro.fessional.wings.slardar.controller.TestCookieController.Ins; +import pro.fessional.wings.slardar.app.controller.TestCookieController.Ins; import java.util.HashSet; import java.util.Set; @@ -80,11 +81,13 @@ public class WingsCookieTest { private OkHttpClient okHttpClient; @Test + @TmsLink("C13115") public void test1Cookie() throws Exception { mockMvcCookie("/test/cookie.json"); } @Test + @TmsLink("C13116") public void test2Cookie() throws Exception { // Must use client, do NOT mock httpClient("/test/cookie-forward.json"); diff --git a/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index b226b3dbd..a66a43503 100644 --- a/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,2 +1,2 @@ pro.fessional.wings.slardar.spring.conf.SlardarAsyncAutoConfiguration -pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration \ No newline at end of file +pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarApplication.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarApplication.java index 55ad09ce6..331364360 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarApplication.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/WingsSlardarApplication.java @@ -3,14 +3,12 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup; -import org.springframework.context.annotation.ComponentScan; /** * @author trydofor * @since 2019-07-20 */ @SpringBootApplication -@ComponentScan("pro.fessional.wings.slardar.service") public class WingsSlardarApplication { public static void main(String[] args) { diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/service/AsyncService.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/service/AsyncService.java similarity index 95% rename from wings/slardar/src/test/java/pro/fessional/wings/slardar/service/AsyncService.java rename to wings/slardar/src/test/java/pro/fessional/wings/slardar/app/service/AsyncService.java index 1922bf2fc..55e28ed94 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/service/AsyncService.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/service/AsyncService.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.service; +package pro.fessional.wings.slardar.app.service; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Async; diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/service/ScheduleService.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/service/ScheduleService.java similarity index 91% rename from wings/slardar/src/test/java/pro/fessional/wings/slardar/service/ScheduleService.java rename to wings/slardar/src/test/java/pro/fessional/wings/slardar/app/service/ScheduleService.java index fcc85faae..8b64f504f 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/service/ScheduleService.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/app/service/ScheduleService.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.service; +package pro.fessional.wings.slardar.app.service; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/TaskSchedulerTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/TaskSchedulerTest.java index dbd40a374..7c37ea3bf 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/TaskSchedulerTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/async/TaskSchedulerTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.slardar.async; import com.alibaba.ttl.TtlRunnable; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -10,7 +11,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import pro.fessional.wings.slardar.context.TerminalContext; -import pro.fessional.wings.slardar.service.AsyncService; +import pro.fessional.wings.slardar.app.service.AsyncService; import java.time.Duration; import java.util.concurrent.CompletableFuture; @@ -34,6 +35,7 @@ public class TaskSchedulerTest { protected AsyncService asyncService; @Test + @TmsLink("C13001") void testTask() throws Exception { final TerminalContext.Builder builder = new TerminalContext.Builder(); final long userId = 1L; diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/autodto/AutoDtoHelperTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/autodto/AutoDtoHelperTest.java index 12d281dd3..68a72c3b7 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/autodto/AutoDtoHelperTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/autodto/AutoDtoHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.autodto; +import io.qameta.allure.TmsLink; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -39,6 +40,7 @@ class AutoDtoHelperTest { * Auto convert lange and time, JP to CN */ @Test + @TmsLink("C13002") void autoRequest() { TerminalContext.Builder builder = new TerminalContext.Builder() .locale(Locale.ENGLISH) @@ -86,6 +88,7 @@ void autoRequest() { * Auto convert lange and time, CN to JP */ @Test + @TmsLink("C13003") void autoResponse() { TerminalContext.Builder builder = new TerminalContext.Builder() .locale(Locale.US) diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/GlobalAttributeHolderTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/GlobalAttributeHolderTest.java index 7acc87b6b..e3b38770f 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/GlobalAttributeHolderTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/GlobalAttributeHolderTest.java @@ -1,6 +1,8 @@ package pro.fessional.wings.slardar.context; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import pro.fessional.mirana.best.TypedReg; @@ -19,8 +21,13 @@ public interface Solos { } @Test + @TmsLink("C13004") public void testSolo() { - log.info("PasssaltByUid={}", Solos.PasssaltByUid); - log.info("PermitsByUid={}", Solos.PermitsByUid); + GlobalAttributeHolder.regLoader(Solos.PasssaltByUid, integerStringKey -> "salt"); + GlobalAttributeHolder.regLoader(Solos.PermitsByUid, integerStringKey -> Set.of("prd", "dev")); + String v1 = GlobalAttributeHolder.tryAttr(Solos.PasssaltByUid, 1); + Set v2 = GlobalAttributeHolder.tryAttr(Solos.PermitsByUid, 1); + Assertions.assertEquals("salt", v1); + Assertions.assertEquals(Set.of("prd", "dev"), v2); } } diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/NowTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/NowTest.java index ef388f34c..56df9196f 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/NowTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/NowTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.context; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @@ -26,6 +27,7 @@ class NowTest { public static final long Offset = 60_000; @Test + @TmsLink("C13005") void initClock() { long sysMs = System.currentTimeMillis(); long nowMs = Now.millis(); @@ -35,6 +37,7 @@ void initClock() { } @Test + @TmsLink("C13006") void clientClock() { ZoneId jp = ZoneId.of("Asia/Tokyo"); TerminalContext.Builder builder = new TerminalContext.Builder() diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/FormatterMain.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/FormatterMain.java deleted file mode 100644 index cc8d29191..000000000 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/FormatterMain.java +++ /dev/null @@ -1,18 +0,0 @@ -package pro.fessional.wings.slardar.datatime; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; - -/** - * test for java 11 idea - * @author trydofor - * @since 2022-02-05 - */ -public class FormatterMain { - - public static void main(String[] args) { - LocalDateTime d = LocalDateTime.of(2021, 1, 2, 3, 0, 0, 0); - DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy[-MM][-dd][ ][HH][:mm][:ss][ ][VV]"); - System.out.println(d.format(df)); - } -} diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/SmartFormatterTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/SmartFormatterTest.java index 6a04a7e3b..e94c3cfc7 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/SmartFormatterTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/datatime/SmartFormatterTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.datatime; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -15,26 +16,35 @@ public class SmartFormatterTest { @Test + @TmsLink("C13007") + public void print() { + LocalDateTime d = LocalDateTime.of(2021, 1, 2, 3, 0, 0, 0); + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy[-MM][-dd][ ][HH][:mm][:ss][ ][VV]"); + System.out.println(d.format(df)); + } + + @Test + @TmsLink("C13008") public void testDatetime() { - LocalDateTime d1 = LocalDateTime.of(2021,1,2,3,4,5,0); + LocalDateTime d1 = LocalDateTime.of(2021, 1, 2, 3, 4, 5, 0); final String smPtn = "yyyy[-][/][.]M[-][/][.]d[ ]['T']H:m:s"; - assertDatetime(d1,"2021-1-2 3:4:5", smPtn); - assertDatetime(d1,"2021-01-2 03:4:5", smPtn); - assertDatetime(d1,"2021-01-02 03:04:05", smPtn); - assertDatetime(d1,"2021-01-02T03:04:05", smPtn); - assertDatetime(d1,"2021/01/02T03:04:05", smPtn); - assertDatetime(d1,"2021.01/02T03:04:05", smPtn); + assertDatetime(d1, "2021-1-2 3:4:5", smPtn); + assertDatetime(d1, "2021-01-2 03:4:5", smPtn); + assertDatetime(d1, "2021-01-02 03:04:05", smPtn); + assertDatetime(d1, "2021-01-02T03:04:05", smPtn); + assertDatetime(d1, "2021/01/02T03:04:05", smPtn); + assertDatetime(d1, "2021.01/02T03:04:05", smPtn); final String usPtn = "[MMMM][MMM][M]/d/[yyyy][yy][ ]['T']H:m:s"; - assertDatetime(d1,"1/2/21 3:4:5", usPtn); - assertDatetime(d1,"1/2/21 03:4:5", usPtn); - assertDatetime(d1,"01/2/2021T3:4:5", usPtn); - assertDatetime(d1,"01/2/2021T03:4:5", usPtn); + assertDatetime(d1, "1/2/21 3:4:5", usPtn); + assertDatetime(d1, "1/2/21 03:4:5", usPtn); + assertDatetime(d1, "01/2/2021T3:4:5", usPtn); + assertDatetime(d1, "01/2/2021T03:4:5", usPtn); - assertDatetime(d1,"Jan/2/21 3:4:5", usPtn); - assertDatetime(d1,"January/2/21 03:4:5", usPtn); - assertDatetime(d1,"Jan/2/2021T3:4:5", usPtn); - assertDatetime(d1,"January/2/2021T03:4:5", usPtn); + assertDatetime(d1, "Jan/2/21 3:4:5", usPtn); + assertDatetime(d1, "January/2/21 03:4:5", usPtn); + assertDatetime(d1, "Jan/2/2021T3:4:5", usPtn); + assertDatetime(d1, "January/2/2021T03:4:5", usPtn); } private void assertDatetime(LocalDateTime ldt, String date, String parser) { @@ -44,20 +54,22 @@ private void assertDatetime(LocalDateTime ldt, String date, String parser) { } final TimeZone tz = TimeZone.getTimeZone("Asia/Shanghai"); + @Test + @TmsLink("C13009") public void testZoned() { TimeZone.setDefault(tz); - LocalDateTime d1 = LocalDateTime.of(2021,1,2,8,4,5,0); + LocalDateTime d1 = LocalDateTime.of(2021, 1, 2, 8, 4, 5, 0); final String smPtn = "yyyy[-][/][.]M[-][/][.]d[ ]['T']H:m:s[.SSS][XXXXX][XXXX][XXX][XX][X]['['][ ][VV][']']"; - assertZoned(d1,"2021-1-2 0:4:5Z", smPtn); - assertZoned(d1,"2021-1-2 8:4:5Asia/Shanghai", smPtn); - assertZoned(d1,"2021-1-2 8:4:5 Asia/Shanghai", smPtn); + assertZoned(d1, "2021-1-2 0:4:5Z", smPtn); + assertZoned(d1, "2021-1-2 8:4:5Asia/Shanghai", smPtn); + assertZoned(d1, "2021-1-2 8:4:5 Asia/Shanghai", smPtn); - assertZoned(d1,"2021-1-2 0:4:5Z", smPtn); - assertZoned(d1,"2021-1-2 8:4:5+0800", smPtn); - assertZoned(d1,"2021-1-2 8:4:5+08:00[Asia/Shanghai]", smPtn); - assertZoned(d1,"2021-1-2 8:4:5+08:00:00[Asia/Shanghai]", smPtn); - assertZoned(d1,"2021-1-2 8:4:5[Asia/Shanghai]", smPtn); + assertZoned(d1, "2021-1-2 0:4:5Z", smPtn); + assertZoned(d1, "2021-1-2 8:4:5+0800", smPtn); + assertZoned(d1, "2021-1-2 8:4:5+08:00[Asia/Shanghai]", smPtn); + assertZoned(d1, "2021-1-2 8:4:5+08:00:00[Asia/Shanghai]", smPtn); + assertZoned(d1, "2021-1-2 8:4:5[Asia/Shanghai]", smPtn); } private void assertZoned(LocalDateTime ldt, String date, String parser) { diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/fastjson/FastJsonHelperTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/fastjson/FastJsonHelperTest.java index 0aeb1be37..c87e17b85 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/fastjson/FastJsonHelperTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/fastjson/FastJsonHelperTest.java @@ -3,6 +3,7 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONWriter.Feature; import com.alibaba.fastjson2.annotation.JSONField; +import io.qameta.allure.TmsLink; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -17,7 +18,7 @@ import static pro.fessional.wings.slardar.fastjson.FastJsonHelper.DefaultWriter; /** - * https://alibaba.github.io/fastjson2/register_custom_reader_writer_cn + * register_custom_reader_writer_cn * * @author trydofor * @since 2022-10-25 @@ -43,6 +44,7 @@ public static class Dto { } @Test + @TmsLink("C13010") public void testDefault() { Dto d0 = new Dto(); final String s0 = JSON.toJSONString(d0, DefaultWriter()); @@ -52,6 +54,7 @@ public void testDefault() { } @Test + @TmsLink("C13011") public void testString() { Dto d0 = new Dto(); final String s0 = FastJsonHelper.string(d0); @@ -62,6 +65,7 @@ public void testString() { } @Test + @TmsLink("C13012") public void testFormatString() { Dto d0 = new Dto(); final String s0 = JSON.toJSONString(d0, FastJsonFilters.NumberFormatString, DefaultWriter()); @@ -75,6 +79,7 @@ public void testFormatString() { * WriteNonStringValueAsString format Number */ @Test + @TmsLink("C13013") public void testSingle() { // default Assertions.assertEquals("true", JSON.toJSONString(true)); diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/jackson/JacksonHelperTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/jackson/JacksonHelperTest.java index 0ded022a8..0a8873df8 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/jackson/JacksonHelperTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/jackson/JacksonHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.jackson; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @@ -15,6 +16,7 @@ class JacksonHelperTest { @Test + @TmsLink("C13014") void testObject() { final String jsonText = InputStreams.readText(JacksonHelperTest.class.getResourceAsStream("/complex.json")); final Map jsonMap = JacksonHelper.object(jsonText, Map.class); diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/json/JsonConversionTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/json/JsonConversionTest.java index eab7ee567..a4bdf6ae1 100644 --- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/json/JsonConversionTest.java +++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/json/JsonConversionTest.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.TypeReference; +import io.qameta.allure.TmsLink; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -31,6 +32,7 @@ class JsonConversionTest { private final JsonConversion conversionService = new JsonConversion(); @Test + @TmsLink("C13015") void canConvert() { Assertions.assertTrue(conversionService.canConvert(String.class, Map.class)); Assertions.assertTrue(conversionService.canConvert(Map.class, String.class)); @@ -58,6 +60,7 @@ public static class Dto { } @Test + @TmsLink("C13016") void convert() { Dto dto = new Dto(); Map map = new HashMap<>(); @@ -90,6 +93,7 @@ void convert() { } @Test + @TmsLink("C13017") void parse() { Dto dto = new Dto(); R rd = R.okData(dto); diff --git a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfCacheTest.java b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfCacheTest.java deleted file mode 100644 index ef6c14e06..000000000 --- a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfCacheTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package pro.fessional.wings.warlock.service.conf; - -import lombok.Setter; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import pro.fessional.mirana.time.Sleep; -import pro.fessional.wings.silencer.modulate.RunMode; - -import java.util.List; - -/** - * Need init database via BootDatabaseTest - * - * @author trydofor - * @since 2022-03-09 - */ -@SpringBootTest(properties = { - "wings.faceless.jooq.cud.table[win_conf_runtime]=-", - "logging.level.root=debug"}) -class RuntimeConfCacheTest { - - @Setter(onMethod_ = {@Autowired}) - private RuntimeConfService runtimeConfService; - - @Test - void testCache() { - final List arm = List.of(RunMode.Develop, RunMode.Local); - final String key = "RuntimeConfCacheTest.testCache"; - runtimeConfService.newObject(key, arm, "test RunMode"); - final List arm1 = runtimeConfService.getList(key, RunMode.class); - final List arm2 = runtimeConfService.getList(key, RunMode.class); - - runtimeConfService.setObject(key, arm); - Sleep.ignoreInterrupt(2_000); - // check log TableChangeEvent(source=[pro.fessional.wings.warlock.service.conf.impl.RuntimeConfServiceImpl] - - final List rm1 = runtimeConfService.getList(key, RunMode.class); - final List rm2 = runtimeConfService.getList(key, RunMode.class); - - Assertions.assertEquals(arm, arm1); - Assertions.assertSame(arm1, arm2); - Assertions.assertNotSame(arm1, rm1); - Assertions.assertSame(rm1, rm2); - } -} diff --git a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java index b9dba966e..a2eec5a50 100644 --- a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java +++ b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.conf; +import io.qameta.allure.TmsLink; import lombok.Data; import lombok.Setter; import org.junit.jupiter.api.Assertions; @@ -37,6 +38,7 @@ class RuntimeConfServiceTest { private RuntimeConfService runtimeConfService; @Test + @TmsLink("C14008") void testSimple() { assertSimple(BigDecimal.class, new BigDecimal("10.00")); assertSimple(String.class, "string"); @@ -66,6 +68,7 @@ private void assertSimple(Class clz, T obj) { } @Test + @TmsLink("C14009") void testCollection() { List ls = List.of("Jan", "Fer"); runtimeConfService.newObject(List.class, ls, "test list"); @@ -88,6 +91,7 @@ public static class Dto { } @Test + @TmsLink("C14010") void testJson() { Dto dto = new Dto(); runtimeConfService.newObject(Dto.class, dto, "Need init database via BootDatabaseTest"); @@ -97,6 +101,7 @@ void testJson() { } @Test + @TmsLink("C14011") void testKryo() { Dto dto = new Dto(); dto.setLdt(LocalDateTime.now()); @@ -107,6 +112,7 @@ void testKryo() { } @Test + @TmsLink("C14012") void testMode() { final List arm = List.of(RunMode.Develop, RunMode.Local); final String key = "RuntimeConfServiceTest.testMode"; @@ -120,16 +126,19 @@ void testMode() { } @Test - void testCache() { + @TmsLink("C14013") + void testCacheWithCud() { final List arm = List.of(RunMode.Develop, RunMode.Local); final String key = "RuntimeConfCacheTest.testCache"; + // insert on duplicated key runtimeConfService.newObject(key, arm, "test RunMode"); final List arm1 = runtimeConfService.getList(key, RunMode.class); final List arm2 = runtimeConfService.getList(key, RunMode.class); + // check log update + // evictAllConfCache by win_conf_runtime, TableChangeEvent runtimeConfService.setObject(key, arm); Sleep.ignoreInterrupt(2_000); - // check log TableChangeEvent(source=[pro.fessional.wings.warlock.service.event.impl.WingsTableCudHandlerImpl] final List rm1 = runtimeConfService.getList(key, RunMode.class); final List rm2 = runtimeConfService.getList(key, RunMode.class); diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java index 8de37aa64..2204520f2 100644 --- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java +++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java @@ -9,7 +9,7 @@ * @author trydofor * @since 2019-12-01 */ -@AutoConfiguration(before = WarlockShadowAutoConfiguration.class) +@AutoConfiguration(before = WarlockShadowSecurityAutoConfiguration.class) @ImportAutoConfiguration(WarlockBondBeanConfiguration.class) public class WarlockBondAutoConfiguration { } diff --git a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/controller/auth/TestLoginPageController.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/app/controller/TestLoginPageController.java similarity index 97% rename from wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/controller/auth/TestLoginPageController.java rename to wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/app/controller/TestLoginPageController.java index 97c6f1f23..00381c577 100644 --- a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/controller/auth/TestLoginPageController.java +++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/app/controller/TestLoginPageController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.warlock.controller.auth; +package pro.fessional.wings.warlock.app.controller; import lombok.Setter; import lombok.extern.slf4j.Slf4j; diff --git a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/security/NoncePermLoginTest.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/security/NoncePermLoginTest.java index a2298214c..158b388e8 100644 --- a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/security/NoncePermLoginTest.java +++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/security/NoncePermLoginTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.security; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.OkHttpClient; @@ -40,6 +41,7 @@ class NoncePermLoginTest { private OkHttpClient okHttpClient; @Test + @TmsLink("C14014") public void testRootLogin() { OkHttpClientHelper.postJson(okHttpClient, host + DangerUrl, "{\"userId\":1,\"danger\":false}"); @@ -60,6 +62,7 @@ public void testRootLogin() { } @Test + @TmsLink("C14015") public void testDanger() { log.warn("current locale = {}", Locale.getDefault()); OkHttpClientHelper.postJson(okHttpClient, host + DangerUrl, "{\"userId\":1,\"danger\":true}"); diff --git a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermServiceTest.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermServiceTest.java index c56f053a0..5112612d5 100644 --- a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermServiceTest.java +++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermServiceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.perm; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -20,6 +21,7 @@ class WarlockPermServiceTest { protected WarlockPermService warlockPermService; @Test + @TmsLink("C14016") void loadPermAll() { final Map a1 = warlockPermService.loadPermAll(); final Map a2 = warlockPermService.loadPermAll(); diff --git a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceCacheTest.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceTest.java similarity index 92% rename from wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceCacheTest.java rename to wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceTest.java index 36ecce77f..08dc893fc 100644 --- a/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceCacheTest.java +++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockRoleServiceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.perm; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -16,12 +17,13 @@ @SpringBootTest(properties = { "wings.faceless.jooq.cud.table[win_role_entry]=-", "logging.level.root=debug"}) -class WarlockRoleServiceCacheTest { +class WarlockRoleServiceTest { @Setter(onMethod_ = {@Autowired}) protected WarlockRoleService warlockRoleService; @Test + @TmsLink("C14017") void loadRoleAll() { final Map a1 = warlockRoleService.loadRoleAll(); final Map a2 = warlockRoleService.loadRoleAll(); diff --git a/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/Warlock1SchemaManagerTest.java b/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/TestWarlock1SchemaManagerSample.java similarity index 93% rename from wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/Warlock1SchemaManagerTest.java rename to wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/TestWarlock1SchemaManagerSample.java index a0bf2a8d4..d62f28805 100644 --- a/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/Warlock1SchemaManagerTest.java +++ b/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/TestWarlock1SchemaManagerSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.project; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -21,12 +22,13 @@ "spring.datasource.username=" + Warlock0CodegenConstant.USER, "spring.datasource.password=" + Warlock0CodegenConstant.PASS, }) -class Warlock1SchemaManagerTest { +class TestWarlock1SchemaManagerSample { @Setter(onMethod_ = {@Autowired}) private SchemaRevisionManager schemaRevisionManager; @Test + @TmsLink("C14018") void init04AuthMain() { final Warlock1SchemaManager manager = new Warlock1SchemaManager(schemaRevisionManager); manager.mergeForceApply(true, @@ -37,6 +39,7 @@ void init04AuthMain() { } @Test + @TmsLink("C14019") void init04AuthTest() { final Warlock1SchemaManager manager = new Warlock1SchemaManager(schemaRevisionManager); manager.mergeForceApply(true, @@ -46,6 +49,7 @@ void init04AuthTest() { @Test + @TmsLink("C14020") void bugfixExecute() { final FlywaveRevisionScanner.Helper helper = FlywaveRevisionScanner.helper(); helper.somefix("01-authn-fix"); diff --git a/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/Warlock2CodeGeneratorTest.java b/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/TestWarlock2CodeGeneratorSample.java similarity index 91% rename from wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/Warlock2CodeGeneratorTest.java rename to wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/TestWarlock2CodeGeneratorSample.java index 0103f8a43..f0bef1074 100644 --- a/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/Warlock2CodeGeneratorTest.java +++ b/wings/warlock-codegen/src/test/java/pro/fessional/wings/warlock/project/TestWarlock2CodeGeneratorSample.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.project; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import pro.fessional.wings.faceless.codegen.JdbcDataLoadHelper; @@ -14,9 +15,10 @@ * @since 2021-02-22 */ @Disabled("Code generation, managed by devops") -class Warlock2CodeGeneratorTest { +class TestWarlock2CodeGeneratorSample { @Test + @TmsLink("C14021") public void genEnum() { Warlock2EnumGenerator generator = new Warlock2EnumGenerator(); generator.setTargetDir(JAVA); @@ -25,6 +27,7 @@ public void genEnum() { } @Test + @TmsLink("C14022") public void genJooq() { Warlock3JooqGenerator generator = new Warlock3JooqGenerator(); generator.setTargetDir(JAVA); @@ -35,6 +38,7 @@ public void genJooq() { } @Test + @TmsLink("C14023") public void genAuth() { JdbcDataLoadHelper helper = JdbcDataLoadHelper.use(JDBC, USER, PASS); Warlock4AuthGenerator generator = new Warlock4AuthGenerator(); diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java index 959d81887..dcda55b4e 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java @@ -2,7 +2,6 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; import pro.fessional.wings.slardar.spring.conf.SlardarSprintAutoConfiguration; import pro.fessional.wings.warlock.spring.bean.WarlockExceptionConfiguration; import pro.fessional.wings.warlock.spring.bean.WarlockHazelcastConfiguration; @@ -10,8 +9,6 @@ import pro.fessional.wings.warlock.spring.bean.WarlockJustAuthConfiguration; import pro.fessional.wings.warlock.spring.bean.WarlockOauthTicketConfiguration; import pro.fessional.wings.warlock.spring.bean.WarlockOtherBeanConfiguration; -import pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration; -import pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration; import pro.fessional.wings.warlock.spring.bean.WarlockWatching2Configuration; @@ -19,7 +16,10 @@ * @author trydofor * @since 2019-12-01 */ -@AutoConfiguration(before = {SlardarSprintAutoConfiguration.class, WarlockAutoConfiguration.class, SecurityAutoConfiguration.class}) +@AutoConfiguration(before = { + SlardarSprintAutoConfiguration.class, + WarlockAutoConfiguration.class, +}) @ImportAutoConfiguration({ WarlockExceptionConfiguration.class, WarlockHazelcastConfiguration.class, @@ -27,8 +27,6 @@ WarlockJustAuthConfiguration.class, WarlockOauthTicketConfiguration.class, WarlockOtherBeanConfiguration.class, - WarlockSecurityBeanConfiguration.class, - WarlockSecurityConfConfiguration.class, WarlockWatching2Configuration.class, }) public class WarlockShadowAutoConfiguration { diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowSecurityAutoConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowSecurityAutoConfiguration.java new file mode 100644 index 000000000..4dce1fb5a --- /dev/null +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowSecurityAutoConfiguration.java @@ -0,0 +1,25 @@ +package pro.fessional.wings.warlock.spring.conf; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.ImportAutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration; +import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration; +import pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration; +import pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration; + + +/** + * @author trydofor + * @since 2019-12-01 + */ +@AutoConfiguration(before = { + WarlockShadowAutoConfiguration.class, + SecurityAutoConfiguration.class, + UserDetailsServiceAutoConfiguration.class, +}) +@ImportAutoConfiguration({ + WarlockSecurityBeanConfiguration.class, + WarlockSecurityConfConfiguration.class, +}) +public class WarlockShadowSecurityAutoConfiguration { +} diff --git a/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 64e7b739b..3b0e62534 100644 --- a/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1,2 @@ pro.fessional.wings.warlock.spring.conf.WarlockShadowAutoConfiguration +pro.fessional.wings.warlock.spring.conf.WarlockShadowSecurityAutoConfiguration diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/auth/TestLoginController.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestLoginController.java similarity index 98% rename from wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/auth/TestLoginController.java rename to wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestLoginController.java index dd65b61c4..94d7109c9 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/auth/TestLoginController.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestLoginController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.warlock.controller.auth; +package pro.fessional.wings.warlock.app.controller; import io.swagger.v3.oas.annotations.Parameter; import lombok.Data; diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestOtherController.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestOtherController.java similarity index 97% rename from wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestOtherController.java rename to wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestOtherController.java index 47adbaaf0..e3043fa12 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestOtherController.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestOtherController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.warlock.controller.other; +package pro.fessional.wings.warlock.app.controller; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpSession; @@ -21,7 +21,7 @@ import pro.fessional.mirana.pain.MessageException; import pro.fessional.wings.warlock.errcode.CommonErrorEnum; import pro.fessional.wings.warlock.security.autogen.PermConstant; -import pro.fessional.wings.warlock.service.watching.WatchingService; +import pro.fessional.wings.warlock.app.service.WatchingService; import java.util.concurrent.CompletableFuture; diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestParam1Controller.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestParam1Controller.java similarity index 95% rename from wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestParam1Controller.java rename to wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestParam1Controller.java index 09445a103..1eca8933b 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestParam1Controller.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestParam1Controller.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.warlock.controller.other; +package pro.fessional.wings.warlock.app.controller; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.logging.LogLevel; diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/TestToyApiController.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestToyApiController.java similarity index 96% rename from wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/TestToyApiController.java rename to wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestToyApiController.java index dd1971cae..7cb75e7cb 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/TestToyApiController.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestToyApiController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.warlock.controller.api; +package pro.fessional.wings.warlock.app.controller; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -20,7 +20,8 @@ import pro.fessional.wings.slardar.context.TerminalContext; import pro.fessional.wings.slardar.httprest.okhttp.OkHttpTokenizeOauth; import pro.fessional.wings.slardar.spring.prop.SlardarSessionProp; -import pro.fessional.wings.warlock.service.watching.WatchingService; +import pro.fessional.wings.warlock.controller.api.AbstractApiAuthController; +import pro.fessional.wings.warlock.app.service.WatchingService; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestTweakController.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestTweakController.java similarity index 95% rename from wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestTweakController.java rename to wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestTweakController.java index 40f524b15..c561cf106 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/other/TestTweakController.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/controller/TestTweakController.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.warlock.controller.other; +package pro.fessional.wings.warlock.app.controller; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.GetMapping; diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/watching/WatchingService.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/service/WatchingService.java similarity index 98% rename from wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/watching/WatchingService.java rename to wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/service/WatchingService.java index 70ff177cb..2f8c40eaf 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/watching/WatchingService.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/app/service/WatchingService.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.warlock.service.watching; +package pro.fessional.wings.warlock.app.service; import lombok.Setter; import lombok.extern.slf4j.Slf4j; diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/ApiAuthControllerTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/ApiAuthControllerTest.java index aca81aef1..a4483b5e7 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/ApiAuthControllerTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/ApiAuthControllerTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.warlock.controller.api; import com.alibaba.fastjson2.JSON; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.HttpUrl; @@ -22,7 +23,7 @@ import pro.fessional.wings.slardar.context.Now; import pro.fessional.wings.slardar.httprest.okhttp.OkHttpClientHelper; import pro.fessional.wings.warlock.service.auth.WarlockOauthService; -import pro.fessional.wings.warlock.service.watching.WatchingService; +import pro.fessional.wings.warlock.app.service.WatchingService; import pro.fessional.wings.warlock.spring.prop.WarlockApiAuthProp; import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp; @@ -36,19 +37,19 @@ import static org.springframework.http.HttpHeaders.CONTENT_DISPOSITION; import static pro.fessional.wings.slardar.httprest.okhttp.OkHttpMediaType.APPLICATION_JSON_VALUE; import static pro.fessional.wings.slardar.httprest.okhttp.OkHttpMediaType.MULTIPART_FORM_DATA_VALUE; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ApiSimple; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ModFileFile; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ModJsonFile; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ModJsonJson; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ReqFileBody; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ReqFileKey; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ReqFileName; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ReqJsonBody; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ReqMethod; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ResFileBody; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ResFileName; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.ResJsonBody; -import static pro.fessional.wings.warlock.controller.api.TestToyApiController.TerUserId; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ApiSimple; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ModFileFile; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ModJsonFile; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ModJsonJson; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ReqFileBody; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ReqFileKey; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ReqFileName; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ReqJsonBody; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ReqMethod; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ResFileBody; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ResFileName; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.ResJsonBody; +import static pro.fessional.wings.warlock.app.controller.TestToyApiController.TerUserId; /** * @author trydofor @@ -125,6 +126,7 @@ private String getToken() { } @Test + @TmsLink("C14024") public void testJsonJson() throws IOException { String[] clients = {client, getToken()}; String[] timestamps = {String.valueOf(Now.millis()), Null.Str}; @@ -196,6 +198,7 @@ private void jsonJson(String client, String timestamp, Function } @Test + @TmsLink("C14025") public void testFileJson() throws IOException { String[] clients = {client, getToken()}; String[] timestamps = {String.valueOf(Now.millis()), Null.Str}; @@ -277,6 +280,7 @@ private void fileJson(String client, String timestamp, Function @Test + @TmsLink("C14026") public void testJsonFile() throws IOException { String[] clients = {client, getToken()}; String[] timestamps = {String.valueOf(Now.millis()), Null.Str}; @@ -362,6 +366,7 @@ private void jsonFile(String client, String timestamp, Function } @Test + @TmsLink("C14027") public void testFileFile() throws IOException { String[] clients = {client, getToken()}; String[] timestamps = {String.valueOf(Now.millis()), Null.Str}; diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/OkHttpTokenizeTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/OkHttpTokenizeTest.java index 56b3756ec..1c6a8c78e 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/OkHttpTokenizeTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/OkHttpTokenizeTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.controller.api; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.OkHttpClient; @@ -43,6 +44,7 @@ class OkHttpTokenizeTest { private final String secret = "wings-trydofor-secret"; @Test + @TmsLink("C14028") public void testOauthAuthorizationCode() { OkHttpTokenizeOauth tokenize = new OkHttpTokenizeOauth(); tokenize.setClientId(client); @@ -65,6 +67,7 @@ public void testOauthAuthorizationCode() { } @Test + @TmsLink("C14029") public void testOauthClientCredentials() { OkHttpTokenizeOauth tokenize = new OkHttpTokenizeOauth(); tokenize.setClientId(client); @@ -84,6 +87,7 @@ public void testOauthClientCredentials() { } @Test + @TmsLink("C14030") public void testFormLogin() { OkHttpTokenizeLogin tokenize = new OkHttpTokenizeLogin(); tokenize.setLoginUrl(host + "/auth/username/login.json"); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/auth/SimpleOauthControllerTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/auth/SimpleOauthControllerTest.java index dc905d875..9f10bd825 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/auth/SimpleOauthControllerTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/auth/SimpleOauthControllerTest.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -46,6 +47,7 @@ class SimpleOauthControllerTest { final String state = RandCode.human(16); @Test + @TmsLink("C14031") void authorizationCode() throws Exception { final MvcResult authResult = mvc.perform(get(warlockUrlmapProp.getOauthAuthorize()) .contentType(MediaType.APPLICATION_JSON) @@ -87,6 +89,7 @@ void authorizationCode() throws Exception { } @Test + @TmsLink("C14032") void clientCredentials() throws Exception { final String code1 = accessToken(clientId, clientSecret, null, null); Assertions.assertNotNull(code1); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Md5HmacSha256Test.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Md5HmacSha256Test.java index 66becc76e..3dcab804b 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Md5HmacSha256Test.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Md5HmacSha256Test.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.other; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Test; import pro.fessional.mirana.bits.HmacHelp; import pro.fessional.mirana.bits.Md5; @@ -17,6 +18,7 @@ public class Md5HmacSha256Test { @Test + @TmsLink("C14033") public void postJson() { final TreeMap queryString = new TreeMap<>(); queryString.put("query", "string"); // normal param @@ -58,6 +60,7 @@ public void postJson() { } @Test + @TmsLink("C14034") public void postFile() { final TreeMap queryString = new TreeMap<>(); queryString.put("query", "string"); // normal param diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Param1ControllerTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Param1ControllerTest.java index 9ee5a4092..a27a99e61 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Param1ControllerTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/Param1ControllerTest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.OkHttpClient; @@ -37,6 +38,7 @@ public class Param1ControllerTest { final LocalDateTime ldt = LocalDateTime.of(2021, 6, 6, 6, 6, 6); @Test + @TmsLink("C14035") public void testMvc() throws JsonProcessingException { testMvc("/test/param1/str.json", objectMapper.writeValueAsString("string"), "\"string\""); testMvc("/test/param1/str.json", "\"string\"", "\"string\""); @@ -69,6 +71,7 @@ public void testMvc() throws JsonProcessingException { * fastjson=["2021-06-06 06:06:06"], jackson=["2021-06-06 06:06:06"] */ @Test + @TmsLink("C14036") public void testObj() throws JsonProcessingException { testObj("string", "\"string\""); testObj(123, "123", "\"123\""); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/WarlockWatchingTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/WarlockWatchingTest.java index eb6004394..7c807edd9 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/WarlockWatchingTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/other/WarlockWatchingTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.other; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.OkHttpClient; @@ -13,7 +14,7 @@ import pro.fessional.mirana.time.StopWatch; import pro.fessional.wings.silencer.watch.Watches; import pro.fessional.wings.slardar.httprest.okhttp.OkHttpClientHelper; -import pro.fessional.wings.warlock.service.watching.WatchingService; +import pro.fessional.wings.warlock.app.service.WatchingService; /** * @author trydofor @@ -39,6 +40,7 @@ public class WarlockWatchingTest { * Check the log */ @Test + @TmsLink("C14037") public void testWatching() { final StopWatch.Watch watch = Watches.acquire("testWatching"); final Request.Builder body = new Request.Builder().url(host + "/test/watching.json"); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny302Test.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny302Test.java index b2c54b15b..a5095c422 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny302Test.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny302Test.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.security; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -25,6 +26,7 @@ class AccessDeny302Test { private String host; @Test + @TmsLink("C14039") public void test302() { RestTemplate tmpl = new RestTemplate(); RequestEntity entity = RequestEntity diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny401Test.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny401Test.java index 5de048400..552e3cc07 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny401Test.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny401Test.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.security; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -32,6 +33,7 @@ class AccessDeny401Test { .build(); @Test + @TmsLink("C14040") public void test401Form() { final String url = host + "/user/authed-user.json"; RequestEntity entity = RequestEntity @@ -46,7 +48,9 @@ public void test401Form() { Assertions.assertNotNull(body); Assertions.assertTrue(body.contains("success")); } + @Test + @TmsLink("C14041") public void test401Basic() { final String url = host + "/user/authed-user.json"; RequestEntity entity = RequestEntity diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny403Test.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny403Test.java index ca90db480..71d17b8a8 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny403Test.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny403Test.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.security; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.HttpUrl; @@ -33,6 +34,7 @@ class AccessDeny403Test { private OkHttpClient okHttpClient; @Test + @TmsLink("C14042") public void testAnonymous() { final RestTemplate tmpl = new RestTemplate(); @@ -84,6 +86,7 @@ public void testAnonymous() { * system.perm.create */ @Test + @TmsLink("C14043") public void testLogin() { OkHttpClientHelper.clearCookie(okHttpClient, HttpUrl.get(host)); final Response r0 = OkHttpClientHelper.execute(okHttpClient, new Request.Builder() @@ -121,6 +124,7 @@ public void testLogin() { } @Test + @TmsLink("C14044") public void testLogout() { OkHttpClientHelper.clearCookie(okHttpClient, HttpUrl.get(host)); final Response r0 = OkHttpClientHelper.execute(okHttpClient, new Request.Builder() diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/GuestSessionTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/GuestSessionTest.java index 05b321799..cfc97fbb1 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/GuestSessionTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/GuestSessionTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.security; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.HttpUrl; @@ -31,6 +32,7 @@ class GuestSessionTest { private OkHttpClient okHttpClient; @Test + @TmsLink("C14045") public void guestSession() { final Response r1 = OkHttpClientHelper.execute(okHttpClient, new Request.Builder().url(host + "/test/guest-session.json"), false); String s1 = OkHttpClientHelper.extractString(r1, false); @@ -41,6 +43,7 @@ public void guestSession() { } @Test + @TmsLink("C14046") public void guest401() { OkHttpClientHelper.clearCookie(okHttpClient, HttpUrl.get(host)); try (final Response r1 = OkHttpClientHelper.execute(okHttpClient, new Request.Builder().url(host + "/user/guest-401.json"), false)) { diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/MemLoginTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/MemLoginTest.java index 2cb665724..4cab3788a 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/MemLoginTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/MemLoginTest.java @@ -2,6 +2,7 @@ import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.TypeReference; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.HttpUrl; @@ -41,6 +42,7 @@ class MemLoginTest { @Test @Order(1) + @TmsLink("C14047") public void testUsernameLogin() { OkHttpClientHelper.clearCookie(okHttpClient, HttpUrl.get(host)); final Response r2 = OkHttpClientHelper.execute(okHttpClient, new Request.Builder() @@ -76,6 +78,7 @@ public void testUsernameLogin() { @Test @Order(2) + @TmsLink("C14048") public void testEmailLogin() { OkHttpClientHelper.clearCookie(okHttpClient, HttpUrl.get(host)); final Response r2 = OkHttpClientHelper.execute(okHttpClient, new Request.Builder() @@ -109,6 +112,7 @@ public void testEmailLogin() { @Test @Order(3) + @TmsLink("C14049") public void testListSession() { final String r4 = OkHttpClientHelper.postJson(okHttpClient, host + "/user/list-session.json", ""); log.info("list-session auth4={}", r4); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/NonceLoginTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/NonceLoginTest.java index a46e187b7..cccfedc47 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/NonceLoginTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/NonceLoginTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.security; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import okhttp3.OkHttpClient; @@ -30,6 +31,7 @@ class NonceLoginTest { private OkHttpClient okHttpClient; @Test + @TmsLink("C14050") public void testTestNyLogin() { final Response r1 = OkHttpClientHelper.execute(okHttpClient, new Request.Builder().url(host + "/auth/console-nonce.json?username=test_ny"), false); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/SafeHttpHelperTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/SafeHttpHelperTest.java index 4085bf7b8..63e4707ed 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/SafeHttpHelperTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/SafeHttpHelperTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.security; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -13,6 +14,7 @@ class SafeHttpHelperTest { @Test + @TmsLink("C14051") void isSafeRedirect() { Set hosts = Set.of("localhost", "[107:0:0:0:200:7051]"); Assertions.assertFalse(SafeHttpHelper.isSafeRedirect("", hosts)); @@ -34,6 +36,7 @@ void isSafeRedirect() { } @Test + @TmsLink("C14052") void parseHostPort() { Assertions.assertNull(SafeHttpHelper.parseHostPort("localhost")); Assertions.assertEquals("localhost", SafeHttpHelper.parseHostPort("http://localhost")); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/justauth/AuthStateBuilderTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/justauth/AuthStateBuilderTest.java index cf61579bf..681d5e3a4 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/justauth/AuthStateBuilderTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/justauth/AuthStateBuilderTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.security.justauth; +import io.qameta.allure.TmsLink; import jakarta.servlet.http.HttpServletRequest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -26,6 +27,7 @@ public void setup() { } @Test + @TmsLink("C14038") public void test() { final HttpServletRequest request = mock(HttpServletRequest.class); when(request.getParameterMap()).thenReturn(Map.of(ParamState, new String[] {"/login", "http://localhost:8080"})); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/PasswordEncoderTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/PasswordEncoderTest.java index b51be1855..85546708a 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/PasswordEncoderTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/PasswordEncoderTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.auth; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Disabled; @@ -26,6 +27,7 @@ class PasswordEncoderTest { private PasssaltEncoder passsaltEncoder; @Test + @TmsLink("C14053") @Disabled("Output password to the log") void printPassword() { final String md5h = Md5.sum("moilioncircle"); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/WarlockTicketServiceTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/WarlockTicketServiceTest.java index e7b87bd01..eff7f3c98 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/WarlockTicketServiceTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/WarlockTicketServiceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.auth; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import pro.fessional.wings.warlock.service.auth.WarlockTicketService.SimpleTerm; @@ -11,8 +12,8 @@ */ class WarlockTicketServiceTest { - @Test + @TmsLink("C14054") public void testTerm() { Term t0 = new SimpleTerm(); t0.setUserId(10086L); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/flakeid/impl/FlakeIdHazelcastImplTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/flakeid/impl/FlakeIdHazelcastImplTest.java index d4cbd3b4a..b3f890ba4 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/flakeid/impl/FlakeIdHazelcastImplTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/flakeid/impl/FlakeIdHazelcastImplTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.flakeid.impl; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -28,6 +29,7 @@ class FlakeIdHazelcastImplTest { private FlakeIdService flakeIdService; @Test + @TmsLink("C14055") void getId() throws InterruptedException { assertTrue(flakeIdService instanceof FlakeIdHazelcastImpl); val threadCnt = 100; diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/grant/PermGrantHelperTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/grant/PermGrantHelperTest.java index bb241aae3..7b9cedae6 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/grant/PermGrantHelperTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/grant/PermGrantHelperTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.warlock.service.grant; import com.google.common.collect.Sets; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Test; import java.util.Arrays; @@ -21,6 +22,7 @@ class PermGrantHelperTest { @Test + @TmsLink("C14056") void canInherit() { assertTrue(PermGrantHelper.canInherit("*", "read")); assertTrue(PermGrantHelper.canInherit(".*", "system.read")); @@ -31,6 +33,7 @@ void canInherit() { } @Test + @TmsLink("C14057") void grantRole() { Map roleMap = new HashMap<>(); roleMap.put(1L, "ROLE_1"); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/AllLightIdProviderPerformTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/AllLightIdProviderPerformTest.java index a65db73c0..c75c4b027 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/AllLightIdProviderPerformTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/AllLightIdProviderPerformTest.java @@ -1,6 +1,7 @@ package pro.fessional.wings.warlock.service.lightid.impl; import com.hazelcast.core.HazelcastInstance; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -31,18 +32,21 @@ public class AllLightIdProviderPerformTest { private HazelcastInstance hazelcastInstance; @Test + @TmsLink("C14058") public void testJvm() { // avg=0.039ms test(new LightIdBufferedProvider(lightIdLoader), 1000); } @Test + @TmsLink("C14059") public void testHz() { // avg=1.065ms test(new HazelcastLightIdProvider(lightIdLoader, hazelcastInstance), 1000); } @Test + @TmsLink("C14060") public void testDb() { // avg=10.723ms, 5ms per sql test(new BlockingLightIdProvider(lightIdLoader), 1000); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/DbLightIdProviderTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/DbLightIdProviderTest.java index 2d1dce93d..0b185732e 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/DbLightIdProviderTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/DbLightIdProviderTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.lightid.impl; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -21,6 +22,7 @@ public class DbLightIdProviderTest { protected LightIdProvider lightIdProvider; @Test + @TmsLink("C14061") public void test() { Assertions.assertInstanceOf(BlockingLightIdProvider.class, lightIdProvider); } diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/HzLightIdProviderTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/HzLightIdProviderTest.java index 7144b699d..ae7a119d5 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/HzLightIdProviderTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/HzLightIdProviderTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.lightid.impl; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -20,6 +21,7 @@ public class HzLightIdProviderTest { protected LightIdProvider lightIdProvider; @Test + @TmsLink("C14062") public void test() { Assertions.assertInstanceOf(HazelcastLightIdProvider.class, lightIdProvider); } diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/JvmLightIdProviderTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/JvmLightIdProviderTest.java index 7c89da9fe..7d6563d97 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/JvmLightIdProviderTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/JvmLightIdProviderTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.lightid.impl; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -21,6 +22,7 @@ public class JvmLightIdProviderTest { protected LightIdProvider lightIdProvider; @Test + @TmsLink("C14063") public void test() { Assertions.assertInstanceOf(LightIdBufferedProvider.class, lightIdProvider); } diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheListenerTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheListenerTest.java index 07dfec4e0..65155a30a 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheListenerTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheListenerTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.perm; +import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Disabled; @@ -21,6 +22,7 @@ class WarlockPermCacheListenerTest { private WarlockRoleService warlockRoleService; @Test + @TmsLink("C14064") @Disabled("Simulate slow processing and observe cache changes") void cleanCache() throws InterruptedException { log.warn("No cache, select Perm from Db"); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermNormalizerTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermNormalizerTest.java index c3dae61a4..3825b95a5 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermNormalizerTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermNormalizerTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.service.perm; +import io.qameta.allure.TmsLink; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -10,6 +11,7 @@ class WarlockPermNormalizerTest { @Test + @TmsLink("C14065") void normalize() { WarlockPermNormalizer normalizer = new WarlockPermNormalizer(); Assertions.assertEquals("ROLE_root", normalizer.role("root")); diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfigurationTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfigurationTest.java index eb67900f1..39bf6cc2b 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfigurationTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfigurationTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.spring.bean; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -19,6 +20,7 @@ class WarlockJournalConfigurationTest { protected JournalService journalService; @Test + @TmsLink("C14066") void terminalJournalService() { Assertions.assertTrue(journalService instanceof TerminalJournalService); } diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/webmvc/BindExceptionAdviceTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/webmvc/BindExceptionAdviceTest.java index 1415bfc10..ad2d94de5 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/webmvc/BindExceptionAdviceTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/webmvc/BindExceptionAdviceTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.webmvc; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -25,7 +26,8 @@ public class BindExceptionAdviceTest { private MockMvc mockMvc; @Test - public void bindingErrorFrom() throws Exception { + @TmsLink("C14067") + public void bindingErrorName() throws Exception { mockMvc.perform(post("/test/binding-error-from.json") .header("Accept-Language", "en_US") .contentType(MediaType.APPLICATION_FORM_URLENCODED) @@ -37,6 +39,7 @@ public void bindingErrorFrom() throws Exception { } @Test + @TmsLink("C14068") public void bindingErrorEmail() throws Exception { mockMvc.perform(post("/test/binding-error-from.json") .header("Accept-Language", "en_US") @@ -49,6 +52,7 @@ public void bindingErrorEmail() throws Exception { } @Test + @TmsLink("C14069") public void bindingErrorJson() throws Exception { mockMvc.perform(post("/test/binding-error-json.json") .header("Accept-Language", "en_US") @@ -60,6 +64,7 @@ public void bindingErrorJson() throws Exception { @SuppressWarnings("all") @Test + @TmsLink("C14070") public void bindingErrorJsonBad() throws Exception { mockMvc.perform(post("/test/binding-error-json.json") .header("Accept-Language", "en_US") diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/webmvc/CodeExceptionHandlerTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/webmvc/CodeExceptionHandlerTest.java index 7677360ad..8bf407f11 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/webmvc/CodeExceptionHandlerTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/webmvc/CodeExceptionHandlerTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.webmvc; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -23,6 +24,7 @@ public class CodeExceptionHandlerTest { private MockMvc mockMvc; @Test + @TmsLink("C14071") public void testCodeExceptionEn() throws Exception { mockMvc.perform(get("/test/code-exception.json") .header("Accept-Language", "en_US")) @@ -31,6 +33,7 @@ public void testCodeExceptionEn() throws Exception { } @Test + @TmsLink("C14072") public void testCodeExceptionCn() throws Exception { mockMvc.perform(get("/test/code-exception.json") .header("Accept-Language", "zh_CN")) @@ -39,6 +42,7 @@ public void testCodeExceptionCn() throws Exception { } @Test + @TmsLink("C14073") public void testMessageExceptionEn() throws Exception { mockMvc.perform(get("/test/message-exception.json") .header("Accept-Language", "en_US")) @@ -47,6 +51,7 @@ public void testMessageExceptionEn() throws Exception { } @Test + @TmsLink("C14074") public void testMessageExceptionCn() throws Exception { mockMvc.perform(get("/test/message-exception.json") .header("Accept-Language", "zh_CN")) @@ -55,6 +60,7 @@ public void testMessageExceptionCn() throws Exception { } @Test + @TmsLink("C14075") public void testFutureExceptionCn() throws Exception { mockMvc.perform(get("/test/future-exception.json") .header("Accept-Language", "zh_CN")) diff --git a/wings/warlock-test/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockTestAutoConfiguration.java b/wings/warlock-test/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockTestAutoConfiguration.java deleted file mode 100644 index a0973d642..000000000 --- a/wings/warlock-test/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockTestAutoConfiguration.java +++ /dev/null @@ -1,18 +0,0 @@ -package pro.fessional.wings.warlock.spring.conf; - -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.context.annotation.ComponentScan; - -/** - * @author trydofor - * @since 2022-01-29 - */ -@SuppressWarnings("SpringComponentScan") -@AutoConfiguration -@ComponentScan({ - "pro.fessional.wings.warlock.helper", - "pro.fessional.wings.warlock.service", - "pro.fessional.wings.warlock.controller", -}) -public class WarlockTestAutoConfiguration { -} diff --git a/wings/warlock-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/warlock-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports deleted file mode 100644 index 576328cf5..000000000 --- a/wings/warlock-test/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ /dev/null @@ -1 +0,0 @@ -pro.fessional.wings.warlock.spring.conf.WarlockTestAutoConfiguration diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/event/impl/WingsTableCudHandlerImpl.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/event/impl/WingsTableCudHandlerImpl.java index 0530486eb..0d32754e7 100644 --- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/event/impl/WingsTableCudHandlerImpl.java +++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/event/impl/WingsTableCudHandlerImpl.java @@ -17,11 +17,14 @@ * @author trydofor * @since 2021-06-19 */ -@Slf4j public class WingsTableCudHandlerImpl implements WingsTableCudHandler { +@Slf4j +public class WingsTableCudHandlerImpl implements WingsTableCudHandler { - @Setter(onMethod_ = {@Autowired}) protected TableChangePublisher tableChangePublisher; + @Setter(onMethod_ = {@Autowired}) + protected TableChangePublisher tableChangePublisher; - @Getter protected final LinkedHashMap, Auto> autoMap = new LinkedHashMap<>(); + @Getter + protected final LinkedHashMap, Auto> autoMap = new LinkedHashMap<>(); @Override public void register(@NotNull Auto auto) { @@ -32,7 +35,7 @@ public void register(@NotNull Auto auto) { public void handle(@NotNull Class source, @NotNull Cud cud, @NotNull String table, @NotNull Supplier>> field) { for (Auto auto : autoMap.values()) { if (auto.accept(source, cud, table)) { - log.debug("skip handle, source={}, cud={}, table={}", source, cud, table); + log.debug("skip auto handled, source={}, cud={}, table={}", source, cud, table); return; } } diff --git a/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java b/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java index 0195af9dc..b9fb6eaaa 100644 --- a/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java +++ b/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock; +import io.qameta.allure.TmsLink; import lombok.Setter; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -36,6 +37,7 @@ public class BootDatabaseTest { private SchemaRevisionManager schemaRevisionManager; @Test + @TmsLink("C14007") void testDropAndInit() { JdbcTemplate tmpl = new JdbcTemplate(dataSource); tmpl.query("SHOW TABLES", rs -> { diff --git a/wings/warlock/src/test/java/pro/fessional/wings/warlock/database/jooq/converter/JooqJournalDiffConverterTest.java b/wings/warlock/src/test/java/pro/fessional/wings/warlock/database/jooq/converter/JooqJournalDiffConverterTest.java index 5987dee66..a4a65802c 100644 --- a/wings/warlock/src/test/java/pro/fessional/wings/warlock/database/jooq/converter/JooqJournalDiffConverterTest.java +++ b/wings/warlock/src/test/java/pro/fessional/wings/warlock/database/jooq/converter/JooqJournalDiffConverterTest.java @@ -1,5 +1,6 @@ package pro.fessional.wings.warlock.database.jooq.converter; +import io.qameta.allure.TmsLink; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -17,6 +18,7 @@ class JooqJournalDiffConverterTest { @Test + @TmsLink("C14001") void to() { JournalDiff d0 = new JournalDiff(); d0.setTable("test_table"); diff --git a/wings/warlock/src/test/java/pro/fessional/wings/warlock/other/ResultTest.java b/wings/warlock/src/test/java/pro/fessional/wings/warlock/other/ResultSerializeTest.java similarity index 96% rename from wings/warlock/src/test/java/pro/fessional/wings/warlock/other/ResultTest.java rename to wings/warlock/src/test/java/pro/fessional/wings/warlock/other/ResultSerializeTest.java index 8321314a1..7bc6eaf1f 100644 --- a/wings/warlock/src/test/java/pro/fessional/wings/warlock/other/ResultTest.java +++ b/wings/warlock/src/test/java/pro/fessional/wings/warlock/other/ResultSerializeTest.java @@ -5,6 +5,7 @@ import com.esotericsoftware.kryo.io.ByteBufferInput; import com.esotericsoftware.kryo.io.Output; import com.fasterxml.jackson.databind.ObjectMapper; +import io.qameta.allure.TmsLink; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Assertions; @@ -27,9 +28,10 @@ * @since 2021-07-08 */ @Slf4j -public class ResultTest { +public class ResultSerializeTest { @Test + @TmsLink("C14002") public void testZoneid() { final int totalSeconds = ZonedDateTime.now(ThreadNow.sysZoneId()).getOffset().getTotalSeconds(); log.info("{}", totalSeconds); @@ -40,6 +42,7 @@ public void testZoneid() { @SuppressWarnings("Convert2Diamond") @SneakyThrows @Test + @TmsLink("C14003") public void testJackson() { final R r1 = R .ok() @@ -60,6 +63,7 @@ public void testJackson() { @SneakyThrows @Test + @TmsLink("C14004") public void testFastjson() { final R r1 = R .ok() @@ -86,6 +90,7 @@ public void testFastjson() { @SuppressWarnings("unchecked") @SneakyThrows @Test + @TmsLink("C14005") public void testKryo() { final R r1 = R .ok() @@ -108,6 +113,7 @@ public void testKryo() { @SuppressWarnings("unchecked") @SneakyThrows @Test + @TmsLink("C14006") public void testSerial() { final R r1 = R .ok() From 33a986eb3d52852f83e5d330cfe2ea0abf07cd11 Mon Sep 17 00:00:00 2001 From: trydofor Date: Fri, 27 Oct 2023 09:32:23 +0800 Subject: [PATCH 05/23] =?UTF-8?q?=F0=9F=93=9D=20changelog=20of=20#142?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 30 +++--------------------------- observe/docs | 2 +- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/changelog.md b/changelog.md index 62f0c0b07..01afd6cf1 100644 --- a/changelog.md +++ b/changelog.md @@ -2,37 +2,13 @@ # WingsBoot Changelog -Help Yourself, Check [Commits] +Help Yourself [Commits] and [History] ## Migrating and Changelog -- notable [Changes] in Docs +Notable [Changes] in [WingsDoc] -## 3.x. Roadmap - -- stable api - -## 3.0.3.300-SNAPSHOT [Current] - -- spring-boot 3.0.3 -- Jakarta EE 9+ -- java 17 -- jooq 3.17.x - -## 2.7.7.220-SNAPSHOT [Temporary] - -- spring-boot 2.7.7 💥 OkHttp, Hazelcast, Cache2k - -## 2.6.6.210-SNAPSHOT [History] - -- java 11 - -## 2.4.2.x-SNAPSHOT [History] - -- java 8 - -[Current]: https://github.com/trydofor/pro.fessional.wings [History]: https://github.com/trydofor/pro.fessional.wings/tags -[Temporary]: https://github.com/trydofor/pro.fessional.wings/tags [Commits]: https://github.com/trydofor/pro.fessional.wings/commits/develop [Changes]: https://wings.fessional.pro/9-example/9a.wings-change/ +[WingsDoc]: https://wings.fessional.pro/ diff --git a/observe/docs b/observe/docs index 0e7b1770d..a3097b641 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit 0e7b1770d87a87643f5ae37eac56f6977ebe3297 +Subproject commit a3097b641c746673e7a5052425c26855b35f02a6 From fd4a97a587782b05b48d2e414b35e5d272824f18 Mon Sep 17 00:00:00 2001 From: trydofor Date: Fri, 27 Oct 2023 13:39:00 +0800 Subject: [PATCH 06/23] =?UTF-8?q?=E2=9C=A8=20WingsSpringBeanScanner=20cust?= =?UTF-8?q?omize=20paths=20#146?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WingsBoot.t.md | 1 + observe/docs | 2 +- observe/mirana | 2 +- .../bean/SilencerRunnerConfiguration.java | 2 + .../spring/boot/WingsSpringBeanScanner.java | 69 +++++++++++++------ .../spring/prop/SilencerScannerProp.java | 26 +++++++ .../wings-conf/wings-scanner-79.properties | 3 + .../silencer/scanner/bean/TestBeanScan.java | 14 ++++ .../scanner/noscan/TestBeanNoScan.java | 14 ++++ .../boot/WingsSpringBeanScannerTest.java | 41 +++++++++++ 10 files changed, 150 insertions(+), 24 deletions(-) create mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerScannerProp.java create mode 100644 wings/silencer/src/main/resources/wings-conf/wings-scanner-79.properties create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/scanner/bean/TestBeanScan.java create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/scanner/noscan/TestBeanNoScan.java create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java diff --git a/WingsBoot.t.md b/WingsBoot.t.md index 2e4bccdd8..28ab79cae 100644 --- a/WingsBoot.t.md +++ b/WingsBoot.t.md @@ -28,6 +28,7 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m * 11022 SilenceDebugTest: tweak logback logger * 11023 StringMapXmlWriterTest: jaxb object to Map object * 11024 StringMapXmlWriterTest: jaxb object to xml string +* 11025 WingsSpringBeanScannerTest: with/without scanning ## 12 Faceless diff --git a/observe/docs b/observe/docs index a3097b641..b51099218 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit a3097b641c746673e7a5052425c26855b35f02a6 +Subproject commit b510992189a328cafdb2b8e44157b0a48ba6722c diff --git a/observe/mirana b/observe/mirana index 25c2ba954..ac2154191 160000 --- a/observe/mirana +++ b/observe/mirana @@ -1 +1 @@ -Subproject commit 25c2ba954784cfe421ce9b13ea8cbc829383ab2a +Subproject commit ac2154191129b2380ce6ad122bf36015d15372a1 diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java index 061fd2554..d7bcd5929 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java @@ -18,6 +18,7 @@ import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner; import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp; import pro.fessional.wings.silencer.spring.prop.SilencerI18nProp; +import pro.fessional.wings.silencer.spring.prop.SilencerScannerProp; import java.util.Map; @@ -32,6 +33,7 @@ @EnableConfigurationProperties({ SilencerEnabledProp.class, SilencerI18nProp.class, + SilencerScannerProp.class, }) public class SilencerRunnerConfiguration { diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScanner.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScanner.java index 4fd658eaa..d2332106c 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScanner.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScanner.java @@ -7,18 +7,23 @@ import org.springframework.context.ApplicationListener; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.ClassPathBeanDefinitionScanner; +import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import pro.fessional.mirana.cast.StringCastUtil; +import pro.fessional.mirana.data.Null; +import pro.fessional.mirana.text.WhiteUtil; import pro.fessional.wings.silencer.spring.help.ApplicationContextHelper; import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp; +import pro.fessional.wings.silencer.spring.prop.SilencerScannerProp; import java.io.IOException; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.Map; /** - * Automatically load the configuration that matches `**/spring/bean/**/*.class` + * Automatically scan component from `**/spring/bean/**/*.class` on ApplicationPreparedEvent * * @author trydofor * @since 2019-07-11 @@ -27,8 +32,6 @@ public class WingsSpringBeanScanner implements ApplicationListener pks = new LinkedHashSet<>(); + for (String s : bns) { + s = WhiteUtil.trim(s, '/'); + if (s.isBlank()) continue; + if (s.contains("*")) throw new IllegalArgumentException("Wings bean MUST be plain path, NOT contain `*`, path=" + s); + pks.add(s); + } + + if (pks.isEmpty()) { + log.info("Wings bean scanner is empty, skip it."); + return; + } + final LinkedHashMap pathPackage = new LinkedHashMap<>(); final PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); final ClassLoader loader = resolver.getClassLoader(); + long start = System.currentTimeMillis(); + String curPkg = null; try { - Resource[] resources = resolver.getResources("classpath*:/" + WINGS_BEAN); - log.info("Wings scanned " + resources.length + " resources of */spring/bean/*"); - for (Resource res : resources) { - try { - String path = res.getURL().getPath(); - guessClassPackage(pathPackage, path, loader); - } - catch (IOException e) { - log.warn("failed to parse package name of res=" + res.getDescription()); + long stt = start; + for (String pk : pks) { + curPkg = pk; + Resource[] resources = resolver.getResources("classpath*:/**/" + pk + "/**/*.class"); + for (Resource res : resources) { + try { + String path = res.getURL().getPath(); + guessClassPackage(pathPackage, path, loader, pk); + } + catch (IOException e) { + log.warn("failed to parse package name of res=" + res.getDescription()); + } } + long end = System.currentTimeMillis(); + log.info("Wings scanned " + resources.length + " resources of /**/" + pk + "/**/, cost " + (end - stt) + " ms"); + stt = end; } } catch (IOException e) { - log.warn("failed to scan /spring/bean/*.class", e); + log.warn("failed to scan " + curPkg, e); } if (pathPackage.isEmpty()) { return; } - String[] basePackages = new String[pathPackage.size()]; - int idx = 0; - for (String pkg : pathPackage.values()) { - log.info("Wings add scan component base package=" + pkg); - basePackages[idx++] = pkg; - } + String[] basePackages = pathPackage.values().toArray(String[]::new); // + log.info("Wings scan component base-package = " + String.join(",", basePackages)); ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner((BeanDefinitionRegistry) context); scanner.scan(basePackages); + log.info("Wings scanned component, total cost " + (System.currentTimeMillis() - start) + " ms"); } // /////////////// - private void guessClassPackage(Map map, String path, ClassLoader loader) { + private void guessClassPackage(Map map, String path, ClassLoader loader, String pkg) { - int ps = path.lastIndexOf("/spring/bean/"); + int ps = path.lastIndexOf(pkg); for (String s : map.keySet()) { if (path.startsWith(s)) { return; diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerScannerProp.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerScannerProp.java new file mode 100644 index 000000000..6e9c509f8 --- /dev/null +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerScannerProp.java @@ -0,0 +1,26 @@ +package pro.fessional.wings.silencer.spring.prop; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.Collections; +import java.util.List; + +/** + * @author trydofor + * @since 2023-10-27 + */ +@Data +@ConfigurationProperties(SilencerScannerProp.Key) +public class SilencerScannerProp { + + public static final String Key = "wings.silencer.scanner"; + + /** + * scan component from `**/spring/bean/**/*.class` on ApplicationPreparedEvent + * + * @see #Key$bean + */ + private List bean = Collections.emptyList(); + public static final String Key$bean = Key + ".bean"; +} diff --git a/wings/silencer/src/main/resources/wings-conf/wings-scanner-79.properties b/wings/silencer/src/main/resources/wings-conf/wings-scanner-79.properties new file mode 100644 index 000000000..03f39fe76 --- /dev/null +++ b/wings/silencer/src/main/resources/wings-conf/wings-scanner-79.properties @@ -0,0 +1,3 @@ +## scan component from `**/spring/bean/**/*.class` on ApplicationPreparedEvent +wings.silencer.scanner.bean=spring/bean + diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/scanner/bean/TestBeanScan.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/scanner/bean/TestBeanScan.java new file mode 100644 index 000000000..96a8b5073 --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/scanner/bean/TestBeanScan.java @@ -0,0 +1,14 @@ +package pro.fessional.wings.silencer.scanner.bean; + +import lombok.Data; +import org.springframework.stereotype.Component; + +/** + * @author trydofor + * @since 2023-10-27 + */ +@Component +@Data +public class TestBeanScan { + private String name = "me"; +} diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/scanner/noscan/TestBeanNoScan.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/scanner/noscan/TestBeanNoScan.java new file mode 100644 index 000000000..9823d1e60 --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/scanner/noscan/TestBeanNoScan.java @@ -0,0 +1,14 @@ +package pro.fessional.wings.silencer.scanner.noscan; + +import lombok.Data; +import org.springframework.stereotype.Component; + +/** + * @author trydofor + * @since 2023-10-27 + */ +@Component +@Data +public class TestBeanNoScan { + private String name = "me"; +} diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java new file mode 100644 index 000000000..44e00035f --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java @@ -0,0 +1,41 @@ +package pro.fessional.wings.silencer.spring.boot; + +import io.qameta.allure.TmsLink; +import lombok.Setter; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.ApplicationContext; +import pro.fessional.wings.silencer.scanner.bean.TestBeanScan; +import pro.fessional.wings.silencer.scanner.noscan.TestBeanNoScan; + +/** + * @author trydofor + * @since 2023-10-27 + */ +@SpringBootTest(properties = { + "spring.wings.silencer.enabled.scanner=true", + "wings.silencer.scanner.bean=scanner/bean, /ti12/lgd /ti12/ar//", +}) +class WingsSpringBeanScannerTest { + + @Setter(onMethod_ = {@Autowired}) + private ApplicationContext applicationContext; + + + @Test + @TmsLink("C11025") + public void test() { + applicationContext.getBean(TestBeanScan.class); + + try { + applicationContext.getBean(TestBeanNoScan.class); + Assertions.fail(); + } + catch (NoSuchBeanDefinitionException e) { + Assertions.assertTrue(true); + } + } +} \ No newline at end of file From bdc9ebf7bc33f5b655a68c76922381fe855a68af Mon Sep 17 00:00:00 2001 From: trydofor Date: Wed, 1 Nov 2023 12:35:41 +0800 Subject: [PATCH 07/23] =?UTF-8?q?=F0=9F=92=A5=20AttributeHolder,=20cache2k?= =?UTF-8?q?=20usage=20#143?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WingsBoot.t.md | 4 +- observe/docs | 2 +- observe/mirana | 2 +- pom.xml | 2 +- .../slardar/event/EventPublishHelperTest.java | 18 + .../concur/impl/FirstBloodInterceptor.java | 7 +- .../servlet/resolver/WingsLocaleResolver.java | 6 +- .../slardar/cache/cache2k/Cache2kSlot.java | 64 ---- .../slardar/cache/cache2k/WingsCache2k.java | 115 +----- .../cache/cache2k/WingsCache2kManager.java | 123 ++++++ .../wings/slardar/concur/ProgressContext.java | 71 ++-- .../slardar/concur/impl/DoubleKillAround.java | 2 +- .../slardar/context/AttributeHolder.java | 360 ++++++++++++++++++ .../context/GlobalAttributeHolder.java | 247 ------------ .../slardar/event/EventPublishHelper.java | 33 +- .../event/attr/AttributeEventListener.java | 15 + .../slardar/event/attr/AttributeRidEvent.java | 64 ++++ .../slardar/event/tweak/TweakClockEvent.java | 7 +- .../event/{ => tweak}/TweakEventListener.java | 5 +- .../slardar/event/tweak/TweakLoggerEvent.java | 8 +- .../slardar/event/tweak/TweakStackEvent.java | 8 +- .../bean/SlardarAsyncConfiguration.java | 69 ---- .../bean/SlardarCacheConfiguration.java | 3 +- .../bean/SlardarEventConfiguration.java | 107 ++++++ ...on.java => SlardarTweakConfiguration.java} | 6 +- .../spring/conf/SlardarAutoConfiguration.java | 6 +- .../spring/prop/SlardarEnabledProp.java | 8 + .../spring-wings-enabled-79.properties | 2 + .../slardar/context/AttributeHolderTest.java | 58 +++ .../context/GlobalAttributeHolderTest.java | 33 -- .../auth/impl/DefaultDaoAuthnCombo.java | 4 +- .../impl/WarlockUserAuthnServiceImpl.java | 8 +- .../impl/WarlockUserBasisServiceImpl.java | 23 +- .../session/NonceTokenSessionHelper.java | 7 +- .../auth/impl/DefaultUserAuthnAutoReg.java | 4 +- 35 files changed, 880 insertions(+), 621 deletions(-) delete mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/Cache2kSlot.java create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2kManager.java create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeHolder.java delete mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/context/GlobalAttributeHolder.java create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeRidEvent.java rename wings/slardar/src/main/java/pro/fessional/wings/slardar/event/{ => tweak}/TweakEventListener.java (94%) create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java rename wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/{SlardarTweakingConfiguration.java => SlardarTweakConfiguration.java} (89%) create mode 100644 wings/slardar/src/test/java/pro/fessional/wings/slardar/context/AttributeHolderTest.java delete mode 100644 wings/slardar/src/test/java/pro/fessional/wings/slardar/context/GlobalAttributeHolderTest.java diff --git a/WingsBoot.t.md b/WingsBoot.t.md index 28ab79cae..043015be0 100644 --- a/WingsBoot.t.md +++ b/WingsBoot.t.md @@ -181,7 +181,7 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m * 13001 TaskSchedulerTest: TtlScheduler and TtlExecutor * 13002 AutoDtoHelperTest: AutoDto in request * 13003 AutoDtoHelperTest: AutoDto in response -* 13004 GlobalAttributeHolderTest: try attr with loader +* 13004 AttributeHolderTest: try attr with loader * 13005 NowTest: tweak system clock-offset * 13006 NowTest: tweak client clock and timezone * 13007 SmartFormatterTest: print date format of pattern @@ -294,6 +294,8 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m * 13114 SpringPageHelperTest: PageRequest to PageQuery to PageRequest * 13115 WingsCookieTest: encrypt cookie in request * 13116 WingsCookieTest: encrypt cookie by forward +* 13117 AttributeHolderTest: Attribute expiry +* 13118 EventPublishHelperTest: async global AttributeRidEvent ## 14 Warlock diff --git a/observe/docs b/observe/docs index b51099218..0402ab970 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit b510992189a328cafdb2b8e44157b0a48ba6722c +Subproject commit 0402ab9707830dfae0e5c0b09edd134059217f11 diff --git a/observe/mirana b/observe/mirana index ac2154191..2f51d286b 160000 --- a/observe/mirana +++ b/observe/mirana @@ -1 +1 @@ -Subproject commit ac2154191129b2380ce6ad122bf36015d15372a1 +Subproject commit 2f51d286bbf4758b727d98dc7d128212f2e09da6 diff --git a/pom.xml b/pom.xml index 12d43dc62..64a83cb62 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ 1.10.0 2.2.3 - 2.6.0-SNAPSHOT + 2.6.4-SNAPSHOT 1.4.1-SNAPSHOT 5.3.2 2.3.3 diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java index e5c810ba2..6412afc45 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java @@ -5,7 +5,11 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; +import pro.fessional.mirana.best.TypedReg; +import pro.fessional.mirana.time.Sleep; import pro.fessional.wings.slardar.app.event.TestEvent; +import pro.fessional.wings.slardar.context.AttributeHolder; +import pro.fessional.wings.slardar.event.attr.AttributeRidEvent; /** * @author trydofor @@ -38,4 +42,18 @@ public void testAsyncSpring() { public void testAsyncGlobal() { EventPublishHelper.AsyncGlobal.publishEvent(new TestEvent("AsyncHazelcast")); } + + private final TypedReg Test1 = new TypedReg<>() {}; + + @Test + @TmsLink("C13118") + public void testAttributeRidEvent() { + AttributeHolder.putAttr(Test1, 1, "1"); + Assertions.assertEquals("1", AttributeHolder.getAttr(Test1, 1)); + AttributeRidEvent event = new AttributeRidEvent(); + event.rid(Test1, 1); + EventPublishHelper.AsyncGlobal.publishEvent(event); + Sleep.ignoreInterrupt(1000); + Assertions.assertNull(AttributeHolder.getAttr(Test1, 1)); + } } diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java index ded8b50e8..9b78f34f9 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java @@ -8,8 +8,8 @@ import org.jetbrains.annotations.NotNull; import org.springframework.web.method.HandlerMethod; import pro.fessional.wings.silencer.spring.WingsOrdered; +import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k; import pro.fessional.wings.slardar.concur.FirstBlood; -import pro.fessional.wings.slardar.concur.ProgressContext; import pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor; import java.lang.reflect.Method; @@ -23,6 +23,8 @@ public class FirstBloodInterceptor implements AutoRegisterInterceptor { public static final int ORDER = WingsOrdered.Lv4Application + 3_000; + private static final Cache Cache = WingsCache2k.builder(FirstBloodInterceptor.class, "handler", 100_000, 3600, -1).build(); + private final List handlers; @Getter @Setter @@ -48,8 +50,7 @@ public boolean preHandle(@NotNull HttpServletRequest request, for (FirstBloodHandler hd : handlers) { if (hd.accept(request, anno)) { - final Cache cache = ProgressContext.get(anno.blood()); - return hd.handle(request, response, handlerMethod, cache, anno); + return hd.handle(request, response, handlerMethod, Cache, anno); } } diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/resolver/WingsLocaleResolver.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/resolver/WingsLocaleResolver.java index bd90a3035..92159ba6f 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/resolver/WingsLocaleResolver.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/resolver/WingsLocaleResolver.java @@ -11,7 +11,7 @@ import org.springframework.web.servlet.i18n.AbstractLocaleContextResolver; import pro.fessional.mirana.i18n.LocaleResolver; import pro.fessional.mirana.i18n.ZoneIdResolver; -import pro.fessional.wings.slardar.context.GlobalAttributeHolder; +import pro.fessional.wings.slardar.context.AttributeHolder; import pro.fessional.wings.slardar.context.SecurityContextUtil; import pro.fessional.wings.slardar.context.TerminalContext; import pro.fessional.wings.slardar.security.WingsUserDetails; @@ -101,7 +101,7 @@ public TimeZoneAwareLocaleContext resolveI18nContext(HttpServletRequest request, if (locale == null) { if (details == null) { if (userId != null) { - locale = GlobalAttributeHolder.tryAttr(LocaleByUid, userId, false); + locale = AttributeHolder.tryAttr(LocaleByUid, userId, false); } } else { @@ -116,7 +116,7 @@ public TimeZoneAwareLocaleContext resolveI18nContext(HttpServletRequest request, if (timeZone == null) { if (details == null) { if (userId != null) { - final ZoneId zid = GlobalAttributeHolder.tryAttr(ZoneIdByUid, userId, false); + final ZoneId zid = AttributeHolder.tryAttr(ZoneIdByUid, userId, false); if (zid != null) { timeZone = TimeZone.getTimeZone(zid); } diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/Cache2kSlot.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/Cache2kSlot.java deleted file mode 100644 index 0ea80dc68..000000000 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/Cache2kSlot.java +++ /dev/null @@ -1,64 +0,0 @@ -package pro.fessional.wings.slardar.cache.cache2k; - -import org.cache2k.Cache; -import org.jetbrains.annotations.NotNull; - -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author trydofor - * @since 2023-01-25 - */ -public class Cache2kSlot { - - public static final Cache2kSlot H24M5 = new Cache2kSlot(24 * 3600, 5 * 60); - - private final Map> slot; - private final int step; - private final int max; - - /** - * Construct a cache slot by ttl with ConcurrentHashMap - * - * @param ttl max ttl in second - * @param step slot step in second - */ - public Cache2kSlot(int ttl, int step) { - this(new ConcurrentHashMap<>(), ttl, step); - } - - /** - * Construct a cache slot by ttl with specified Map - * - * @param slot slot map - * @param ttl max ttl in second - * @param step slot step in second - */ - public Cache2kSlot(Map> slot, int ttl, int step) { - this.slot = slot; - this.step = step; - this.max = ttl / step; - } - - /** - * Get an unbounded cache with a max ttl of 24 hours and a precision of `step` seconds, based on `second`. - * - * @param second ttl - * @return the cache - */ - @NotNull - public Cache getCache(int second) { - int slot = second / step; - - int min = 1; - if (slot <= min) { - slot = min; - } - else if (slot >= max) { - slot = max; - } - - return this.slot.computeIfAbsent(slot, k -> WingsCache2k.builder(Cache2kSlot.class, "slot" + (k * step), -1, k * step, -1).build()); - } -} diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2k.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2k.java index 6fa063af6..0a8f4c473 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2k.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2k.java @@ -1,32 +1,18 @@ package pro.fessional.wings.slardar.cache.cache2k; -import lombok.extern.slf4j.Slf4j; import org.cache2k.Cache2kBuilder; -import org.cache2k.config.CacheBuildContext; -import org.cache2k.config.Feature; import org.cache2k.config.ToggleFeature; -import org.cache2k.extra.spring.SpringCache2kCache; -import org.cache2k.extra.spring.SpringCache2kCacheManager; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import pro.fessional.wings.slardar.cache.WingsCache; -import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp; import java.time.Duration; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicLong; -import java.util.function.Function; - -import static pro.fessional.wings.slardar.spring.prop.SlardarCacheProp.inLevel; /** * @author trydofor * @since 2023-01-25 */ -@Slf4j public class WingsCache2k { public static Class FeatureJmx = initFeatureJmx(); @@ -45,7 +31,7 @@ private static Class initFeatureJmx() { public static String name(Class clz, String use) { if (clz == null) return null; - return clz.getName() + "." + use + "-" + NameCounter.getAndIncrement(); + return clz.getName() + WingsCache.Joiner + use + "-" + NameCounter.getAndIncrement(); } @NotNull @@ -92,103 +78,4 @@ public static Cache2kBuilder build(Cache2kBuilder bld, int ma return bld; } - - public static class Manager extends SpringCache2kCacheManager implements WingsCache.State { - - private final SlardarCacheProp slardarCacheProp; - private final ConcurrentHashMap nullsCache = new ConcurrentHashMap<>(); - - private final Feature levelingFeature; - private Function, Cache2kBuilder> defaultSetup = null; - - public Manager(String name, SlardarCacheProp slardarCacheProp) { - super(name == null ? DEFAULT_SPRING_CACHE_MANAGER_NAME : name); - this.slardarCacheProp = slardarCacheProp; - this.levelingFeature = new Feature() { - @Override - public void enlist(@NotNull CacheBuildContext ctx) { - final String name = ctx.getName(); - final Cache2kBuilder bld = ctx.getConfig().builder(); - - for (Map.Entry entry : slardarCacheProp.getLevel().entrySet()) { - // same prefix - final String key = entry.getKey(); - if (inLevel(name, key)) { - final SlardarCacheProp.Conf level = entry.getValue(); - build(bld, level.getMaxSize(), level.getMaxLive(), level.getMaxIdle(), false); - log.info("Wings Cache2k name={}, level={}", name, key); - return; - } - } - - final SlardarCacheProp.Conf common = slardarCacheProp.getCommon(); - build(bld, common.getMaxSize(), common.getMaxLive(), common.getMaxIdle(), false); - log.info("Wings Cache2k name={}, level=default", name); - } - }; - super.defaultSetup(this::levelingBuilder); - super.setAllowUnknownCache(true); - } - - - @Override - @NotNull - public SpringCache2kCacheManager defaultSetup(@NotNull Function, Cache2kBuilder> f) { - defaultSetup = f; - return this; - } - - @Override - @NotNull - public SpringCache2kCache getCache(@NotNull String name) { - final int size = slardarCacheProp.getNullSize(); - if (size < 0) { - return super.getCache(name); - } - else { - return nullsCache.computeIfAbsent(name, k -> { - final SpringCache2kCache cache = super.getCache(k); - return new NullsCache2k(cache.getNativeCache(), size, slardarCacheProp.getNullLive()); - }); - } - } - - /** - * defaultSetup know which cache to build - */ - protected Cache2kBuilder levelingBuilder(@NotNull Cache2kBuilder builder) { - - if (defaultSetup != null) { - defaultSetup.apply(builder); - } - - if (FeatureJmx != null) { - builder.enable(FeatureJmx); - } - - builder.config().getFeatures().add(levelingFeature); - - return builder; - } - - @Override - @NotNull - public Map statsCacheSize() { - final Map stats = new TreeMap<>(); - final Map cacheMap = super.getCacheMap(); - for (Map.Entry en : cacheMap.entrySet()) { - final SpringCache2kCache cache = en.getValue(); - stats.put(en.getKey(), cache == null ? -1 : cache.getNativeCache().entries().size()); - } - - return stats; - } - - @Override - @NotNull - public Set statsCacheKeys(String name) { - final SpringCache2kCache cache = getCache(name); - return cache.getNativeCache().keys(); - } - } } diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2kManager.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2kManager.java new file mode 100644 index 000000000..c5278974a --- /dev/null +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2kManager.java @@ -0,0 +1,123 @@ +package pro.fessional.wings.slardar.cache.cache2k; + +import lombok.extern.slf4j.Slf4j; +import org.cache2k.Cache2kBuilder; +import org.cache2k.config.CacheBuildContext; +import org.cache2k.config.Feature; +import org.cache2k.extra.spring.SpringCache2kCache; +import org.cache2k.extra.spring.SpringCache2kCacheManager; +import org.jetbrains.annotations.NotNull; +import pro.fessional.wings.slardar.cache.WingsCache; +import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp; + +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; + +import static pro.fessional.wings.slardar.spring.prop.SlardarCacheProp.inLevel; + +/** + * @author trydofor + * @since 2023-11-01 + */ +@Slf4j +public class WingsCache2kManager extends SpringCache2kCacheManager implements WingsCache.State { + + private final SlardarCacheProp slardarCacheProp; + private final ConcurrentHashMap nullsCache = new ConcurrentHashMap<>(); + + private final Feature levelingFeature; + private Function, Cache2kBuilder> defaultSetup = null; + + public WingsCache2kManager(String name, SlardarCacheProp slardarCacheProp) { + super(name == null ? DEFAULT_SPRING_CACHE_MANAGER_NAME : name); + this.slardarCacheProp = slardarCacheProp; + this.levelingFeature = new Feature() { + @Override + public void enlist(@NotNull CacheBuildContext ctx) { + final String name = ctx.getName(); + final Cache2kBuilder bld = ctx.getConfig().builder(); + + for (Map.Entry entry : slardarCacheProp.getLevel().entrySet()) { + // same prefix + final String key = entry.getKey(); + if (inLevel(name, key)) { + final SlardarCacheProp.Conf level = entry.getValue(); + WingsCache2k.build(bld, level.getMaxSize(), level.getMaxLive(), level.getMaxIdle(), false); + log.info("Wings Cache2k name={}, level={}", name, key); + return; + } + } + + final SlardarCacheProp.Conf common = slardarCacheProp.getCommon(); + WingsCache2k.build(bld, common.getMaxSize(), common.getMaxLive(), common.getMaxIdle(), false); + log.info("Wings Cache2k name={}, level=default", name); + } + }; + super.defaultSetup(this::levelingBuilder); + super.setAllowUnknownCache(true); + } + + + @Override + @NotNull + public SpringCache2kCacheManager defaultSetup(@NotNull Function, Cache2kBuilder> f) { + defaultSetup = f; + return this; + } + + @Override + @NotNull + public SpringCache2kCache getCache(@NotNull String name) { + final int size = slardarCacheProp.getNullSize(); + if (size < 0) { + return super.getCache(name); + } + else { + return nullsCache.computeIfAbsent(name, k -> { + final SpringCache2kCache cache = super.getCache(k); + return new NullsCache2k(cache.getNativeCache(), size, slardarCacheProp.getNullLive()); + }); + } + } + + /** + * defaultSetup know which cache to build + */ + protected Cache2kBuilder levelingBuilder(@NotNull Cache2kBuilder builder) { + + if (defaultSetup != null) { + defaultSetup.apply(builder); + } + + if (WingsCache2k.FeatureJmx != null) { + builder.enable(WingsCache2k.FeatureJmx); + } + + builder.config().getFeatures().add(levelingFeature); + + return builder; + } + + @Override + @NotNull + public Map statsCacheSize() { + final Map stats = new TreeMap<>(); + final Map cacheMap = super.getCacheMap(); + for (Map.Entry en : cacheMap.entrySet()) { + final SpringCache2kCache cache = en.getValue(); + stats.put(en.getKey(), cache == null ? -1 : cache.getNativeCache().entries().size()); + } + + return stats; + } + + @Override + @NotNull + public Set statsCacheKeys(String name) { + final SpringCache2kCache cache = getCache(name); + return cache.getNativeCache().keys(); + } +} diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/ProgressContext.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/ProgressContext.java index 7be96fa0c..c3202d223 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/ProgressContext.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/ProgressContext.java @@ -6,57 +6,30 @@ import org.jetbrains.annotations.Nullable; import pro.fessional.mirana.code.LeapCode; import pro.fessional.mirana.time.ThreadNow; +import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k; import java.util.Objects; import java.util.concurrent.atomic.AtomicLong; -import static pro.fessional.wings.slardar.cache.cache2k.Cache2kSlot.H24M5; - /** * @author trydofor * @since 2021-03-15 */ public class ProgressContext { - private static final AtomicLong count = new AtomicLong(0); - private static final LeapCode leapCode = new LeapCode(); - - /** - * Get the progress bar by inside key - */ - @Nullable - public static Bar get(String key) { - if (key == null) return null; - int pos = key.indexOf("-"); - if (pos <= 0) return null; + private static final Cache Cache = WingsCache2k + .builder(ProgressContext.class, "bar", -1, 24 * 3600, -1, Object.class, Bar.class) + .build(); - final long second = leapCode.decode(key, 0, pos); - return get(key, (int) second); - } + private static final AtomicLong Counter = new AtomicLong(0); + private static final LeapCode Encoder = new LeapCode(); /** * Get the progress bar by outside key and ttl second. */ @Nullable - public static Bar get(Object key, int second) { - if (key == null) return null; - - final Cache cache = H24M5.getCache(second); - final Object obj = cache.get(key); - if (obj instanceof Bar) { - return (Bar) obj; - } - else { - return null; - } - } - - /** - * Get cache by ttl second - */ - @NotNull - public static Cache get(int second) { - return H24M5.getCache(second); + public static Bar get(Object key) { + return key == null ? null : Cache.get(key); } /** @@ -72,11 +45,17 @@ public static Bar gen(Object key, int second) { */ @NotNull public static Bar gen(Object key, long started, int second) { - final Cache cache = H24M5.getCache(second); - Bar bar = new Bar(key(started, second), started); - cache.put(bar.key, bar); + final Bar bar = new Bar(key(started, second), started); + Cache.mutate(bar.key, entry -> { + entry.setValue(bar); + entry.setExpiryTime(entry.getStartTime() + second * 1000L); + }); + if (key != null) { - cache.put(key, bar); + Cache.mutate(key, entry -> { + entry.setValue(bar); + entry.setExpiryTime(entry.getStartTime() + second * 1000L); + }); } return bar; } @@ -86,17 +65,17 @@ public static Bar gen(Object key, long started, int second) { */ @NotNull public static String key(long started, int second) { - StringBuilder sb = new StringBuilder(30); - sb.append(leapCode.encode26(second, 5)); + StringBuilder sb = new StringBuilder(50); + sb.append(Encoder.encode26(second, 5)); sb.append('-'); - sb.append(leapCode.encode26(started, 10)); - long cnt = count.incrementAndGet(); + sb.append(Encoder.encode26(started, 10)); + long cnt = Counter.incrementAndGet(); while (cnt <= 0) { - count.set(0); - cnt = count.incrementAndGet(); + Counter.set(0); + cnt = Counter.incrementAndGet(); } sb.append('-'); - sb.append(leapCode.encode26(cnt, 5)); + sb.append(Encoder.encode26(cnt, 5)); return sb.toString(); } diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillAround.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillAround.java index 878917dc0..b47a2b5bd 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillAround.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/impl/DoubleKillAround.java @@ -118,7 +118,7 @@ public Object doubleKill(ProceedingJoinPoint joinPoint) throws Throwable { } } else { - final ProgressContext.Bar bar = ProgressContext.get(arrKey, ttl); + final ProgressContext.Bar bar = ProgressContext.get(arrKey); if (bar == null) { throw new DoubleKillException("", 0); // Never here, Defensive } diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeHolder.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeHolder.java new file mode 100644 index 000000000..79e4412f5 --- /dev/null +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeHolder.java @@ -0,0 +1,360 @@ +package pro.fessional.wings.slardar.context; + +import org.cache2k.Cache; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import pro.fessional.mirana.best.TypedReg; +import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k; +import pro.fessional.wings.slardar.event.attr.AttributeRidEvent; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; + +/** + * App level, default ttl=12H, unbounded cache. + * Need manually register and remove (or publish {@link AttributeRidEvent}) + * + * @author trydofor + * @see AttributeRidEvent + * @since 2021-03-30 + */ +public class AttributeHolder { + /** + * default ttl = 12H + */ + public static final int TtlDefault = 12 * 3600; + private static final ConcurrentHashMap, Function> LOADER = new ConcurrentHashMap<>(); + + private static final ConcurrentHashMap, Cache> HOLDER = new ConcurrentHashMap<>(); + + @NotNull + private static Cache getCache(@NotNull TypedReg reg) { + return HOLDER.computeIfAbsent(reg, k -> + WingsCache2k.builder(AttributeHolder.class, + reg.regType.getName().substring(reg.regType.getPackageName().length() + 1), + -1, TtlDefault, -1 + ).build()); + } + + @NotNull + public static Set> holders() { + return new HashSet<>(HOLDER.keySet()); + } + + @NotNull + public static Set> loaders() { + return new HashSet<>(LOADER.keySet()); + } + + /** + * Registering a typed key-value and its loader + * + * @param reg Type to register + * @param loader returns `null` is not cached and is called every time, so it is recommended to return `nonnull`. + * @param key type + * @param value type + */ + @SuppressWarnings("unchecked") + public static void regLoader(@NotNull TypedReg reg, @NotNull Function loader) { + LOADER.put(reg, (Function) loader); + } + + /** + * Put an attribute value to the typed key. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param value value + * @param key type + * @param value type + */ + public static void putAttr(@NotNull TypedReg reg, @NotNull K key, @NotNull V value) { + putAttr(reg, key, value, TtlDefault); + } + + /** + * Put an attribute value to the typed key. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param value value + * @param ttl ttl in second + * @param key type + * @param value type + */ + public static void putAttr(@NotNull TypedReg reg, @NotNull K key, @NotNull V value, int ttl) { + getCache(reg).mutate(key, entry -> { + entry.setValue(value); + entry.setExpiryTime(entry.getStartTime() + ttl * 1000L); + }); + } + + /** + * Put all attribute value from map to the typed key. + * + * @param reg Type to register + * @param map map of attribute + * @param key type + * @param value type + */ + public static void putAttrs(@NotNull TypedReg reg, @NotNull Map map) { + putAttrs(reg, map, TtlDefault); + } + + /** + * Put all attribute value from map to the typed key. + * + * @param reg Type to register + * @param map map of attribute + * @param ttl ttl in second + * @param key type + * @param value type + */ + public static void putAttrs(@NotNull TypedReg reg, @NotNull Map map, int ttl) { + if (map.isEmpty()) return; + + final Cache cache = getCache(reg); + for (Map.Entry en : map.entrySet()) { + cache.mutate(en.getKey(), entry -> { + entry.setValue(en.getValue()); + entry.setExpiryTime(entry.getStartTime() + ttl * 1000L); + }); + } + } + + /** + * Try to get an attribute by typed key, load it if not found, return `elze` if the result is null. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param elze return `elze` if result is null + * @param key type + * @param value type + */ + @Contract("_,_,!null->!null") + public static V tryAttr(@NotNull TypedReg reg, @NotNull K key, V elze) { + return tryAttr(reg, key, elze, TtlDefault); + } + + /** + * Try to get an attribute by typed key, load it if not found, return `elze` if the result is null. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param elze return `elze` if result is null + * @param ttl ttl in second + * @param key type + * @param value type + */ + @Contract("_,_,!null,_->!null") + public static V tryAttr(@NotNull TypedReg reg, @NotNull K key, V elze, int ttl) { + final V obj = tryAttr(reg, key, false, ttl); + return obj == null ? elze : obj; + } + + /** + * Try to get an attribute by typed key, load it if not found, throw NPE if the result is null. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param key type + * @param value type + */ + @NotNull + public static V tryAttr(@NotNull TypedReg reg, @NotNull K key) { + return tryAttr(reg, key, true, TtlDefault); + } + + /** + * Try to get an attribute by typed key, load it if not found, throw NPE if the result is null. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param ttl ttl in second + * @param key type + * @param value type + */ + @NotNull + public static V tryAttr(@NotNull TypedReg reg, @NotNull K key, int ttl) { + return tryAttr(reg, key, true, ttl); + } + + /** + * Try to get an attribute by typed key, load it if not found, throw NPE if notnull and the result is null. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param notnull whether notnull + * @param key type + * @param value type + */ + @Contract("_,_,true ->!null") + public static V tryAttr(@NotNull TypedReg reg, @NotNull K key, boolean notnull) { + return tryAttr(reg, key, notnull, TtlDefault); + } + + /** + * Try to get an attribute by typed key, load it if not found, throw NPE if notnull and the result is null. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param notnull whether notnull + * @param ttl ttl in second + * @param key type + * @param value type + */ + @SuppressWarnings("unchecked") + @Contract("_,_,true,_ ->!null") + public static V tryAttr(@NotNull TypedReg reg, @NotNull K key, boolean notnull, int ttl) { + + final Object rst = getCache(reg).invoke(key, entry -> { + Object t = null; + if (entry.exists()) { + t = entry.getValue(); + } + else { + Function ld = LOADER.get(reg); + if (ld != null) { + t = ld.apply(key); + entry.setValue(t); + entry.setExpiryTime(entry.getStartTime() + ttl * 1000L); + } + } + return t; + }); + + if (rst == null && notnull) { + throw new NullPointerException("aware=" + reg + ",key=" + key); + } + else { + return (V) rst; + } + } + + /** + * Get an attribute by typed key, and NOT load if not found. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param key type + * @param value type + */ + @SuppressWarnings("unchecked") + @Nullable + public static V getAttr(@NotNull TypedReg reg, @NotNull K key) { + Cache cache = HOLDER.get(reg); + return cache == null ? null : (V) cache.get(key); + } + + /** + * Get all attributes by typed keys, and NOT load if not found. + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param key type + * @param value type + */ + @SuppressWarnings("unchecked") + @NotNull + public static Map getAttrs(@NotNull TypedReg reg, @NotNull Collection key) { + Cache cache = HOLDER.get(reg); + if (cache == null) return Collections.emptyMap(); + return (Map) cache.getAll(key); + } + + /** + * remove an attribute by key + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param key type + */ + public static void ridAttr(TypedReg reg, K key) { + Cache cache = HOLDER.get(reg); + if (cache != null) { + cache.remove(key); + } + } + + /** + * remove all attribute by keys + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param key type + */ + @SafeVarargs + public static void ridAttrs(TypedReg reg, K... key) { + if (key == null || key.length == 0) return; + ridAttrs(reg, Arrays.asList(key)); + } + + /** + * remove all attribute by keys + * + * @param reg Type to register + * @param key unique key, e.g. userId + * @param key type + */ + public static void ridAttrs(TypedReg reg, Collection key) { + if (key == null || key.isEmpty()) return; + Cache cache = HOLDER.get(reg); + if (cache != null) { + cache.removeAll(key); + } + } + + /** + * remove all attribute of type + * + * @param reg Type to register + */ + public static void ridAttrAll(TypedReg... reg) { + if (reg == null || reg.length == 0) return; + ridAttrAll(Arrays.asList(reg)); + } + + /** + * remove all attribute of type + * + * @param reg Type to register + */ + public static void ridAttrAll(Collection> reg) { + if (reg == null || reg.isEmpty()) return; + for (TypedReg tr : reg) { + Cache cache = HOLDER.get(tr); + if (cache != null) { + cache.removeAll(); + } + } + } + + /** + * remove the loader + * + * @param reg Type to register + */ + public static void ridLoader(TypedReg... reg) { + if (reg == null || reg.length == 0) return; + ridLoader(Arrays.asList(reg)); + } + + /** + * remove the loader + * + * @param reg Type to register + */ + public static void ridLoader(Collection> reg) { + if (reg == null || reg.isEmpty()) return; + for (TypedReg r : reg) { + LOADER.remove(r); + } + } +} diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/GlobalAttributeHolder.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/GlobalAttributeHolder.java deleted file mode 100644 index b8be538fe..000000000 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/GlobalAttributeHolder.java +++ /dev/null @@ -1,247 +0,0 @@ -package pro.fessional.wings.slardar.context; - -import org.cache2k.Cache; -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; -import pro.fessional.mirana.best.TypedReg; -import pro.fessional.mirana.best.TypedReg.Key; -import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k; - -import java.time.Duration; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Function; -import java.util.stream.Collectors; - -/** - * App level, ttl=12H, unbounded cache. - * Need manually register and remove. - * - * @author trydofor - * @since 2021-03-30 - */ -public class GlobalAttributeHolder { - - - // - @SuppressWarnings("all") - private static final Cache CACHE = WingsCache2k.builder(GlobalAttributeHolder.class, "CACHE", -1, Duration.ofHours(12), null, Key.class, Object.class).build(); - private static final ConcurrentHashMap, Function> LOADER = new ConcurrentHashMap<>(); - - /** - * Registering a typed key-value and its loader - * - * @param reg Type to register - * @param loader returns `null` is not cached and is called every time, so it is recommended to return `nonnull`. - * @param key type - * @param value type - */ - public static void regLoader(@NotNull TypedReg reg, @NotNull Function, V> loader) { - LOADER.put(reg, loader); - } - - /** - * Put an attribute value to the typed key. - * - * @param reg Type to register - * @param key unique key, e.g. userId - * @param value value - * @param key type - * @param value type - */ - public static void putAttr(@NotNull TypedReg reg, @NotNull K key, @NotNull V value) { - Key k = new Key<>(reg, key); - CACHE.put(k, value); - } - - /** - * Put all attribute value from map to the typed key. - * - * @param reg Type to register - * @param map map of attribute - * @param key type - * @param value type - */ - public static void putAttr(@NotNull TypedReg reg, @NotNull Map map) { - Map, V> kvs = new HashMap<>(map.size()); - for (Map.Entry en : map.entrySet()) { - kvs.put(new Key<>(reg, en.getKey()), en.getValue()); - } - CACHE.putAll(kvs); - } - - /** - * Try to get an attribute by typed key, load it if not found, return `elze` if the result is null. - * - * @param reg Type to register - * @param key unique key, e.g. userId - * @param elze return `elze` if result is null - * @param key type - * @param value type - */ - @Contract("_,_,!null->!null") - public static V tryAttr(@NotNull TypedReg reg, @NotNull K key, V elze) { - final V obj = tryAttr(reg, key, false); - return obj == null ? elze : obj; - } - - /** - * Try to get an attribute by typed key, load it if not found, throw NPE if the result is null. - * - * @param reg Type to register - * @param key unique key, e.g. userId - * @param key type - * @param value type - */ - @NotNull - public static V tryAttr(@NotNull TypedReg reg, @NotNull K key) { - return tryAttr(reg, key, true); - } - - /** - * Try to get an attribute by typed key, load it if not found, throw NPE if notnull and the result is null. - * - * @param reg Type to register - * @param key unique key, e.g. userId - * @param notnull whether notnull - * @param key type - * @param value type - */ - @SuppressWarnings({"unchecked", "rawtypes"}) - @Contract("_,_,true ->!null") - public static V tryAttr(@NotNull TypedReg reg, @NotNull K key, boolean notnull) { - Key k = new Key<>(reg, key); - final Function ld = (Function) LOADER.get(reg); - final Object rst; - if (ld == null) { - rst = CACHE.get(k); - } - else { - rst = CACHE.computeIfAbsent(k, ld); - } - - if (rst == null && notnull) { - throw new NullPointerException("aware=" + reg + ",key=" + key); - } - return (V) rst; - } - - /** - * Get an attribute by typed key, and NOT load if not found. - * - * @param reg Type to register - * @param key unique key, e.g. userId - * @param key type - * @param value type - */ - @SuppressWarnings("unchecked") - public static V getAttr(@NotNull TypedReg reg, @NotNull K key) { - Key k = new Key<>(reg, key); - final Object rst = CACHE.get(k); - return (V) rst; - } - - /** - * remove an attribute by key - * - * @param reg Type to register - * @param key unique key, e.g. userId - * @param key type - */ - public static void ridAttr(TypedReg reg, K key) { - CACHE.remove(new Key<>(reg, key)); - } - - /** - * remove all attribute by keys - * - * @param reg Type to register - * @param key unique key, e.g. userId - * @param key type - */ - @SafeVarargs - public static void ridAttr(TypedReg reg, K... key) { - if (key == null || key.length == 0) return; - ridAttrs(reg, Arrays.asList(key)); - } - - /** - * remove all attribute by keys - * - * @param reg Type to register - * @param key unique key, e.g. userId - * @param key type - */ - public static void ridAttrs(TypedReg reg, Collection key) { - if (key == null || key.isEmpty()) return; - final Set> ks = new HashSet<>(); - for (K k : key) { - ks.add(new Key<>(reg, k)); - } - CACHE.removeAll(ks); - } - - /** - * remove all attribute of type - * - * @param reg Type to register - */ - public static void ridAttrAll(TypedReg... reg) { - if (reg == null || reg.length == 0) return; - ridAttrAll(Arrays.asList(reg)); - } - - /** - * remove all attribute of type - * - * @param reg Type to register - */ - @SuppressWarnings({"unchecked", "rawtypes"}) - public static void ridAttrAll(Collection> reg) { - if (reg == null || reg.isEmpty()) return; - final Set> rgs; - if (reg instanceof Set) { - rgs = (Set>) reg; - } - else { - rgs = new HashSet<>(reg); - } - - final Set keys = CACHE - .asMap() - .keySet() - .stream() - .filter(it -> rgs.contains(it.reg)) - .collect(Collectors.toSet()); - CACHE.removeAll(keys); - } - - /** - * remove all attribute of type and its loader - * - * @param reg Type to register - */ - public static void ridLoader(TypedReg... reg) { - if (reg == null || reg.length == 0) return; - ridLoader(Arrays.asList(reg)); - } - - /** - * remove all attribute of type and its loader - * - * @param reg Type to register - */ - public static void ridLoader(Collection> reg) { - if (reg == null || reg.isEmpty()) return; - - for (TypedReg r : reg) { - LOADER.remove(r); - } - ridAttrAll(reg); - } -} diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/EventPublishHelper.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/EventPublishHelper.java index 62f1d8155..6ac0728be 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/EventPublishHelper.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/EventPublishHelper.java @@ -1,11 +1,12 @@ package pro.fessional.wings.slardar.event; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.jetbrains.annotations.NotNull; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.event.ApplicationEventMulticaster; import org.springframework.context.support.AbstractApplicationContext; import org.springframework.core.ResolvableType; -import pro.fessional.mirana.best.AssertState; import java.util.concurrent.Executor; @@ -28,6 +29,7 @@ * @since 2021-06-07 */ +@Slf4j public class EventPublishHelper { /** @@ -44,10 +46,20 @@ public class EventPublishHelper { * Wrap Hazelcast (HazelcastTopic)topic to SpringEvent. * fire and forget, async and unordered by default. * If the event needs to be ordered, set globalOrderEnabled=true. + *

+ * throws IllegalStateException if no globalPublisher * * @see #hasAsyncGlobal */ - public static final ApplicationEventPublisher AsyncGlobal = new GlobalPub(); + public static final ApplicationEventPublisher AsyncGlobal = new GlobalPub(true); + + /** + * try to publish widely, prefer AsyncGlobal, else AsyncSpring with warn + * + * @see #AsyncGlobal + * @see #AsyncSpring + */ + public static final ApplicationEventPublisher AsyncWidely = new GlobalPub(false); private static Executor executor; private static ApplicationEventPublisher springPublisher; @@ -85,12 +97,25 @@ public void publishEvent(@NotNull Object event) { } } + @RequiredArgsConstructor private static class GlobalPub implements ApplicationEventPublisher { + private final boolean strict; + @Override public void publishEvent(@NotNull Object event) { - AssertState.notNull(globalPublisher, "no globalPublisher, use #hasAsyncGlobal to test"); - executor.execute(() -> globalPublisher.publishEvent(event)); + if (globalPublisher != null) { + executor.execute(() -> globalPublisher.publishEvent(event)); + } + else { + if (strict) { + throw new IllegalStateException("no globalPublisher, use #hasAsyncGlobal to test"); + } + else { + log.warn("no globalPublisher, publish by spring async in no strict"); + } + executor.execute(() -> springPublisher.publishEvent(event)); + } } } } diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java new file mode 100644 index 000000000..1404bdb91 --- /dev/null +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java @@ -0,0 +1,15 @@ +package pro.fessional.wings.slardar.event.attr; + +import org.springframework.context.event.EventListener; + +/** + * @author trydofor + * @since 2023-10-31 + */ +public class AttributeEventListener { + + @EventListener + public void ridAttr(AttributeRidEvent event) { + event.handleEvent(); + } +} diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeRidEvent.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeRidEvent.java new file mode 100644 index 000000000..44a35b0cf --- /dev/null +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeRidEvent.java @@ -0,0 +1,64 @@ +package pro.fessional.wings.slardar.event.attr; + +import lombok.Data; +import org.jetbrains.annotations.Contract; +import pro.fessional.mirana.best.TypedReg; +import pro.fessional.wings.slardar.context.AttributeHolder; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * @author trydofor + * @since 2021-03-07 + */ +@Data +public class AttributeRidEvent implements Serializable { + + @Serial + private static final long serialVersionUID = 6313180145649074244L; + + private final Map> typedReg = new HashMap<>(); + + public AttributeRidEvent() { + } + + public AttributeRidEvent(TypedReg reg, Object... key) { + Set keys = typedReg.computeIfAbsent(reg.serialize(), k -> new HashSet<>()); + keys.addAll(Arrays.asList(key)); + } + + @SafeVarargs + @Contract("_,_->this") + public final AttributeRidEvent rid(TypedReg reg, K... key) { + rid(reg, Arrays.asList(key)); + return this; + } + + @Contract("_,_->this") + public AttributeRidEvent rid(TypedReg reg, Collection key) { + Set keys = typedReg.computeIfAbsent(reg.serialize(), k -> new HashSet<>()); + keys.addAll(key); + return this; + } + + public void handleEvent() { + for (Map.Entry> ent : typedReg.entrySet()) { + String s = ent.getKey(); + TypedReg reg = TypedReg.deserialize(s); + Set ks = ent.getValue(); + if (ks == null || ks.isEmpty()) { + AttributeHolder.ridAttrAll(reg); + } + else { + AttributeHolder.ridAttrs(reg, ks); + } + } + } +} diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakClockEvent.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakClockEvent.java index 053fbcc8f..3d3ba2713 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakClockEvent.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakClockEvent.java @@ -2,13 +2,18 @@ import lombok.Data; +import java.io.Serial; +import java.io.Serializable; + /** * @author trydofor * @since 2022-10-31 */ @Data -public class TweakClockEvent { +public class TweakClockEvent implements Serializable { + @Serial + private static final long serialVersionUID = 7710834456093042523L; /** * Long.MAX_VALUE means all user */ diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/TweakEventListener.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakEventListener.java similarity index 94% rename from wings/slardar/src/main/java/pro/fessional/wings/slardar/event/TweakEventListener.java rename to wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakEventListener.java index 0fc8b28d9..b57985605 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/TweakEventListener.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakEventListener.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.slardar.event; +package pro.fessional.wings.slardar.event.tweak; import org.jetbrains.annotations.NotNull; import org.springframework.boot.logging.LogLevel; @@ -8,9 +8,6 @@ import pro.fessional.wings.silencer.tweak.TweakLogger; import pro.fessional.wings.silencer.tweak.TweakStack; import pro.fessional.wings.slardar.context.TerminalContext; -import pro.fessional.wings.slardar.event.tweak.TweakClockEvent; -import pro.fessional.wings.slardar.event.tweak.TweakLoggerEvent; -import pro.fessional.wings.slardar.event.tweak.TweakStackEvent; import java.time.Clock; import java.time.Duration; diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakLoggerEvent.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakLoggerEvent.java index 5f6c0c3e9..c0888e883 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakLoggerEvent.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakLoggerEvent.java @@ -3,12 +3,18 @@ import lombok.Data; import org.springframework.boot.logging.LogLevel; +import java.io.Serial; +import java.io.Serializable; + /** * @author trydofor * @since 2022-10-31 */ @Data -public class TweakLoggerEvent { +public class TweakLoggerEvent implements Serializable { + + @Serial + private static final long serialVersionUID = 1559944973588991049L; /** * Long.MAX_VALUE means all user */ diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakStackEvent.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakStackEvent.java index 767c423f3..67d546285 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakStackEvent.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/tweak/TweakStackEvent.java @@ -2,12 +2,18 @@ import lombok.Data; +import java.io.Serial; +import java.io.Serializable; + /** * @author trydofor * @since 2022-10-31 */ @Data -public class TweakStackEvent { +public class TweakStackEvent implements Serializable { + + @Serial + private static final long serialVersionUID = -3524639212951770945L; /** * Long.MAX_VALUE means all user */ diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java index ad48962bc..02b59a9d6 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java @@ -3,36 +3,27 @@ import com.alibaba.ttl.threadpool.TtlExecutors; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration; -import org.springframework.boot.autoconfigure.task.TaskExecutionProperties; import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration; import org.springframework.boot.autoconfigure.task.TaskSchedulingProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.task.TaskExecutorBuilder; import org.springframework.boot.task.TaskSchedulerBuilder; -import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.event.ApplicationEventMulticaster; -import org.springframework.context.event.SimpleApplicationEventMulticaster; import org.springframework.core.task.AsyncTaskExecutor; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; -import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner; -import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.slardar.async.TaskSchedulerHelper; import pro.fessional.wings.slardar.async.TtlThreadPoolTaskScheduler; -import pro.fessional.wings.slardar.event.EventPublishHelper; import pro.fessional.wings.slardar.spring.prop.SlardarAsyncProp; import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; -import java.lang.reflect.Method; import java.util.concurrent.Executor; import static org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME; @@ -55,8 +46,6 @@ @ConditionalOnProperty(name = SlardarEnabledProp.Key$async, havingValue = "true") @EnableConfigurationProperties(SlardarAsyncProp.class) public class SlardarAsyncConfiguration { - - public static final String slardarEventExecutor = "slardarEventExecutor"; public static final String slardarHeavyScheduler = "slardarHeavyScheduler"; private static final Log log = LogFactory.getLog(SlardarAsyncConfiguration.class); @@ -90,26 +79,6 @@ public ThreadPoolTaskScheduler taskScheduler(TaskSchedulerBuilder builder) { return bean; } - @Bean(name = slardarEventExecutor) - @ConditionalOnMissingBean(name = slardarEventExecutor) - public Executor slardarEventExecutor(SlardarAsyncProp prop) { - TaskExecutorBuilder builder = new TaskExecutorBuilder(); - final TaskExecutionProperties event = prop.getEvent(); - final TaskExecutionProperties.Pool pool = event.getPool(); - builder = builder.queueCapacity(pool.getQueueCapacity()); - builder = builder.corePoolSize(pool.getCoreSize()); - builder = builder.maxPoolSize(pool.getMaxSize()); - builder = builder.allowCoreThreadTimeOut(pool.isAllowCoreThreadTimeout()); - builder = builder.keepAlive(pool.getKeepAlive()); - TaskExecutionProperties.Shutdown shutdown = event.getShutdown(); - builder = builder.awaitTermination(shutdown.isAwaitTermination()); - builder = builder.awaitTerminationPeriod(shutdown.getAwaitTerminationPeriod()); - builder = builder.threadNamePrefix(event.getThreadNamePrefix()); - log.info("Slardar spring-bean slardarEventExecutor via TtlThreadPoolTaskExecutor, prefix=" + event.getThreadNamePrefix()); - final ThreadPoolTaskExecutor executor = builder.build(); - executor.initialize(); - return TtlExecutors.getTtlExecutor(executor); - } @Bean(name = slardarHeavyScheduler) @ConditionalOnMissingBean(name = slardarHeavyScheduler) @@ -126,44 +95,6 @@ public ThreadPoolTaskScheduler slardarHeavyScheduler(SlardarAsyncProp prop) { return builder.configure(scheduler); } - @Bean - public ApplicationStartedEventRunner runnerEventPublishHelper( - ApplicationEventPublisher publisher, - ApplicationEventMulticaster multicaster, - @Qualifier(slardarEventExecutor) Executor executor) { - log.info("Slardar spring-runs runnerEventPublishHelper"); - return new ApplicationStartedEventRunner(WingsOrdered.Lv4Application, ignored -> { - EventPublishHelper.setExecutor(executor); - log.info("Slardar conf eventPublishHelper ApplicationEventPublisher=" + publisher.getClass()); - EventPublishHelper.setSpringPublisher(publisher); - log.info("Slardar conf eventPublishHelper ApplicationEventMulticaster=" + multicaster.getClass()); - if (multicaster instanceof SimpleApplicationEventMulticaster mc) { - try { - final Method getTaskExecutor = BeanUtils.findMethod(SimpleApplicationEventMulticaster.class, "getTaskExecutor"); - if (getTaskExecutor != null) { - getTaskExecutor.setAccessible(true); - final Object te = getTaskExecutor.invoke(mc); - if (te != null) { - log.warn("Slardar conf eventPublishHelper SimpleApplicationEventMulticaster should without TaskExecutor"); - } - } - - final Method getErrorHandler = BeanUtils.findMethod(SimpleApplicationEventMulticaster.class, "getErrorHandler"); - if (getErrorHandler != null) { - getErrorHandler.setAccessible(true); - final Object eh = getErrorHandler.invoke(mc); - if (eh != null) { - log.warn("Slardar conf eventPublishHelper SimpleApplicationEventMulticaster should without ErrorHandler"); - } - } - } - catch (Exception e) { - log.info("failed to check SimpleApplicationEventMulticaster", e); - } - } - }); - } - @Bean @ConditionalOnMissingBean public TaskSchedulerHelper taskSchedulerHelper( diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java index a44147de1..a241666c9 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java @@ -26,6 +26,7 @@ import pro.fessional.wings.slardar.cache.WingsCache; import pro.fessional.wings.slardar.cache.WingsCacheHelper; import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k; +import pro.fessional.wings.slardar.cache.cache2k.WingsCache2kManager; import pro.fessional.wings.slardar.cache.spring.CacheEvictMultiKeys; import pro.fessional.wings.slardar.cache.spring.WingsCacheAnnoOprSource; import pro.fessional.wings.slardar.cache.spring.WingsCacheInterceptor; @@ -66,7 +67,7 @@ public SlardarCacheConfiguration(@Value("${spring.jmx.enabled:false}") boolean j public SpringCache2kCacheManager cache2kCacheManager(SlardarCacheProp conf) { log.info("Slardar spring-bean cache2kCacheManager as " + Manager.Memory); // https://github.com/cache2k/cache2k/issues/123 - return new WingsCache2k.Manager("spring-wings-" + hashCode(), conf); + return new WingsCache2kManager("spring-wings-" + hashCode(), conf); } // //////////////////// aop //////////////////// diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java new file mode 100644 index 000000000..a9d6d5879 --- /dev/null +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java @@ -0,0 +1,107 @@ +package pro.fessional.wings.slardar.spring.bean; + +import com.alibaba.ttl.threadpool.TtlExecutors; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.task.TaskExecutionProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.task.TaskExecutorBuilder; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.event.ApplicationEventMulticaster; +import org.springframework.context.event.SimpleApplicationEventMulticaster; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner; +import pro.fessional.wings.silencer.spring.WingsOrdered; +import pro.fessional.wings.slardar.event.EventPublishHelper; +import pro.fessional.wings.slardar.event.attr.AttributeEventListener; +import pro.fessional.wings.slardar.spring.prop.SlardarAsyncProp; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; + +import java.lang.reflect.Method; +import java.util.concurrent.Executor; + +/** + *
+ * @author trydofor
+ * @since 2023-10-31
+ */
+@Configuration(proxyBeanMethods = false)
+@ConditionalOnProperty(name = SlardarEnabledProp.Key$event, havingValue = "true")
+@EnableConfigurationProperties(SlardarAsyncProp.class)
+public class SlardarEventConfiguration {
+    private static final Log log = LogFactory.getLog(SlardarEventConfiguration.class);
+
+    public static final String slardarEventExecutor = "slardarEventExecutor";
+
+    @Bean(name = slardarEventExecutor)
+    @ConditionalOnMissingBean(name = slardarEventExecutor)
+    public Executor slardarEventExecutor(SlardarAsyncProp prop) {
+        TaskExecutorBuilder builder = new TaskExecutorBuilder();
+        final TaskExecutionProperties event = prop.getEvent();
+        final TaskExecutionProperties.Pool pool = event.getPool();
+        builder = builder.queueCapacity(pool.getQueueCapacity());
+        builder = builder.corePoolSize(pool.getCoreSize());
+        builder = builder.maxPoolSize(pool.getMaxSize());
+        builder = builder.allowCoreThreadTimeOut(pool.isAllowCoreThreadTimeout());
+        builder = builder.keepAlive(pool.getKeepAlive());
+        TaskExecutionProperties.Shutdown shutdown = event.getShutdown();
+        builder = builder.awaitTermination(shutdown.isAwaitTermination());
+        builder = builder.awaitTerminationPeriod(shutdown.getAwaitTerminationPeriod());
+        builder = builder.threadNamePrefix(event.getThreadNamePrefix());
+        log.info("Slardar spring-bean slardarEventExecutor via TtlThreadPoolTaskExecutor, prefix=" + event.getThreadNamePrefix());
+        final ThreadPoolTaskExecutor executor = builder.build();
+        executor.initialize();
+        return TtlExecutors.getTtlExecutor(executor);
+    }
+
+    @Bean
+    public ApplicationStartedEventRunner runnerEventPublishHelper(
+            ApplicationEventPublisher publisher,
+            ApplicationEventMulticaster multicaster,
+            @Qualifier(slardarEventExecutor) Executor executor) {
+        log.info("Slardar spring-runs runnerEventPublishHelper");
+        return new ApplicationStartedEventRunner(WingsOrdered.Lv4Application, ignored -> {
+            EventPublishHelper.setExecutor(executor);
+            log.info("Slardar conf eventPublishHelper ApplicationEventPublisher=" + publisher.getClass());
+            EventPublishHelper.setSpringPublisher(publisher);
+            log.info("Slardar conf eventPublishHelper ApplicationEventMulticaster=" + multicaster.getClass());
+            if (multicaster instanceof SimpleApplicationEventMulticaster mc) {
+                try {
+                    final Method getTaskExecutor = BeanUtils.findMethod(SimpleApplicationEventMulticaster.class, "getTaskExecutor");
+                    if (getTaskExecutor != null) {
+                        getTaskExecutor.setAccessible(true);
+                        final Object te = getTaskExecutor.invoke(mc);
+                        if (te != null) {
+                            log.warn("Slardar conf eventPublishHelper SimpleApplicationEventMulticaster should without TaskExecutor");
+                        }
+                    }
+
+                    final Method getErrorHandler = BeanUtils.findMethod(SimpleApplicationEventMulticaster.class, "getErrorHandler");
+                    if (getErrorHandler != null) {
+                        getErrorHandler.setAccessible(true);
+                        final Object eh = getErrorHandler.invoke(mc);
+                        if (eh != null) {
+                            log.warn("Slardar conf eventPublishHelper SimpleApplicationEventMulticaster should without ErrorHandler");
+                        }
+                    }
+                }
+                catch (Exception e) {
+                    log.info("failed to check SimpleApplicationEventMulticaster", e);
+                }
+            }
+        });
+    }
+
+    @Bean
+    @ConditionalOnMissingBean
+    public AttributeEventListener attributeEventListener() {
+        log.info("Slardar spring-bean AttributeEventListener");
+        return new AttributeEventListener();
+    }
+}
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakingConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java
similarity index 89%
rename from wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakingConfiguration.java
rename to wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java
index 282cac1cd..af81d2222 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakingConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java
@@ -5,7 +5,7 @@
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.slardar.event.TweakEventListener;
+import pro.fessional.wings.slardar.event.tweak.TweakEventListener;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpTweakLogInterceptor;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
@@ -15,9 +15,9 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnProperty(name = SlardarEnabledProp.Key$tweaking, havingValue = "true")
-public class SlardarTweakingConfiguration {
+public class SlardarTweakConfiguration {
 
-    private static final Log log = LogFactory.getLog(SlardarTweakingConfiguration.class);
+    private static final Log log = LogFactory.getLog(SlardarTweakConfiguration.class);
 
     @Bean
     public TweakEventListener tweakEventListener() {
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
index cbc2293bd..b9611619d 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
@@ -7,11 +7,12 @@
 import pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDingNoticeConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDoubleKillConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarEventConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarI18nConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarMonitorConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration;
-import pro.fessional.wings.slardar.spring.bean.SlardarTweakingConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarTweakConfiguration;
 import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
@@ -25,11 +26,12 @@
         SlardarDateTimeConfiguration.class,
         SlardarDingNoticeConfiguration.class,
         SlardarDoubleKillConfiguration.class,
+        SlardarEventConfiguration.class,
         SlardarI18nConfiguration.class,
         SlardarJacksonConfiguration.class,
         SlardarMonitorConfiguration.class,
         SlardarOkhttpConfiguration.class,
-        SlardarTweakingConfiguration.class,
+        SlardarTweakConfiguration.class,
 })
 public class SlardarAutoConfiguration {
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java
index 4d0934ac9..e6e57eda8 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java
@@ -87,6 +87,14 @@ public class SlardarEnabledProp {
     private boolean async = true;
     public static final String Key$async = Key + ".async";
 
+    /**
+     * whether to enable slardar event utils
+     *
+     * @see #Key$async
+     */
+    private boolean event = true;
+    public static final String Key$event = Key + ".event";
+
     /**
      * whether to prevent forgery editing
      *
diff --git a/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties
index 699b4b803..f3a60cbd6 100644
--- a/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties
+++ b/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties
@@ -16,6 +16,8 @@ spring.wings.slardar.enabled.session=true
 spring.wings.slardar.enabled.session-hazelcast=true
 ## whether to enable spring Async and thread pool
 spring.wings.slardar.enabled.async=true
+## whether to enable slardar event utils
+spring.wings.slardar.enabled.event=true
 ## whether to prevent forgery editing
 spring.wings.slardar.enabled.righter=true
 ## whether to enable Interceptor of debounce
diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/AttributeHolderTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/AttributeHolderTest.java
new file mode 100644
index 000000000..4d2fa197a
--- /dev/null
+++ b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/AttributeHolderTest.java
@@ -0,0 +1,58 @@
+package pro.fessional.wings.slardar.context;
+
+import io.qameta.allure.TmsLink;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import pro.fessional.mirana.best.TypedReg;
+import pro.fessional.mirana.time.Sleep;
+
+import java.util.Set;
+
+/**
+ * @author trydofor
+ * @since 2021-03-31
+ */
+@Slf4j
+class AttributeHolderTest {
+
+    public interface Solos {
+        TypedReg PasssaltByUid = new TypedReg<>() {};
+        TypedReg> PermitsByUid = new TypedReg<>() {};
+    }
+
+    @Test
+    @TmsLink("C13004")
+    public void testSolo() {
+        AttributeHolder.regLoader(Solos.PasssaltByUid, integerStringKey -> "salt");
+        AttributeHolder.regLoader(Solos.PermitsByUid, integerStringKey -> Set.of("prd", "dev"));
+        String v1 = AttributeHolder.tryAttr(Solos.PasssaltByUid, 1);
+        Set v2 = AttributeHolder.tryAttr(Solos.PermitsByUid, 1);
+        Assertions.assertEquals("salt", v1);
+        Assertions.assertEquals(Set.of("prd", "dev"), v2);
+
+        Assertions.assertEquals(Integer.class, Solos.PasssaltByUid.keyType);
+        Assertions.assertEquals(String.class, Solos.PasssaltByUid.valType);
+
+        System.out.println(">>>" + Solos.PasssaltByUid.regType.getName().substring(Solos.PasssaltByUid.regType.getPackageName().length() + 1));
+    }
+
+    TypedReg Expiry = new TypedReg<>() {};
+
+    @Test
+    @TmsLink("C13117")
+    public void testExpiry() {
+        // put and get
+        AttributeHolder.putAttr(Expiry, 1, "1", 1);
+        Assertions.assertEquals("1", AttributeHolder.getAttr(Expiry, 1));
+        Sleep.ignoreInterrupt(2000); // 1500 fail
+        Assertions.assertNull(AttributeHolder.getAttr(Expiry, 1));
+
+        // loader and try
+        AttributeHolder.regLoader(Expiry, integer -> "1");
+        Assertions.assertEquals("1", AttributeHolder.tryAttr(Expiry, 1, 1));
+        Sleep.ignoreInterrupt(2000);
+        Assertions.assertNull(AttributeHolder.getAttr(Expiry, 1));
+        Assertions.assertEquals("1", AttributeHolder.tryAttr(Expiry, 1));
+    }
+}
diff --git a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/GlobalAttributeHolderTest.java b/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/GlobalAttributeHolderTest.java
deleted file mode 100644
index e3b38770f..000000000
--- a/wings/slardar/src/test/java/pro/fessional/wings/slardar/context/GlobalAttributeHolderTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package pro.fessional.wings.slardar.context;
-
-import io.qameta.allure.TmsLink;
-import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-import pro.fessional.mirana.best.TypedReg;
-
-import java.util.Set;
-
-/**
- * @author trydofor
- * @since 2021-03-31
- */
-@Slf4j
-class GlobalAttributeHolderTest {
-
-    public interface Solos {
-        TypedReg PasssaltByUid = new TypedReg<>() {};
-        TypedReg> PermitsByUid = new TypedReg<>() {};
-    }
-
-    @Test
-    @TmsLink("C13004")
-    public void testSolo() {
-        GlobalAttributeHolder.regLoader(Solos.PasssaltByUid, integerStringKey -> "salt");
-        GlobalAttributeHolder.regLoader(Solos.PermitsByUid, integerStringKey -> Set.of("prd", "dev"));
-        String v1 = GlobalAttributeHolder.tryAttr(Solos.PasssaltByUid, 1);
-        Set v2 = GlobalAttributeHolder.tryAttr(Solos.PermitsByUid, 1);
-        Assertions.assertEquals("salt", v1);
-        Assertions.assertEquals(Set.of("prd", "dev"), v2);
-    }
-}
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
index d7f0b792b..8e77f9b32 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
@@ -11,7 +11,7 @@
 import org.springframework.context.i18n.LocaleContextHolder;
 import pro.fessional.wings.faceless.service.journal.JournalService;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
-import pro.fessional.wings.slardar.context.GlobalAttributeHolder;
+import pro.fessional.wings.slardar.context.AttributeHolder;
 import pro.fessional.wings.slardar.context.TerminalContext;
 import pro.fessional.wings.slardar.errcode.AuthnErrorEnum;
 import pro.fessional.wings.slardar.security.WingsAuthTypeParser;
@@ -207,7 +207,7 @@ private WarlockAuthnService.Details selectDetails(WinUserBasisTable user, WinUse
 
         if (details != null) {
             details.setAuthType(authType);
-            final String passsalt = GlobalAttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, details.getUserId());
+            final String passsalt = AttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, details.getUserId());
             details.setPasssalt(passsalt);
         }
         return details;
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/user/impl/WarlockUserAuthnServiceImpl.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/user/impl/WarlockUserAuthnServiceImpl.java
index aad1683ef..40f55a012 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/user/impl/WarlockUserAuthnServiceImpl.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/user/impl/WarlockUserAuthnServiceImpl.java
@@ -15,7 +15,7 @@
 import pro.fessional.mirana.pain.CodeException;
 import pro.fessional.wings.faceless.service.journal.JournalService;
 import pro.fessional.wings.faceless.service.lightid.LightIdService;
-import pro.fessional.wings.slardar.context.GlobalAttributeHolder;
+import pro.fessional.wings.slardar.context.AttributeHolder;
 import pro.fessional.wings.slardar.security.PasssaltEncoder;
 import pro.fessional.wings.slardar.security.PasswordHelper;
 import pro.fessional.wings.slardar.security.WingsAuthTypeParser;
@@ -87,7 +87,7 @@ public long create(long userId, @NotNull Authn authn) {
             auth.setAuthType(wingsAuthTypeParser.parse(authType));
             auth.setUsername(authn.getUsername());
 
-            final String salt = GlobalAttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, userId);
+            final String salt = AttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, userId);
             PasswordHelper helper = new PasswordHelper(passwordEncoder, passsaltEncoder);
             auth.setPassword(helper.hash(authn.getPassword(), salt));
 
@@ -129,7 +129,7 @@ public void modify(long userId, @NotNull Authn authn) {
 
             if (authn.getPassword() != null) {
                 PasswordHelper helper = new PasswordHelper(passwordEncoder, passsaltEncoder);
-                final String slat = GlobalAttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, userId);
+                final String slat = AttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, userId);
                 setter.put(t.Password, helper.hash(authn.getPassword(), slat));
             }
 
@@ -166,7 +166,7 @@ public void renew(long userId, @NotNull Renew renew) {
             Map, Object> setter = new HashMap<>();
 
             if (renew.getPassword() != null) {
-                final String slat = GlobalAttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, userId);
+                final String slat = AttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, userId);
                 PasswordHelper helper = new PasswordHelper(passwordEncoder, passsaltEncoder);
                 setter.put(t.Password, helper.hash(renew.getPassword(), slat));
             }
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/user/impl/WarlockUserBasisServiceImpl.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/user/impl/WarlockUserBasisServiceImpl.java
index 009d8a508..f0781f1cb 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/user/impl/WarlockUserBasisServiceImpl.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/user/impl/WarlockUserBasisServiceImpl.java
@@ -12,8 +12,10 @@
 import pro.fessional.wings.faceless.database.helper.DaoAssert;
 import pro.fessional.wings.faceless.service.journal.JournalService;
 import pro.fessional.wings.faceless.service.lightid.LightIdService;
-import pro.fessional.wings.slardar.context.GlobalAttributeHolder;
+import pro.fessional.wings.slardar.context.AttributeHolder;
 import pro.fessional.wings.slardar.context.TerminalContext;
+import pro.fessional.wings.slardar.event.EventPublishHelper;
+import pro.fessional.wings.slardar.event.attr.AttributeRidEvent;
 import pro.fessional.wings.warlock.database.autogen.tables.WinUserBasisTable;
 import pro.fessional.wings.warlock.database.autogen.tables.daos.WinUserBasisDao;
 import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinUserBasis;
@@ -52,32 +54,32 @@ public void afterPropertiesSet() {
         if (winUserBasisDao.notTableExist()) return;
 
         log.info("warlock conf SaltByUid for GlobalAttributeHolder");
-        GlobalAttributeHolder.regLoader(SaltByUid, k -> {
+        AttributeHolder.regLoader(SaltByUid, k -> {
             final WinUserBasisTable t = winUserBasisDao.getTable();
             return winUserBasisDao.ctx()
                                   .select(t.Passsalt)
                                   .from(t)
-                                  .where(t.Id.eq(k.key))
+                                  .where(t.Id.eq(k))
                                   .fetchOneInto(String.class);
         });
 
         log.info("warlock conf LocaleByUid for GlobalAttributeHolder");
-        GlobalAttributeHolder.regLoader(LocaleByUid, k -> {
+        AttributeHolder.regLoader(LocaleByUid, k -> {
             final WinUserBasisTable t = winUserBasisDao.getTable();
             return winUserBasisDao.ctx()
                                   .select(t.Locale)
                                   .from(t)
-                                  .where(t.Id.eq(k.key))
+                                  .where(t.Id.eq(k))
                                   .fetchOneInto(Locale.class);
         });
 
         log.info("warlock conf ZoneIdByUid for GlobalAttributeHolder");
-        GlobalAttributeHolder.regLoader(ZoneIdByUid, k -> {
+        AttributeHolder.regLoader(ZoneIdByUid, k -> {
             final WinUserBasisTable t = winUserBasisDao.getTable();
             return winUserBasisDao.ctx()
                                   .select(t.Zoneid)
                                   .from(t)
-                                  .where(t.Id.eq(k.key))
+                                  .where(t.Id.eq(k))
                                   .fetchOneInto(ZoneId.class);
         });
     }
@@ -92,7 +94,7 @@ public long create(@NotNull Basis user) {
             po.setNickname(user.getNickname());
 
             final String passsalt = RandCode.human(40);
-            GlobalAttributeHolder.putAttr(SaltByUid, uid, passsalt);
+            AttributeHolder.putAttr(SaltByUid, uid, passsalt);
             po.setPasssalt(passsalt);
 
             po.setAvatar(Z.notNullSafe(Null.Str, user.getAvatar()));
@@ -126,5 +128,10 @@ public void modify(long userId, @NotNull Basis user) {
         });
 
         DaoAssert.assertEq1(rc, CommonErrorEnum.DataNotFound);
+
+        AttributeRidEvent event = new AttributeRidEvent();
+        event.rid(LocaleByUid, userId);
+        event.rid(ZoneIdByUid, userId);
+        EventPublishHelper.AsyncWidely.publishEvent(event);
     }
 }
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/session/NonceTokenSessionHelper.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/session/NonceTokenSessionHelper.java
index 2ba056d89..e7998963b 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/session/NonceTokenSessionHelper.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/session/NonceTokenSessionHelper.java
@@ -5,6 +5,7 @@
 import org.cache2k.Cache2kBuilder;
 import org.jetbrains.annotations.Nullable;
 import pro.fessional.mirana.data.R;
+import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k;
 
 import java.util.concurrent.TimeUnit;
 
@@ -21,10 +22,8 @@
  */
 public class NonceTokenSessionHelper {
 
-    private static final Cache cache = Cache2kBuilder
-            .of(String.class, Sf.class)
-            .entryCapacity(100_000)
-            .expireAfterWrite(300, TimeUnit.SECONDS)
+    private static final Cache cache = WingsCache2k
+            .builder(NonceTokenSessionHelper.class, "nonce", 100_000, 300, -1, String.class, Sf.class)
             .build();
 
     private static class Sf {
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
index 8f6cfa99a..53ddf809d 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
@@ -9,7 +9,7 @@
 import pro.fessional.mirana.code.RandCode;
 import pro.fessional.wings.faceless.service.journal.JournalService;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
-import pro.fessional.wings.slardar.context.GlobalAttributeHolder;
+import pro.fessional.wings.slardar.context.AttributeHolder;
 import pro.fessional.wings.slardar.context.TerminalContext;
 import pro.fessional.wings.slardar.security.WingsAuthDetails;
 import pro.fessional.wings.warlock.constants.WarlockGlobalAttribute;
@@ -94,7 +94,7 @@ public Details create(@NotNull Enum authType, String username, WingsAuthDetai
 
             result.setUsername(authn.getUsername());
             result.setPassword(authn.getPassword());
-            result.setPasssalt(GlobalAttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, uid));
+            result.setPasssalt(AttributeHolder.tryAttr(WarlockGlobalAttribute.SaltByUid, uid));
             result.setExpiredDt(authn.getExpiredDt());
 
             return result;

From 1258fdac62abfc442f5fb714487ed8d9db9b1e8e Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Thu, 2 Nov 2023 13:40:43 +0800
Subject: [PATCH 08/23] =?UTF-8?q?=E2=9C=85=20assert=20logger=20in=20testca?=
 =?UTF-8?q?se=20#148?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 WingsBoot.t.md                                | 17 ++--
 .../tiny/task/other/ExecutorServiceTest.java  | 19 +++-
 .../silencer/testing/AssertionLogger.java     | 90 +++++++++++++++++++
 .../app/WingsSilencerTestApplication.java     | 15 ++++
 .../silencer/testing/AssertionLoggerTest.java | 51 +++++++++++
 wings/testing-database/pom.xml                |  4 +
 .../service/conf/RuntimeConfServiceTest.java  | 14 ++-
 .../service/perm/WarlockPermCacheTest.java}   | 22 +++--
 wings/warlock-test/pom.xml                    |  4 +
 9 files changed, 221 insertions(+), 15 deletions(-)
 create mode 100644 wings/silencer-test/src/main/java/pro/fessional/wings/silencer/testing/AssertionLogger.java
 create mode 100644 wings/silencer-test/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerTestApplication.java
 create mode 100644 wings/silencer-test/src/test/java/pro/fessional/wings/silencer/testing/AssertionLoggerTest.java
 rename wings/{warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheListenerTest.java => warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheTest.java} (66%)

diff --git a/WingsBoot.t.md b/WingsBoot.t.md
index 043015be0..3fb71b6f6 100644
--- a/WingsBoot.t.md
+++ b/WingsBoot.t.md
@@ -29,6 +29,7 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m
 * 11023 StringMapXmlWriterTest: jaxb object to Map object
 * 11024 StringMapXmlWriterTest: jaxb object to xml string
 * 11025 WingsSpringBeanScannerTest: with/without scanning
+* 11026 AssertionLoggerTest: install, assert and uninstall
 
 ## 12 Faceless
 
@@ -68,8 +69,8 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m
 * 12034 TemplateUtilTest: merge more partial token
 * 12035 TemplateUtilTest: is boundary
 * 12036 SchemaFulldumpManagerTest: clean and init schema itself
-* 12037 SchemaFulldumpManagerTest: dump DDL to file
-* 12038 SchemaFulldumpManagerTest: dump record to file
+* 12037 SchemaFulldumpManagerTest: dump DDL, check file
+* 12038 SchemaFulldumpManagerTest: dump record, check file
 * 12039 SchemaJournalManagerTest: clean and init schema itself
 * 12040 SchemaJournalManagerTest: create table with prefix
 * 12041 SchemaJournalManagerTest: create sharding
@@ -113,22 +114,22 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m
 * 12079 LightIdServiceImplTest: check lightId range
 * 12080 JooqLocaleConverterTest: jooq locale converter
 * 12081 WingsJooqDaoAliasImplTest: clean and init schema itself
-* 12082 WingsJooqDaoAliasImplTest: print batch load
-* 12083 WingsJooqDaoAliasImplTest: batch insert
+* 12082 WingsJooqDaoAliasImplTest: batch load, check log
+* 12083 WingsJooqDaoAliasImplTest: batch insert, check log
 * 12084 WingsJooqDaoAliasImplTest: batch merge
 * 12085 WingsJooqDaoAliasImplTest: batch store
 * 12086 WingsJooqDaoAliasImplTest: batch update
 * 12087 WingsJooqDaoAliasImplTest: single merge
 * 12088 WingsJooqDaoAliasImplTest: batch merge 3
-* 12089 WingsJooqDaoAliasImplTest: logic delete
+* 12089 WingsJooqDaoAliasImplTest: logic delete, check log
 * 12090 WingsJooqUtilTest: jooq condition with map
 * 12091 WingsJooqUtilTest: jooq condition builder
 * 12092 WingsJooqUtilTest: jooq condition if or false
 * 12093 WingsJooqUtilTest: jooq condition eq or skip
 * 12094 WingsJooqUtilTest: jooq condition in or skip
 * 12095 JooqDeleteListenerTest: clean and init schema itself
-* 12096 JooqDeleteListenerTest: print JournalJooqHelper delete listener
-* 12097 JooqDeleteListenerTest: print dsl DELETE/UPDATE listener
+* 12096 JooqDeleteListenerTest: JournalJooqHelper delete listener, check log
+* 12097 JooqDeleteListenerTest: dsl DELETE/UPDATE listener, check log
 * 12098 JooqMapperCompatibleTest: clean and init schema itself
 * 12099 JooqMapperCompatibleTest: jooq table exist
 * 12100 JooqMapperCompatibleTest: jooq case-sensitive alias
@@ -362,7 +363,7 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m
 * 14061 DbLightIdProviderTest: database impl instance
 * 14062 HzLightIdProviderTest: hazelcast impl instance
 * 14063 JvmLightIdProviderTest: jvm impl instance
-* 14064 WarlockPermCacheListenerTest: load perm and role caching, check log
+* 14064 WarlockPermCacheTest: load perm and role caching, check log
 * 14065 WarlockPermNormalizerTest: normalize role naming prefix
 * 14066 WarlockJournalConfigurationTest: assert TerminalJournalService overriding
 * 14067 BindExceptionAdviceTest: name binding error via post form
diff --git a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java
index 45d5b1dff..13c9e8e14 100644
--- a/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java
+++ b/radiant/tiny-task/src/test/java/pro/fessional/wings/tiny/task/other/ExecutorServiceTest.java
@@ -2,10 +2,12 @@
 
 import io.qameta.allure.TmsLink;
 import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import pro.fessional.wings.silencer.testing.AssertionLogger;
 import pro.fessional.wings.slardar.async.TaskSchedulerHelper;
 
 import java.time.Instant;
@@ -23,13 +25,24 @@ class ExecutorServiceTest {
     @Test
     @TmsLink("C15012")
     void schedule() throws InterruptedException {
+        final AssertionLogger al = AssertionLogger.install();
+        al.rule("-1 run", event -> event.getFormattedMessage().contains("-1 run="));
+        al.rule("-1 cancel", event -> event.getFormattedMessage().contains("-1 cancel=false"));
+        al.rule("=0 run", event -> event.getFormattedMessage().contains("=0 run="));
+        al.rule("=0 cancel", event -> event.getFormattedMessage().contains("=0 cancel=false"));
+        al.rule("+1 cancel", event -> event.getFormattedMessage().contains("+1 cancel=true"));
+        al.rule("== run", event -> event.getFormattedMessage().contains("== run="));
+        al.rule("== cancel", event -> event.getFormattedMessage().contains("== cancel=true"));
+        al.rule(".. run", event -> event.getFormattedMessage().contains(".. run="));
+        al.rule(".. cancel", event -> event.getFormattedMessage().contains(".. cancel=true"));
+        al.start();
+
         final ThreadPoolTaskScheduler scheduler = TaskSchedulerHelper.referScheduler(false);
         final ScheduledFuture f1 = scheduler.schedule(() -> log.info("-1 run={}", System.currentTimeMillis()),
                 Instant.ofEpochMilli(System.currentTimeMillis() - 1000));
         Thread.sleep(500);
         log.info("-1 cancel={}", f1.cancel(false));
 
-
         final ScheduledFuture f2 = scheduler.schedule(() -> log.info("=0 run={}", System.currentTimeMillis()),
                 Instant.ofEpochMilli(System.currentTimeMillis()));
         Thread.sleep(500);
@@ -74,5 +87,9 @@ void schedule() throws InterruptedException {
 
         Thread.sleep(2000);
         log.info("== done=");
+
+        al.stop();
+        Assertions.assertTrue(al.assertAllTrue());
+        al.uninstall();
     }
 }
diff --git a/wings/silencer-test/src/main/java/pro/fessional/wings/silencer/testing/AssertionLogger.java b/wings/silencer-test/src/main/java/pro/fessional/wings/silencer/testing/AssertionLogger.java
new file mode 100644
index 000000000..174708518
--- /dev/null
+++ b/wings/silencer-test/src/main/java/pro/fessional/wings/silencer/testing/AssertionLogger.java
@@ -0,0 +1,90 @@
+package pro.fessional.wings.silencer.testing;
+
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.spi.ILoggingEvent;
+import ch.qos.logback.core.Appender;
+import ch.qos.logback.core.AppenderBase;
+
+import org.jetbrains.annotations.Contract;
+import org.slf4j.LoggerFactory;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.function.Predicate;
+
+
+/**
+ * @author trydofor
+ * @since 2023-11-01
+ */
+public class AssertionLogger extends AppenderBase {
+
+    /**
+     * install, and add rules, start, then assert, finally uninstall.
+     */
+    public static AssertionLogger install() {
+        final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
+        AssertionLogger memoryAppender = new AssertionLogger();
+        memoryAppender.setContext((LoggerContext) LoggerFactory.getILoggerFactory());
+        root.addAppender(memoryAppender);
+        return memoryAppender;
+    }
+
+    private final Map> rules = new LinkedHashMap<>();
+    private final Map count = new LinkedHashMap<>();
+
+    @Contract("_,_->this")
+    public AssertionLogger rule(String name, Predicate rule) {
+        rules.put(name, rule);
+        count.put(name, 0);
+        return this;
+    }
+
+    @Override
+    protected void append(ILoggingEvent event) {
+        if (!isStarted()) return;
+
+        for (Map.Entry> en : rules.entrySet()) {
+            if (en.getValue().test(event)) {
+                count.compute(en.getKey(), (s, c) -> c == null ? 1 : c + 1);
+            }
+        }
+    }
+
+    public Map getAssertCount() {
+        return count;
+    }
+
+    public int getAssertCount(String name) {
+        Integer c = count.get(name);
+        return c == null ? 0 : c;
+    }
+
+    public boolean assertAllTrue() {
+        for (Integer c : count.values()) {
+            if (c == null || c <= 0) return false;
+        }
+        return true;
+    }
+
+
+    public void resetAll() {
+        rules.clear();
+        count.clear();
+    }
+
+    public void resetCount() {
+        count.clear();
+    }
+
+    public void uninstall() {
+        resetAll();
+        final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
+        for (Iterator> iter = root.iteratorForAppenders(); iter.hasNext(); ) {
+            Appender apd = iter.next();
+            if (apd == this) root.detachAppender(apd);
+        }
+    }
+}
diff --git a/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerTestApplication.java b/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerTestApplication.java
new file mode 100644
index 000000000..10d132982
--- /dev/null
+++ b/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/app/WingsSilencerTestApplication.java
@@ -0,0 +1,15 @@
+package pro.fessional.wings.silencer.app;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @author trydofor
+ * @since 2019-07-20
+ */
+@SpringBootApplication
+public class WingsSilencerTestApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(WingsSilencerTestApplication.class, args);
+    }
+}
diff --git a/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/testing/AssertionLoggerTest.java b/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/testing/AssertionLoggerTest.java
new file mode 100644
index 000000000..85af1dbbe
--- /dev/null
+++ b/wings/silencer-test/src/test/java/pro/fessional/wings/silencer/testing/AssertionLoggerTest.java
@@ -0,0 +1,51 @@
+package pro.fessional.wings.silencer.testing;
+
+import io.qameta.allure.TmsLink;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+/**
+ * @author trydofor
+ * @since 2023-11-01
+ */
+@SpringBootTest
+@Slf4j
+class AssertionLoggerTest {
+
+    @Test
+    @TmsLink("C11026")
+    void install() {
+        final AssertionLogger al = AssertionLogger.install();
+        String str = "AssertionLoggerTest to assert in logger";
+        al.rule("info", evn -> evn.getFormattedMessage().contains(str));
+        al.start();
+
+        //
+        log.info(str);
+        Assertions.assertTrue(al.getAssertCount("info") > 0);
+
+        //
+        al.resetCount();
+        al.stop();
+        log.info(str);
+        assertEquals(0, al.getAssertCount("info"));
+
+        al.resetCount();
+        al.start();
+        log.info(str);
+        Assertions.assertTrue(al.getAssertCount("info") > 0);
+
+        /////
+        al.resetCount();
+        al.uninstall();
+        al.rule("info", evn -> evn.getFormattedMessage().contains(str));
+        al.start();
+
+        log.info(str);
+        assertEquals(0, al.getAssertCount("info"));
+    }
+}
\ No newline at end of file
diff --git a/wings/testing-database/pom.xml b/wings/testing-database/pom.xml
index fe36dd848..8d3ccf0ad 100644
--- a/wings/testing-database/pom.xml
+++ b/wings/testing-database/pom.xml
@@ -21,6 +21,10 @@
             pro.fessional.wings
             silencer-curse
         
+        
+            pro.fessional.wings
+            silencer-test
+        
         
             org.springframework.boot
             spring-boot-starter-jdbc
diff --git a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java
index a2eec5a50..f19bfe38d 100644
--- a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java
+++ b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java
@@ -10,6 +10,7 @@
 import org.springframework.cache.CacheManager;
 import pro.fessional.mirana.time.Sleep;
 import pro.fessional.wings.silencer.modulate.RunMode;
+import pro.fessional.wings.silencer.testing.AssertionLogger;
 import pro.fessional.wings.slardar.cache.WingsCacheHelper;
 import pro.fessional.wings.warlock.caching.CacheConst;
 import pro.fessional.wings.warlock.service.conf.impl.RuntimeConfServiceImpl;
@@ -128,6 +129,12 @@ void testMode() {
     @Test
     @TmsLink("C14013")
     void testCacheWithCud() {
+        final AssertionLogger al = AssertionLogger.install();
+        al.rule("insert", event -> event.getFormattedMessage().contains("insert into `win_conf_runtime`"));
+        al.rule("update", event -> event.getFormattedMessage().contains("update `win_conf_runtime`"));
+        al.rule("evictAllConfCache", event -> event.getFormattedMessage().contains("evictAllConfCache by win_conf_runtime, TableChangeEvent"));
+        al.start();
+
         final List arm = List.of(RunMode.Develop, RunMode.Local);
         final String key = "RuntimeConfCacheTest.testCache";
         // insert on duplicated key
@@ -135,11 +142,16 @@ void testCacheWithCud() {
         final List arm1 = runtimeConfService.getList(key, RunMode.class);
         final List arm2 = runtimeConfService.getList(key, RunMode.class);
 
-        // check log update
+        // update `win_conf_runtime`
         // evictAllConfCache by win_conf_runtime, TableChangeEvent
         runtimeConfService.setObject(key, arm);
         Sleep.ignoreInterrupt(2_000);
 
+        Assertions.assertTrue(al.getAssertCount("insert") > 0);
+        Assertions.assertTrue(al.getAssertCount("update") > 0);
+        Assertions.assertEquals(2, al.getAssertCount("evictAllConfCache"));
+        al.uninstall();
+
         final List rm1 = runtimeConfService.getList(key, RunMode.class);
         final List rm2 = runtimeConfService.getList(key, RunMode.class);
 
diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheListenerTest.java b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheTest.java
similarity index 66%
rename from wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheListenerTest.java
rename to wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheTest.java
index 65155a30a..54fc5bb0f 100644
--- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheListenerTest.java
+++ b/wings/warlock-bond/src/test/java/pro/fessional/wings/warlock/service/perm/WarlockPermCacheTest.java
@@ -3,10 +3,11 @@
 import io.qameta.allure.TmsLink;
 import lombok.Setter;
 import lombok.extern.slf4j.Slf4j;
-import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
+import pro.fessional.wings.silencer.testing.AssertionLogger;
 
 /**
  * @author trydofor
@@ -14,7 +15,7 @@
  */
 @Slf4j
 @SpringBootTest
-class WarlockPermCacheListenerTest {
+class WarlockPermCacheTest {
 
     @Setter(onMethod_ = {@Autowired})
     private WarlockPermService warlockPermServer;
@@ -23,23 +24,34 @@ class WarlockPermCacheListenerTest {
 
     @Test
     @TmsLink("C14064")
-    @Disabled("Simulate slow processing and observe cache changes")
     void cleanCache() throws InterruptedException {
+        AssertionLogger al = AssertionLogger.install();
+        al.rule("loadPermAll", event -> event.getFormattedMessage().contains("loadPermAll size="));
+        al.rule("loadRoleAll", event -> event.getFormattedMessage().contains("loadRoleAll size="));
+        al.start();
+
         log.warn("No cache, select Perm from Db");
         warlockPermServer.loadPermAll();
         log.warn("No cache, select Role from Db");
         warlockRoleService.loadRoleAll();
+
         log.warn("Cache, no Db select");
         warlockPermServer.loadPermAll();
         warlockRoleService.loadRoleAll();
+
         log.warn("Modify Perm=1, trigger jooq CUD event");
         warlockPermServer.modify(1, "test cleanCache");
-        log.info("Sleep 3s, Wait async event");
-        Thread.sleep(3000);
+        log.info("Sleep 2s, Wait async event");
+        Thread.sleep(2000);
+
         log.warn("No cache, select Perm from Db");
         warlockPermServer.loadPermAll();
         log.warn("Cache, no Db select");
         warlockRoleService.loadRoleAll();
         log.warn("Check the log");
+
+        Assertions.assertEquals(2, al.getAssertCount("loadPermAll"));
+        Assertions.assertEquals(1, al.getAssertCount("loadRoleAll"));
+        al.uninstall();
     }
 }
diff --git a/wings/warlock-test/pom.xml b/wings/warlock-test/pom.xml
index d0be77655..e95e62a03 100644
--- a/wings/warlock-test/pom.xml
+++ b/wings/warlock-test/pom.xml
@@ -29,5 +29,9 @@
             pro.fessional.wings
             testing-database
         
+        
+            pro.fessional.wings
+            silencer-test
+        
     
 

From 6ae900fed14f6961cde84f45f64fa3ce6109a72b Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Fri, 3 Nov 2023 09:55:15 +0800
Subject: [PATCH 09/23] =?UTF-8?q?=E2=9C=A8=20AttributeCache=20handle=20att?=
 =?UTF-8?q?ribute=20cache=20#149?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 observe/mirana                                |   2 +-
 .../WingsHazelcastCacheCustomizer.java        |   5 +-
 .../slardar/event/EventPublishHelperTest.java |  13 +
 .../concur/impl/DebounceInterceptor.java      |   2 +-
 .../concur/impl/FirstBloodInterceptor.java    |   2 +-
 .../domainx/DefaultDomainRequestMatcher.java  |   4 +-
 .../wings/slardar/cache/WingsCache.java       |  48 ++-
 .../slardar/cache/cache2k/NullsCache2k.java   |   2 +-
 .../slardar/cache/cache2k/WingsCache2k.java   |  87 +++--
 .../cache/cache2k/WingsCache2kManager.java    |   8 +-
 .../slardar/cache/spring/NullsCache.java      |   2 +-
 .../wings/slardar/concur/ProgressContext.java |   2 +-
 .../wings/slardar/context/AttributeCache.java | 331 ++++++++++++++++++
 .../slardar/context/AttributeHolder.java      | 143 +++-----
 .../event/attr/AttributeEventListener.java    |  24 +-
 .../slardar/event/attr/AttributeRidEvent.java |  15 -
 .../slardar/spring/prop/SlardarCacheProp.java |  16 -
 .../security/justauth/JustAuthStateCache.java |   2 +-
 .../session/NonceTokenSessionHelper.java      |   2 +-
 .../WarlockSecurityBeanConfiguration.java     |   2 +-
 20 files changed, 546 insertions(+), 166 deletions(-)
 create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeCache.java

diff --git a/observe/mirana b/observe/mirana
index 2f51d286b..9e877fdde 160000
--- a/observe/mirana
+++ b/observe/mirana
@@ -1 +1 @@
-Subproject commit 2f51d286bbf4758b727d98dc7d128212f2e09da6
+Subproject commit 9e877fdde97542c0af0f0bf3f87607972f303a11
diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/cache/hazelcast/WingsHazelcastCacheCustomizer.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/cache/hazelcast/WingsHazelcastCacheCustomizer.java
index 8915c09d1..574277bb3 100644
--- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/cache/hazelcast/WingsHazelcastCacheCustomizer.java
+++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/cache/hazelcast/WingsHazelcastCacheCustomizer.java
@@ -6,12 +6,11 @@
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.boot.autoconfigure.hazelcast.HazelcastConfigCustomizer;
+import pro.fessional.wings.slardar.cache.WingsCache;
 import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp;
 
 import java.util.Map;
 
-import static pro.fessional.wings.slardar.spring.prop.SlardarCacheProp.wildcard;
-
 /**
  * @author trydofor
  * @since 2023-07-18
@@ -35,7 +34,7 @@ public void customize(Config config) {
         // check level
         for (Map.Entry entry : cacheProp.getLevel().entrySet()) {
             final SlardarCacheProp.Conf lvl = entry.getValue();
-            final String name = wildcard(entry.getKey());
+            final String name = WingsCache.Naming.wildcard(entry.getKey());
             checkMapConf(config, mapCnf, name, lvl.getMaxLive(), lvl.getMaxIdle(), lvl.getMaxSize());
         }
     }
diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java
index 6412afc45..ca8424a7b 100644
--- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java
+++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java
@@ -55,5 +55,18 @@ public void testAttributeRidEvent() {
         EventPublishHelper.AsyncGlobal.publishEvent(event);
         Sleep.ignoreInterrupt(1000);
         Assertions.assertNull(AttributeHolder.getAttr(Test1, 1));
+
+        //
+        AttributeHolder.putAttr(Test1, 1, "1");
+        Assertions.assertEquals("1", AttributeHolder.getAttr(Test1, 1));
+
+        // unregister, no listener affect
+        AttributeHolder.unregister(Test1);
+
+        AttributeRidEvent event2 = new AttributeRidEvent();
+        event2.rid(Test1, 1);
+        EventPublishHelper.AsyncGlobal.publishEvent(event2);
+        Sleep.ignoreInterrupt(1000);
+        Assertions.assertEquals("1", AttributeHolder.getAttr(Test1, 1));
     }
 }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DebounceInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DebounceInterceptor.java
index 074f17c97..0c99b930c 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DebounceInterceptor.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/DebounceInterceptor.java
@@ -43,7 +43,7 @@ public class DebounceInterceptor implements AutoRegisterInterceptor {
     private int order = ORDER;
 
     public DebounceInterceptor(int capacity, int maxWait, ModelAndView res) {
-        this.cache = WingsCache2k.builder(DebounceInterceptor.class, "cache", capacity, maxWait, -1, String.class, Dto.class).build();
+        this.cache = WingsCache2k.builder(DebounceInterceptor.class, "cache", capacity, maxWait, 0, String.class, Dto.class).build();
         this.modelAndView = res;
     }
 
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java
index 9b78f34f9..f3428c80f 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/FirstBloodInterceptor.java
@@ -23,7 +23,7 @@ public class FirstBloodInterceptor implements AutoRegisterInterceptor {
 
     public static final int ORDER = WingsOrdered.Lv4Application + 3_000;
 
-    private static final Cache Cache = WingsCache2k.builder(FirstBloodInterceptor.class, "handler", 100_000, 3600, -1).build();
+    private static final Cache Cache = WingsCache2k.builder(FirstBloodInterceptor.class, "handler", 100_000, 3600, 0).build();
 
     private final List handlers;
 
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/domainx/DefaultDomainRequestMatcher.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/domainx/DefaultDomainRequestMatcher.java
index 46c5c7a79..ddc53d36b 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/domainx/DefaultDomainRequestMatcher.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/domainx/DefaultDomainRequestMatcher.java
@@ -36,8 +36,8 @@ public class DefaultDomainRequestMatcher implements DomainRequestMatcher {
     public DefaultDomainRequestMatcher(String pathPrefix, Collection otherUrl, int cacheSize, Supplier> supplier) {
         this.pathPrefix = pathPrefix;
         this.otherUrl.addAll(otherUrl);
-        this.matchedUrl = WingsCache2k.builder(DefaultDomainRequestMatcher.class, "matchedUrl", cacheSize, -1, -1, String.class, Boolean.class).build();
-        this.notfoundUrl = WingsCache2k.builder(DefaultDomainRequestMatcher.class, "notfoundUrl", cacheSize, -1, -1, String.class, Boolean.class).build();
+        this.matchedUrl = WingsCache2k.builder(DefaultDomainRequestMatcher.class, "matchedUrl", cacheSize, 0, 0, String.class, Boolean.class).build();
+        this.notfoundUrl = WingsCache2k.builder(DefaultDomainRequestMatcher.class, "notfoundUrl", cacheSize, 0, 0, String.class, Boolean.class).build();
         this.handlerMappingSupplier = supplier;
     }
 
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/WingsCache.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/WingsCache.java
index feb2ed934..be8e07d8f 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/WingsCache.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/WingsCache.java
@@ -4,6 +4,7 @@
 
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * @author trydofor
@@ -26,6 +27,49 @@ public interface WingsCache {
      */
     String Wildcard = "*";
 
+
+    class Naming {
+        private static final AtomicLong Counter = new AtomicLong(1);
+
+        /**
+         * format the cache name
+         */
+        @NotNull
+        public static String use(@NotNull Class owner, @NotNull String use) {
+            return owner.getName() + Joiner + use + "-" + Counter.getAndIncrement();
+        }
+
+        /**
+         * format the cache name
+         */
+        @NotNull
+        public static String use(@NotNull Class clz, @NotNull Class use) {
+            return use(clz, use.getName().substring(use.getPackageName().length() + 1));
+        }
+
+        /**
+         * join the parts with Joiner
+         */
+        public static String join(String... part) {
+            return String.join(Joiner, part);
+        }
+
+        /**
+         * append Wildcard to the end
+         */
+        @NotNull
+        public static String wildcard(String level) {
+            return level + Joiner + Wildcard;
+        }
+
+        public static boolean inLevel(String name, String level) {
+            if (name == null || level == null) return false;
+            final int len = level.length();
+            return name.regionMatches(true, 0, level, 0, len)
+                   && name.regionMatches(true, len, Joiner, 0, Joiner.length());
+        }
+    }
+
     class Manager {
         /**
          * cache in current jvm, default cache2k
@@ -69,10 +113,6 @@ class Level {
          */
         public static final String Session = "session" + Joiner;
 
-        public static String join(String... part) {
-            return String.join(Joiner, part);
-        }
-
         public static String forever(String... part) {
             return Forever + String.join(Joiner, part);
         }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/NullsCache2k.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/NullsCache2k.java
index 188c7b64b..5f99f37f2 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/NullsCache2k.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/NullsCache2k.java
@@ -16,7 +16,7 @@ public class NullsCache2k extends SpringCache2kCache {
 
     public NullsCache2k(Cache cache, int size, int live) {
         super(cache);
-        this.nulls = size > 0 ? WingsCache2k.builder(NullsCache2k.class, "nulls", size, live, -1).build() : null;
+        this.nulls = size > 0 ? WingsCache2k.builder(NullsCache2k.class, "nulls", size, live, 0).build() : null;
     }
 
     @Override
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2k.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2k.java
index 0a8f4c473..065c7f24f 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2k.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2k.java
@@ -4,10 +4,9 @@
 import org.cache2k.config.ToggleFeature;
 import org.jetbrains.annotations.Contract;
 import org.jetbrains.annotations.NotNull;
-import pro.fessional.wings.slardar.cache.WingsCache;
+import pro.fessional.wings.slardar.cache.WingsCache.Naming;
 
 import java.time.Duration;
-import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * @author trydofor
@@ -27,40 +26,88 @@ private static Class initFeatureJmx() {
         }
     }
 
-    private static final AtomicLong NameCounter = new AtomicLong(1);
-
-    public static String name(Class clz, String use) {
-        if (clz == null) return null;
-        return clz.getName() + WingsCache.Joiner + use + "-" + NameCounter.getAndIncrement();
-    }
-
+    /**
+     * construct UnknownTypes builder with max size, ttl and tti in second
+     *
+     * @param owner owner part of name
+     * @param use   usage part of name
+     * @param max   capacity, max size
+     * @param ttl   time to live in second, skip if le 0
+     * @param tti   time to idle in second, skip if le 0
+     */
     @NotNull
-    public static Cache2kBuilder builder(Class clz, String use, int max, int ttl, int tti) {
-        return build(Cache2kBuilder.forUnknownTypes().name(name(clz, use)), max, ttl, tti, true);
+    public static Cache2kBuilder builder(Class owner, String use, int max, int ttl, int tti) {
+        return builder(Cache2kBuilder.forUnknownTypes().name(Naming.use(owner, use)), max, ttl, tti, true);
     }
 
+    /**
+     * construct K-V type builder with max size, ttl and tti in second
+     *
+     * @param owner owner part of name
+     * @param use   usage part of name
+     * @param max   capacity, max size
+     * @param ttl   time to live in second, skip if le 0
+     * @param tti   time to idle in second, skip if le 0
+     */
+
     @NotNull
-    public static  Cache2kBuilder builder(Class clz, String use, int max, int ttl, int tti, Class k, Class v) {
-        return build(Cache2kBuilder.of(k, v).name(name(clz, use)), max, ttl, tti, true);
+    public static  Cache2kBuilder builder(Class owner, String use, int max, int ttl, int tti, Class k, Class v) {
+        return builder(Cache2kBuilder.of(k, v).name(Naming.use(owner, use)), max, ttl, tti, true);
     }
 
+    /**
+     * construct UnknownTypes builder with max size, ttl and tti in second
+     *
+     * @param owner owner part of name
+     * @param use   usage part of name
+     * @param max   capacity, max size
+     * @param ttl   time to live, skip if null
+     * @param tti   time to idle, skip if null
+     */
     @NotNull
-    public static Cache2kBuilder builder(Class clz, String use, int max, Duration ttl, Duration tti) {
-        return build(Cache2kBuilder.forUnknownTypes().name(name(clz, use)), max, ttl, tti, true);
+    public static Cache2kBuilder builder(Class owner, String use, int max, Duration ttl, Duration tti) {
+        return builder(Cache2kBuilder.forUnknownTypes().name(Naming.use(owner, use)), max, ttl, tti, true);
     }
 
+    /**
+     * construct K-V type builder with max size, ttl and tti in second
+     *
+     * @param owner owner part of name
+     * @param use   usage part of name
+     * @param max   capacity, max size
+     * @param ttl   time to live, skip if null
+     * @param tti   time to idle, skip if null
+     */
     @NotNull
-    public static  Cache2kBuilder builder(Class clz, String use, int max, Duration ttl, Duration tti, Class k, Class v) {
-        return build(Cache2kBuilder.of(k, v).name(name(clz, use)), max, ttl, tti, true);
+    public static  Cache2kBuilder builder(Class owner, String use, int max, Duration ttl, Duration tti, Class k, Class v) {
+        return builder(Cache2kBuilder.of(k, v).name(Naming.use(owner, use)), max, ttl, tti, true);
     }
 
+    /**
+     * builder with max size, ttl and tti in second, and feather
+     *
+     * @param bld     the builder
+     * @param max     capacity, max size
+     * @param ttl     time to live in second, skip if null
+     * @param tti     time to idle in second, skip if null
+     * @param feature whether enable feather
+     */
     @Contract("_,_,_,_,_->param1")
-    public static  Cache2kBuilder build(Cache2kBuilder bld, int max, int ttl, int tti, boolean feature) {
-        return build(bld, max, ttl > 0 ? Duration.ofSeconds(ttl) : null, tti > 0 ? Duration.ofSeconds(tti) : null, feature);
+    public static  Cache2kBuilder builder(Cache2kBuilder bld, int max, int ttl, int tti, boolean feature) {
+        return builder(bld, max, ttl > 0 ? Duration.ofSeconds(ttl) : null, tti > 0 ? Duration.ofSeconds(tti) : null, feature);
     }
 
+    /**
+     * builder with max size, ttl and tti in second, and feather
+     *
+     * @param bld     the builder
+     * @param max     capacity, max size
+     * @param ttl     time to live, skip if null
+     * @param tti     time to idle, skip if null
+     * @param feature whether enable feather
+     */
     @Contract("_,_,_,_,_->param1")
-    public static  Cache2kBuilder build(Cache2kBuilder bld, int max, Duration ttl, Duration tti, boolean feature) {
+    public static  Cache2kBuilder builder(Cache2kBuilder bld, int max, Duration ttl, Duration tti, boolean feature) {
 
         if (feature && FeatureJmx != null) {
             bld.enable(FeatureJmx);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2kManager.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2kManager.java
index c5278974a..94c27d36c 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2kManager.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/cache2k/WingsCache2kManager.java
@@ -16,8 +16,6 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.Function;
 
-import static pro.fessional.wings.slardar.spring.prop.SlardarCacheProp.inLevel;
-
 /**
  * @author trydofor
  * @since 2023-11-01
@@ -43,16 +41,16 @@ public  void enlist(@NotNull CacheBuildContext ctx) {
                 for (Map.Entry entry : slardarCacheProp.getLevel().entrySet()) {
                     // same prefix
                     final String key = entry.getKey();
-                    if (inLevel(name, key)) {
+                    if (WingsCache.Naming.inLevel(name, key)) {
                         final SlardarCacheProp.Conf level = entry.getValue();
-                        WingsCache2k.build(bld, level.getMaxSize(), level.getMaxLive(), level.getMaxIdle(), false);
+                        WingsCache2k.builder(bld, level.getMaxSize(), level.getMaxLive(), level.getMaxIdle(), false);
                         log.info("Wings Cache2k name={}, level={}", name, key);
                         return;
                     }
                 }
 
                 final SlardarCacheProp.Conf common = slardarCacheProp.getCommon();
-                WingsCache2k.build(bld, common.getMaxSize(), common.getMaxLive(), common.getMaxIdle(), false);
+                WingsCache2k.builder(bld, common.getMaxSize(), common.getMaxLive(), common.getMaxIdle(), false);
                 log.info("Wings Cache2k name={}, level=default", name);
             }
         };
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/spring/NullsCache.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/spring/NullsCache.java
index b8ce9a858..a42e9d802 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/spring/NullsCache.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/spring/NullsCache.java
@@ -24,7 +24,7 @@ public class NullsCache implements Cache {
 
     public NullsCache(Cache cache, int size, int live) {
         this.backend = cache;
-        this.nulls = size > 0 ? WingsCache2k.builder(NullsCache.class, "nulls", size, live, -1).build() : null;
+        this.nulls = size > 0 ? WingsCache2k.builder(NullsCache.class, "nulls", size, live, 0).build() : null;
     }
 
     @Override
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/ProgressContext.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/ProgressContext.java
index c3202d223..514080cad 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/ProgressContext.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/concur/ProgressContext.java
@@ -18,7 +18,7 @@
 public class ProgressContext {
 
     private static final Cache Cache = WingsCache2k
-            .builder(ProgressContext.class, "bar", -1, 24 * 3600, -1, Object.class, Bar.class)
+            .builder(ProgressContext.class, "bar", 0, 24 * 3600, 0, Object.class, Bar.class)
             .build();
 
     private static final AtomicLong Counter = new AtomicLong(0);
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeCache.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeCache.java
new file mode 100644
index 000000000..5f9d5e34a
--- /dev/null
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeCache.java
@@ -0,0 +1,331 @@
+package pro.fessional.wings.slardar.context;
+
+import lombok.Getter;
+import lombok.Setter;
+import org.cache2k.Cache;
+import org.cache2k.config.CacheType;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import pro.fessional.mirana.best.TypedReg;
+import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+/**
+ * thread safe
+ *
+ * @author trydofor
+ * @since 2023-11-02
+ */
+public class AttributeCache {
+
+    private static final HashMap, Set>> Registers = new HashMap<>();
+
+    private final Cache cache;
+    @Setter
+    private Function loader;
+
+    @Getter
+    private final Class owner;
+    @Getter
+    private final TypedReg typed;
+    @Getter
+    private final String name;
+    @Getter
+    private final int size;
+    @Getter
+    private final int live;
+    @Getter
+    private final int idle;
+
+    public AttributeCache(@NotNull Class owner, @NotNull TypedReg reg, int max, int ttl, int tti) {
+        this(owner, reg, max, ttl, tti, null);
+    }
+
+    @SuppressWarnings("unchecked")
+    public AttributeCache(@NotNull Class owner, @NotNull TypedReg reg, int max, int ttl, int tti, @Nullable Function loader) {
+        final String use = reg.regType.getName().substring(reg.regType.getPackageName().length() + 1);
+        this.cache = (Cache) WingsCache2k
+                .builder(owner, use, max, ttl, tti)
+                .keyType(CacheType.of(reg.keyType))
+                .valueType(CacheType.of(reg.valType))
+                .build();
+        this.loader = loader;
+        this.owner = owner;
+        this.typed = reg;
+        this.name = cache.getName();
+        this.size = Math.max(0, max);
+        this.live = Math.max(0, ttl);
+        this.idle = Math.max(0, tti);
+    }
+
+    /**
+     * Put key and value
+     *
+     * @param key   the key
+     * @param value the value
+     */
+    public void putAttr(@NotNull K key, @NotNull V value) {
+        cache.put(key, value);
+    }
+
+    /**
+     * Put key and value with ttl
+     *
+     * @param key   the key
+     * @param value the value
+     * @param ttl   time to live in second
+     */
+    public void putAttr(@NotNull K key, @NotNull V value, int ttl) {
+        if (ttl > 0) {
+            cache.mutate(key, entry -> {
+                entry.setValue(value);
+                entry.setExpiryTime(entry.getStartTime() + ttl * 1000L);
+            });
+        }
+        else {
+            cache.put(key, value);
+        }
+    }
+
+    /**
+     * Put keys and values
+     *
+     * @param map map of key-value
+     */
+    public void putAttrs(@NotNull Map map) {
+        cache.putAll(map);
+    }
+
+    /**
+     * Put keys and values with ttl
+     *
+     * @param map map of key-value
+     * @param ttl time to live in second
+     */
+    public void putAttrs(@NotNull Map map, int ttl) {
+        if (ttl > 0) {
+            for (Map.Entry en : map.entrySet()) {
+                cache.mutate(en.getKey(), entry -> {
+                    entry.setValue(en.getValue());
+                    entry.setExpiryTime(entry.getStartTime() + ttl * 1000L);
+                });
+            }
+        }
+        else {
+            cache.putAll(map);
+        }
+    }
+
+    /**
+     * Try to get value by key, load it if not found, return `elze` if the result is null.
+     *
+     * @param key  unique key, e.g. userId
+     * @param elze return `elze` if result is null
+     */
+    @Contract("_,!null->!null")
+    public V tryAttr(@NotNull K key, V elze) {
+        final V obj = tryAttr(key, false, 0);
+        return obj == null ? elze : obj;
+    }
+
+    /**
+     * Try to get value by key, load it if not found, return `elze` if the result is null.
+     *
+     * @param key  unique key, e.g. userId
+     * @param elze return `elze` if result is null
+     * @param ttl  ttl in second
+     */
+    @Contract("_,!null,_->!null")
+    public V tryAttr(@NotNull K key, V elze, int ttl) {
+        final V obj = tryAttr(key, false, ttl);
+        return obj == null ? elze : obj;
+    }
+
+    /**
+     * Try to get an attribute by typed key, load it if not found, throw NPE if the result is null.
+     *
+     * @param key unique key, e.g. userId
+     */
+    @NotNull
+    public V tryAttr(@NotNull K key) {
+        return tryAttr(key, true, 0);
+    }
+
+    /**
+     * Try to get an attribute by typed key, load it if not found, throw NPE if the result is null.
+     *
+     * @param key unique key, e.g. userId
+     * @param ttl ttl in second
+     */
+    @NotNull
+    public V tryAttr(@NotNull K key, int ttl) {
+        return tryAttr(key, true, ttl);
+    }
+
+    /**
+     * Try to get an attribute by typed key, load it if not found, throw NPE if notnull and the result is null.
+     *
+     * @param key     unique key, e.g. userId
+     * @param notnull whether notnull
+     */
+    @Contract("_,true ->!null")
+    public V tryAttr(@NotNull K key, boolean notnull) {
+        return tryAttr(key, notnull, 0);
+    }
+
+    /**
+     * Try to get an attribute by typed key, load it if not found, throw NPE if notnull and the result is null.
+     *
+     * @param key     unique key, e.g. userId
+     * @param notnull whether notnull
+     * @param ttl     ttl in second
+     */
+    @Contract("_,true,_ ->!null")
+    public V tryAttr(@NotNull K key, boolean notnull, int ttl) {
+
+        final V rst = cache.invoke(key, entry -> {
+
+            if (entry.exists()) {
+                return entry.getValue();
+            }
+
+            V v = null;
+            if (loader != null) {
+                v = loader.apply(key);
+                entry.setValue(v);
+                if (ttl > 0) {
+                    entry.setExpiryTime(entry.getStartTime() + ttl * 1000L);
+                }
+            }
+
+            return v;
+        });
+
+        if (rst == null && notnull) {
+            throw new NullPointerException("typed=" + typed + ",key=" + key);
+        }
+        else {
+            return rst;
+        }
+    }
+
+    /**
+     * Get an attribute by typed key, and NOT load if not found.
+     *
+     * @param key unique key, e.g. userId
+     */
+    @Nullable
+    public V getAttr(@NotNull K key) {
+        return cache.get(key);
+    }
+
+    /**
+     * Get all attributes by typed keys, and NOT load if not found.
+     *
+     * @param key unique key, e.g. userId
+     */
+
+    @NotNull
+    public Map getAttrs(@NotNull Collection key) {
+        return cache.getAll(key);
+    }
+
+    /**
+     * remove an attribute by key
+     *
+     * @param key unique key, e.g. userId
+     */
+    public void ridAttr(K key) {
+        cache.remove(key);
+    }
+
+    /**
+     * remove all attribute by keys
+     *
+     * @param key unique key, e.g. userId
+     */
+    public void ridAttrs(Collection key) {
+        if (key == null || key.isEmpty()) return;
+        cache.removeAll(key);
+    }
+
+    /**
+     * remove all attribute
+     */
+    public void ridAttrAll() {
+        cache.removeAll();
+    }
+
+
+    /**
+     * register to the global
+     */
+    public void register() {
+        final Set> tmp;
+        synchronized (Registers) {
+            tmp = Registers.computeIfAbsent(typed, ignore -> new LinkedHashSet<>());
+        }
+        synchronized (tmp) {
+            tmp.add(this);
+        }
+    }
+
+    /**
+     * unregister from the global
+     */
+    public void unregister() {
+        final Set> tmp;
+        synchronized (Registers) {
+            tmp = Registers.get(typed);
+        }
+
+        if (tmp == null) return;
+
+        synchronized (tmp) {
+            tmp.remove(this);
+        }
+
+    }
+
+    /**
+     * thread safely list the registered types
+     */
+    @NotNull
+    public static Set> registered() {
+        final LinkedHashSet> tmp;
+        synchronized (Registers) {
+            tmp = new LinkedHashSet<>(Registers.keySet());
+        }
+        return tmp;
+    }
+
+    /**
+     * thread safely loop the registered type
+     */
+    @SuppressWarnings("unchecked")
+    public static  void forEach(@NotNull TypedReg reg, @NotNull Consumer> handle) {
+        final Set> tmp;
+        synchronized (Registers) {
+            tmp = Registers.get(reg);
+        }
+
+        if (tmp == null) return;
+
+        final LinkedHashSet> ats;
+        synchronized (tmp) {
+            ats = new LinkedHashSet<>(tmp);
+        }
+
+        for (AttributeCache ac : ats) {
+            handle.accept((AttributeCache) ac);
+        }
+    }
+}
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeHolder.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeHolder.java
index 79e4412f5..21cedcb74 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeHolder.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/context/AttributeHolder.java
@@ -1,11 +1,9 @@
 package pro.fessional.wings.slardar.context;
 
-import org.cache2k.Cache;
 import org.jetbrains.annotations.Contract;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import pro.fessional.mirana.best.TypedReg;
-import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k;
 import pro.fessional.wings.slardar.event.attr.AttributeRidEvent;
 
 import java.util.Arrays;
@@ -18,7 +16,7 @@
 import java.util.function.Function;
 
 /**
- * App level, default ttl=12H, unbounded cache.
+ * App level, default ttl=12H, unbounded thread safe cache.
  * Need manually register and remove (or publish {@link AttributeRidEvent})
  *
  * @author trydofor
@@ -30,27 +28,21 @@ public class AttributeHolder {
      * default ttl = 12H
      */
     public static final int TtlDefault = 12 * 3600;
-    private static final ConcurrentHashMap, Function> LOADER = new ConcurrentHashMap<>();
-
-    private static final ConcurrentHashMap, Cache> HOLDER = new ConcurrentHashMap<>();
+    private static final ConcurrentHashMap, AttributeCache> Holder = new ConcurrentHashMap<>();
 
+    @SuppressWarnings("unchecked")
     @NotNull
-    private static Cache getCache(@NotNull TypedReg reg) {
-        return HOLDER.computeIfAbsent(reg, k ->
-                WingsCache2k.builder(AttributeHolder.class,
-                        reg.regType.getName().substring(reg.regType.getPackageName().length() + 1),
-                        -1, TtlDefault, -1
-                ).build());
+    public static  AttributeCache getCache(@NotNull TypedReg reg) {
+        return (AttributeCache) Holder.computeIfAbsent(reg, k -> {
+            var cache = new AttributeCache<>(AttributeHolder.class, reg, 0, TtlDefault, 0);
+            cache.register();
+            return cache;
+        });
     }
 
     @NotNull
     public static Set> holders() {
-        return new HashSet<>(HOLDER.keySet());
-    }
-
-    @NotNull
-    public static Set> loaders() {
-        return new HashSet<>(LOADER.keySet());
+        return new HashSet<>(Holder.keySet());
     }
 
     /**
@@ -61,9 +53,8 @@ private static Cache getCache(@NotNull TypedReg reg) {
      * @param     key type
      * @param     value type
      */
-    @SuppressWarnings("unchecked")
     public static  void regLoader(@NotNull TypedReg reg, @NotNull Function loader) {
-        LOADER.put(reg, (Function) loader);
+        getCache(reg).setLoader(loader);
     }
 
     /**
@@ -76,7 +67,7 @@ public static  void regLoader(@NotNull TypedReg reg, @NotNull Functi
      * @param    value type
      */
     public static  void putAttr(@NotNull TypedReg reg, @NotNull K key, @NotNull V value) {
-        putAttr(reg, key, value, TtlDefault);
+        getCache(reg).putAttr(key, value);
     }
 
     /**
@@ -90,10 +81,7 @@ public static  void putAttr(@NotNull TypedReg reg, @NotNull K key, @
      * @param    value type
      */
     public static  void putAttr(@NotNull TypedReg reg, @NotNull K key, @NotNull V value, int ttl) {
-        getCache(reg).mutate(key, entry -> {
-            entry.setValue(value);
-            entry.setExpiryTime(entry.getStartTime() + ttl * 1000L);
-        });
+        getCache(reg).putAttr(key, value, ttl);
     }
 
     /**
@@ -105,7 +93,7 @@ public static  void putAttr(@NotNull TypedReg reg, @NotNull K key, @
      * @param  value type
      */
     public static  void putAttrs(@NotNull TypedReg reg, @NotNull Map map) {
-        putAttrs(reg, map, TtlDefault);
+        getCache(reg).putAttrs(map);
     }
 
     /**
@@ -118,15 +106,7 @@ public static  void putAttrs(@NotNull TypedReg reg, @NotNull Map value type
      */
     public static  void putAttrs(@NotNull TypedReg reg, @NotNull Map map, int ttl) {
-        if (map.isEmpty()) return;
-
-        final Cache cache = getCache(reg);
-        for (Map.Entry en : map.entrySet()) {
-            cache.mutate(en.getKey(), entry -> {
-                entry.setValue(en.getValue());
-                entry.setExpiryTime(entry.getStartTime() + ttl * 1000L);
-            });
-        }
+        getCache(reg).putAttrs(map, ttl);
     }
 
     /**
@@ -140,7 +120,7 @@ public static  void putAttrs(@NotNull TypedReg reg, @NotNull Map!null")
     public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, V elze) {
-        return tryAttr(reg, key, elze, TtlDefault);
+        return getCache(reg).tryAttr(key, elze);
     }
 
     /**
@@ -155,8 +135,7 @@ public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, V el
      */
     @Contract("_,_,!null,_->!null")
     public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, V elze, int ttl) {
-        final V obj = tryAttr(reg, key, false, ttl);
-        return obj == null ? elze : obj;
+        return getCache(reg).tryAttr(key, elze, ttl);
     }
 
     /**
@@ -169,7 +148,7 @@ public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, V el
      */
     @NotNull
     public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key) {
-        return tryAttr(reg, key, true, TtlDefault);
+        return getCache(reg).tryAttr(key);
     }
 
     /**
@@ -183,7 +162,7 @@ public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key) {
      */
     @NotNull
     public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, int ttl) {
-        return tryAttr(reg, key, true, ttl);
+        return getCache(reg).tryAttr(key, ttl);
     }
 
     /**
@@ -197,7 +176,7 @@ public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, int
      */
     @Contract("_,_,true ->!null")
     public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, boolean notnull) {
-        return tryAttr(reg, key, notnull, TtlDefault);
+        return getCache(reg).tryAttr(key, notnull);
     }
 
     /**
@@ -210,32 +189,9 @@ public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, bool
      * @param      key type
      * @param      value type
      */
-    @SuppressWarnings("unchecked")
     @Contract("_,_,true,_ ->!null")
     public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, boolean notnull, int ttl) {
-
-        final Object rst = getCache(reg).invoke(key, entry -> {
-            Object t = null;
-            if (entry.exists()) {
-                t = entry.getValue();
-            }
-            else {
-                Function ld = LOADER.get(reg);
-                if (ld != null) {
-                    t = ld.apply(key);
-                    entry.setValue(t);
-                    entry.setExpiryTime(entry.getStartTime() + ttl * 1000L);
-                }
-            }
-            return t;
-        });
-
-        if (rst == null && notnull) {
-            throw new NullPointerException("aware=" + reg + ",key=" + key);
-        }
-        else {
-            return (V) rst;
-        }
+        return getCache(reg).tryAttr(key, notnull, ttl);
     }
 
     /**
@@ -249,8 +205,8 @@ public static  V tryAttr(@NotNull TypedReg reg, @NotNull K key, bool
     @SuppressWarnings("unchecked")
     @Nullable
     public static  V getAttr(@NotNull TypedReg reg, @NotNull K key) {
-        Cache cache = HOLDER.get(reg);
-        return cache == null ? null : (V) cache.get(key);
+        AttributeCache cache = (AttributeCache) Holder.get(reg);
+        return cache == null ? null : cache.getAttr(key);
     }
 
     /**
@@ -264,9 +220,8 @@ public static  V getAttr(@NotNull TypedReg reg, @NotNull K key) {
     @SuppressWarnings("unchecked")
     @NotNull
     public static  Map getAttrs(@NotNull TypedReg reg, @NotNull Collection key) {
-        Cache cache = HOLDER.get(reg);
-        if (cache == null) return Collections.emptyMap();
-        return (Map) cache.getAll(key);
+        AttributeCache cache = (AttributeCache) Holder.get(reg);
+        return cache == null ? Collections.emptyMap() : cache.getAttrs(key);
     }
 
     /**
@@ -276,10 +231,11 @@ public static  Map getAttrs(@NotNull TypedReg reg, @NotNull Co
      * @param key unique key, e.g. userId
      * @param  key type
      */
+    @SuppressWarnings("unchecked")
     public static  void ridAttr(TypedReg reg, K key) {
-        Cache cache = HOLDER.get(reg);
+        AttributeCache cache = (AttributeCache) Holder.get(reg);
         if (cache != null) {
-            cache.remove(key);
+            cache.ridAttr(key);
         }
     }
 
@@ -290,24 +246,12 @@ public static  void ridAttr(TypedReg reg, K key) {
      * @param key unique key, e.g. userId
      * @param  key type
      */
-    @SafeVarargs
-    public static  void ridAttrs(TypedReg reg, K... key) {
-        if (key == null || key.length == 0) return;
-        ridAttrs(reg, Arrays.asList(key));
-    }
-
-    /**
-     * remove all attribute by keys
-     *
-     * @param reg Type to register
-     * @param key unique key, e.g. userId
-     * @param  key type
-     */
+    @SuppressWarnings("unchecked")
     public static  void ridAttrs(TypedReg reg, Collection key) {
         if (key == null || key.isEmpty()) return;
-        Cache cache = HOLDER.get(reg);
+        AttributeCache cache = (AttributeCache) Holder.get(reg);
         if (cache != null) {
-            cache.removeAll(key);
+            cache.ridAttrs(key);
         }
     }
 
@@ -328,10 +272,11 @@ public static void ridAttrAll(TypedReg... reg) {
      */
     public static void ridAttrAll(Collection> reg) {
         if (reg == null || reg.isEmpty()) return;
+
         for (TypedReg tr : reg) {
-            Cache cache = HOLDER.get(tr);
+            AttributeCache cache = Holder.get(tr);
             if (cache != null) {
-                cache.removeAll();
+                cache.ridAttrAll();
             }
         }
     }
@@ -353,8 +298,24 @@ public static void ridLoader(TypedReg... reg) {
      */
     public static void ridLoader(Collection> reg) {
         if (reg == null || reg.isEmpty()) return;
-        for (TypedReg r : reg) {
-            LOADER.remove(r);
+
+        for (TypedReg tr : reg) {
+            AttributeCache cache = Holder.get(tr);
+            if (cache != null) {
+                cache.setLoader(null);
+            }
+        }
+    }
+
+    /**
+     * unregister from the event
+     */
+    public static void unregister(TypedReg... reg) {
+        for (TypedReg tr : reg) {
+            AttributeCache cache = Holder.get(tr);
+            if (cache != null) {
+                cache.unregister();
+            }
         }
     }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java
index 1404bdb91..70258439c 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java
@@ -1,15 +1,37 @@
 package pro.fessional.wings.slardar.event.attr;
 
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.context.event.EventListener;
+import pro.fessional.mirana.best.TypedReg;
+import pro.fessional.wings.slardar.context.AttributeCache;
+
+import java.util.Map;
+import java.util.Set;
 
 /**
+ * Listener AttributeRidEvent to rid attributes on AttributeCache
+ *
  * @author trydofor
  * @since 2023-10-31
  */
+@Slf4j
 public class AttributeEventListener {
 
     @EventListener
     public void ridAttr(AttributeRidEvent event) {
-        event.handleEvent();
+        for (Map.Entry> ent : event.getTypedReg().entrySet()) {
+            TypedReg reg = TypedReg.deserialize(ent.getKey(), false);
+            if (reg == null) continue;
+
+            final Set ks = ent.getValue();
+            if (ks == null || ks.isEmpty()) {
+                log.info("ridAttrAll, type={}", reg);
+                AttributeCache.forEach(reg, AttributeCache::ridAttrAll);
+            }
+            else {
+                log.info("ridAttrAll, type={}, key-size={}", reg, ks.size());
+                AttributeCache.forEach(reg, cache -> cache.ridAttrs(ks));
+            }
+        }
     }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeRidEvent.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeRidEvent.java
index 44a35b0cf..b0f79ae55 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeRidEvent.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeRidEvent.java
@@ -3,7 +3,6 @@
 import lombok.Data;
 import org.jetbrains.annotations.Contract;
 import pro.fessional.mirana.best.TypedReg;
-import pro.fessional.wings.slardar.context.AttributeHolder;
 
 import java.io.Serial;
 import java.io.Serializable;
@@ -47,18 +46,4 @@ public  AttributeRidEvent rid(TypedReg reg, Collection key) {
         keys.addAll(key);
         return this;
     }
-
-    public void handleEvent() {
-        for (Map.Entry> ent : typedReg.entrySet()) {
-            String s = ent.getKey();
-            TypedReg reg = TypedReg.deserialize(s);
-            Set ks = ent.getValue();
-            if (ks == null || ks.isEmpty()) {
-                AttributeHolder.ridAttrAll(reg);
-            }
-            else {
-                AttributeHolder.ridAttrs(reg, ks);
-            }
-        }
-    }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarCacheProp.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarCacheProp.java
index 3eacec2ce..a84b3a976 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarCacheProp.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarCacheProp.java
@@ -7,9 +7,6 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import static pro.fessional.wings.slardar.cache.WingsCache.Joiner;
-import static pro.fessional.wings.slardar.cache.WingsCache.Wildcard;
-
 /**
  * LRU (Least Recently Used) default, unit is second, 0=infinitely
  *
@@ -101,17 +98,4 @@ public static class Conf {
          */
         private int maxSize = 0;
     }
-
-    // /////////////////
-
-    public static String wildcard(String level) {
-        return WingsCache.Level.join(level, Wildcard);
-    }
-
-    public static boolean inLevel(String name, String level) {
-        if (name == null || level == null) return false;
-        final int len = level.length();
-        return name.regionMatches(true, 0, level, 0, len)
-               && name.regionMatches(true, len, Joiner, 0, Joiner.length());
-    }
 }
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/JustAuthStateCache.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/JustAuthStateCache.java
index 6bf593be5..19673a0f6 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/JustAuthStateCache.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/JustAuthStateCache.java
@@ -14,7 +14,7 @@ public class JustAuthStateCache implements AuthStateCache {
     private final Cache cache;
 
     public JustAuthStateCache(int max, int ttl) {
-        this.cache = WingsCache2k.builder(JustAuthStateCache.class, "cache", max, ttl, -1, String.class, String.class)
+        this.cache = WingsCache2k.builder(JustAuthStateCache.class, "cache", max, ttl, 0, String.class, String.class)
                                  .build();
     }
 
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/session/NonceTokenSessionHelper.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/session/NonceTokenSessionHelper.java
index e7998963b..e8f660c66 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/session/NonceTokenSessionHelper.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/session/NonceTokenSessionHelper.java
@@ -23,7 +23,7 @@
 public class NonceTokenSessionHelper {
 
     private static final Cache cache = WingsCache2k
-            .builder(NonceTokenSessionHelper.class, "nonce", 100_000, 300, -1, String.class, Sf.class)
+            .builder(NonceTokenSessionHelper.class, "nonce", 100_000, 300, 0, String.class, Sf.class)
             .build();
 
     private static class Sf {
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
index 7b8800d72..4a8d1a34e 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
@@ -266,7 +266,7 @@ public NonceUserDetailsCombo nonceUserDetailsCombo() {
         final NonceUserDetailsCombo bean = new NonceUserDetailsCombo();
         bean.setOrder(WingsOrdered.Lv3Service + 200);
         bean.setAcceptNonceType(securityProp.mapNonceAuthEnum());
-        final String cn = WingsCache.Level.join(securityProp.getNonceCacheLevel(), NonceUserDetailsCombo.class.getName());
+        final String cn = WingsCache.Naming.join(securityProp.getNonceCacheLevel(), NonceUserDetailsCombo.class.getName());
         bean.setCacheName(cn);
         final CacheManager cm = applicationContext.getBean(securityProp.getNonceCacheManager(), CacheManager.class);
         bean.setCacheManager(cm);

From 8fd3f71a1ee8fd1943b9e0280327152e0b4d6449 Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Mon, 6 Nov 2023 11:21:30 +0800
Subject: [PATCH 10/23] =?UTF-8?q?=F0=9F=94=8A=20adjust=20logger=20from=20i?=
 =?UTF-8?q?nfo=20to=20debug=20#150?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../admin/controller/AdminController.java     |  2 +-
 .../service/impl/TinyMailServiceImpl.java     | 34 +++++++++----------
 .../service/impl/TinyTaskBeatServiceImpl.java |  6 ++--
 .../service/impl/TinyTaskConfServiceImpl.java | 12 +++----
 .../service/impl/TinyTaskExecServiceImpl.java |  4 +--
 .../faceless/flywave/RevisionFitness.java     |  2 +-
 .../jooq/listener/JournalDeleteListener.java  |  2 +-
 .../faceless/concur/MysqlServerLock.java      |  2 +-
 .../concur/DatabaseGlobalLockTest.java        |  2 +-
 .../bean/SlardarBootAdminConfiguration.java   |  6 ++--
 .../concur/impl/RighterInterceptor.java       |  4 +--
 .../slardar/monitor/viewer/LogViewer.java     |  2 +-
 .../impl/AbstractAuthPermCheckCombo.java      |  2 +-
 .../impl/ComboWingsUserDetailsService.java    |  4 +--
 .../AbstractRequestResponseLogging.java       |  2 +-
 .../event/attr/AttributeEventListener.java    |  4 +--
 .../httprest/okhttp/OkHttpTokenizeOauth.java  |  2 +-
 .../slardar/monitor/metric/LogMetric.java     |  4 +--
 .../monitor/report/DingTalkReport.java        |  6 ++--
 .../bean/SlardarCacheConfiguration.java       |  8 ++---
 .../conf/impl/RuntimeConfServiceImpl.java     |  2 +-
 .../auth/impl/DefaultDaoAuthnCombo.java       |  4 +--
 .../perm/impl/WarlockPermServiceImpl.java     |  4 +--
 .../perm/impl/WarlockRoleServiceImpl.java     |  4 +--
 .../controller/auth/LoginPageController.java  |  6 ++--
 .../controller/auth/LoginProcController.java  |  2 +-
 .../security/handler/LoginSuccessHandler.java |  2 +-
 .../handler/NonceLoginSuccessHandler.java     |  2 +-
 .../security/justauth/AuthStateBuilder.java   |  4 +--
 .../listener/WarlockFailedLoginListener.java  |  2 +-
 .../userdetails/JustAuthUserAuthnAutoReg.java |  4 +--
 .../userdetails/JustAuthUserDetailsCombo.java |  2 +-
 .../auth/impl/ComboWarlockAuthnService.java   |  2 +-
 .../auth/impl/DefaultUserAuthnAutoReg.java    |  4 +--
 .../event/impl/TableChangePublisherImpl.java  |  2 +-
 35 files changed, 77 insertions(+), 79 deletions(-)

diff --git a/example/winx-admin/src/main/java/com/moilioncircle/wings/admin/controller/AdminController.java b/example/winx-admin/src/main/java/com/moilioncircle/wings/admin/controller/AdminController.java
index f221d52d7..f2dd44da5 100644
--- a/example/winx-admin/src/main/java/com/moilioncircle/wings/admin/controller/AdminController.java
+++ b/example/winx-admin/src/main/java/com/moilioncircle/wings/admin/controller/AdminController.java
@@ -24,7 +24,7 @@ public class AdminController {
     @PostMapping("/admin/disable-root.json")
     public R rootNeverLogin() {
         authnService.disable(DefaultUserId.Root, WarlockAuthType.USERNAME);
-        log.info("disable root");
+        log.debug("disable root");
         return R.OK;
     }
 }
diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailServiceImpl.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailServiceImpl.java
index 7cccb334d..771d2888d 100644
--- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailServiceImpl.java
+++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailServiceImpl.java
@@ -359,7 +359,7 @@ private boolean notMatchProp(WinMailSender po) {
         if (tinyMailServiceProp.isOnlyApp()) {
             final String ma = po.getMailApps();
             if (StringUtils.isNotEmpty(ma) && !appName.equalsIgnoreCase(ma)) {
-                log.info("skip only send app-mail app={}, id={}", appName, po.getId());
+                log.debug("skip only send app-mail app={}, id={}", appName, po.getId());
                 return true;
             }
         }
@@ -368,11 +368,11 @@ private boolean notMatchProp(WinMailSender po) {
             if (StringUtils.isNotEmpty(mrs)) {
                 final RunMode rmd = RuntimeMode.getRunMode();
                 if (rmd == RunMode.Nothing) {
-                    log.info("skip only send run-mail, run={}, id={}", mrs, po.getId());
+                    log.debug("skip only send run-mail, run={}, id={}", mrs, po.getId());
                     return true;
                 }
                 if (!RuntimeMode.hasRunMode(arrayOrNull(mrs, true))) {
-                    log.info("skip only send run-mail, run={}, cur={}, id={}", mrs, rmd, po.getId());
+                    log.debug("skip only send run-mail, run={}, cur={}, id={}", mrs, rmd, po.getId());
                     return true;
                 }
             }
@@ -381,14 +381,14 @@ private boolean notMatchProp(WinMailSender po) {
         final int maxDone = BoxedCastUtil.orElse(po.getMaxDone(), 0) > 0 ? po.getMaxDone() : tinyMailServiceProp.getMaxDone();
         final int sumDone = BoxedCastUtil.orElse(po.getSumDone(), 0);
         if (sumDone >= maxDone) {
-            log.info("skip max-send, max={}, sum={}, id={}", maxDone, sumDone, po.getId());
+            log.debug("skip max-send, max={}, sum={}, id={}", maxDone, sumDone, po.getId());
             return true;
         }
 
         final int maxFail = BoxedCastUtil.orElse(po.getMaxFail(), 0) > 0 ? po.getMaxFail() : tinyMailServiceProp.getMaxFail();
         final int sumFail = BoxedCastUtil.orElse(po.getSumFail(), 0);
         if (sumFail >= maxFail) {
-            log.info("skip max-fail, max={}, sum={}, id={}", maxFail, sumFail, po.getId());
+            log.debug("skip max-fail, max={}, sum={}, id={}", maxFail, sumFail, po.getId());
             return true;
         }
 
@@ -406,7 +406,7 @@ private boolean notNextLock(WinMailSender po, long now) {
                 .execute();
 
         if (rc <= 0) {
-            log.info("skip not-next-lock mail, id={}", po.getId());
+            log.debug("skip not-next-lock mail, id={}", po.getId());
             return true;
         }
 
@@ -426,12 +426,12 @@ private void saveStatusAndRetry(@NotNull WinMailSender po, TinyMailMessage messa
 
                 if (po.getSumDone() + 1 >= tinyMailServiceProp.getMaxDone()) {
                     setter.put(t.NextSend, EmptyValue.DATE_TIME);
-                    log.info("done mail by max-send id={}, subject={}", po.getId(), po.getMailSubj());
+                    log.debug("done mail by max-send id={}, subject={}", po.getId(), po.getMailSubj());
                 }
                 else {
                     nextSend = now + tinyMailServiceProp.getTryNext().toMillis();
                     setter.put(t.NextSend, DateLocaling.sysLdt(nextSend));
-                    log.info("next done-mail id={}, subject={}", po.getId(), po.getMailSubj());
+                    log.debug("next done-mail id={}, subject={}", po.getId(), po.getMailSubj());
                 }
 
                 setter.put(t.SumSend, t.SumSend.add(1));
@@ -445,7 +445,7 @@ private void saveStatusAndRetry(@NotNull WinMailSender po, TinyMailMessage messa
                 final int maxFail = BoxedCastUtil.orElse(po.getMaxFail(), 0) > 0 ? po.getMaxFail() : tinyMailServiceProp.getMaxFail();
                 if (po.getSumFail() + 1 >= maxFail) {
                     setter.put(t.NextSend, EmptyValue.DATE_TIME);
-                    log.info("done mail by max-fail id={}, subject={}", po.getId(), po.getMailSubj());
+                    log.debug("done mail by max-fail id={}, subject={}", po.getId(), po.getMailSubj());
                 }
                 else if (retry) {
                     if (exception instanceof MailWaitException mwe) {
@@ -467,7 +467,7 @@ else if (exception instanceof MailParseException || exception instanceof Messagi
 
                     if (nextSend > 0) {
                         setter.put(t.NextSend, DateLocaling.sysLdt(nextSend));
-                        log.info("next fail-mail id={}, subject={}", po.getId(), po.getMailSubj());
+                        log.debug("next fail-mail id={}, subject={}", po.getId(), po.getMailSubj());
                     }
                 }
                 else {
@@ -493,7 +493,7 @@ else if (exception instanceof MailParseException || exception instanceof Messagi
 
             if (!notHookStop) {
                 setter.put(t.NextSend, EmptyValue.DATE_TIME);
-                log.info("hook stop mail, id={}", po.getId());
+                log.debug("hook stop mail, id={}", po.getId());
             }
 
             journalService.commit(Jane.Update, journal -> {
@@ -515,14 +515,14 @@ else if (exception instanceof MailParseException || exception instanceof Messagi
             if (notHookStop && nextSend > 0) {
                 asyncMails.add(new AsyncMail(po.getId(), nextSend, retry, check, null, message));
                 taskScheduler.schedule(this::doAsyncBatchSend, Instant.ofEpochMilli(nextSend));
-                log.info("schedule done-mail send, id={}, subject={}", po.getId(), po.getMailSubj());
+                log.debug("schedule done-mail send, id={}, subject={}", po.getId(), po.getMailSubj());
             }
         }
         else {
             if (notHookStop && retry && nextSend > 0 && nextSend - now < tinyMailServiceProp.getMaxNext().toMillis()) {
                 asyncMails.add(new AsyncMail(po.getId(), nextSend, retry, check, null, message));
                 taskScheduler.schedule(this::doAsyncBatchSend, Instant.ofEpochMilli(nextSend));
-                log.info("schedule fail-mail send, id=" + po.getId() + ", subject=" + po.getMailSubj());
+                log.debug("schedule fail-mail send, id=" + po.getId() + ", subject=" + po.getMailSubj());
             }
             else {
                 if (rethrow) {
@@ -534,7 +534,7 @@ else if (exception instanceof MailParseException || exception instanceof Messagi
                     }
                 }
                 else {
-                    log.info("no rethrow or retry mail, id=" + po.getId() + ", subject=" + po.getMailSubj());
+                    log.debug("no rethrow or retry mail, id=" + po.getId() + ", subject=" + po.getMailSubj());
                 }
             }
         }
@@ -581,11 +581,11 @@ private long doAsyncFreshSend(@NotNull WinMailSender po, TinyMailMessage message
         final long nxt;
         if (mds > now) {
             nxt = mds;
-            log.info("plan async date={} id={}", md, id);
+            log.debug("plan async date={} id={}", md, id);
         }
         else {
             nxt = now;
-            log.info("plan async date=now id={}", id);
+            log.debug("plan async date=now id={}", id);
         }
 
         // check format
@@ -678,7 +678,7 @@ private void doAsyncBatchSend() {
                     log.warn("plan next war-size={}, idle={}", size, tinyMailServiceProp.getTryNext());
                 }
                 else {
-                    log.info("plan next size={}, idle={}", size, tinyMailServiceProp.getTryNext());
+                    log.debug("plan next size={}, idle={}", size, tinyMailServiceProp.getTryNext());
                 }
             }
         }
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java
index a5e11abe8..e21475e93 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java
@@ -54,7 +54,7 @@ public int cleanResult() {
                 .from(tr)
                 .fetchInto(Long.class);
         if (tid.isEmpty()) {
-            log.info("no task result to clean");
+            log.debug("no task result to clean");
             return 0;
         }
 
@@ -73,7 +73,7 @@ public int cleanResult() {
                 .collect(Collectors.toList());
 
         if (cond.isEmpty()) {
-            log.info("no task condition to clean");
+            log.debug("no task condition to clean");
             return 0;
         }
 
@@ -104,7 +104,7 @@ public String checkHealth() {
         final StringBuilder mis = new StringBuilder();
 
         for (WinTaskDefine r : tks) {
-            log.info("check health task id={}, name={}", r.getId(), r.getTaskerName());
+            log.debug("check health task id={}, name={}", r.getId(), r.getTaskerName());
             int beat = r.getTimingBeat();
             if (beat <= 0) {
                 beat = Math.max(r.getTimingRate(), r.getTimingIdle());
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java
index ddd08e9ef..6ce61d4ac 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java
@@ -103,7 +103,7 @@ private TaskerProp property(@NotNull String key, @NotNull TinyTasker anno) {
             rp.setTimingCron(anno.cron());
             rp.setTimingIdle(anno.idle());
             rp.setTimingRate(anno.rate());
-            log.info("no prop, use annotation, key={}", key);
+            log.debug("no prop, use annotation, key={}", key);
         }
         else {
             if (pp.notTimingZone()) {
@@ -113,7 +113,7 @@ private TaskerProp property(@NotNull String key, @NotNull TinyTasker anno) {
                 rp.setTimingZone(pp.getTimingZone());
             }
             if (pp.notTimingPlan()) {
-                log.info("no prop timingplan, use annotation, key={}", key);
+                log.debug("no prop timingplan, use annotation, key={}", key);
                 rp.setTimingCron(anno.cron());
                 rp.setTimingIdle(anno.idle());
                 rp.setTimingRate(anno.rate());
@@ -255,7 +255,7 @@ private Conf config(@NotNull Class claz, @NotNull Object bean, @NotNull Metho
         }
 
         String tkn = TaskerHelper.tokenize(claz, method.getName());
-        log.info("find tiny task, prop={}, ref={}", key, tkn);
+        log.debug("find tiny task, prop={}, ref={}", key, tkn);
 
         if (isEmpty(prop.getTaskerName())) {
             prop.setTaskerName(claz.getSimpleName() + TaskerHelper.MethodPrefix + method.getName());
@@ -279,7 +279,7 @@ private Conf config(@NotNull Class claz, @NotNull Object bean, @NotNull Metho
             enabled = prop.isEnabled();
             autorun = prop.isAutorun();
             noticeBean = prop.getNoticeBean();
-            log.info("insert prop to database, version={}, id={}", prop.getVersion(), id);
+            log.debug("insert prop to database, version={}, id={}", prop.getVersion(), id);
         }
         else if (po.getVersion() < prop.getVersion()) {
             id = po.getId();
@@ -287,14 +287,14 @@ else if (po.getVersion() < prop.getVersion()) {
             autorun = prop.isAutorun();
             noticeBean = prop.getNoticeBean();
             updateProp(prop, key, id);
-            log.info("replace prop to database, version={}, id={}", prop.getVersion(), id);
+            log.debug("replace prop to database, version={}, id={}", prop.getVersion(), id);
         }
         else {
             id = po.getId();
             enabled = BoxedCastUtil.orTrue(po.getEnabled());
             autorun = BoxedCastUtil.orTrue(po.getAutorun());
             noticeBean = po.getNoticeBean();
-            log.info("use database config, version={}, id={}", prop.getVersion(), id);
+            log.debug("use database config, version={}, id={}", prop.getVersion(), id);
             // diff
             final LinkedHashMap> df = diff(po, prop);
             if (!df.isEmpty()) {
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java
index ee5424587..a245c8e4f 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java
@@ -123,7 +123,7 @@ public boolean force(long id) {
                 if (notice != null) ntcWhen = noticeWhen(td.getNoticeWhen());
 
                 postNotice(notice, noticeConf, ntcWhen, taskerName, taskMsg, execTms, WhenExec);
-                log.info("task force exec, id={}", id);
+                log.debug("task force exec, id={}", id);
 
                 final Object result;
                 if (dryrun) {
@@ -200,7 +200,6 @@ private boolean relaunch(long id) {
                 return false;
             }
 
-            log.info("prepare task name={}, id={}", td.getTaskerName(), td.getId());
             if (notEnable(td.getEnabled(), id)
                 || notApps(td.getTaskerApps(), id)
                 || notRuns(td.getTaskerRuns(), id)) {
@@ -221,6 +220,7 @@ private boolean relaunch(long id) {
                 return false;
             }
 
+            log.info("prepare task name={}, id={}", td.getTaskerName(), td.getId());
             final ScheduledFuture handle = taskScheduler.schedule(() -> {
                 long execTms = ThreadNow.millis();
                 try {
diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/flywave/RevisionFitness.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/flywave/RevisionFitness.java
index d1e81c734..88079f437 100644
--- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/flywave/RevisionFitness.java
+++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/flywave/RevisionFitness.java
@@ -161,7 +161,7 @@ private TreeMap> checkUnapply(SchemaRevisionManager manager) {
         boolean unInit = false;
         for (Map.Entry> en : manager.statusRevisions().entrySet()) {
             final String nextDb = en.getKey();
-            log.info("Wings Revision Check Database={}", nextDb);
+            log.debug("Wings Revision Check Database={}", nextDb);
             Map sts = en.getValue();
             if (sts == null) {
                 unInit = true;
diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/listener/JournalDeleteListener.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/listener/JournalDeleteListener.java
index 6aff07fe6..dc5e25443 100644
--- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/listener/JournalDeleteListener.java
+++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/listener/JournalDeleteListener.java
@@ -59,7 +59,7 @@ public void renderEnd(ExecuteContext ctx) {
         String updateSql = buildUpdateSql(ctx.dsl(), sql, table, params);
         if (updateSql == null) return;
 
-        log.info("Wings journal-delete, sql={}", updateSql);
+        log.debug("Wings journal-delete, sql={}", updateSql);
 
         try {
             if (params.isEmpty()) {
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/concur/MysqlServerLock.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/concur/MysqlServerLock.java
index 78520830a..5a4ef9469 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/concur/MysqlServerLock.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/concur/MysqlServerLock.java
@@ -99,7 +99,7 @@ else if (rc == 0) {
             log.warn("unlock not owned lock, name={}", lockName);
         }
         else {
-            log.info("unlock lock, name={}", lockName);
+            log.debug("unlock lock, name={}", lockName);
         }
     }
 
diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java
index 12e9a540c..afa0bb544 100644
--- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java
+++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java
@@ -57,7 +57,7 @@ void lockFail(CountDownLatch latch) {
                 assertFalse(b);
             }
             catch (InterruptedException e) {
-                log.info("ignore", e);
+                log.warn("ignore", e);
             }
             latch.countDown();
         }).start();
diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
index b3affa0fd..7a9be91c9 100644
--- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
+++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java
@@ -165,9 +165,9 @@ public BasicAuthHttpHeaderProvider basicAuthHttpHeadersProvider(AdminServerPrope
 //        @Bean
 //        public InstanceExchangeFilterFunction bootAdminSessionFilter() {
 //            return (instance, request, next) -> next.exchange(request).doOnSubscribe((s) -> {
-//                log.info(">>>" + request.url());
-//                log.info(">>>" + request.headers());
-//                log.info(">>>" + request.cookies());
+//                log.debug(">>>" + request.url());
+//                log.debug(">>>" + request.headers());
+//                log.debug(">>>" + request.cookies());
 //            });
 //        }
     }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterInterceptor.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterInterceptor.java
index 27d9b6798..2caf27f6d 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterInterceptor.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/concur/impl/RighterInterceptor.java
@@ -98,7 +98,7 @@ public boolean preHandle(@NotNull HttpServletRequest request,
         final String key = getKey(session);
         byte[] bytes = decodeAudit(key, audit);
         if (bytes == null) {
-            log.info("failed to check digest. session={}, audit={}", session.getId(), audit);
+            log.debug("failed to check digest. session={}, audit={}", session.getId(), audit);
             responseError(response);
             return false;
         }
@@ -110,7 +110,7 @@ public boolean preHandle(@NotNull HttpServletRequest request,
             return true;
         }
         catch (Exception e) {
-            log.warn("failed to deserialize. session=" + session + ", audit=" + audit, e);
+            log.info("failed to deserialize. session=" + session + ", audit=" + audit, e);
             responseError(response);
             return false;
         }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/monitor/viewer/LogViewer.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/monitor/viewer/LogViewer.java
index 599bc7ff6..bdac12cb1 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/monitor/viewer/LogViewer.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/monitor/viewer/LogViewer.java
@@ -86,7 +86,7 @@ public void filter(Map> warns) {
                 WarnMetric.Warn next = iter.next();
                 if (next.getType() == WarnMetric.Type.File) {
                     if (canIgnoreHead(next.getWarn())) {
-                        log.info("remove ignored warning");
+                        log.debug("remove ignored warning");
                         iter.remove();
                     }
                     else {
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/security/impl/AbstractAuthPermCheckCombo.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/security/impl/AbstractAuthPermCheckCombo.java
index 43fd8bd3a..949b79ecd 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/security/impl/AbstractAuthPermCheckCombo.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/security/impl/AbstractAuthPermCheckCombo.java
@@ -36,7 +36,7 @@ public boolean check(WingsUserDetails userDetails, WingsBindAuthToken authentica
             }
         }
 
-        log.info("reject login, require any permit {}", permit);
+        log.debug("reject login, require any permit {}", permit);
         return false;
     }
 
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/security/impl/ComboWingsUserDetailsService.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/security/impl/ComboWingsUserDetailsService.java
index fed43d5b6..61f46366c 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/security/impl/ComboWingsUserDetailsService.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/security/impl/ComboWingsUserDetailsService.java
@@ -33,7 +33,7 @@ public class ComboWingsUserDetailsService implements WingsUserDetailsService {
         for (Combo combo : combos) {
             userDetails = combo.loadOrNull(username, authType, authDetail);
             if (userDetails != null) {
-                log.info("loadUserByUsername by combo={}", combo.getClass());
+                log.debug("loadUserByUsername by combo={}", combo.getClass());
                 break;
             }
         }
@@ -42,7 +42,7 @@ public class ComboWingsUserDetailsService implements WingsUserDetailsService {
             for (Combo combo : combos) {
                 userDetails = combo.postAudit(userDetails, username, authType, authDetail);
                 if (userDetails == null) {
-                    log.info("postAudit deny by combo={}", combo.getClass());
+                    log.debug("postAudit deny by combo={}", combo.getClass());
                     break;
                 }
             }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/stream/AbstractRequestResponseLogging.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/stream/AbstractRequestResponseLogging.java
index 547442c36..d123ce8ed 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/stream/AbstractRequestResponseLogging.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/stream/AbstractRequestResponseLogging.java
@@ -175,6 +175,6 @@ protected void buildResponseHeader(@NotNull ReuseStreamResponseWrapper response,
     }
 
     protected void logging(@NotNull String message) {
-        log.info(message);
+        log.debug(message);
     }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java
index 70258439c..7e8d7d89b 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/event/attr/AttributeEventListener.java
@@ -25,11 +25,11 @@ public void ridAttr(AttributeRidEvent event) {
 
             final Set ks = ent.getValue();
             if (ks == null || ks.isEmpty()) {
-                log.info("ridAttrAll, type={}", reg);
+                log.debug("ridAttrAll, type={}", reg);
                 AttributeCache.forEach(reg, AttributeCache::ridAttrAll);
             }
             else {
-                log.info("ridAttrAll, type={}, key-size={}", reg, ks.size());
+                log.debug("ridAttrAll, type={}, key-size={}", reg, ks.size());
                 AttributeCache.forEach(reg, cache -> cache.ridAttrs(ks));
             }
         }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/httprest/okhttp/OkHttpTokenizeOauth.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/httprest/okhttp/OkHttpTokenizeOauth.java
index cdb6d4ded..966ceb1ef 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/httprest/okhttp/OkHttpTokenizeOauth.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/httprest/okhttp/OkHttpTokenizeOauth.java
@@ -142,7 +142,7 @@ else if (AuthorizationCode.equals(valAccessToken)) {
             notnull = true;
         }
         else {
-            log.info("valAccessToken must is {} or {}", ClientCredentials, AuthorizationCode);
+            log.warn("AccessToken must is {} or {}", ClientCredentials, AuthorizationCode);
             return null;
         }
 
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/metric/LogMetric.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/metric/LogMetric.java
index c055d4757..d86bd5527 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/metric/LogMetric.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/metric/LogMetric.java
@@ -57,13 +57,13 @@ public String getKey() {
     public @NotNull List check() {
         final String file = rule.getFile();
         if (file == null || file.isEmpty() || !rule.isEnable()) {
-            log.info("skip un-conf file or disable");
+            log.debug("skip un-conf file or disable");
             return Collections.emptyList();
         }
 
         final long from = readLastForm();
         final LogStat.Stat stat = LogStat.stat(rule.file, from, rule.getRuntimeKeys());
-        log.info("LogStat-{}, stat={}", key, stat);
+        log.debug("LogStat-{}, stat={}", key, stat);
         writeLastFrom(stat);
 
         if (stat.getTimeDone() - lastClean > 24 * 3600 * 1000L) {
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/report/DingTalkReport.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/report/DingTalkReport.java
index e12b0b086..bbf19699e 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/report/DingTalkReport.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/report/DingTalkReport.java
@@ -36,17 +36,17 @@ public Sts report(String appName, String jvmName, Map T getObjectCache(String key, TypeDescriptor type) {
     public boolean evictAllConfCache(TableChangeEvent event) {
         final String tb = CacheEventHelper.receiveTable(event, EventTables, DELETE | UPDATE);
         if (tb != null) {
-            log.info("evictAllConfCache by {}, {}", tb, event);
+            log.debug("evictAllConfCache by {}, {}", tb, event);
             return true;
         }
 
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
index 8e77f9b32..ae11d5052 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java
@@ -151,7 +151,7 @@ public void onFailure(@NotNull Enum authType, String username, String details
                 .fetchOne();
 
         if (auth == null) {
-            log.info("ignore login failure by not found auth-type={}, username={}", at, username);
+            log.debug("ignore login failure by not found auth-type={}, username={}", at, username);
             return;
         }
 
@@ -164,7 +164,7 @@ public void onFailure(@NotNull Enum authType, String username, String details
         warlockDangerService.block(authType, username, second);
 
         if (cnt > max) {
-            log.info("ignore login failure by reach max-count={}, auth-type={}, username={}", max, at, username);
+            log.debug("ignore login failure by reach max-count={}, auth-type={}, username={}", max, at, username);
             return;
         }
 
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/perm/impl/WarlockPermServiceImpl.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/perm/impl/WarlockPermServiceImpl.java
index 38ff740ca..b6406bf98 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/perm/impl/WarlockPermServiceImpl.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/perm/impl/WarlockPermServiceImpl.java
@@ -92,7 +92,7 @@ public Map loadPermAll() {
                     .where(t.getOnlyLive())
                     .fetch()
                     .intoMap(Record3::value1, it -> unitePermit(it.value2(), it.value3()));
-            log.info("loadPermAll size={}", all.size());
+            log.debug("loadPermAll size={}", all.size());
             return all;
         }
 
@@ -104,7 +104,7 @@ public Map loadPermAll() {
         public boolean evictPermAllCache(@Nullable TableChangeEvent event) {
             final String tb = CacheEventHelper.receiveTable(event, EventTables);
             if (tb != null) {
-                log.info("evictPermAllCache by {}, {}", tb, event);
+                log.debug("evictPermAllCache by {}, {}", tb, event);
                 return true;
             }
 
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/perm/impl/WarlockRoleServiceImpl.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/perm/impl/WarlockRoleServiceImpl.java
index da3562c08..05c39e11f 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/perm/impl/WarlockRoleServiceImpl.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/perm/impl/WarlockRoleServiceImpl.java
@@ -96,7 +96,7 @@ public Map loadRoleAll() {
                     .where(t.getOnlyLive())
                     .fetch()
                     .intoMap(Record2::value1, it -> permNormalizer.role(it.value2()));
-            log.info("loadRoleAll size={}", all.size());
+            log.debug("loadRoleAll size={}", all.size());
             return all;
         }
 
@@ -108,7 +108,7 @@ public Map loadRoleAll() {
         public boolean evictRoleAllCache(TableChangeEvent event) {
             final String tb = CacheEventHelper.receiveTable(event, EventTables);
             if (tb != null) {
-                log.info("evictRoleAllCache by {}, {}", tb, event);
+                log.debug("evictRoleAllCache by {}, {}", tb, event);
                 return true;
             }
 
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java
index bad07157b..0c5ab3afa 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java
@@ -67,7 +67,7 @@ public ResponseEntity loginList(@PathVariable(WingsAuthHelper.ExtName) String
                                        HttpServletRequest request,
                                        HttpServletResponse response) {
         final MediaType mt = ContentTypeHelper.mediaTypeByUri(extName);
-        log.info("default login-page media-type={}", mt);
+        log.debug("default login-page media-type={}", mt);
         return wingsAuthPageHandler.response(Null.Enm, mt, request, response);
     }
 
@@ -102,7 +102,7 @@ public ResponseEntity LoginPage(@PathVariable(WingsAuthHelper.ExtName) String
                                        HttpServletResponse response) {
         final Enum em = wingsAuthTypeParser.parse(authType);
         final MediaType mt = ContentTypeHelper.mediaTypeByUri(extName, MediaType.APPLICATION_JSON);
-        log.info("login-page authType={}, authZone={}, mediaType={}, state={}, host={}", authType, authZone, mt, state, host);
+        log.debug("login-page authType={}, authZone={}, mediaType={}, state={}, host={}", authType, authZone, mt, state, host);
         return wingsAuthPageHandler.response(em, mt, request, response);
     }
 
@@ -121,7 +121,7 @@ public ResponseEntity LoginPage2(@PathVariable(WingsAuthHelper.ExtName) Strin
                                         HttpServletResponse response) {
         final Enum em = wingsAuthTypeParser.parse(authType);
         final MediaType mt = ContentTypeHelper.mediaTypeByUri(extName, MediaType.APPLICATION_JSON);
-        log.info("login-page authType={}, authZone={}, mediaType={}, state={}, host={}", authType, authZone, mt, state, host);
+        log.debug("login-page authType={}, authZone={}, mediaType={}, state={}, host={}", authType, authZone, mt, state, host);
         return wingsAuthPageHandler.response(em, mt, request, response);
     }
 
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginProcController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginProcController.java
index 7f31ed2c0..143adf928 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginProcController.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginProcController.java
@@ -53,7 +53,7 @@ public R login(@PathVariable(WingsAuthHelper.AuthType) String authType,
                          @RequestParam(value = WingsAuthHelper.AuthZone, required = false) String authZone,
                          @RequestParam("username") String username,
                          @RequestParam("password") String password) {
-        log.info("authType={}, authZone={}, username={}, password={}", authType, authZone, username, password);
+        log.debug("authType={}, authZone={}, username={}, password={}", authType, authZone, username, password);
         return R.ng("handler by filter, never here");
     }
 }
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/handler/LoginSuccessHandler.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/handler/LoginSuccessHandler.java
index 414d78323..f0f8b6156 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/handler/LoginSuccessHandler.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/handler/LoginSuccessHandler.java
@@ -44,7 +44,7 @@ protected void onResponse(@NotNull HttpServletRequest req, @NotNull HttpServletR
 
         if (state != null && !state.isEmpty()) {
             if (state.startsWith("/") || isSafeRedirect(state)) {
-                log.info("redirect to {}", state);
+                log.debug("redirect to {}", state);
                 res.sendRedirect(state);
             }
             else {
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/handler/NonceLoginSuccessHandler.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/handler/NonceLoginSuccessHandler.java
index 937be88e6..0b06fb80a 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/handler/NonceLoginSuccessHandler.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/handler/NonceLoginSuccessHandler.java
@@ -42,7 +42,7 @@ public final void onAuthenticationSuccess(HttpServletRequest request, HttpServle
             sid = session.getId();
             if (state != null) {
                 NonceTokenSessionHelper.bindNonceSession(state, sid);
-                log.info("parse client state={}, uid={}", state, uid);
+                log.debug("parse client state={}, uid={}", state, uid);
             }
         }
 
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/AuthStateBuilder.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/AuthStateBuilder.java
index 2235965d2..c58cf7315 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/AuthStateBuilder.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/justauth/AuthStateBuilder.java
@@ -72,7 +72,7 @@ public String buildState(HttpServletRequest request) {
             final byte[] bytes = JSON.toJSONBytes(paraMap, FastJsonHelper.DefaultWriter());
             final byte[] encode = aes.encode(bytes);
             final String state = Base64.encode(encode);
-            log.info("AuthStateBuilder, buildState={}", state);
+            log.debug("AuthStateBuilder, buildState={}", state);
             return uuid + state;
         }
     }
@@ -107,7 +107,7 @@ public String parseState(HttpServletRequest request) {
         if (args.length > 0) {
             final String fmt = safeState.get(args[0]);
             final String rst = FormatUtil.message(fmt, (Object[]) args);
-            log.info("AuthStateBuilder, parseParam={}", rst);
+            log.debug("AuthStateBuilder, parseParam={}", rst);
             return rst;
         }
         else {
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/listener/WarlockFailedLoginListener.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/listener/WarlockFailedLoginListener.java
index cd5e57ec1..d2004bf86 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/listener/WarlockFailedLoginListener.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/listener/WarlockFailedLoginListener.java
@@ -28,7 +28,7 @@ public class WarlockFailedLoginListener implements ApplicationListener authType, @Nullable Wing
         final Object authUser = authDetail.getRealData();
         if (username.isEmpty() && authUser instanceof AuthUser) {
             username = ((AuthUser) authUser).getUuid();
-            log.info("load auth-user by {} use uuid={}", authType, username);
+            log.debug("load auth-user by {} use uuid={}", authType, username);
         }
         return super.doLoad(username, authType, authDetail);
     }
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/ComboWarlockAuthnService.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/ComboWarlockAuthnService.java
index 8ac180268..9116e43e7 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/ComboWarlockAuthnService.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/ComboWarlockAuthnService.java
@@ -83,7 +83,7 @@ public Details register(@NotNull Enum authType, String username, WingsAuthDet
             if (autoReg.accept(authType, username, details)) {
                 final Details dt = autoReg.create(authType, username, details);
                 if (dt != null) {
-                    log.info("register by AutoReg={}", autoReg.getClass());
+                    log.debug("register by AutoReg={}", autoReg.getClass());
                     return dt;
                 }
             }
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
index 53ddf809d..fb852c12b 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java
@@ -64,7 +64,7 @@ public Details create(@NotNull Enum authType, String username, WingsAuthDetai
 
             beforeSave(user, username, details);
             long uid = warlockUserBasisService.create(user);
-            log.info("auto register user authType={}, username={}, userId={}", authType, username, uid);
+            log.debug("auto register user authType={}, username={}, userId={}", authType, username, uid);
             afterSave(user, username, details, uid);
             //
             Authn authn = new Authn();
@@ -81,7 +81,7 @@ public Details create(@NotNull Enum authType, String username, WingsAuthDetai
 
             beforeSave(authn, username, details, uid);
             long aid = warlockUserAuthnService.create(uid, authn);
-            log.info("auto register auth authType={}, username={}, authId={}", authType, username, aid);
+            log.debug("auto register auth authType={}, username={}, authId={}", authType, username, aid);
             afterSave(authn, username, details, uid, aid);
 
             final Details result = new Details();
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/event/impl/TableChangePublisherImpl.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/event/impl/TableChangePublisherImpl.java
index 154ebed2f..a82a9a751 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/event/impl/TableChangePublisherImpl.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/service/event/impl/TableChangePublisherImpl.java
@@ -22,7 +22,7 @@ public class TableChangePublisherImpl implements TableChangePublisher {
     @Override
     public void publish(@NotNull TableChangeEvent event) {
         if (event.hasSource(EVENT_SRC)) {
-            log.info("skip published event, table={}, change={}", event.getTable(), event.getChange());
+            log.debug("skip published event, table={}, change={}", event.getTable(), event.getChange());
         }
         else {
             log.debug("publish event={}", event);

From b816d2cf8887af8cca06f98d726fe778fd45f97b Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Tue, 7 Nov 2023 09:26:40 +0800
Subject: [PATCH 11/23] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20more?=
 =?UTF-8?q?=20info=20in=20log=20monitor=20#151?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 observe/docs                                           |  2 +-
 observe/mirana                                         |  2 +-
 .../wings/slardar/monitor/metric/LogMetric.java        | 10 +++++++++-
 .../resources/wings-conf/wings-monitor-79.properties   |  2 ++
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/observe/docs b/observe/docs
index 0402ab970..ffa975d08 160000
--- a/observe/docs
+++ b/observe/docs
@@ -1 +1 @@
-Subproject commit 0402ab9707830dfae0e5c0b09edd134059217f11
+Subproject commit ffa975d08a456decb31466d7477032719e49c901
diff --git a/observe/mirana b/observe/mirana
index 9e877fdde..42dc807e6 160000
--- a/observe/mirana
+++ b/observe/mirana
@@ -1 +1 @@
-Subproject commit 9e877fdde97542c0af0f0bf3f87607972f303a11
+Subproject commit 42dc807e64fe3cc9d657921d0c48a3fd6ee0cd64
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/metric/LogMetric.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/metric/LogMetric.java
index d86bd5527..4fca8da99 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/metric/LogMetric.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/monitor/metric/LogMetric.java
@@ -62,7 +62,7 @@ public String getKey() {
         }
 
         final long from = readLastForm();
-        final LogStat.Stat stat = LogStat.stat(rule.file, from, rule.getRuntimeKeys());
+        final LogStat.Stat stat = LogStat.stat(rule.file, from, rule.getPreview(), rule.getRuntimeKeys());
         log.debug("LogStat-{}, stat={}", key, stat);
         writeLastFrom(stat);
 
@@ -216,6 +216,14 @@ public static class Rule {
         private Set keyword = Collections.emptySet();
         public static final String Key$keyword = Key + ".keyword";
 
+        /**
+         * preview lines after found keyword
+         *
+         * @see #Key$preview
+         */
+        private int preview = 10;
+        public static final String Key$preview = Key + ".preview";
+
         /**
          * log charset
          */
diff --git a/wings/slardar/src/main/resources/wings-conf/wings-monitor-79.properties b/wings/slardar/src/main/resources/wings-conf/wings-monitor-79.properties
index 5eef68fe7..79ee26c42 100644
--- a/wings/slardar/src/main/resources/wings-conf/wings-monitor-79.properties
+++ b/wings/slardar/src/main/resources/wings-conf/wings-monitor-79.properties
@@ -47,6 +47,8 @@ wings.slardar.monitor.log.default.bound=40
 wings.slardar.monitor.log.default.level=' WARN ',' ERROR '
 ## log content (after level) keywords
 wings.slardar.monitor.log.default.keyword=
+## preview lines after found keyword
+wings.slardar.monitor.log.default.preview=10
 ## log charset
 wings.slardar.monitor.log.default.charset=UTF8
 ## delete scanned files older than N days, `-1` means no cleaning

From 8d0b26c317562b747ddf9287005b0267f4db4a04 Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Thu, 9 Nov 2023 16:42:28 +0800
Subject: [PATCH 12/23] =?UTF-8?q?=F0=9F=94=A8=20wings-mysql-user.sh=20gen?=
 =?UTF-8?q?=20sql=20file?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 observe/scripts/wings-mysql-user.sh | 39 ++++++++++++++++-------------
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/observe/scripts/wings-mysql-user.sh b/observe/scripts/wings-mysql-user.sh
index 27b54f195..18d9976ba 100755
--- a/observe/scripts/wings-mysql-user.sh
+++ b/observe/scripts/wings-mysql-user.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-THIS_VERSION=2023-04-14
+THIS_VERSION=2023-11-09
 
 cat </dev/null 2>&1
-  exec_cmd="mysql -vvv -f "
-  if [[ -f "$option" ]]; then
-    echo -e "\033[0;33mNOTE: current option file \033[m"
-    cat "$option"
-    exec_cmd="mysql --defaults-extra-file=$option -vvv -f "
-  fi
-fi
-
 echo -e '\033[37;42;1mNOTE: users and passwd\033[m'
 grep -v '^#' </dev/null 2>&1
 
 if [[ "$command" == "create" ]]; then
-  grep -v '^#' <> "$temp_sql" <> "$temp_sql" <> "$temp_sql" <> "$temp_sql" </dev/null 2>&1
+
+  if [[ -f "$option" ]]; then
+    echo -e "\033[0;33mNOTE: current option file \033[m"
+    cat "$option"
+    mysql --defaults-extra-file="$option" -vvv --force < "$temp_sql"
+  else
+    mysql -vvv --force < "$temp_sql"
+  fi
+fi

From ffdf2f1b5e629c7113e689f4684a4a968b32a0a4 Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Thu, 9 Nov 2023 17:04:38 +0800
Subject: [PATCH 13/23] =?UTF-8?q?=F0=9F=93=8C=20bump=20meepo=20to=201.4.14?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 64a83cb62..136ea6e93 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,7 @@
         2.2.3 
         
         2.6.4-SNAPSHOT 
-        1.4.1-SNAPSHOT 
+        1.4.14-SNAPSHOT 
         5.3.2 
         2.3.3 
         2.0.41 

From f85ae2fcb4ba7e666629f1a0a08e17409a6d800e Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Fri, 10 Nov 2023 12:17:09 +0800
Subject: [PATCH 14/23] =?UTF-8?q?=F0=9F=A4=A1=20mock=20jooq=20dsl=20#152?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 WingsBoot.t.md                                |  2 +
 observe/docs                                  |  2 +-
 .../database/jooq/WingsJooqDaoAliasImpl.java  | 30 ++++++-
 .../conf/FacelessJooqAutoConfiguration.java   |  3 +-
 .../app/conf/MockJooqConfiguration.java       | 28 ++++++
 .../jooq/MockTstNormalTableDataProvider.java  | 68 ++++++++++++++
 .../faceless/jooq/MockTstNormalTableTest.java | 90 +++++++++++++++++++
 7 files changed, 218 insertions(+), 5 deletions(-)
 create mode 100644 wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/MockJooqConfiguration.java
 create mode 100644 wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/jooq/MockTstNormalTableDataProvider.java
 create mode 100644 wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/MockTstNormalTableTest.java

diff --git a/WingsBoot.t.md b/WingsBoot.t.md
index 3fb71b6f6..47f0bc5db 100644
--- a/WingsBoot.t.md
+++ b/WingsBoot.t.md
@@ -176,6 +176,8 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m
 * 12141 JooqShardingTest: print sprint sharding delete
 * 12142 JooqShardingTest: print sprint sharding batch insert
 * 12143 JooqShardingTest: print sprint sharding batch merge
+* 12144 MockTstNormalTableTest: mock ConnectionProvider by spring
+* 12145 MockTstNormalTableTest: mock DSLContext to Dao instance
 
 ## 13 Slardar
 
diff --git a/observe/docs b/observe/docs
index ffa975d08..00b5644e9 160000
--- a/observe/docs
+++ b/observe/docs
@@ -1 +1 @@
-Subproject commit ffa975d08a456decb31466d7477032719e49c901
+Subproject commit 00b5644e93cebfcc2e42dc8903c70631f2d19f54
diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImpl.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImpl.java
index 4b9641d9a..dc3bbd651 100644
--- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImpl.java
+++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImpl.java
@@ -51,6 +51,7 @@
 import java.util.function.BiFunction;
 import java.util.function.BiPredicate;
 import java.util.function.Function;
+import java.util.function.Supplier;
 import java.util.stream.Collectors;
 
 /**
@@ -79,6 +80,8 @@ public abstract class WingsJooqDaoAliasImpl & WingsAliasTable
     protected final Field[] pkeys;
     protected volatile int tableExist = -1;
 
+    protected volatile Supplier dslSup = null;
+
     protected WingsJooqDaoAliasImpl(T table, Class

type) { this(table, type, null); } @@ -89,6 +92,25 @@ protected WingsJooqDaoAliasImpl(T table, Class

type, Configuration conf) { this.pkeys = WingsJooqUtil.primaryKeys(table); } + @Override + @NotNull + public DSLContext ctx() { + if (dslSup == null) return super.ctx(); + + DSLContext dsl = dslSup.get(); + return dsl != null ? dsl : super.ctx(); + } + + /** + * set/remove dsl Supplier to current instance, e.g. mocking DSL. + * if Supplier or its result is null, return the original Dsl. + * + * @param sup to supply Dsl. + */ + public void setDslContext(@Nullable Supplier sup) { + this.dslSup = sup; + } + /** * -1:Unchecked | 0:Not exist | 1:Exists * @@ -864,6 +886,7 @@ public List

fetch(T table, int offset, int limit, Condition cond, Collection< public List fetch(Class claz, T table, QueryPart... selectsOrders) { return fetch(claz, table, null, selectsOrders); } + @NotNull public List fetch(Class claz, T table, Collection selectsOrders) { return fetch(claz, table, null, selectsOrders); @@ -1148,7 +1171,7 @@ public Optional

fetchOptional(T table, QueryPart... selectsOrders) { return Optional.ofNullable(fetchOne(table, null, selectsOrders)); } - @NotNull + @NotNull public Optional

fetchOptional(T table, Collection selectsOrders) { return Optional.ofNullable(fetchOne(table, null, selectsOrders)); } @@ -1158,7 +1181,7 @@ public Optional

fetchLimitOptional(T table, QueryPart... selectsOrders) { return Optional.ofNullable(fetchLimitOne(table, null, selectsOrders)); } - @NotNull + @NotNull public Optional

fetchLimitOptional(T table, Collection selectsOrders) { return Optional.ofNullable(fetchLimitOne(table, null, selectsOrders)); } @@ -1246,7 +1269,7 @@ public Optional fetchLimitOptional(Class claz, T table, QueryPart... s return Optional.ofNullable(fetchLimitOne(claz, table, null, selectsOrders)); } - @NotNull + @NotNull public Optional fetchLimitOptional(Class claz, T table, Collection selectsOrders) { return Optional.ofNullable(fetchLimitOne(claz, table, null, selectsOrders)); } @@ -1255,6 +1278,7 @@ public E fetchOne(Class claz, T table, Condition cond, QueryPart... selec final var two = selectAndOrders(List.of(selectsOrders)); return fetchOne(claz, table, cond, two.one(), two.two(), false); } + public E fetchOne(Class claz, T table, Condition cond, Collection selectsOrders) { final var two = selectAndOrders(selectsOrders); return fetchOne(claz, table, cond, two.one(), two.two(), false); diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java index 7d2cfb18d..0d01a39a8 100644 --- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java @@ -3,6 +3,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration; import pro.fessional.wings.faceless.spring.bean.FacelessJooqConfiguration; import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; @@ -11,7 +12,7 @@ * @since 2019-06-01 */ -@AutoConfiguration(before = FacelessAutoConfiguration.class) +@AutoConfiguration(before = {FacelessAutoConfiguration.class, JooqAutoConfiguration.class}) @ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true") @ImportAutoConfiguration(FacelessJooqConfiguration.class) public class FacelessJooqAutoConfiguration { diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/MockJooqConfiguration.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/MockJooqConfiguration.java new file mode 100644 index 000000000..65f67c59c --- /dev/null +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/conf/MockJooqConfiguration.java @@ -0,0 +1,28 @@ +package pro.fessional.wings.faceless.app.conf; + +import org.jooq.ConnectionProvider; +import org.jooq.impl.DefaultConnectionProvider; +import org.jooq.tools.jdbc.MockConnection; +import org.jooq.tools.jdbc.MockConnectionProvider; +import org.jooq.tools.jdbc.MockDataProvider; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import pro.fessional.wings.faceless.app.database.jooq.MockTstNormalTableDataProvider; + +/** + * @author trydofor + * @since 2023-11-10 + */ +@Configuration(proxyBeanMethods = false) +public class MockJooqConfiguration { + + @Bean + @ConditionalOnProperty(name = "wings.faceless.testing.mock-jooq", havingValue = "true") + public ConnectionProvider mockConnectionProvider() { + MockDataProvider provider = new MockTstNormalTableDataProvider(); + MockConnection connection = new MockConnection(provider); + DefaultConnectionProvider delegate = new DefaultConnectionProvider(connection); + return new MockConnectionProvider(delegate, provider);// + } +} diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/jooq/MockTstNormalTableDataProvider.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/jooq/MockTstNormalTableDataProvider.java new file mode 100644 index 000000000..e920cb25f --- /dev/null +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/jooq/MockTstNormalTableDataProvider.java @@ -0,0 +1,68 @@ +package pro.fessional.wings.faceless.app.database.jooq; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; + +import pro.fessional.wings.faceless.convention.EmptyValue; +import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; + +import lombok.Getter; +import lombok.Setter; +import org.jooq.DSLContext; +import org.jooq.SQLDialect; +import org.jooq.impl.DSL; +import org.jooq.tools.jdbc.MockDataProvider; +import org.jooq.tools.jdbc.MockExecuteContext; +import org.jooq.tools.jdbc.MockResult; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstNormalTable; + +import java.sql.SQLException; + +import static pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable.TstNormalTable; + +/** + * @author trydofor + * @since 2023-11-10 + */ +@Setter +@Getter +public class MockTstNormalTableDataProvider implements MockDataProvider { + + public static final TstNormalTable DefaultRecord = new TstNormalTable(); + + static { + DefaultRecord.setId(102310086L); + DefaultRecord.setCreateDt(LocalDateTime.now()); + DefaultRecord.setModifyDt(EmptyValue.DATE_TIME); + DefaultRecord.setDeleteDt(EmptyValue.DATE_TIME); + DefaultRecord.setCommitId(0L); + DefaultRecord.setValueVarchar("MockValueVarchar"); + DefaultRecord.setValueDecimal(new BigDecimal("102310086")); + DefaultRecord.setValueBoolean(false); + DefaultRecord.setValueInt(102310086); + DefaultRecord.setValueLong(102310086L); + DefaultRecord.setValueDate(LocalDate.of(2023, 10, 23)); + DefaultRecord.setValueTime(LocalTime.of(23, 10, 23)); + DefaultRecord.setValueLang(StandardLanguage.ZH_CN); + } + + private TstNormalTable record = DefaultRecord; + + @Override + public MockResult[] execute(MockExecuteContext ctx) throws SQLException { + String sql = ctx.sql(); + + if (sql.toUpperCase().startsWith("SELECT")) { + // You might need a DSLContext to create org.jooq.Result and org.jooq.Record objects + DSLContext create = DSL.using(SQLDialect.MYSQL); + // Always return one record + var result = create.newResult(TstNormalTable); + result.add(create.newRecord(TstNormalTable, record)); + return new MockResult[]{new MockResult(1, result)}; + } + + throw new SQLException("Statement not supported: " + sql); + } +} \ No newline at end of file diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/MockTstNormalTableTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/MockTstNormalTableTest.java new file mode 100644 index 000000000..ce1e55a7f --- /dev/null +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/MockTstNormalTableTest.java @@ -0,0 +1,90 @@ +package pro.fessional.wings.faceless.jooq; + +import io.qameta.allure.TmsLink; +import lombok.Setter; +import org.jooq.DSLContext; +import org.jooq.SQLDialect; +import org.jooq.impl.DSL; +import org.jooq.tools.jdbc.MockConnection; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstNormalTableDao; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstNormalTable; +import pro.fessional.wings.faceless.app.database.jooq.MockTstNormalTableDataProvider; +import pro.fessional.wings.faceless.convention.EmptyValue; +import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.List; + +import static pro.fessional.wings.faceless.app.database.jooq.MockTstNormalTableDataProvider.DefaultRecord; + + +/** + * @author trydofor + * @since 2023-11-10 + */ +@SpringBootTest(properties = { + "wings.faceless.testing.mock-jooq=true", + """ + spring.datasource.url=jdbc:h2:./${testing.dbname}\\ + ;USER=${spring.datasource.username};PASSWORD=${spring.datasource.password}\\ + ;MODE=MySQL;CASE_INSENSITIVE_IDENTIFIERS=TRUE;IGNORECASE=TRUE\\ + ;AUTO_RECONNECT=TRUE;AUTO_SERVER=TRUE""" +}) +public class MockTstNormalTableTest { + + @Setter(onMethod_ = {@Autowired}) + protected TstNormalTableDao tstNormalTableDao; + + @Setter(onMethod_ = {@Autowired}) + protected DSLContext dslContext; + + @Test + @TmsLink("C12144") + public void springGlobal() { + var r1 = dslContext.selectFrom(TstNormalTableTable.TstNormalTable) + .where(TstNormalTableTable.TstNormalTable.Id.eq(1L)) + .fetchInto(TstNormalTable.class); + Assertions.assertEquals(1, r1.size()); + Assertions.assertEquals(DefaultRecord, r1.get(0)); + List r2 = tstNormalTableDao.fetchById(1L); + Assertions.assertEquals(1, r2.size()); + Assertions.assertEquals(DefaultRecord, r2.get(0)); + } + + @Test + @TmsLink("C12145") + public void manualInstance() { + TstNormalTable m = new TstNormalTable(); + m.setId(-1023L); + m.setCreateDt(LocalDateTime.now()); + m.setModifyDt(EmptyValue.DATE_TIME); + m.setDeleteDt(EmptyValue.DATE_TIME); + m.setCommitId(-1L); + m.setValueVarchar("MyMockValueVarchar"); + m.setValueDecimal(new BigDecimal("-102310086")); + m.setValueBoolean(false); + m.setValueInt(-102310086); + m.setValueLong(-102310086L); + m.setValueDate(LocalDate.of(2023, 11, 11)); + m.setValueTime(LocalTime.of(11, 23, 45)); + m.setValueLang(StandardLanguage.EN_US); + + MockTstNormalTableDataProvider provider = new MockTstNormalTableDataProvider(); + provider.setRecord(m); + MockConnection connection = new MockConnection(provider); + DSLContext dsl = DSL.using(connection, SQLDialect.MYSQL); + tstNormalTableDao.setDslContext(() -> dsl); + List r2 = tstNormalTableDao.fetchById(1L); + Assertions.assertEquals(1, r2.size()); + Assertions.assertEquals(m, r2.get(0)); + tstNormalTableDao.setDslContext(null); + } +} From e17c0f6a6ed8e8072a700ef3e9a2830902214d9d Mon Sep 17 00:00:00 2001 From: trydofor Date: Mon, 13 Nov 2023 16:23:59 +0800 Subject: [PATCH 15/23] =?UTF-8?q?=E2=9C=85=20multiple=20instance=20LightId?= =?UTF-8?q?Service=20#153?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WingsBoot.t.md | 1 + observe/docs | 2 +- .../lightid/impl/JvmLightIdProviderTest.java | 57 ++++++++++++++++++- 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/WingsBoot.t.md b/WingsBoot.t.md index 47f0bc5db..70e66e6d0 100644 --- a/WingsBoot.t.md +++ b/WingsBoot.t.md @@ -377,6 +377,7 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m * 14073 CodeExceptionHandlerTest: message exception in english * 14074 CodeExceptionHandlerTest: message exception in chinese * 14075 CodeExceptionHandlerTest: CompletableFuture exception in chinese +* 14076 JvmLightIdProviderTest: 50 instances compete for 1 db by tx ## 15 Tiny diff --git a/observe/docs b/observe/docs index 00b5644e9..924abad55 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit 00b5644e93cebfcc2e42dc8903c70631f2d19f54 +Subproject commit 924abad555b3cbecf64963a60c696f4b28f87a79 diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/JvmLightIdProviderTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/JvmLightIdProviderTest.java index 7d6563d97..aaf88f5ed 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/JvmLightIdProviderTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/lightid/impl/JvmLightIdProviderTest.java @@ -9,21 +9,76 @@ import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.mirana.id.LightIdBufferedProvider; import pro.fessional.mirana.id.LightIdProvider; +import pro.fessional.wings.faceless.service.lightid.BlockIdProvider; +import pro.fessional.wings.faceless.service.lightid.LightIdService; +import pro.fessional.wings.faceless.service.lightid.impl.LightIdServiceImpl; + +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Executors; + +import static org.junit.jupiter.api.Assertions.assertEquals; /** * @author trydofor * @since 2023-07-18 */ -@SpringBootTest(properties = "wings.faceless.lightid.provider.monotonic=jvm") +@SpringBootTest(properties = { + "wings.faceless.lightid.provider.monotonic=jvm", + "wings.faceless.lightid.insert.step=10", +}) @Slf4j public class JvmLightIdProviderTest { @Setter(onMethod_ = {@Autowired}) protected LightIdProvider lightIdProvider; + @Setter(onMethod_ = {@Autowired}) + protected BlockIdProvider blockIdProvider; + @Setter(onMethod_ = {@Autowired}) + protected LightIdProvider.Loader lightIdLoader; @Test @TmsLink("C14063") public void test() { Assertions.assertInstanceOf(LightIdBufferedProvider.class, lightIdProvider); } + + @Test + @TmsLink("C14076") + public void testMultiInstance() throws InterruptedException { + final var threadCnt = 30; + final var loopCount = 1000; + final var idCache = new ConcurrentHashMap(); + final var pools = Executors.newFixedThreadPool(threadCnt); + + final var seqName = "testMultiInstance"; + final var ids = new LightIdService[threadCnt]; + for (int i = 0; i < threadCnt; i++) { + final var lip = new LightIdBufferedProvider(lightIdLoader); + lip.setTimeout(10000); + lip.setErrAlive(1000); + lip.setMaxError(1); + lip.setMaxCount(10); + ids[i] = new LightIdServiceImpl(lip, blockIdProvider); + ids[i].getId(seqName); + } + log.info("CountDownLatch {}", threadCnt); + + final var end = new CountDownLatch(threadCnt); + for (int i = 0; i < threadCnt; i++) { + final var idx = i; + pools.submit(() -> { + log.info("start {}", idx); + for (int j = 0; j < loopCount; j++) { + var id = ids[idx].getId(seqName, 0); + idCache.put(id, id); + } + log.info("done {}", idx); + end.countDown(); + }); + } + end.await(); + log.info("all done"); + assertEquals(loopCount * threadCnt, idCache.size()); + } } From ca52bf7c8ee8a1e4eeca9a3cc4283283bfe1d79a Mon Sep 17 00:00:00 2001 From: trydofor Date: Tue, 14 Nov 2023 18:24:41 +0800 Subject: [PATCH 16/23] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20add=20Generator=20to?= =?UTF-8?q?=20customize=20LightId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- observe/mirana | 2 +- .../faceless/service/lightid/impl/LightIdServiceImplTest.kt | 5 +++-- .../faceless/spring/bean/FacelessLightIdConfiguration.java | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/observe/mirana b/observe/mirana index 42dc807e6..0140d977b 160000 --- a/observe/mirana +++ b/observe/mirana @@ -1 +1 @@ -Subproject commit 42dc807e64fe3cc9d657921d0c48a3fd6ee0cd64 +Subproject commit 0140d977b062baaa4c49f484e9a4b5fe5037454d diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt index 54f394151..5ae0e10de 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt @@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.jdbc.core.JdbcTemplate import pro.fessional.mirana.id.LightIdBufferedProvider +import pro.fessional.mirana.id.LightIdUtil import pro.fessional.wings.faceless.flywave.SchemaRevisionManager import pro.fessional.wings.faceless.flywave.WingsRevision import pro.fessional.wings.faceless.helper.WingsTestHelper @@ -113,10 +114,10 @@ open class LightIdServiceImplTest { fun test4RangeId() { val rg = 999_000_000_000L val id = lightIdService.getId(seqName, 0) - lightIdBufferedProvider.setSequenceHandler { seq -> seq + rg } + lightIdBufferedProvider.setGenerator { _, b, s -> LightIdUtil.toId(b, s + rg) } val id1 = lightIdService.getId(seqName, 0) assertEquals(rg + 1, id1 - id) - lightIdBufferedProvider.sequenceHandler = null + lightIdBufferedProvider.generator = LightIdBufferedProvider.GENERATOR val id2 = lightIdService.getId(seqName, 0) assertEquals(2, id2 - id) } diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java index 591120a5f..05e65f3e4 100644 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java +++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java @@ -72,7 +72,7 @@ public LightIdProvider.Loader lightIdLoader(LightSequenceSelect lightSequenceSel @ConditionalOnMissingBean(LightIdProvider.class) public LightIdProvider lightIdProvider(LightIdProvider.Loader lightIdLoader, LightIdProviderProp providerProp, - ObjectProvider sequenceHandler) { + ObjectProvider generator) { final String mono = providerProp.getMonotonic(); log.info("Faceless spring-bean lightIdProvider in " + mono); if ("jvm".equalsIgnoreCase(mono)) { @@ -82,7 +82,8 @@ public LightIdProvider lightIdProvider(LightIdProvider.Loader lightIdLoader, provider.setErrAlive(providerProp.getErrAlive()); provider.setMaxError(providerProp.getMaxError()); provider.setMaxCount(providerProp.getMaxCount()); - sequenceHandler.ifAvailable(provider::setSequenceHandler); + // default LightIdUtil.toId + generator.ifAvailable(provider::setGenerator); return provider; } else if ("db".equalsIgnoreCase(mono)) { From d4e23d40f11041d5e434df8e8224c68cb4414f07 Mon Sep 17 00:00:00 2001 From: trydofor Date: Sat, 18 Nov 2023 18:49:27 +0800 Subject: [PATCH 17/23] =?UTF-8?q?=F0=9F=92=A5=20disable=20any=20@Component?= =?UTF-8?q?=20by=20prop=20#86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WingsBoot.t.md | 4 + .../wings/devs/BootDatabaseTest.java | 4 +- .../src/test/resources/application.properties | 9 +- .../tiny/mail/database/TinyMailDatabase.java | 8 + .../tiny/task/database/TinyTaskDatabase.java | 8 + .../mail/controller/MailListController.java | 5 +- .../mail/controller/MailSendController.java | 5 +- .../tiny/mail/sender/MailSenderManager.java | 11 +- .../service/impl/TinyMailListServiceImpl.java | 2 + .../service/impl/TinyMailServiceImpl.java | 2 + .../spring/bean/TinyMailConfiguration.java | 46 ++- .../conf/TinyMailAutoConfiguration.java | 12 +- .../mail/spring/prop/TinyMailEnabledProp.java | 51 --- .../mail/spring/prop/TinyMailSenderProp.java | 8 + .../wings-flywave-fit-79.properties | 2 +- .../wings/tiny/project/BootDatabaseTest.java | 4 +- .../tiny/project/TinyMailCodeGenTest.java | 4 +- .../src/test/resources/application.properties | 2 +- .../task/controller/TaskConfController.java | 5 +- .../task/controller/TaskExecController.java | 5 +- .../task/controller/TaskListController.java | 5 +- .../service/impl/TinyTaskBeatServiceImpl.java | 2 + .../service/impl/TinyTaskConfServiceImpl.java | 2 + .../service/impl/TinyTaskExecServiceImpl.java | 14 +- .../service/impl/TinyTaskListServiceImpl.java | 2 + .../service/impl/TinyTaskServiceImpl.java | 2 + .../spring/bean/TinyTaskConfiguration.java | 46 ++- .../conf/TinyTaskAutoConfiguration.java | 12 +- .../task/spring/prop/TinyTaskEnabledProp.java | 68 ---- .../task/spring/prop/TinyTaskExecProp.java | 26 ++ .../spring-wings-enabled-79.properties | 12 - .../wings-tinytask-exec-79.properties | 2 + .../src/test/resources/application.properties | 2 +- .../bean/BatriderServcombConfiguration.java | 5 +- .../conf/BatriderAutoConfiguration.java | 9 +- .../spring/prop/BatriderEnabledProp.java | 27 -- .../faceless/enums/ConstantEnumI18nTest.java | 2 +- .../faceless/flywave/RevisionFitness.java | 2 +- .../project/ProjectSchemaManager.java | 2 +- ...uration.java => FlywaveConfiguration.java} | 25 +- .../spring/conf/FlywaveAutoConfiguration.java | 13 +- .../spring/prop/FlywaveEnabledProp.java | 35 --- .../faceless/spring/prop/FlywaveFitProp.java | 8 + .../spring-wings-enabled-79.properties | 4 - .../wings-flywave-fit-79.properties | 3 + .../TestWingsSchemaGeneratorSample.java | 3 +- .../flywave/SchemaJournalManagerTest.kt | 2 + .../flywave/SchemaRevisionMangerTest.kt | 2 + .../flywave/SimpleJdbcTemplateTest.kt | 2 + .../faceless/flywave/SqlSegmentParserTest.kt | 4 +- .../faceless/flywave/WingsShardingTest.kt | 2 + .../lightid/impl/LightIdServiceImplTest.kt | 2 + .../src/test/resources/application.properties | 2 + .../faceless/database/jooq/WingsJooqEnv.java | 2 +- .../bean/FacelessJooqConfiguration.java | 68 +--- .../bean/FacelessJooqCudConfiguration.java | 83 +++++ .../conf/FacelessJooqAutoConfiguration.java | 13 +- ...ledProp.java => FacelessJooqConfProp.java} | 23 +- .../spring/prop/FacelessJooqCudProp.java | 2 +- ...operties => wings-jooq-conf-79.properties} | 27 +- .../jooq/WingsJooqDaoAliasImplTest.java | 2 + .../faceless/jooq/JooqDeleteListenerTest.java | 4 +- .../jooq/JooqMapperCompatibleTest.java | 2 + .../jooq/JooqTableCudListenerTest.java | 6 +- .../jooq/TransactionalServiceTest.java | 2 + .../sample/TestJooqDslAndDaoSample.java | 2 + .../sample/TestJooqMostSelectSample.java | 2 + .../FacelessShardingSphereConfiguration.java | 62 ++++ .../FacelessShardingsphereConfiguration.java | 55 ---- .../conf/FacelessShardAutoConfiguration.java | 14 +- .../faceless/flywave/FlywaveShardingTest.java | 2 + .../wings/faceless/jooq/JooqShardingTest.java | 2 + .../spring-wings-enabled.properties | 2 +- .../wini18n/impl/StandardI18nServiceJdbc.java | 13 +- ...ration.java => FacelessConfiguration.java} | 49 ++- .../bean/FacelessEnumI18nConfiguration.java | 37 --- .../bean/FacelessFlakeIdConfiguration.java | 30 -- .../bean/FacelessJournalConfiguration.java | 46 --- .../bean/FacelessLightIdConfiguration.java | 141 +++++---- .../conf/FacelessAutoConfiguration.java | 21 +- .../spring/prop/FacelessEnabledProp.java | 50 --- .../spring-wings-enabled-79.properties | 9 - .../concur/DatabaseGlobalLockTest.java | 3 +- .../database/helper/DatabaseCheckerTest.java | 2 + .../silencer/encrypt/SecretProvider.java | 9 + .../bean/SilencerAutoLogConfiguration.java | 10 +- .../bean/SilencerEncryptConfiguration.java | 21 +- .../bean/SilencerInspectConfiguration.java | 12 +- ...va => SilencerModeWiredConfiguration.java} | 8 +- .../bean/SilencerTweakConfiguration.java | 98 +++--- .../conf/SilencerCurseAutoConfiguration.java | 13 +- .../spring/prop/SilencerInspectProp.java | 27 -- .../wings-conf/wings-inspect-79.properties | 4 - .../app/conf/SpringOrderConfiguration.java | 12 +- .../src/test/resources/application.properties | 2 +- .../message/CombinableMessageSource.java | 51 ++- .../silencer/message/MessageSourceHelper.java | 44 +++ .../runner/ApplicationInspectRunner.java | 3 +- .../spring/bean/SilencerConfiguration.java | 85 +++++ .../bean/SilencerMessageConfiguration.java | 46 --- .../bean/SilencerRunnerConfiguration.java | 104 +++---- .../spring/boot/ConditionalWingsEnabled.java | 59 ++++ .../spring/boot/WingsAutoConfigProcessor.java | 33 +- .../spring/boot/WingsEnabledCondition.java | 252 +++++++++++++++ .../conf/SilencerAutoConfiguration.java | 17 +- .../spring/prop/SilencerEnabledProp.java | 27 +- .../spring-wings-enabled-79.properties | 15 +- .../bean/WingsEnabledCatConfiguration.java | 129 ++++++++ .../bean/WingsEnabledDogConfiguration.java | 90 ++++++ .../silencer/app/service/ScanService.java | 13 + .../spring/boot/WingsEnabledDefaultTest.java | 80 +++++ .../spring/boot/WingsEnabledFalseTest.java | 94 ++++++ .../spring/boot/WingsEnabledTopFalseTest.java | 60 ++++ .../spring/boot/WingsSilencerSpringTest.java | 2 +- .../boot/WingsSpringBeanScannerTest.java | 2 +- .../help/CombinableMessageSourceTest.java | 12 +- .../src/test/resources/application.properties | 2 +- ...java => HazelcastConfigConfiguration.java} | 34 +- .../bean/HazelcastFlakeIdConfiguration.java | 27 -- .../bean/HazelcastLightIdConfiguration.java | 40 --- .../bean/HazelcastMockConfiguration.java | 39 --- .../bean/HazelcastPublisherConfiguration.java | 27 -- .../bean/HazelcastServiceConfiguration.java | 82 +++++ .../SlardarHazelCachingAutoConfiguration.java | 24 -- .../SlardarHazelDistIdAutoConfiguration.java | 24 -- .../SlardarHazelcastAutoConfiguration.java | 22 ++ ...ot.autoconfigure.AutoConfiguration.imports | 3 +- .../spring-wings-enabled-79.properties | 2 + .../slardar/event/EventPublishHelperTest.java | 2 +- ... => SlardarHazelSessionConfiguration.java} | 14 +- .../SlardarHazelSessionAutoConfiguration.java | 13 +- .../webmvc/WingsSessionLangZoneTest.java | 2 +- .../bean/SlardarActuatorConfiguration.java | 3 + .../SlardarBootAdminClientConfiguration.java | 52 ++++ .../bean/SlardarBootAdminConfiguration.java | 174 ----------- .../SlardarBootAdminServerConfiguration.java | 139 +++++++++ .../bean/SlardarSecurityConfiguration.java | 42 +-- .../SlardarBootAdminAutoConfiguration.java | 17 +- .../conf/SlardarSprintAutoConfiguration.java | 11 +- .../slardar/webmvc/Cve2023T34035Test.java | 6 +- .../src/test/resources/application.properties | 5 +- .../spring-wings-enabled.properties | 1 + .../servlet/cookie/CookieRequestWrapper.java | 27 +- .../impl/WingsCookieInterceptorImpl.java | 42 ++- .../bean/SlardarCookieConfiguration.java | 17 +- .../bean/SlardarDebounceConfiguration.java | 10 +- .../SlardarDomainExtendConfiguration.java | 8 +- .../SlardarDoubleKillWebConfiguration.java | 21 +- .../bean/SlardarFirstBloodConfiguration.java | 35 +-- .../bean/SlardarJacksonWebConfiguration.java | 144 +++++---- .../bean/SlardarLocaleConfiguration.java | 10 +- .../bean/SlardarOkhttpWebConfiguration.java | 12 +- .../bean/SlardarOverloadConfiguration.java | 10 +- .../bean/SlardarPageQueryConfiguration.java | 22 +- .../bean/SlardarRemoteConfiguration.java | 10 +- ...a => SlardarReuseStreamConfiguration.java} | 12 +- .../bean/SlardarRighterConfiguration.java | 30 +- .../bean/SlardarSessionConfiguration.java | 27 +- .../bean/SlardarSwaggerConfiguration.java | 3 + .../bean/SlardarTerminalConfiguration.java | 13 +- .../bean/SlardarUndertowConfiguration.java | 6 +- .../bean/SlardarWebMvcConfiguration.java | 3 + ...va => SlardarWebFunAutoConfiguration.java} | 22 +- .../conf/SlardarWebMvcAutoConfiguration.java | 21 ++ ...ot.autoconfigure.AutoConfiguration.imports | 3 +- .../SlardarFirstBloodTestConfiguration.java | 5 +- .../wings/slardar/concur/FirstBloodTest.java | 7 +- .../slardar/domain/DomainExtendTest.java | 2 +- .../wings/slardar/json/DecimalFormatTest.java | 1 - .../slardar/json/WingsJacksonMapperTest.java | 1 - .../wings/slardar/webmvc/WingsCookieTest.java | 2 +- .../src/test/resources/application.properties | 2 +- .../cache/spring/WingsCacheAnnoOprSource.java | 6 +- .../bean/SlardarAsyncConfiguration.java | 16 +- .../bean/SlardarCacheConfiguration.java | 61 ++-- .../bean/SlardarDateTimeConfiguration.java | 111 +++---- .../bean/SlardarDingNoticeConfiguration.java | 15 +- .../bean/SlardarDoubleKillConfiguration.java | 8 +- .../bean/SlardarEventConfiguration.java | 15 +- .../spring/bean/SlardarI18nConfiguration.java | 13 +- .../bean/SlardarJacksonConfiguration.java | 37 +-- .../bean/SlardarMonitorConfiguration.java | 79 +++-- .../bean/SlardarOkhttpConfiguration.java | 62 ++-- .../bean/SlardarTweakConfiguration.java | 11 +- .../conf/SlardarAsyncAutoConfiguration.java | 12 +- .../spring/conf/SlardarAutoConfiguration.java | 11 +- .../conf/SlardarCacheAutoConfiguration.java | 16 + .../spring/prop/SlardarEnabledProp.java | 290 ------------------ ...OkHttpProp.java => SlardarOkhttpProp.java} | 7 +- ...ot.autoconfigure.AutoConfiguration.imports | 1 + .../spring-wings-enabled-79.properties | 2 +- .../bean/WarlockAwesomeConfiguration.java | 19 +- .../conf/WarlockAwesomeAutoConfiguration.java | 8 +- .../service/conf/RuntimeConfServiceTest.java | 3 +- .../bean/WarlockBondBeanConfiguration.java | 30 +- .../conf/WarlockBondAutoConfiguration.java | 8 +- .../src/test/resources/application.properties | 2 + .../project/Warlock1SchemaManager.java | 2 +- .../warlock/controller/MvcController.java | 8 + .../admin/AdminTweakController.java | 5 +- .../bean/WarlockExceptionConfiguration.java | 13 +- .../bean/WarlockHazelcastConfiguration.java | 32 -- .../bean/WarlockJournalConfiguration.java | 10 +- .../bean/WarlockJustAuthConfiguration.java | 17 +- .../bean/WarlockOauthTicketConfiguration.java | 11 +- .../bean/WarlockOtherBeanConfiguration.java | 40 ++- .../WarlockSecurityBeanConfiguration.java | 181 ++++------- .../WarlockSecurityConfConfiguration.java | 9 +- .../WarlockSecurityDummyConfiguration.java | 80 +++++ .../bean/WarlockWatching2Configuration.java | 5 +- ... => WarlockSecurityAutoConfiguration.java} | 11 +- .../conf/WarlockShadowAutoConfiguration.java | 14 +- ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../service/auth/PasswordEncoderTest.java | 2 +- .../bean/WarlockJournalDisableTest.java | 27 ++ .../bean/WarlockAutoRunConfiguration.java | 14 +- .../bean/WarlockLockBeanConfiguration.java | 13 +- .../bean/WarlockTableChangeConfiguration.java | 11 +- .../bean/WarlockWatchingConfiguration.java | 16 +- .../spring/conf/WarlockAutoConfiguration.java | 13 +- .../spring/prop/WarlockEnabledProp.java | 9 - .../spring-wings-enabled-77.properties | 5 +- .../wings/warlock/BootDatabaseTest.java | 4 +- 223 files changed, 2908 insertions(+), 2580 deletions(-) create mode 100644 radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/mail/database/TinyMailDatabase.java create mode 100644 radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/TinyTaskDatabase.java delete mode 100644 radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailEnabledProp.java delete mode 100644 radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskEnabledProp.java create mode 100644 radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskExecProp.java delete mode 100644 radiant/tiny-task/src/main/resources/wings-conf/spring-wings-enabled-79.properties create mode 100644 radiant/tiny-task/src/main/resources/wings-conf/wings-tinytask-exec-79.properties delete mode 100644 wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/prop/BatriderEnabledProp.java rename wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/{WingsFlywaveConfiguration.java => FlywaveConfiguration.java} (90%) delete mode 100644 wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/prop/FlywaveEnabledProp.java delete mode 100644 wings/faceless-flywave/src/main/resources/wings-conf/spring-wings-enabled-79.properties create mode 100644 wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqCudConfiguration.java rename wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/{FacelessJooqEnabledProp.java => FacelessJooqConfProp.java} (85%) rename wings/faceless-jooq/src/main/resources/wings-conf/{spring-wings-enabled-79.properties => wings-jooq-conf-79.properties} (73%) create mode 100644 wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingSphereConfiguration.java delete mode 100644 wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingsphereConfiguration.java rename wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/{FacelessDataSourceConfiguration.java => FacelessConfiguration.java} (56%) delete mode 100644 wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java delete mode 100644 wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessFlakeIdConfiguration.java delete mode 100644 wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJournalConfiguration.java delete mode 100644 wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessEnabledProp.java delete mode 100644 wings/faceless/src/main/resources/wings-conf/spring-wings-enabled-79.properties rename wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/{SilencerRuntimeConfiguration.java => SilencerModeWiredConfiguration.java} (74%) delete mode 100644 wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerInspectProp.java delete mode 100644 wings/silencer-curse/src/main/resources/wings-conf/wings-inspect-79.properties create mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/message/MessageSourceHelper.java create mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerConfiguration.java delete mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java create mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java create mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledDogConfiguration.java create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/app/service/ScanService.java create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledDefaultTest.java create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java create mode 100644 wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java rename wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/{HazelcastCacheConfiguration.java => HazelcastConfigConfiguration.java} (51%) delete mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastFlakeIdConfiguration.java delete mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java delete mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastMockConfiguration.java delete mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastPublisherConfiguration.java create mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastServiceConfiguration.java delete mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java delete mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelDistIdAutoConfiguration.java create mode 100644 wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelcastAutoConfiguration.java create mode 100644 wings/slardar-hazel-caching/src/main/resources/wings-conf/spring-wings-enabled-79.properties rename wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/{HazelcastSessionConfiguration.java => SlardarHazelSessionConfiguration.java} (76%) create mode 100644 wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminClientConfiguration.java delete mode 100644 wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java create mode 100644 wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminServerConfiguration.java create mode 100644 wings/slardar-test/src/main/resources/wings-conf/spring-wings-enabled.properties rename wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/{SlardarRestreamConfiguration.java => SlardarReuseStreamConfiguration.java} (67%) rename wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/{SlardarWebmvcAutoConfiguration.java => SlardarWebFunAutoConfiguration.java} (68%) create mode 100644 wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebMvcAutoConfiguration.java create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarCacheAutoConfiguration.java delete mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java rename wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/{SlardarOkHttpProp.java => SlardarOkhttpProp.java} (95%) create mode 100644 wings/warlock-bond/src/test/resources/application.properties create mode 100644 wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/MvcController.java delete mode 100644 wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockHazelcastConfiguration.java create mode 100644 wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityDummyConfiguration.java rename wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/{WarlockShadowSecurityAutoConfiguration.java => WarlockSecurityAutoConfiguration.java} (68%) create mode 100644 wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalDisableTest.java diff --git a/WingsBoot.t.md b/WingsBoot.t.md index 70e66e6d0..ee7c99e66 100644 --- a/WingsBoot.t.md +++ b/WingsBoot.t.md @@ -30,6 +30,9 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m * 11024 StringMapXmlWriterTest: jaxb object to xml string * 11025 WingsSpringBeanScannerTest: with/without scanning * 11026 AssertionLoggerTest: install, assert and uninstall +* 11027 WingsEnabledDefaultTest: default enabled config and bean +* 11028 WingsEnabledFalseTest: disable config and bean +* 11029 WingsEnabledTopFalseTest: disable top config ## 12 Faceless @@ -378,6 +381,7 @@ Use `t.md` as local [Test Management](https://www.jetbrains.com/help/idea/test-m * 14074 CodeExceptionHandlerTest: message exception in chinese * 14075 CodeExceptionHandlerTest: CompletableFuture exception in chinese * 14076 JvmLightIdProviderTest: 50 instances compete for 1 db by tx +* 14077 WarlockJournalDisableTest: disable TerminalJournalService ## 15 Tiny diff --git a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java b/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java index b2c7a3c51..5125086ac 100644 --- a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java +++ b/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java @@ -27,8 +27,8 @@ * @since 2021-02-22 */ @SpringBootTest(properties = { - "spring.wings.faceless.flywave.enabled.module=true", - "spring.wings.faceless.flywave.enabled.checker=false", + "spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true", + "wings.faceless.flywave.checker=false", }) @Disabled("manual initialization") public class BootDatabaseTest { diff --git a/radiant/devs-mvndep/src/test/resources/application.properties b/radiant/devs-mvndep/src/test/resources/application.properties index f2fff4ea8..f0bf313f8 100644 --- a/radiant/devs-mvndep/src/test/resources/application.properties +++ b/radiant/devs-mvndep/src/test/resources/application.properties @@ -1,11 +1,6 @@ -spring.wings.silencer.enabled.scanner=false +spring.wings.enabled.silencer.scanner=false -spring.wings.slardar.enabled.autoconf=false -spring.wings.warlock.enabled.autoconf=false -spring.wings.tiny.mail.enabled.autoconf=false -spring.wings.tiny.task.enabled.autoconf=false - -spring.wings.faceless.flywave.enabled.checker=false +wings.faceless.flywave.checker=false spring.application.name=wings-mvndep server.port=8086 diff --git a/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/mail/database/TinyMailDatabase.java b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/mail/database/TinyMailDatabase.java new file mode 100644 index 000000000..79f13cce9 --- /dev/null +++ b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/mail/database/TinyMailDatabase.java @@ -0,0 +1,8 @@ +package pro.fessional.wings.tiny.mail.database; + +/** + * @author trydofor + * @since 2023-11-22 + */ +public interface TinyMailDatabase { +} diff --git a/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/TinyTaskDatabase.java b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/TinyTaskDatabase.java new file mode 100644 index 000000000..f2248e69e --- /dev/null +++ b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/TinyTaskDatabase.java @@ -0,0 +1,8 @@ +package pro.fessional.wings.tiny.task.database; + +/** + * @author trydofor + * @since 2023-11-22 + */ +public interface TinyTaskDatabase { +} diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailListController.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailListController.java index 8fbc151e5..ff5a0f630 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailListController.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailListController.java @@ -3,7 +3,6 @@ import io.swagger.v3.oas.annotations.Operation; import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; @@ -12,9 +11,9 @@ import pro.fessional.mirana.data.R; import pro.fessional.mirana.page.PageQuery; import pro.fessional.mirana.page.PageResult; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.mail.service.TinyMailListService; import pro.fessional.wings.tiny.mail.service.TinyMailPlain; -import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailUrlmapProp; /** @@ -22,7 +21,7 @@ * @since 2023-01-13 */ @RestController -@ConditionalOnProperty(name = TinyMailEnabledProp.Key$controllerList, havingValue = "true") +@ConditionalWingsEnabled public class MailListController { @Setter(onMethod_ = {@Autowired}) diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailSendController.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailSendController.java index 0f8276877..d623bccd8 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailSendController.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailSendController.java @@ -4,15 +4,14 @@ import lombok.Data; import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.data.R; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.mail.service.TinyMailPlain; import pro.fessional.wings.tiny.mail.service.TinyMailService; -import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailUrlmapProp; /** @@ -20,7 +19,7 @@ * @since 2023-01-13 */ @RestController -@ConditionalOnProperty(name = TinyMailEnabledProp.Key$controllerSend, havingValue = "true") +@ConditionalWingsEnabled public class MailSendController { @Setter(onMethod_ = {@Autowired}) diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/sender/MailSenderManager.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/sender/MailSenderManager.java index 413a53dfb..1d7715a6a 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/sender/MailSenderManager.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/sender/MailSenderManager.java @@ -4,13 +4,11 @@ import jakarta.mail.internet.MimeMessage; import lombok.Getter; import lombok.RequiredArgsConstructor; -import lombok.Setter; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.RandomUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.mail.MailProperties; import org.springframework.core.io.Resource; import org.springframework.mail.MailAuthenticationException; @@ -20,7 +18,6 @@ import pro.fessional.mirana.time.Sleep; import pro.fessional.mirana.time.ThreadNow; import pro.fessional.wings.faceless.convention.EmptySugar; -import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailSenderProp; import java.math.BigDecimal; @@ -51,10 +48,6 @@ public class MailSenderManager { protected final TinyMailSenderProp senderProp; @Getter protected final MailSenderProvider senderProvider; - @Getter - @Setter(onMethod_ = {@Value("${" + TinyMailEnabledProp.Key$dryrun + "}")}) - protected boolean dryrun = false; - protected final ConcurrentHashMap mailHostWait = new ConcurrentHashMap<>(); protected final ConcurrentHashMap mailHostIdle = new ConcurrentHashMap<>(); @@ -107,7 +100,7 @@ public void singleSend(@NotNull TinyMailMessage message, @Nullable MimeMessagePr */ @SneakyThrows public void singleSend(@NotNull TinyMailMessage message, long maxWait, @Nullable MimeMessagePrepareHelper preparer) { - if (dryrun) { + if (senderProp.isDryrun()) { final int slp = RandomUtils.nextInt(10, 2000); Sleep.ignoreInterrupt(slp); log.info("single mail dryrun and sleep {} ms", slp); @@ -160,7 +153,7 @@ public List batchSend(Collection message if (messages.isEmpty()) return Collections.emptyList(); final List results = new ArrayList<>(messages.size()); - if (dryrun) { + if (senderProp.isDryrun()) { final int slp = RandomUtils.nextInt(10, 2000); Sleep.ignoreInterrupt(slp); log.info("batch mail dryrun and sleep {} ms", slp); diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailListServiceImpl.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailListServiceImpl.java index ef2f9155e..dada398c1 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailListServiceImpl.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailListServiceImpl.java @@ -15,6 +15,7 @@ import pro.fessional.mirana.page.PageResult; import pro.fessional.wings.faceless.database.jooq.WingsJooqUtil; import pro.fessional.wings.faceless.database.jooq.helper.PageJooqHelper; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.jackson.JacksonHelper; import pro.fessional.wings.tiny.mail.database.autogen.tables.WinMailSenderTable; import pro.fessional.wings.tiny.mail.database.autogen.tables.daos.WinMailSenderDao; @@ -30,6 +31,7 @@ * @since 2023-01-13 */ @Service +@ConditionalWingsEnabled @Slf4j public class TinyMailListServiceImpl implements TinyMailListService, InitializingBean { diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailServiceImpl.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailServiceImpl.java index 771d2888d..f8b811c8e 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailServiceImpl.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/service/impl/TinyMailServiceImpl.java @@ -30,6 +30,7 @@ import pro.fessional.wings.faceless.service.lightid.LightIdService; import pro.fessional.wings.silencer.modulate.RunMode; import pro.fessional.wings.silencer.modulate.RuntimeMode; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.help.CommonPropHelper; import pro.fessional.wings.slardar.jackson.JacksonHelper; import pro.fessional.wings.tiny.mail.database.autogen.tables.WinMailSenderTable; @@ -67,6 +68,7 @@ * @since 2023-01-06 */ @Service +@ConditionalWingsEnabled @Slf4j public class TinyMailServiceImpl implements TinyMailService, InitializingBean { diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java index 252f54bb2..ca0712ad6 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java @@ -4,19 +4,21 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.web.bind.annotation.RestController; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.tiny.mail.controller.MailListController; +import pro.fessional.wings.tiny.mail.database.TinyMailDatabase; import pro.fessional.wings.tiny.mail.sender.MailConfigProvider; import pro.fessional.wings.tiny.mail.sender.MailNotice; import pro.fessional.wings.tiny.mail.sender.MailSenderManager; import pro.fessional.wings.tiny.mail.sender.MailSenderProvider; +import pro.fessional.wings.tiny.mail.service.TinyMailService; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailConfigProp; -import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailSenderProp; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailServiceProp; import pro.fessional.wings.tiny.mail.spring.prop.TinyMailUrlmapProp; @@ -27,53 +29,63 @@ */ @Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled @EnableConfigurationProperties({ TinyMailConfigProp.class, - TinyMailEnabledProp.class, TinyMailSenderProp.class, TinyMailServiceProp.class, TinyMailUrlmapProp.class, }) -@ComponentScan({ - "pro.fessional.wings.tiny.mail.database", - "pro.fessional.wings.tiny.mail.service" -}) @RequiredArgsConstructor public class TinyMailConfiguration { private static final Log log = LogFactory.getLog(TinyMailConfiguration.class); + + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + @ComponentScan(basePackageClasses = {TinyMailDatabase.class, TinyMailService.class}) + public static class DaoServScan { + public DaoServScan() { + log.info("TinyMail spring-scan database, service"); + } + } + + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + @ComponentScan(basePackageClasses = MailListController.class) + @ConditionalOnClass(RestController.class) + public static class MvcRestScan { + public MvcRestScan() { + log.info("TinyMail spring-scan controller"); + } + } + @Bean - @ConditionalOnMissingBean(MailSenderProvider.class) + @ConditionalWingsEnabled public MailSenderProvider mailSenderProvider(JavaMailSender defaultSender) { log.info("TinyMail spring-bean mailSenderProvider"); return new MailSenderProvider(defaultSender); } @Bean - @ConditionalOnMissingBean(MailConfigProvider.class) + @ConditionalWingsEnabled public MailConfigProvider mailConfigProvider(TinyMailConfigProp tinyMailConfigProp) { log.info("TinyMail spring-bean mailConfigProvider"); return new MailConfigProvider(tinyMailConfigProp); } @Bean - @ConditionalOnMissingBean(MailSenderManager.class) + @ConditionalWingsEnabled public MailSenderManager mailSenderManager(TinyMailSenderProp senderProp, MailSenderProvider senderProvider) { log.info("TinyMail spring-bean mailSenderManager"); return new MailSenderManager(senderProp, senderProvider); } @Bean - @ConditionalOnMissingBean(MailNotice.class) + @ConditionalWingsEnabled public MailNotice mailNotice(MailConfigProvider configProvider, MailSenderManager senderManager) { log.info("TinyMail spring-bean mailNotice"); return new MailNotice(configProvider, senderManager); } - - @Configuration(proxyBeanMethods = false) - @ComponentScan("pro.fessional.wings.tiny.mail.controller") - @ConditionalOnClass(RestController.class) - public static class MvcController { - } } diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java index 7a4e69418..c2c3797ca 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java @@ -1,18 +1,16 @@ package pro.fessional.wings.tiny.mail.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration; +import org.springframework.context.annotation.Import; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration; -import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp; /** * @author trydofor * @since 2019-07-11 */ -@AutoConfiguration(before = SlardarAutoConfiguration.class) -@ConditionalOnProperty(name = TinyMailEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration(TinyMailConfiguration.class) +@AutoConfiguration +@ConditionalWingsEnabled +@Import(TinyMailConfiguration.class) public class TinyMailAutoConfiguration { } diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailEnabledProp.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailEnabledProp.java deleted file mode 100644 index a6ff24709..000000000 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailEnabledProp.java +++ /dev/null @@ -1,51 +0,0 @@ -package pro.fessional.wings.tiny.mail.spring.prop; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * spring-wings-enabled-79.properties - * - * @author trydofor - * @see #Key - * @since 2021-02-13 - */ -@Data -@ConfigurationProperties(TinyMailEnabledProp.Key) -public class TinyMailEnabledProp { - - public static final String Key = "spring.wings.tiny.mail.enabled"; - - /** - * whether to enable auto config - * - * @see #Key$autoconf - */ - private boolean autoconf = true; - public static final String Key$autoconf = Key + ".autoconf"; - - /** - * whether to dry run, log only without actually send - * - * @see #Key$dryrun - */ - private boolean dryrun = false; - public static final String Key$dryrun = Key + ".dryrun"; - - /** - * whether to enable MailListController - * - * @see #Key$controllerList - */ - private boolean controllerList = true; - public static final String Key$controllerList = Key + ".controller-list"; - - /** - * whether to enable MailSendController - * - * @see #Key$controllerSend - */ - private boolean controllerSend = true; - public static final String Key$controllerSend = Key + ".controller-send"; - -} diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailSenderProp.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailSenderProp.java index 38bda3983..f74242dbc 100644 --- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailSenderProp.java +++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailSenderProp.java @@ -17,6 +17,14 @@ public class TinyMailSenderProp { public static final String Key = "wings.tiny.mail.sender"; + /** + * whether to dry run, log only without actually send + * + * @see #Key$dryrun + */ + private boolean dryrun = false; + public static final String Key$dryrun = Key + ".dryrun"; + /** * biz-id Header to locate mail by business, default mail id. * diff --git a/radiant/tiny-mail/src/main/resources/wings-conf/wings-flywave-fit-79.properties b/radiant/tiny-mail/src/main/resources/wings-conf/wings-flywave-fit-79.properties index 61297ea71..cd99d603a 100644 --- a/radiant/tiny-mail/src/main/resources/wings-conf/wings-flywave-fit-79.properties +++ b/radiant/tiny-mail/src/main/resources/wings-conf/wings-flywave-fit-79.properties @@ -1,4 +1,4 @@ -spring.wings.faceless.flywave.enabled.module=true +spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true wings.faceless.flywave.fit.tiny-mail.path=classpath*:/wings-flywave/master/07-mail/*.sql wings.faceless.flywave.fit.tiny-mail.revi=2020_1027_01L diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java index 03816b38f..06be3bfcd 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java @@ -28,8 +28,8 @@ * @since 2021-02-22 */ @SpringBootTest(properties = { - "spring.wings.faceless.flywave.enabled.module=true", - "spring.wings.faceless.flywave.enabled.checker=false", + "spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true", + "wings.faceless.flywave.checker=false", }) @Disabled("manual initialization") public class BootDatabaseTest { diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java index 5b70d97f6..1a17534da 100644 --- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java +++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java @@ -14,8 +14,8 @@ * @since 2021-02-22 */ @SpringBootTest(properties = { - "spring.wings.faceless.flywave.enabled.module=true", - "spring.wings.faceless.flywave.enabled.checker=false", + "spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true", + "wings.faceless.flywave.checker=false", "wings.tiny.mail.service.boot-scan=0", }) @Disabled("Code gen, managed by devops") diff --git a/radiant/tiny-mail/src/test/resources/application.properties b/radiant/tiny-mail/src/test/resources/application.properties index 99c282281..977ca96cf 100644 --- a/radiant/tiny-mail/src/test/resources/application.properties +++ b/radiant/tiny-mail/src/test/resources/application.properties @@ -1,7 +1,7 @@ spring.application.name=tiny-mail-test server.port=8086 debug=true -spring.wings.faceless.flywave.enabled.module=true +spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true spring.mail.properties.mail.debug=true wings.tiny.mail.sender.force-prefix=DEBUG diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskConfController.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskConfController.java index d6e1a6dde..6cb4a0a0d 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskConfController.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskConfController.java @@ -5,7 +5,6 @@ import lombok.EqualsAndHashCode; import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; @@ -13,9 +12,9 @@ import pro.fessional.mirana.data.Diff; import pro.fessional.mirana.data.Q; import pro.fessional.mirana.data.R; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.schedule.conf.TaskerProp; import pro.fessional.wings.tiny.task.service.TinyTaskConfService; -import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp; import java.util.LinkedHashMap; @@ -26,7 +25,7 @@ * @since 2022-12-26 */ @RestController -@ConditionalOnProperty(name = TinyTaskEnabledProp.Key$controllerConf, havingValue = "true") +@ConditionalWingsEnabled public class TaskConfController { @Setter(onMethod_ = {@Autowired}) diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskExecController.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskExecController.java index dc4b4c9ba..69f4010d4 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskExecController.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskExecController.java @@ -3,15 +3,14 @@ import io.swagger.v3.oas.annotations.Operation; import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.data.Q; import pro.fessional.mirana.data.R; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.service.TinyTaskExecService; -import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp; /** @@ -19,7 +18,7 @@ * @since 2022-12-26 */ @RestController -@ConditionalOnProperty(name = TinyTaskEnabledProp.Key$controllerExec, havingValue = "true") +@ConditionalWingsEnabled public class TaskExecController { @Setter(onMethod_ = {@Autowired}) diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskListController.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskListController.java index 94b826c06..da42b0164 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskListController.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskListController.java @@ -3,7 +3,6 @@ import io.swagger.v3.oas.annotations.Operation; import lombok.Setter; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; @@ -11,9 +10,9 @@ import pro.fessional.mirana.data.Q; import pro.fessional.mirana.page.PageQuery; import pro.fessional.mirana.page.PageResult; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.database.autogen.tables.pojos.WinTaskResult; import pro.fessional.wings.tiny.task.service.TinyTaskListService; -import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp; /** @@ -21,7 +20,7 @@ * @since 2022-12-26 */ @RestController -@ConditionalOnProperty(name = TinyTaskEnabledProp.Key$controllerList, havingValue = "true") +@ConditionalWingsEnabled public class TaskListController { @Setter(onMethod_ = {@Autowired}) diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java index e21475e93..b17c15a0f 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskBeatServiceImpl.java @@ -11,6 +11,7 @@ import org.springframework.stereotype.Service; import pro.fessional.mirana.time.DateLocaling; import pro.fessional.mirana.time.ThreadNow; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskDefineTable; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskResultTable; import pro.fessional.wings.tiny.task.database.autogen.tables.daos.WinTaskDefineDao; @@ -28,6 +29,7 @@ * @since 2022-12-26 */ @Service +@ConditionalWingsEnabled @TinyTasker.Auto @Slf4j public class TinyTaskBeatServiceImpl implements TinyTaskBeatService { diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java index 6ce61d4ac..bb15d7a34 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskConfServiceImpl.java @@ -24,6 +24,7 @@ import pro.fessional.wings.silencer.modulate.RunMode; import pro.fessional.wings.silencer.modulate.RuntimeMode; import pro.fessional.wings.silencer.notice.SmallNotice; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskDefineTable; import pro.fessional.wings.tiny.task.database.autogen.tables.daos.WinTaskDefineDao; import pro.fessional.wings.tiny.task.database.autogen.tables.pojos.WinTaskDefine; @@ -53,6 +54,7 @@ * @since 2022-12-14 */ @Service +@ConditionalWingsEnabled @Slf4j public class TinyTaskConfServiceImpl implements TinyTaskConfService { diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java index a245c8e4f..05a68c158 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskExecServiceImpl.java @@ -27,6 +27,7 @@ import pro.fessional.wings.faceless.service.lightid.LightIdService; import pro.fessional.wings.silencer.modulate.RunMode; import pro.fessional.wings.silencer.modulate.RuntimeMode; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.async.TaskSchedulerHelper; import pro.fessional.wings.slardar.jackson.JacksonHelper; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskDefineTable; @@ -38,7 +39,7 @@ import pro.fessional.wings.tiny.task.schedule.exec.NoticeExec; import pro.fessional.wings.tiny.task.schedule.exec.TaskerExec; import pro.fessional.wings.tiny.task.service.TinyTaskExecService; -import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; +import pro.fessional.wings.tiny.task.spring.prop.TinyTaskExecProp; import java.time.Duration; import java.time.Instant; @@ -66,6 +67,7 @@ * @since 2022-12-21 */ @Service +@ConditionalWingsEnabled @Slf4j public class TinyTaskExecServiceImpl implements TinyTaskExecService { @@ -88,8 +90,8 @@ public class TinyTaskExecServiceImpl implements TinyTaskExecService { @Setter(onMethod_ = {@Autowired}) protected JournalService journalService; - @Setter(onMethod_ = {@Value("${" + TinyTaskEnabledProp.Key$dryrun + "}")}) - protected boolean dryrun = false; + @Setter(onMethod_ = {@Autowired}) + protected TinyTaskExecProp execProp; @Override public boolean launch(long id) { @@ -126,7 +128,7 @@ public boolean force(long id) { log.debug("task force exec, id={}", id); final Object result; - if (dryrun) { + if (execProp.isDryrun()) { final int slp = RandomUtils.nextInt(10, 2000); result = "dryrun and sleep " + slp; Sleep.ignoreInterrupt(slp); @@ -254,7 +256,7 @@ private boolean relaunch(long id) { log.info("task exec, id={}", id); final Object result; - if (dryrun) { + if (execProp.isDryrun()) { final int slp = RandomUtils.nextInt(10, 2000); result = "dryrun and sleep " + slp; Sleep.ignoreInterrupt(slp); @@ -361,7 +363,7 @@ private void postNotice(NoticeExec ntc, String cnf, Set whs, String t for (String w : wh) { if (whs.contains(w)) { if (w.equals(WhenFeed)) { - if (!dryrun && StringUtils.isNotEmpty(msg)) { + if (!execProp.isDryrun() && StringUtils.isNotEmpty(msg)) { ntc.postNotice(cnf, tn + " " + w.toUpperCase(), zdt + "\n\n" + msg); return; } diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskListServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskListServiceImpl.java index 65ecd56ea..fcac00c9c 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskListServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskListServiceImpl.java @@ -12,6 +12,7 @@ import pro.fessional.mirana.time.DateFormatter; import pro.fessional.mirana.time.ThreadNow; import pro.fessional.wings.faceless.database.jooq.helper.PageJooqHelper; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskDefineTable; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskResultTable; import pro.fessional.wings.tiny.task.database.autogen.tables.daos.WinTaskDefineDao; @@ -30,6 +31,7 @@ * @since 2022-12-26 */ @Service +@ConditionalWingsEnabled @Slf4j public class TinyTaskListServiceImpl implements TinyTaskListService { diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java index 964e3674c..9428511da 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/service/impl/TinyTaskServiceImpl.java @@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.stereotype.Service; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.async.TaskSchedulerHelper; import pro.fessional.wings.tiny.task.service.TinyTaskConfService; import pro.fessional.wings.tiny.task.service.TinyTaskConfService.Conf; @@ -22,6 +23,7 @@ * @since 2022-12-13 */ @Service +@ConditionalWingsEnabled @Slf4j public class TinyTaskServiceImpl implements TinyTaskService { diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java index f3fcc186c..a37d12013 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java @@ -5,7 +5,6 @@ import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; @@ -14,10 +13,13 @@ import org.springframework.web.bind.annotation.RestController; import pro.fessional.wings.silencer.runner.ApplicationReadyEventRunner; import pro.fessional.wings.silencer.spring.WingsOrdered; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.tiny.task.controller.TaskConfController; +import pro.fessional.wings.tiny.task.database.TinyTaskDatabase; import pro.fessional.wings.tiny.task.schedule.TinyTasker; import pro.fessional.wings.tiny.task.service.TinyTaskService; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskDefineProp; -import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; +import pro.fessional.wings.tiny.task.spring.prop.TinyTaskExecProp; import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp; import java.util.Map; @@ -28,21 +30,41 @@ */ @Configuration(proxyBeanMethods = false) -@ComponentScan({"pro.fessional.wings.tiny.task.database", - "pro.fessional.wings.tiny.task.service"}) +@ConditionalWingsEnabled @EnableConfigurationProperties({ TinyTaskDefineProp.class, - TinyTaskEnabledProp.class, + TinyTaskExecProp.class, TinyTaskUrlmapProp.class }) public class TinyTaskConfiguration { private static final Log log = LogFactory.getLog(TinyTaskConfiguration.class); + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + @ComponentScan(basePackageClasses = {TinyTaskDatabase.class, TinyTaskService.class}) + public static class DaoServScan { + public DaoServScan() { + log.info("TinyTask spring-scan database, service"); + } + } + + @Configuration(proxyBeanMethods = false) + @ComponentScan(basePackageClasses = TaskConfController.class) + @ConditionalOnClass(RestController.class) + public static class MvcRestScan { + public MvcRestScan() { + log.info("TinyTask spring-scan controller"); + } + } + + /** + * auto start TinyTask.Auto + */ @Bean - @ConditionalOnProperty(name = TinyTaskEnabledProp.Key$autorun, havingValue = "true") - public ApplicationReadyEventRunner runnerTinyTaskerAuto(@NotNull ApplicationContext context, ObjectProvider tinyTaskService) { - log.info("TinyTask spring-runs runnerTinyTaskerAuto"); + @ConditionalWingsEnabled + public ApplicationReadyEventRunner tinyTaskerAutoRunner(@NotNull ApplicationContext context, ObjectProvider tinyTaskService) { + log.info("TinyTask spring-runs tinyTaskerAutoRunner"); return new ApplicationReadyEventRunner(WingsOrdered.Lv3Service, ignored -> { final TinyTaskService service = tinyTaskService.getIfAvailable(); if (service == null) { @@ -52,15 +74,9 @@ public ApplicationReadyEventRunner runnerTinyTaskerAuto(@NotNull ApplicationCont final Map beans = context.getBeansWithAnnotation(TinyTasker.Auto.class); for (Map.Entry en : beans.entrySet()) { - log.info("TinyTask spring-conf runnerTinyTaskerAuto, name=" + en.getKey()); + log.info("TinyTask spring-conf TinyTaskerAuto, name=" + en.getKey()); service.schedule(en.getValue()); } }); } - - @Configuration(proxyBeanMethods = false) - @ComponentScan("pro.fessional.wings.tiny.task.controller") - @ConditionalOnClass(RestController.class) - public static class MvcController { - } } diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java index 2ac986bd3..d604e38f4 100644 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java @@ -1,18 +1,16 @@ package pro.fessional.wings.tiny.task.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration; +import org.springframework.context.annotation.Import; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration; -import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp; /** * @author trydofor * @since 2019-07-11 */ -@AutoConfiguration(before = SlardarAutoConfiguration.class) -@ConditionalOnProperty(name = TinyTaskEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration(TinyTaskConfiguration.class) +@AutoConfiguration +@ConditionalWingsEnabled +@Import(TinyTaskConfiguration.class) public class TinyTaskAutoConfiguration { } diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskEnabledProp.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskEnabledProp.java deleted file mode 100644 index 2ed0a8a01..000000000 --- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskEnabledProp.java +++ /dev/null @@ -1,68 +0,0 @@ -package pro.fessional.wings.tiny.task.spring.prop; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * spring-wings-enabled-79.properties - * - * @author trydofor - * @see #Key - * @since 2021-02-13 - */ -@Data -@ConfigurationProperties(TinyTaskEnabledProp.Key) -public class TinyTaskEnabledProp { - - public static final String Key = "spring.wings.tiny.task.enabled"; - - /** - * whether to enable auto config. - * - * @see #Key$autoconf - */ - private boolean autoconf = true; - public static final String Key$autoconf = Key + ".autoconf"; - - - /** - * whether to auto register TinyTask.Auto. - * - * @see #Key$autorun - */ - private boolean autorun = true; - public static final String Key$autorun = Key + ".autorun"; - - /** - * whether to dry run, log only without realy exec the task. - * - * @see #Key$dryrun - */ - private boolean dryrun = false; - public static final String Key$dryrun = Key + ".dryrun"; - - /** - * whether to enable TaskConfController. - * - * @see #Key$controllerConf - */ - private boolean controllerConf = true; - public static final String Key$controllerConf = Key + ".controller-conf"; - - /** - * whether to enable TaskExecController. - * - * @see #Key$controllerExec - */ - private boolean controllerExec = true; - public static final String Key$controllerExec = Key + ".controller-exec"; - - /** - * whether to enable TaskListController. - * - * @see #Key$controllerList - */ - private boolean controllerList = true; - public static final String Key$controllerList = Key + ".controller-list"; - -} diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskExecProp.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskExecProp.java new file mode 100644 index 000000000..d9fc6b1f8 --- /dev/null +++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskExecProp.java @@ -0,0 +1,26 @@ +package pro.fessional.wings.tiny.task.spring.prop; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * wings-tinytask-exec-79.properties + * + * @author trydofor + * @see #Key + * @since 2021-02-13 + */ +@Data +@ConfigurationProperties(TinyTaskExecProp.Key) +public class TinyTaskExecProp { + + public static final String Key = "wings.tiny.task.exec"; + + /** + * whether to dry run, log only without realy exec the task. + * + * @see #Key$dryrun + */ + private boolean dryrun = false; + public static final String Key$dryrun = Key + ".dryrun"; +} diff --git a/radiant/tiny-task/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/radiant/tiny-task/src/main/resources/wings-conf/spring-wings-enabled-79.properties deleted file mode 100644 index f02f39317..000000000 --- a/radiant/tiny-task/src/main/resources/wings-conf/spring-wings-enabled-79.properties +++ /dev/null @@ -1,12 +0,0 @@ -## whether to enable auto config. -spring.wings.tiny.task.enabled.autoconf=true -## whether to auto register TinyTask.Auto. -spring.wings.tiny.task.enabled.autorun=true -## whether to dry run, log only without realy exec the task. -spring.wings.tiny.task.enabled.dryrun=false -## whether to enable TaskConfController. -spring.wings.tiny.task.enabled.controller-conf=true -## whether to enable TaskExecController. -spring.wings.tiny.task.enabled.controller-exec=true -## whether to enable TaskListController. -spring.wings.tiny.task.enabled.controller-list=true diff --git a/radiant/tiny-task/src/main/resources/wings-conf/wings-tinytask-exec-79.properties b/radiant/tiny-task/src/main/resources/wings-conf/wings-tinytask-exec-79.properties new file mode 100644 index 000000000..9473b119f --- /dev/null +++ b/radiant/tiny-task/src/main/resources/wings-conf/wings-tinytask-exec-79.properties @@ -0,0 +1,2 @@ +## whether to dry run, log only without realy exec the task. +wings.tiny.task.exec.dryrun=false diff --git a/radiant/tiny-task/src/test/resources/application.properties b/radiant/tiny-task/src/test/resources/application.properties index c146b79cc..44ecf7374 100644 --- a/radiant/tiny-task/src/test/resources/application.properties +++ b/radiant/tiny-task/src/test/resources/application.properties @@ -1,7 +1,7 @@ spring.application.name=tiny-task-test server.port=8086 debug=true -spring.wings.faceless.flywave.enabled.module=true +spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true wings.faceless.flywave.auto-init=true wings.faceless.flywave.fit.tiny-task.revi=2019_0512_01L, 2019_0520_01L, 2020_1026_01L diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java index 4a8a9068c..450b48868 100644 --- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java +++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java @@ -3,15 +3,16 @@ import org.apache.servicecomb.springboot2.starter.EnableServiceComb; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.batrider.spring.prop.BatriderEnabledProp; import pro.fessional.wings.batrider.spring.prop.BatriderHandlerProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** * @author trydofor * @since 2022-08-03 */ @Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled @EnableServiceComb -@EnableConfigurationProperties({BatriderEnabledProp.class,BatriderHandlerProp.class}) +@EnableConfigurationProperties(BatriderHandlerProp.class) public class BatriderServcombConfiguration { } diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java index ba305f41b..00639e1b1 100644 --- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java +++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java @@ -1,17 +1,16 @@ package pro.fessional.wings.batrider.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Import; import pro.fessional.wings.batrider.spring.bean.BatriderServcombConfiguration; -import pro.fessional.wings.batrider.spring.prop.BatriderEnabledProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** * @author trydofor * @since 2019-07-11 */ @AutoConfiguration -@ConditionalOnProperty(name = BatriderEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration(BatriderServcombConfiguration.class) +@ConditionalWingsEnabled +@Import(BatriderServcombConfiguration.class) public class BatriderAutoConfiguration { } diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/prop/BatriderEnabledProp.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/prop/BatriderEnabledProp.java deleted file mode 100644 index 42dc6cbd0..000000000 --- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/prop/BatriderEnabledProp.java +++ /dev/null @@ -1,27 +0,0 @@ -package pro.fessional.wings.batrider.spring.prop; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * spring-wings-enabled-79.properties - * - * @author trydofor - * @see #Key - * @since 2021-02-13 - */ -@Data -@ConfigurationProperties(BatriderEnabledProp.Key) -public class BatriderEnabledProp { - - public static final String Key = "spring.wings.batrider.enabled"; - - /** - * Whether to enable auto config. - * - * @see #Key$autoconf - */ - private boolean autoconf = true; - public static final String Key$autoconf = Key + ".autoconf"; - -} diff --git a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java index f37836923..70c9f7e73 100644 --- a/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java +++ b/wings/faceless-awesome/src/test/java/pro/fessional/wings/faceless/enums/ConstantEnumI18nTest.java @@ -23,7 +23,7 @@ * @since 2020-06-10 */ -@SpringBootTest(properties = {"spring.wings.faceless.enabled.enumi18n=true"}) +@SpringBootTest @TestMethodOrder(MethodName.class) public class ConstantEnumI18nTest { diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/flywave/RevisionFitness.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/flywave/RevisionFitness.java index 88079f437..39b10c094 100644 --- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/flywave/RevisionFitness.java +++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/flywave/RevisionFitness.java @@ -74,7 +74,7 @@ private void applyRevision(SchemaRevisionManager manager, TreeMap throw new IllegalStateException(""" Wings `flywave revision` do NOT exist, and Auto Init is dangerous, you can, - 1.stop checker: `spring.wings.faceless.flywave.enabled.checker=false` + 1.stop checker: `wings.faceless.flywave.checker=false` 2.revision fitness do NOT contain `EXEC` 3.init `flywave revision` manually 4.auto-init: `wings.faceless.flywave.auto-init=true` At Your Own Risk diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/project/ProjectSchemaManager.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/project/ProjectSchemaManager.java index b9eac50f5..00ff7caba 100644 --- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/project/ProjectSchemaManager.java +++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/project/ProjectSchemaManager.java @@ -15,7 +15,7 @@ /** * Provides a convenient version management of common scenarios. - * spring.wings.faceless.flywave.enabled.module=true + * spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true * * @author trydofor * @since 2021-02-20 diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/FlywaveConfiguration.java similarity index 90% rename from wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java rename to wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/FlywaveConfiguration.java index 3106f32f1..7c179b6bd 100644 --- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/WingsFlywaveConfiguration.java +++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/FlywaveConfiguration.java @@ -4,11 +4,9 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Scope; import pro.fessional.wings.faceless.database.DataSourceContext; import pro.fessional.wings.faceless.flywave.RevisionFitness; @@ -21,12 +19,12 @@ import pro.fessional.wings.faceless.flywave.impl.DefaultRevisionManager; import pro.fessional.wings.faceless.flywave.impl.MySqlStatementParser; import pro.fessional.wings.faceless.flywave.impl.MysqlDefinitionLoader; -import pro.fessional.wings.faceless.spring.prop.FlywaveEnabledProp; import pro.fessional.wings.faceless.spring.prop.FlywaveFitProp; import pro.fessional.wings.faceless.spring.prop.FlywaveSqlProp; import pro.fessional.wings.faceless.spring.prop.FlywaveVerProp; import pro.fessional.wings.silencer.runner.ApplicationRunnerOrdered; import pro.fessional.wings.silencer.spring.WingsOrdered; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import java.util.TreeSet; @@ -37,20 +35,19 @@ * @since 2019-06-01 */ @Configuration(proxyBeanMethods = false) -@ConditionalOnClass(name = "pro.fessional.wings.faceless.database.DataSourceContext") -@ConditionalOnProperty(name = FlywaveEnabledProp.Key$module, havingValue = "true") +@ConditionalWingsEnabled +@ConditionalOnClass(DataSourceContext.class) @EnableConfigurationProperties({ - FlywaveEnabledProp.class, FlywaveFitProp.class, FlywaveSqlProp.class, FlywaveVerProp.class, }) -@Import(FacelessDataSourceConfiguration.class) -public class WingsFlywaveConfiguration { +public class FlywaveConfiguration { - private static final Log log = LogFactory.getLog(WingsFlywaveConfiguration.class); + private static final Log log = LogFactory.getLog(FlywaveConfiguration.class); @Bean + @ConditionalWingsEnabled @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public SchemaJournalManager schemaJournalManager( DataSourceContext facelessDs, @@ -71,6 +68,7 @@ public SchemaJournalManager schemaJournalManager( } @Bean + @ConditionalWingsEnabled @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public DefaultRevisionManager schemaVersionManger( DataSourceContext sources, @@ -92,6 +90,7 @@ public DefaultRevisionManager schemaVersionManger( } @Bean + @ConditionalWingsEnabled @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE) public SchemaShardingManager schemaShardingManager( DataSourceContext sources, @@ -103,6 +102,7 @@ public SchemaShardingManager schemaShardingManager( } @Bean + @ConditionalWingsEnabled public SchemaFulldumpManager schemaFulldumpManager( SqlStatementParser statementParser, SchemaDefinitionLoader schemaDefinitionLoader) { @@ -111,6 +111,7 @@ public SchemaFulldumpManager schemaFulldumpManager( } @Bean + @ConditionalWingsEnabled public SqlStatementParser sqlStatementParser(FlywaveSqlProp conf) { if ("mysql".equalsIgnoreCase(conf.getDialect())) { log.info("FacelessFlywave spring-bean sqlStatementParser"); @@ -122,6 +123,7 @@ public SqlStatementParser sqlStatementParser(FlywaveSqlProp conf) { } @Bean + @ConditionalWingsEnabled public SqlSegmentProcessor sqlSegmentProcessor(FlywaveSqlProp conf) { if ("mysql".equalsIgnoreCase(conf.getDialect())) { final String fs = conf.getFormatShard(); @@ -146,6 +148,7 @@ public SqlSegmentProcessor sqlSegmentProcessor(FlywaveSqlProp conf) { } @Bean + @ConditionalWingsEnabled public SchemaDefinitionLoader schemaDefinitionLoader(FlywaveSqlProp conf) { if ("mysql".equalsIgnoreCase(conf.getDialect())) { log.info("FacelessFlywave spring-bean schemaDefinitionLoader"); @@ -157,8 +160,8 @@ public SchemaDefinitionLoader schemaDefinitionLoader(FlywaveSqlProp conf) { } @Bean - @ConditionalOnProperty(name = FlywaveEnabledProp.Key$checker, havingValue = "true") - public ApplicationRunnerOrdered runnerRevisionChecker(DefaultRevisionManager manager, FlywaveFitProp prop) { + @ConditionalWingsEnabled(absKey = FlywaveFitProp.Key$checker) + public ApplicationRunnerOrdered revisionCheckerRunner(DefaultRevisionManager manager, FlywaveFitProp prop) { log.info("FacelessFlywave spring-runs runnerRevisionChecker"); return new ApplicationRunnerOrdered(WingsOrdered.Lv5Supervisor, ignored -> { log.info("FacelessFlywave check RevisionFitness"); diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java index b840488f8..b4550a441 100644 --- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java +++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java @@ -1,18 +1,17 @@ package pro.fessional.wings.faceless.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import pro.fessional.wings.faceless.spring.bean.WingsFlywaveConfiguration; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; +import org.springframework.context.annotation.Import; +import pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** * @author trydofor * @since 2019-06-01 */ -@AutoConfiguration(before = FacelessAutoConfiguration.class) -@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration(WingsFlywaveConfiguration.class) +@AutoConfiguration +@ConditionalWingsEnabled(false) +@Import(FlywaveConfiguration.class) public class FlywaveAutoConfiguration { } diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/prop/FlywaveEnabledProp.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/prop/FlywaveEnabledProp.java deleted file mode 100644 index 1c046b38f..000000000 --- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/prop/FlywaveEnabledProp.java +++ /dev/null @@ -1,35 +0,0 @@ -package pro.fessional.wings.faceless.spring.prop; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * spring-wings-enabled-79.properties - * - * @author trydofor - * @see #Key - * @since 2021-02-13 - */ -@Data -@ConfigurationProperties(FlywaveEnabledProp.Key) -public class FlywaveEnabledProp { - - public static final String Key = "spring.wings.faceless.flywave.enabled"; - - /** - * whether to inject Flywave related beans. - * - * @see #Key$module - * @see #Key$module - */ - private boolean module = false; - public static final String Key$module = Key + ".module"; - - /** - * whether flywave performs version checking for database. - * - * @see #Key$checker - */ - private boolean checker = true; - public static final String Key$checker = Key + ".checker"; -} diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/prop/FlywaveFitProp.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/prop/FlywaveFitProp.java index 30c8f97b9..ffe5cd820 100644 --- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/prop/FlywaveFitProp.java +++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/prop/FlywaveFitProp.java @@ -26,6 +26,14 @@ public class FlywaveFitProp { private boolean autoInit = false; public static final String Key$autoInit = Key + ".auto-init"; + /** + * whether flywave performs version checking for database. + * + * @see #Key$checker + */ + private boolean checker = true; + public static final String Key$checker = Key + ".checker"; + /** * Specific dependencies * diff --git a/wings/faceless-flywave/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/faceless-flywave/src/main/resources/wings-conf/spring-wings-enabled-79.properties deleted file mode 100644 index 9aa241c8a..000000000 --- a/wings/faceless-flywave/src/main/resources/wings-conf/spring-wings-enabled-79.properties +++ /dev/null @@ -1,4 +0,0 @@ -## whether to inject Flywave related beans. -spring.wings.faceless.flywave.enabled.module=false -## whether flywave performs version checking for database. -spring.wings.faceless.flywave.enabled.checker=true diff --git a/wings/faceless-flywave/src/main/resources/wings-conf/wings-flywave-fit-79.properties b/wings/faceless-flywave/src/main/resources/wings-conf/wings-flywave-fit-79.properties index dcc6d55f8..7638f4dc3 100644 --- a/wings/faceless-flywave/src/main/resources/wings-conf/wings-flywave-fit-79.properties +++ b/wings/faceless-flywave/src/main/resources/wings-conf/wings-flywave-fit-79.properties @@ -1,6 +1,9 @@ ## whether to allow auto init, non-empty database, preferably manual init wings.faceless.flywave.auto-init=false +## whether flywave performs version checking for database. +wings.faceless.flywave.checker=true + ## sql scan pattern, comma separated. PathMatchingResourcePatternResolver format wings.faceless.flywave.fit.flywave-init.path=classpath*:/wings-flywave/master/00-init/*.sql diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaGeneratorSample.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaGeneratorSample.java index 0b554d7d8..990492484 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaGeneratorSample.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsSchemaGeneratorSample.java @@ -20,8 +20,7 @@ * @since 2019-06-22 */ -@SpringBootTest(properties = {"spring.wings.faceless.flywave.enabled.module=true", -// "spring.wings.faceless.enabled.enumi18n=true", +@SpringBootTest(properties = { // "spring.shardingsphere.datasource.names=writer", // "spring.shardingsphere.datasource.writer.jdbc-url=jdbc:mysql://127.0.0.1:3306/wings?autoReconnect=true&useSSL=false", // "spring.shardingsphere.datasource.writer.username=trydofor", diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt index bc1ef4be2..5220e6de6 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaJournalManagerTest.kt @@ -8,6 +8,7 @@ import org.junit.jupiter.api.MethodOrderer.MethodName import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestMethodOrder import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization import org.springframework.boot.test.context.SpringBootTest import org.springframework.jdbc.core.JdbcTemplate import pro.fessional.wings.faceless.flywave.SchemaJournalManagerTest.Companion.HEAD @@ -84,6 +85,7 @@ import pro.fessional.wings.faceless.util.FlywaveRevisionScanner "END" ] ) +@DependsOnDatabaseInitialization @TestMethodOrder(MethodName::class) class SchemaJournalManagerTest { diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt index 4898e0060..dbaa9a366 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SchemaRevisionMangerTest.kt @@ -6,6 +6,7 @@ import org.junit.jupiter.api.MethodOrderer.MethodName import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestMethodOrder import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization import org.springframework.boot.test.context.SpringBootTest import pro.fessional.wings.faceless.helper.WingsTestHelper import pro.fessional.wings.faceless.helper.WingsTestHelper.REVISION_TEST_V1 @@ -23,6 +24,7 @@ import pro.fessional.wings.faceless.util.FlywaveRevisionScanner "wings.faceless.flywave.ver.schema-version-table=win_schema_version", ] ) +@DependsOnDatabaseInitialization @TestMethodOrder(MethodName::class) open class SchemaRevisionMangerTest { diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SimpleJdbcTemplateTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SimpleJdbcTemplateTest.kt index df1f38e8e..d96f3cbf3 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SimpleJdbcTemplateTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SimpleJdbcTemplateTest.kt @@ -3,6 +3,7 @@ package pro.fessional.wings.faceless.flywave import io.qameta.allure.TmsLink import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization import org.springframework.boot.test.context.SpringBootTest import pro.fessional.wings.faceless.database.DataSourceContext import pro.fessional.wings.faceless.flywave.util.SimpleJdbcTemplate @@ -12,6 +13,7 @@ import pro.fessional.wings.faceless.flywave.util.SimpleJdbcTemplate * @since 2019-06-19 */ @SpringBootTest +@DependsOnDatabaseInitialization class SimpleJdbcTemplateTest { @Autowired diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentParserTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentParserTest.kt index ffedc89ac..4a914c173 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentParserTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/SqlSegmentParserTest.kt @@ -5,6 +5,7 @@ import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization import org.springframework.boot.test.context.SpringBootTest import pro.fessional.wings.faceless.util.FlywaveRevisionScanner @@ -13,6 +14,7 @@ import pro.fessional.wings.faceless.util.FlywaveRevisionScanner * @since 2019-06-10 */ @SpringBootTest(properties = ["debug = true"]) +@DependsOnDatabaseInitialization class SqlSegmentParserTest { @Autowired @@ -39,7 +41,7 @@ class SqlSegmentParserTest { } } - val trg = sqlSegmentProcessor.parse(sqlStatementParser, SqlSegmentParserTest::class.java.getResourceAsStream("/sql/ddl-dml.sql").bufferedReader().readText()) + val trg = sqlSegmentProcessor.parse(sqlStatementParser, SqlSegmentParserTest::class.java.getResourceAsStream("/sql/ddl-dml.sql")!!.bufferedReader().readText()) println("1009===========") for (stm in trg) { printSegment(1009, stm) diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTest.kt index 92d34bfa5..83f4113e4 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/flywave/WingsShardingTest.kt @@ -6,11 +6,13 @@ import org.junit.jupiter.api.MethodOrderer import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestMethodOrder import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization import org.springframework.boot.test.context.SpringBootTest import javax.sql.DataSource @SpringBootTest @TestMethodOrder(MethodOrderer.MethodName::class) +@DependsOnDatabaseInitialization open class WingsShardingTest { @Autowired diff --git a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt index 5ae0e10de..11043da93 100644 --- a/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt +++ b/wings/faceless-flywave/src/test/kotlin/pro/fessional/wings/faceless/service/lightid/impl/LightIdServiceImplTest.kt @@ -7,6 +7,7 @@ import org.junit.jupiter.api.MethodOrderer import org.junit.jupiter.api.Test import org.junit.jupiter.api.TestMethodOrder import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization import org.springframework.boot.test.context.SpringBootTest import org.springframework.jdbc.core.JdbcTemplate import pro.fessional.mirana.id.LightIdBufferedProvider @@ -29,6 +30,7 @@ import java.util.concurrent.atomic.AtomicLong */ @SpringBootTest @TestMethodOrder(MethodOrderer.MethodName::class) +@DependsOnDatabaseInitialization open class LightIdServiceImplTest { @Autowired diff --git a/wings/faceless-flywave/src/test/resources/application.properties b/wings/faceless-flywave/src/test/resources/application.properties index c9ddfd77f..72f9921f1 100644 --- a/wings/faceless-flywave/src/test/resources/application.properties +++ b/wings/faceless-flywave/src/test/resources/application.properties @@ -1,3 +1,5 @@ spring.application.name=wings-faceless server.port=8082 debug=true + +spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true \ No newline at end of file diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/WingsJooqEnv.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/WingsJooqEnv.java index a4ffcf56a..8099dace1 100644 --- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/WingsJooqEnv.java +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/database/jooq/WingsJooqEnv.java @@ -13,7 +13,7 @@ public class WingsJooqEnv { /** * Whether mysql's efficient `insert ignore` and `replace into` are supported in Dao. - * spring.wings.faceless.jooq.enabled.batch-mysql=true + * wings.faceless.jooq.conf.batch-mysql=true */ public static volatile boolean daoBatchMysql = true; diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java index f562da76e..af073c1dd 100644 --- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java @@ -2,35 +2,22 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.jetbrains.annotations.NotNull; import org.jooq.ConverterProvider; -import org.jooq.ExecuteListenerProvider; import org.jooq.VisitListenerProvider; import org.jooq.conf.Settings; -import org.jooq.impl.DefaultExecuteListenerProvider; import org.jooq.impl.DefaultVisitListenerProvider; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.jooq.DefaultConfigurationCustomizer; import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.faceless.database.WingsTableCudHandler; import pro.fessional.wings.faceless.database.jooq.WingsJooqEnv; import pro.fessional.wings.faceless.database.jooq.converter.JooqConverterDelegate; -import pro.fessional.wings.faceless.database.jooq.helper.JournalDiffHelper; import pro.fessional.wings.faceless.database.jooq.listener.AutoQualifyFieldListener; -import pro.fessional.wings.faceless.database.jooq.listener.JournalDeleteListener; -import pro.fessional.wings.faceless.database.jooq.listener.TableCudListener; -import pro.fessional.wings.faceless.spring.prop.FacelessJooqCudProp; -import pro.fessional.wings.faceless.spring.prop.FacelessJooqEnabledProp; - -import java.util.List; -import java.util.stream.Collectors; +import pro.fessional.wings.faceless.spring.prop.FacelessJooqConfProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** * @author trydofor @@ -38,18 +25,16 @@ * @since 2019-08-12 */ @Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = FacelessJooqEnabledProp.Key$module, havingValue = "true") -@ConditionalOnClass(name = "org.jooq.conf.Settings") -@EnableConfigurationProperties({ - FacelessJooqCudProp.class, - FacelessJooqEnabledProp.class, -}) +@ConditionalWingsEnabled +@ConditionalOnClass(Settings.class) +@EnableConfigurationProperties(FacelessJooqConfProp.class) public class FacelessJooqConfiguration { - public static final String jooqWingsConfigCustomizer = "jooqWingsConfigCustomizer"; private static final Log log = LogFactory.getLog(FacelessJooqConfiguration.class); /** + * enable jooq auto qualify. + *

* workaround before Version 3.14.0 * still opening, maybe 3.18.0 checked on 2023-01-18 * @@ -59,47 +44,22 @@ public class FacelessJooqConfiguration { * @link group_concat_max_len */ @Bean - @ConditionalOnProperty(name = FacelessJooqEnabledProp.Key$autoQualify, havingValue = "true") + @ConditionalWingsEnabled(absKey = FacelessJooqConfProp.Key$autoQualify) public VisitListenerProvider jooqAutoQualifyFieldListener() { log.info("FacelessJooq spring-bean jooqAutoQualifyFieldListener"); return new DefaultVisitListenerProvider(new AutoQualifyFieldListener()); } - @Bean - @ConditionalOnProperty(name = FacelessJooqEnabledProp.Key$listenTableCud, havingValue = "true") - public VisitListenerProvider jooqTableCudListener(FacelessJooqCudProp prop, List handlers) { - final TableCudListener listener = new TableCudListener(); - - final String names = handlers.stream().map(it -> it.getClass().getName()).collect(Collectors.joining(",")); - log.info("FacelessJooq spring-bean jooqTableCudListener with handler=" + names); - for (WingsTableCudHandler handler : handlers) { - handler.register(listener); - } - - listener.setHandlers(handlers); - listener.setCreate(prop.isCreate()); - listener.setUpdate(prop.isUpdate()); - listener.setDelete(prop.isDelete()); - listener.setTableField(prop.getTable()); - return new DefaultVisitListenerProvider(listener); - } @Bean - @ConditionalOnProperty(name = FacelessJooqEnabledProp.Key$journalDelete, havingValue = "true") - public ExecuteListenerProvider jooqJournalDeleteListener() { - log.info("FacelessJooq spring-bean jooqJournalDeleteListener"); - return new DefaultExecuteListenerProvider(new JournalDeleteListener()); - } - - @Bean(name = jooqWingsConfigCustomizer) - @ConditionalOnMissingBean(name = jooqWingsConfigCustomizer) + @ConditionalWingsEnabled public DefaultConfigurationCustomizer jooqWingsConfigCustomizer( - FacelessJooqEnabledProp config, + FacelessJooqConfProp config, ObjectProvider providers, ObjectProvider> converters, ObjectProvider visitListenerProviders ) { - log.info("FacelessJooq spring-bean " + jooqWingsConfigCustomizer); + log.info("FacelessJooq spring-bean jooqWingsConfigCustomizer"); return configuration -> { final VisitListenerProvider[] visitArr = visitListenerProviders.orderedStream().toArray(VisitListenerProvider[]::new); @@ -133,10 +93,4 @@ public DefaultConfigurationCustomizer jooqWingsConfigCustomizer( } }; } - - @Autowired - public void autowireJournalDiffHelper(@NotNull FacelessJooqCudProp prop) { - log.info("FacelessJooq spring-auto initJournalDiffHelper"); - JournalDiffHelper.putDefaultIgnore(prop.getDiff()); - } } diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqCudConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqCudConfiguration.java new file mode 100644 index 000000000..d4a8a92b3 --- /dev/null +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqCudConfiguration.java @@ -0,0 +1,83 @@ +package pro.fessional.wings.faceless.spring.bean; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jetbrains.annotations.NotNull; +import org.jooq.ExecuteListenerProvider; +import org.jooq.VisitListenerProvider; +import org.jooq.conf.Settings; +import org.jooq.impl.DefaultExecuteListenerProvider; +import org.jooq.impl.DefaultVisitListenerProvider; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import pro.fessional.wings.faceless.database.WingsTableCudHandler; +import pro.fessional.wings.faceless.database.jooq.helper.JournalDiffHelper; +import pro.fessional.wings.faceless.database.jooq.listener.JournalDeleteListener; +import pro.fessional.wings.faceless.database.jooq.listener.TableCudListener; +import pro.fessional.wings.faceless.spring.prop.FacelessJooqConfProp; +import pro.fessional.wings.faceless.spring.prop.FacelessJooqCudProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author trydofor + * @see JooqAutoConfiguration + * @since 2019-08-12 + */ +@Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled +@ConditionalOnClass(Settings.class) +@EnableConfigurationProperties(FacelessJooqCudProp.class) +public class FacelessJooqCudConfiguration { + private static final Log log = LogFactory.getLog(FacelessJooqCudConfiguration.class); + + + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + public static class JournalDiffWired { + @Autowired + public void auto(@NotNull FacelessJooqCudProp prop) { + log.info("FacelessJooq spring-auto initJournalDiffHelper"); + JournalDiffHelper.putDefaultIgnore(prop.getDiff()); + } + } + + /** + * listen to table's create/update/delete. + */ + @Bean + @ConditionalWingsEnabled(absKey = FacelessJooqConfProp.Key$listenTableCud) + public VisitListenerProvider jooqTableCudListener(FacelessJooqCudProp prop, List handlers) { + final TableCudListener listener = new TableCudListener(); + + final String names = handlers.stream().map(it -> it.getClass().getName()).collect(Collectors.joining(",")); + log.info("FacelessJooq spring-bean jooqTableCudListener with handler=" + names); + for (WingsTableCudHandler handler : handlers) { + handler.register(listener); + } + + listener.setHandlers(handlers); + listener.setCreate(prop.isCreate()); + listener.setUpdate(prop.isUpdate()); + listener.setDelete(prop.isDelete()); + listener.setTableField(prop.getTable()); + return new DefaultVisitListenerProvider(listener); + } + + /** + * when deleting with commit_id, whether to update first and then delete. + */ + @Bean + @ConditionalWingsEnabled(absKey = FacelessJooqConfProp.Key$journalDelete) + public ExecuteListenerProvider jooqJournalDeleteListener() { + log.info("FacelessJooq spring-bean jooqJournalDeleteListener"); + return new DefaultExecuteListenerProvider(new JournalDeleteListener()); + } + +} diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java index 0d01a39a8..137940225 100644 --- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessJooqAutoConfiguration.java @@ -1,19 +1,18 @@ package pro.fessional.wings.faceless.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration; +import org.springframework.context.annotation.Import; import pro.fessional.wings.faceless.spring.bean.FacelessJooqConfiguration; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; +import pro.fessional.wings.faceless.spring.bean.FacelessJooqCudConfiguration; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** * @author trydofor * @since 2019-06-01 */ -@AutoConfiguration(before = {FacelessAutoConfiguration.class, JooqAutoConfiguration.class}) -@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration(FacelessJooqConfiguration.class) +@AutoConfiguration +@ConditionalWingsEnabled +@Import({FacelessJooqConfiguration.class, FacelessJooqCudConfiguration.class}) public class FacelessJooqAutoConfiguration { } diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqEnabledProp.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqConfProp.java similarity index 85% rename from wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqEnabledProp.java rename to wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqConfProp.java index 909c1e25c..5e8baa019 100644 --- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqEnabledProp.java +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqConfProp.java @@ -4,34 +4,27 @@ import org.springframework.boot.context.properties.ConfigurationProperties; /** - * spring-wings-enabled-79.properties + * wings-jooq-conf-79.properties * * @author trydofor * @see #Key * @since 2021-02-13 */ @Data -@ConfigurationProperties(FacelessJooqEnabledProp.Key) -public class FacelessJooqEnabledProp { +@ConfigurationProperties(FacelessJooqConfProp.Key) +public class FacelessJooqConfProp { - public static final String Key = "spring.wings.faceless.jooq.enabled"; - - /** - * whether to enable jooq config. - * - * @see #Key$module - */ - private boolean module = true; - public static final String Key$module = Key + ".module"; + public static final String Key = "wings.faceless.jooq.conf"; /** * whether to enable jooq auto qualify. * * @see #Key$autoQualify */ - private boolean autoQualify = true; + private String autoQualify = ""; public static final String Key$autoQualify = Key + ".auto-qualify"; + /** * whether to use efficient mysql syntax when performing bulk inserts via Dao. * @@ -53,7 +46,7 @@ public class FacelessJooqEnabledProp { * * @see #Key$journalDelete */ - private boolean journalDelete = false; + private String journalDelete = ""; public static final String Key$journalDelete = Key + ".journal-delete"; /** @@ -61,7 +54,7 @@ public class FacelessJooqEnabledProp { * * @see #Key$listenTableCud */ - private boolean listenTableCud = false; + private String listenTableCud = ""; public static final String Key$listenTableCud = Key + ".listen-table-cud"; /** diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqCudProp.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqCudProp.java index aca6bae8b..abf283321 100644 --- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqCudProp.java +++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqCudProp.java @@ -15,7 +15,7 @@ /** * CUD listener settings for jooq. - * spring-wings-enabled-79.properties + * wings-jooq-cud-79.properties * * @author trydofor * @see #Key diff --git a/wings/faceless-jooq/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/faceless-jooq/src/main/resources/wings-conf/wings-jooq-conf-79.properties similarity index 73% rename from wings/faceless-jooq/src/main/resources/wings-conf/spring-wings-enabled-79.properties rename to wings/faceless-jooq/src/main/resources/wings-conf/wings-jooq-conf-79.properties index 0f3489121..5a25149ad 100644 --- a/wings/faceless-jooq/src/main/resources/wings-conf/spring-wings-enabled-79.properties +++ b/wings/faceless-jooq/src/main/resources/wings-conf/wings-jooq-conf-79.properties @@ -1,20 +1,17 @@ -## whether to enable jooq config. -spring.wings.faceless.jooq.enabled.module=true - ## whether to enable jooq auto qualify. -spring.wings.faceless.jooq.enabled.auto-qualify=true - -## whether to use efficient mysql syntax when performing bulk inserts via Dao. -spring.wings.faceless.jooq.enabled.batch-mysql=true - -## whether to inject global converters, recommended in Table. -spring.wings.faceless.jooq.enabled.converter=false +wings.faceless.jooq.conf.auto-qualify=true ## when deleting with commit_id, whether to update first and then delete. -spring.wings.faceless.jooq.enabled.journal-delete=false +wings.faceless.jooq.conf.journal-delete=false ## whether to listen to table's create/update/delete. -spring.wings.faceless.jooq.enabled.listen-table-cud=true +wings.faceless.jooq.conf.listen-table-cud=true + +## whether to use efficient mysql syntax when performing bulk inserts via Dao. +wings.faceless.jooq.conf.batch-mysql=true + +## whether to inject global converters, recommended in Table. +wings.faceless.jooq.conf.converter=false ##whether the jOOQ `GROUP_CONCAT` function should be overflow-protected by setting ##the `@@group_concat_max_len` session variable in MySQL style database @@ -27,15 +24,15 @@ spring.wings.faceless.jooq.enabled.listen-table-cud=true ##* ##* ##* -spring.wings.faceless.jooq.enabled.render-group-concat=false +wings.faceless.jooq.conf.render-group-concat=false ## whether any catalog name should be rendered at all. ## Use this for single-catalog environments, or when all objects are made ## available using synonyms -spring.wings.faceless.jooq.enabled.render-catalog=false +wings.faceless.jooq.conf.render-catalog=false ## whether any schema name should be rendered at all. ## Setting this to false also implicitly sets "renderCatalog" to false. ## Use this for single-schema environments, or when all objects are made ## available using synonyms -spring.wings.faceless.jooq.enabled.render-schema=false +wings.faceless.jooq.conf.render-schema=false diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java index b0771795d..87432c68e 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/database/jooq/WingsJooqDaoAliasImplTest.java @@ -9,6 +9,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; @@ -38,6 +39,7 @@ */ @SpringBootTest +@DependsOnDatabaseInitialization @ActiveProfiles("init") @TestMethodOrder(MethodOrderer.MethodName.class) @Tag("init") diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java index e42e152a7..d31c2ef95 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java @@ -10,6 +10,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.test.context.ActiveProfiles; @@ -35,9 +36,10 @@ * @since 2019-09-27 */ +@SpringBootTest(properties = {"spring.wings.faceless.jooq.enabled.journal-delete=true"}) +@DependsOnDatabaseInitialization @TestMethodOrder(MethodOrderer.MethodName.class) @ActiveProfiles("init") -@SpringBootTest(properties = {"spring.wings.faceless.jooq.enabled.journal-delete=true"}) @Tag("init") @Slf4j public class JooqDeleteListenerTest { diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java index 1def03835..75258dad6 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqMapperCompatibleTest.java @@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; @@ -29,6 +30,7 @@ */ @SpringBootTest +@DependsOnDatabaseInitialization @TestMethodOrder(MethodOrderer.MethodName.class) public class JooqMapperCompatibleTest { diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java index e00d7bf45..615a9bdfd 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java @@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import pro.fessional.wings.faceless.convention.EmptyValue; @@ -46,12 +47,13 @@ */ @SuppressWarnings("CanBeFinal") -@TestMethodOrder(MethodOrderer.MethodName.class) -@ActiveProfiles("init") @SpringBootTest(properties = { "wings.faceless.jooq.cud.table[tst_sharding]=id,login_info", "spring.wings.faceless.jooq.enabled.listen-table-cud=true" }) +@DependsOnDatabaseInitialization +@TestMethodOrder(MethodOrderer.MethodName.class) +@ActiveProfiles("init") @Tag("init") @Slf4j public class JooqTableCudListenerTest { diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java index 274f57fca..289c03e4c 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/TransactionalServiceTest.java @@ -9,6 +9,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.mirana.id.LightIdBufferedProvider; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; @@ -25,6 +26,7 @@ * @since 2023-03-09 */ @SpringBootTest +@DependsOnDatabaseInitialization @TestMethodOrder(MethodOrderer.MethodName.class) @Slf4j public class TransactionalServiceTest { diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java index cfa12e92b..9fa39657c 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqDslAndDaoSample.java @@ -14,6 +14,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; @@ -46,6 +47,7 @@ @SpringBootTest +@DependsOnDatabaseInitialization @TestMethodOrder(MethodOrderer.MethodName.class) @Slf4j public class TestJooqDslAndDaoSample { diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqMostSelectSample.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqMostSelectSample.java index 5b12b09eb..5d8cead8b 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqMostSelectSample.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/sample/TestJooqMostSelectSample.java @@ -31,6 +31,7 @@ import org.mapstruct.MappingTarget; import org.mapstruct.factory.Mappers; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import pro.fessional.mirana.page.PageQuery; @@ -73,6 +74,7 @@ */ @SpringBootTest +@DependsOnDatabaseInitialization @TestMethodOrder(MethodOrderer.MethodName.class) @Slf4j public class TestJooqMostSelectSample { diff --git a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingSphereConfiguration.java b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingSphereConfiguration.java new file mode 100644 index 000000000..426e5c940 --- /dev/null +++ b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingSphereConfiguration.java @@ -0,0 +1,62 @@ +package pro.fessional.wings.faceless.spring.bean; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.shardingsphere.driver.jdbc.core.driver.ShardingSphereDriverURLManager; +import org.apache.shardingsphere.infra.util.yaml.YamlEngine; +import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRootConfiguration; +import org.apache.shardingsphere.infra.yaml.config.swapper.resource.YamlDataSourceConfigurationSwapper; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import pro.fessional.wings.faceless.database.DataSourceContext; +import pro.fessional.wings.faceless.database.sharding.WriteRouteOnlyAround; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; + +import javax.sql.DataSource; +import java.util.Map; + + +/** + * Config sharding datasource to DataSourceContext + * + * @author trydofor + */ + +@Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled +public class FacelessShardingSphereConfiguration { + private static final Log log = LogFactory.getLog(FacelessShardingSphereConfiguration.class); + + @Bean + @ConditionalWingsEnabled + public WriteRouteOnlyAround writeRouteOnlyAround() { + log.info("FacelessShard spring-bean writeRouteOnlyAround"); + return new WriteRouteOnlyAround(); + } + + + @ConditionalWingsEnabled + @ConditionalOnClass(DataSourceContext.class) + public static class DataSourceContextBean { + @Bean + public DataSourceContext.Customizer shardingSphereCustomizer(@Value("${spring.datasource.url}") String jdbcUrl) throws Exception { + if (!jdbcUrl.startsWith("jdbc:shardingsphere:")) { + log.info("FacelessShard skip shardingSphereCustomizer jdbcUrl=" + jdbcUrl); + return ignored -> false; + } + + final byte[] yamlBytes = ShardingSphereDriverURLManager.getContent(jdbcUrl); + YamlRootConfiguration rootConfig = YamlEngine.unmarshal(yamlBytes, YamlRootConfiguration.class); + final YamlDataSourceConfigurationSwapper configurationSwapper = new YamlDataSourceConfigurationSwapper(); + final Map dsMap = configurationSwapper.swapToDataSources(rootConfig.getDataSources()); + log.info("FacelessShard spring-bean shardingSphereCustomizer backends size=" + dsMap.size()); + + return (ctx) -> { + ctx.clearBackend().addBackend(dsMap); + return true; + }; + } + } +} diff --git a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingsphereConfiguration.java b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingsphereConfiguration.java deleted file mode 100644 index 907c9b04c..000000000 --- a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingsphereConfiguration.java +++ /dev/null @@ -1,55 +0,0 @@ -package pro.fessional.wings.faceless.spring.bean; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.shardingsphere.driver.jdbc.core.driver.ShardingSphereDriverURLManager; -import org.apache.shardingsphere.infra.util.yaml.YamlEngine; -import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRootConfiguration; -import org.apache.shardingsphere.infra.yaml.config.swapper.resource.YamlDataSourceConfigurationSwapper; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.faceless.database.DataSourceContext; -import pro.fessional.wings.faceless.database.sharding.WriteRouteOnlyAround; - -import javax.sql.DataSource; -import java.util.Map; - - -/** - * Config sharding datasource to DataSourceContext - * - * @author trydofor - */ - -@Configuration(proxyBeanMethods = false) -public class FacelessShardingsphereConfiguration { - private static final Log log = LogFactory.getLog(FacelessShardingsphereConfiguration.class); - - @Bean - public WriteRouteOnlyAround writeRouteOnlyAround() { - log.info("FacelessShard spring-bean writeRouteOnlyAround"); - return new WriteRouteOnlyAround(); - } - - @Bean - @ConditionalOnClass(name = "pro.fessional.wings.faceless.database.DataSourceContext") - public DataSourceContext.Customizer shardingSphereCustomizer(@Value("${spring.datasource.url}") String jdbcUrl) throws Exception { - if (!jdbcUrl.startsWith("jdbc:shardingsphere:")) { - log.info("FacelessShard skip shardingSphereCustomizer jdbcUrl=" + jdbcUrl); - return ignored -> false; - } - - final byte[] yamlBytes = ShardingSphereDriverURLManager.getContent(jdbcUrl); - YamlRootConfiguration rootConfig = YamlEngine.unmarshal(yamlBytes, YamlRootConfiguration.class); - final YamlDataSourceConfigurationSwapper configurationSwapper = new YamlDataSourceConfigurationSwapper(); - final Map dsMap = configurationSwapper.swapToDataSources(rootConfig.getDataSources()); - log.info("FacelessShard spring-bean shardingSphereCustomizer backends size=" + dsMap.size()); - - return (ctx) -> { - ctx.clearBackend().addBackend(dsMap); - return true; - }; - } -} diff --git a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessShardAutoConfiguration.java b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessShardAutoConfiguration.java index 9923665a1..c38d1046b 100644 --- a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessShardAutoConfiguration.java +++ b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessShardAutoConfiguration.java @@ -1,18 +1,18 @@ package pro.fessional.wings.faceless.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import pro.fessional.wings.faceless.spring.bean.FacelessShardingsphereConfiguration; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; +import org.springframework.context.annotation.Import; +import pro.fessional.wings.faceless.spring.bean.FacelessShardingSphereConfiguration; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; + /** * @author trydofor * @since 2019-06-01 */ -@AutoConfiguration(before = FacelessAutoConfiguration.class) -@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration(FacelessShardingsphereConfiguration.class) +@AutoConfiguration +@ConditionalWingsEnabled +@Import(FacelessShardingSphereConfiguration.class) public class FacelessShardAutoConfiguration { } diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java index c3ae219ff..f1b3a1422 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/flywave/FlywaveShardingTest.java @@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.jdbc.core.JdbcTemplate; import pro.fessional.wings.faceless.database.DataSourceContext; @@ -24,6 +25,7 @@ * @since 2021-01-18 */ @SpringBootTest +@DependsOnDatabaseInitialization @TestMethodOrder(MethodOrderer.MethodName.class) public class FlywaveShardingTest { diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java index e12014055..6064a2925 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java @@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import pro.fessional.wings.faceless.convention.EmptyValue; import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; @@ -39,6 +40,7 @@ @SuppressWarnings({"FieldMayBeFinal", "CanBeFinal"}) @SpringBootTest +@DependsOnDatabaseInitialization @TestMethodOrder(MethodOrderer.MethodName.class) @Slf4j public class JooqShardingTest { diff --git a/wings/faceless-test/src/main/resources/wings-conf/spring-wings-enabled.properties b/wings/faceless-test/src/main/resources/wings-conf/spring-wings-enabled.properties index 396822964..aa5b55e6a 100644 --- a/wings/faceless-test/src/main/resources/wings-conf/spring-wings-enabled.properties +++ b/wings/faceless-test/src/main/resources/wings-conf/spring-wings-enabled.properties @@ -1,5 +1,5 @@ ## whether to inject Flywave related beans. -spring.wings.faceless.flywave.enabled.module=true +spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true ## when deleting with commit_id, whether to update first and then delete. spring.wings.faceless.jooq.enabled.journal-delete=true diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/service/wini18n/impl/StandardI18nServiceJdbc.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/service/wini18n/impl/StandardI18nServiceJdbc.java index 0a2cc32db..b9da11652 100644 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/service/wini18n/impl/StandardI18nServiceJdbc.java +++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/service/wini18n/impl/StandardI18nServiceJdbc.java @@ -8,6 +8,7 @@ import pro.fessional.mirana.i18n.LocaleResolver; import pro.fessional.wings.faceless.service.wini18n.StandardI18nService; import pro.fessional.wings.silencer.message.CombinableMessageSource; +import pro.fessional.wings.silencer.message.MessageSourceHelper; import java.util.List; import java.util.Locale; @@ -21,8 +22,6 @@ public class StandardI18nServiceJdbc implements StandardI18nService { private final JdbcTemplate jdbcTemplate; - private final CombinableMessageSource combinableMessageSource; - private final ConcurrentHashMap cache = new ConcurrentHashMap<>(); @Override @@ -52,8 +51,9 @@ public int reloadBase(String base) { strExtractor, base, kind, ukey, lan); String hint = txt == null ? "" : txt; - if (combinableMessageSource != null && !hint.isEmpty()) { - combinableMessageSource.addMessage(code(base, kind, ukey), lang, hint); + CombinableMessageSource combinable = MessageSourceHelper.getCombinableMessageSource(false); + if (combinable != null && !hint.isEmpty()) { + combinable.addMessage(code(base, kind, ukey), lang, hint); } return hint; }); @@ -64,10 +64,11 @@ private int cache(List pos) { String key = key(po.base, po.kind, po.ukey, po.lang); String txt = po.hint; cache.put(key, txt); - if (combinableMessageSource != null) { + CombinableMessageSource combinable = MessageSourceHelper.getCombinableMessageSource(false); + if (combinable != null) { String code = code(po.base, po.kind, po.ukey); Locale lang = LocaleResolver.locale(po.lang); - combinableMessageSource.addMessage(code, lang, txt); + combinable.addMessage(code, lang, txt); } } return pos.size(); diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessConfiguration.java similarity index 56% rename from wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java rename to wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessConfiguration.java index ab6c26354..ec14ffb0f 100644 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessDataSourceConfiguration.java +++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessConfiguration.java @@ -3,11 +3,21 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.jdbc.core.JdbcTemplate; import pro.fessional.wings.faceless.database.DataSourceContext; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; +import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.CommitJournalModify; +import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.impl.CommitJournalModifyJdbc; +import pro.fessional.wings.faceless.service.flakeid.FlakeIdService; +import pro.fessional.wings.faceless.service.flakeid.impl.FlakeIdLightIdImpl; +import pro.fessional.wings.faceless.service.journal.JournalService; +import pro.fessional.wings.faceless.service.journal.impl.DefaultJournalService; +import pro.fessional.wings.faceless.service.lightid.BlockIdProvider; +import pro.fessional.wings.faceless.service.lightid.LightIdService; +import pro.fessional.wings.faceless.service.wini18n.StandardI18nService; +import pro.fessional.wings.faceless.service.wini18n.impl.StandardI18nServiceJdbc; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import javax.sql.DataSource; import java.util.Map; @@ -20,12 +30,13 @@ * @since 2019-06-25 */ @Configuration(proxyBeanMethods = false) -@EnableConfigurationProperties(FacelessEnabledProp.class) -public class FacelessDataSourceConfiguration { +@ConditionalWingsEnabled +public class FacelessConfiguration { - private static final Log log = LogFactory.getLog(FacelessDataSourceConfiguration.class); + private static final Log log = LogFactory.getLog(FacelessConfiguration.class); @Bean + @ConditionalWingsEnabled public DataSourceContext dataSourceContext( ObjectProvider dataSources, ObjectProvider modifiers) { @@ -75,4 +86,32 @@ public DataSourceContext dataSourceContext( return ctx; } + + @Bean + @ConditionalWingsEnabled + public StandardI18nService standardI18nService(JdbcTemplate jdbcTemplate) { + log.info("Faceless spring-bean standardI18nService"); + return new StandardI18nServiceJdbc(jdbcTemplate); + } + + @Bean + @ConditionalWingsEnabled + public FlakeIdService flakeIdService(LightIdService lightIdService) { + log.info("Faceless spring-bean flakeIdService"); + return new FlakeIdLightIdImpl(lightIdService); + } + + @Bean + @ConditionalWingsEnabled + public CommitJournalModify commitJournalModify(JdbcTemplate jdbcTemplate) { + log.info("Faceless spring-bean commitJournalModify"); + return new CommitJournalModifyJdbc(jdbcTemplate); + } + + @Bean + @ConditionalWingsEnabled + public JournalService journalService(LightIdService lightIdService, BlockIdProvider blockIdProvider, CommitJournalModify journalModify) { + log.info("Faceless spring-bean journalService"); + return new DefaultJournalService(lightIdService, blockIdProvider, journalModify); + } } diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java deleted file mode 100644 index 89762ef59..000000000 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessEnumI18nConfiguration.java +++ /dev/null @@ -1,37 +0,0 @@ -package pro.fessional.wings.faceless.spring.bean; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.jdbc.core.JdbcTemplate; -import pro.fessional.wings.faceless.service.wini18n.StandardI18nService; -import pro.fessional.wings.faceless.service.wini18n.impl.StandardI18nServiceJdbc; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; -import pro.fessional.wings.silencer.message.CombinableMessageSource; - -/** - * @author trydofor - * @since 2019-06-01 - */ -@Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = FacelessEnabledProp.Key$enumi18n, havingValue = "true") -@ConditionalOnClass(name = "pro.fessional.wings.silencer.message.CombinableMessageSource") -public class FacelessEnumI18nConfiguration { - - private static final Log log = LogFactory.getLog(FacelessEnumI18nConfiguration.class); - - @Bean - @ConditionalOnMissingBean(StandardI18nService.class) - public StandardI18nService standardI18nService( - JdbcTemplate jdbcTemplate, - ObjectProvider combinableMessageSource - ) { - log.info("Faceless spring-bean standardI18nService"); - return new StandardI18nServiceJdbc(jdbcTemplate, combinableMessageSource.getIfAvailable()); - } -} diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessFlakeIdConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessFlakeIdConfiguration.java deleted file mode 100644 index a076016e1..000000000 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessFlakeIdConfiguration.java +++ /dev/null @@ -1,30 +0,0 @@ -package pro.fessional.wings.faceless.spring.bean; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.faceless.service.flakeid.FlakeIdService; -import pro.fessional.wings.faceless.service.flakeid.impl.FlakeIdLightIdImpl; -import pro.fessional.wings.faceless.service.lightid.LightIdService; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; - -/** - * @author trydofor - * @since 2019-06-01 - */ -@Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = FacelessEnabledProp.Key$lightid, havingValue = "true") -public class FacelessFlakeIdConfiguration { - - private static final Log log = LogFactory.getLog(FacelessFlakeIdConfiguration.class); - - @Bean - @ConditionalOnMissingBean(FlakeIdService.class) - public FlakeIdService flakeIdService(LightIdService lightIdService) { - log.info("Faceless spring-bean flakeIdService"); - return new FlakeIdLightIdImpl(lightIdService); - } -} diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJournalConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJournalConfiguration.java deleted file mode 100644 index 54ef6a88d..000000000 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJournalConfiguration.java +++ /dev/null @@ -1,46 +0,0 @@ -package pro.fessional.wings.faceless.spring.bean; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.jdbc.core.JdbcTemplate; -import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.CommitJournalModify; -import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.impl.CommitJournalModifyJdbc; -import pro.fessional.wings.faceless.service.journal.JournalService; -import pro.fessional.wings.faceless.service.journal.impl.DefaultJournalService; -import pro.fessional.wings.faceless.service.lightid.BlockIdProvider; -import pro.fessional.wings.faceless.service.lightid.LightIdService; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; - -/** - * @author trydofor - * @since 2019-06-01 - */ -@Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = FacelessEnabledProp.Key$journal, havingValue = "true") -public class FacelessJournalConfiguration { - - private static final Log log = LogFactory.getLog(FacelessJournalConfiguration.class); - - @Bean - @ConditionalOnMissingBean(JournalService.class) - public JournalService journalService( - LightIdService lightIdService, - BlockIdProvider blockIdProvider, - CommitJournalModify journalModify - ) { - log.info("Faceless spring-bean journalService"); - return new DefaultJournalService(lightIdService, blockIdProvider, journalModify); - } - - - @Bean - @ConditionalOnMissingBean(CommitJournalModify.class) - public CommitJournalModify commitJournalModify(JdbcTemplate jdbcTemplate) { - log.info("Faceless spring-bean commitJournalModify"); - return new CommitJournalModifyJdbc(jdbcTemplate); - } -} diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java index 05e65f3e4..153013834 100644 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java +++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java @@ -6,7 +6,6 @@ import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -25,24 +24,66 @@ import pro.fessional.wings.faceless.service.lightid.impl.DefaultBlockIdProvider; import pro.fessional.wings.faceless.service.lightid.impl.LightIdMysqlLoader; import pro.fessional.wings.faceless.service.lightid.impl.LightIdServiceImpl; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; import pro.fessional.wings.faceless.spring.prop.LightIdInsertProp; import pro.fessional.wings.faceless.spring.prop.LightIdLayoutProp; import pro.fessional.wings.faceless.spring.prop.LightIdProviderProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** * @author trydofor * @since 2019-06-01 */ @Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = FacelessEnabledProp.Key$lightid, havingValue = "true") -@EnableConfigurationProperties({LightIdInsertProp.class, LightIdLayoutProp.class, LightIdProviderProp.class,}) +@ConditionalWingsEnabled +@EnableConfigurationProperties({LightIdInsertProp.class, LightIdProviderProp.class,}) public class FacelessLightIdConfiguration { private static final Log log = LogFactory.getLog(FacelessLightIdConfiguration.class); + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + @EnableConfigurationProperties(LightIdLayoutProp.class) + public static class LayoutWired { + @Autowired + public void auto(@NotNull LightIdLayoutProp prop) { + final Boolean bf = prop.getBlockFirst(); + if (bf != null) { + log.info("Faceless spring-auto forceLightIdLayout forceBlockFirst=" + bf); + LightIdUtil.forceBlockFirst(bf); + } + final Integer bb = prop.getBlockBits(); + if (bb != null) { + log.info("Faceless spring-auto forceLightIdLayout forceBlockBit=" + bb); + LightIdUtil.forceBlockBit(bb); + } + } + } + + + @Bean + @ConditionalWingsEnabled + @ConditionalOnExpression("!'${" + LightIdProviderProp.Key$blockType + "}'.equals('biz')") + public BlockIdProvider blockProvider(LightIdProviderProp providerProp, + ObjectProvider jdbcTemplate) { + final String blockType = providerProp.getBlockType(); + log.info("Faceless spring-bean lightIdProvider" + blockType); + if ("sql".equalsIgnoreCase(blockType)) { + return new DefaultBlockIdProvider(providerProp.getBlockPara(), jdbcTemplate.getIfAvailable()); + } + else if ("fix".equalsIgnoreCase(blockType)) { + final int id = Integer.parseInt(providerProp.getBlockPara()); + return () -> id; + } + else if ("biz".equalsIgnoreCase(blockType)) { + throw new IllegalArgumentException("should not be here for user biz bean"); + } + else { + throw new IllegalArgumentException("unsupported wings.faceless.lightid.provider.block-type=" + blockType); + } + } + @Bean - @ConditionalOnMissingBean(LightSequenceSelect.class) + @ConditionalWingsEnabled public LightSequenceSelect lightSequenceSelect(LightIdProviderProp prop, JdbcTemplate jdbcTemplate) { log.info("Faceless spring-bean lightSequenceSelect"); return new LightSequenceSelectJdbc( @@ -53,14 +94,14 @@ public LightSequenceSelect lightSequenceSelect(LightIdProviderProp prop, JdbcTem } @Bean - @ConditionalOnMissingBean(LightSequenceModify.class) + @ConditionalWingsEnabled public LightSequenceModify lightSequenceModify(LightIdProviderProp providerProp, JdbcTemplate jdbcTemplate) { log.info("Faceless spring-bean lightSequenceModify"); return new LightSequenceModifyJdbc(jdbcTemplate, providerProp.getSequenceInsert(), providerProp.getSequenceUpdate()); } @Bean - @ConditionalOnMissingBean(LightIdProvider.Loader.class) + @ConditionalWingsEnabled public LightIdProvider.Loader lightIdLoader(LightSequenceSelect lightSequenceSelect, LightSequenceModify lightSequenceModify, LightIdInsertProp insertProp) { @@ -69,76 +110,42 @@ public LightIdProvider.Loader lightIdLoader(LightSequenceSelect lightSequenceSel } @Bean - @ConditionalOnMissingBean(LightIdProvider.class) - public LightIdProvider lightIdProvider(LightIdProvider.Loader lightIdLoader, - LightIdProviderProp providerProp, - ObjectProvider generator) { - final String mono = providerProp.getMonotonic(); - log.info("Faceless spring-bean lightIdProvider in " + mono); - if ("jvm".equalsIgnoreCase(mono)) { - // avg=0.039ms - LightIdBufferedProvider provider = new LightIdBufferedProvider(lightIdLoader); - provider.setTimeout(providerProp.getTimeout()); - provider.setErrAlive(providerProp.getErrAlive()); - provider.setMaxError(providerProp.getMaxError()); - provider.setMaxCount(providerProp.getMaxCount()); - // default LightIdUtil.toId - generator.ifAvailable(provider::setGenerator); - return provider; - } - else if ("db".equalsIgnoreCase(mono)) { - // avg=10.723ms - log.warn("the BlockingLightIdProvider is slow, about 10ms per id"); - final BlockingLightIdProvider provider = new BlockingLightIdProvider(lightIdLoader); - provider.setTimeout(providerProp.getTimeout()); - return provider; - } - else { - throw new IllegalArgumentException("unsupported monotonic type=" + mono); - } + @ConditionalWingsEnabled + @ConditionalOnProperty(name = LightIdProviderProp.Key$monotonic, havingValue = "jvm") + public LightIdProvider jvmLightIdProvider(LightIdProvider.Loader loader, + LightIdProviderProp prop, + ObjectProvider generator) { + log.info("Faceless spring-bean jvmLightIdProvider"); + // avg=0.039ms + LightIdBufferedProvider provider = new LightIdBufferedProvider(loader); + provider.setTimeout(prop.getTimeout()); + provider.setErrAlive(prop.getErrAlive()); + provider.setMaxError(prop.getMaxError()); + provider.setMaxCount(prop.getMaxCount()); + // default LightIdUtil.toId + generator.ifAvailable(provider::setGenerator); + return provider; } @Bean - @ConditionalOnMissingBean(BlockIdProvider.class) - @ConditionalOnExpression("!'${" + LightIdProviderProp.Key$blockType + "}'.equals('biz')") - public BlockIdProvider blockProvider(LightIdProviderProp providerProp, - ObjectProvider jdbcTemplate) { - final String blockType = providerProp.getBlockType(); - log.info("Faceless spring-bean lightIdProvider" + blockType); - if ("sql".equalsIgnoreCase(blockType)) { - return new DefaultBlockIdProvider(providerProp.getBlockPara(), jdbcTemplate.getIfAvailable()); - } - else if ("fix".equalsIgnoreCase(blockType)) { - final int id = Integer.parseInt(providerProp.getBlockPara()); - return () -> id; - } - else if ("biz".equalsIgnoreCase(blockType)) { - throw new IllegalArgumentException("should not be here for user biz bean"); - } - else { - throw new IllegalArgumentException("unsupported wings.faceless.lightid.provider.block-type=" + blockType); - } + @ConditionalWingsEnabled + @ConditionalOnProperty(name = LightIdProviderProp.Key$monotonic, havingValue = "db") + public LightIdProvider dbLightIdProvider(LightIdProvider.Loader loader, LightIdProviderProp prop) { + log.info("Faceless spring-bean dbLightIdProvider"); + + // avg=10.723ms + log.warn("the BlockingLightIdProvider is slow, about 10ms per id"); + final BlockingLightIdProvider provider = new BlockingLightIdProvider(loader); + provider.setTimeout(prop.getTimeout()); + return provider; } @Bean - @ConditionalOnMissingBean(LightIdService.class) + @ConditionalWingsEnabled public LightIdService lightIdService(LightIdProvider lightIdProvider, BlockIdProvider blockIdProvider) { log.info("Faceless spring-bean lightIdService"); return new LightIdServiceImpl(lightIdProvider, blockIdProvider); } - @Autowired - public void autowireLightIdLayout(@NotNull LightIdLayoutProp prop) { - final Boolean bf = prop.getBlockFirst(); - if (bf != null) { - log.info("Faceless spring-auto forceLightIdLayout forceBlockFirst=" + bf); - LightIdUtil.forceBlockFirst(bf); - } - final Integer bb = prop.getBlockBits(); - if (bb != null) { - log.info("Faceless spring-auto forceLightIdLayout forceBlockBit=" + bb); - LightIdUtil.forceBlockBit(bb); - } - } } diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java index 96f92431f..c5bc9acb0 100644 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java +++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java @@ -1,14 +1,10 @@ package pro.fessional.wings.faceless.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import pro.fessional.wings.faceless.spring.bean.FacelessDataSourceConfiguration; -import pro.fessional.wings.faceless.spring.bean.FacelessEnumI18nConfiguration; -import pro.fessional.wings.faceless.spring.bean.FacelessFlakeIdConfiguration; -import pro.fessional.wings.faceless.spring.bean.FacelessJournalConfiguration; +import org.springframework.context.annotation.Import; +import pro.fessional.wings.faceless.spring.bean.FacelessConfiguration; import pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration; -import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** * @author trydofor @@ -16,13 +12,10 @@ */ @AutoConfiguration -@ConditionalOnProperty(name = FacelessEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration({ - FacelessDataSourceConfiguration.class, - FacelessEnumI18nConfiguration.class, - FacelessFlakeIdConfiguration.class, - FacelessJournalConfiguration.class, - FacelessLightIdConfiguration.class, +@ConditionalWingsEnabled +@Import({ + FacelessConfiguration.class, + FacelessLightIdConfiguration.class }) public class FacelessAutoConfiguration { } diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessEnabledProp.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessEnabledProp.java deleted file mode 100644 index e6577ee4d..000000000 --- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessEnabledProp.java +++ /dev/null @@ -1,50 +0,0 @@ -package pro.fessional.wings.faceless.spring.prop; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * spring-wings-enabled-79.properties - * - * @author trydofor - * @see #Key - * @since 2021-02-13 - */ -@Data -@ConfigurationProperties(FacelessEnabledProp.Key) -public class FacelessEnabledProp { - - public static final String Key = "spring.wings.faceless.enabled"; - - /** - * Whether to start auto config - * - * @see #Key$autoconf - */ - private boolean autoconf = true; - public static final String Key$autoconf = Key + ".autoconf"; - - /** - * Whether to inject lingthid - * - * @see #Key$lightid - */ - private boolean lightid = true; - public static final String Key$lightid = Key + ".lightid"; - - /** - * Whether to inject journal - * - * @see #Key$journal - */ - private boolean journal = true; - public static final String Key$journal = Key + ".journal"; - - /** - * Whether to inject StandardI18nService - * - * @see #Key$enumi18n - */ - private boolean enumi18n = true; - public static final String Key$enumi18n = Key + ".enumi18n"; -} diff --git a/wings/faceless/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/faceless/src/main/resources/wings-conf/spring-wings-enabled-79.properties deleted file mode 100644 index 8080ef76d..000000000 --- a/wings/faceless/src/main/resources/wings-conf/spring-wings-enabled-79.properties +++ /dev/null @@ -1,9 +0,0 @@ -## Whether to start auto config -spring.wings.faceless.enabled.autoconf=true -## Whether to inject lingthid -spring.wings.faceless.enabled.lightid=true -## Whether to inject journal -spring.wings.faceless.enabled.journal=true -## Whether to inject StandardI18nService -spring.wings.faceless.enabled.enumi18n=false - diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java index afa0bb544..61a980d81 100644 --- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java +++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/concur/DatabaseGlobalLockTest.java @@ -5,8 +5,8 @@ import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; - import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; import java.util.concurrent.CountDownLatch; @@ -22,6 +22,7 @@ */ @SpringBootTest @Slf4j +@DependsOnDatabaseInitialization class DatabaseGlobalLockTest { @Setter(onMethod_ = {@Autowired}) diff --git a/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseCheckerTest.java b/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseCheckerTest.java index a6085b33d..5450cb8f6 100644 --- a/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseCheckerTest.java +++ b/wings/faceless/src/test/java/pro/fessional/wings/faceless/database/helper/DatabaseCheckerTest.java @@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; import javax.sql.DataSource; @@ -22,6 +23,7 @@ // "spring.datasource.url=jdbc:mysql://localhost:3306/wings_faceless?connectionTimeZone=-04:00&forceConnectionTimeZoneToSession=true", }) @Slf4j +@DependsOnDatabaseInitialization class DatabaseCheckerTest { @Setter(onMethod_ = {@Autowired}) diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/encrypt/SecretProvider.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/encrypt/SecretProvider.java index 0bdf2a5fa..f54b8ddd3 100644 --- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/encrypt/SecretProvider.java +++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/encrypt/SecretProvider.java @@ -2,6 +2,7 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import pro.fessional.mirana.code.RandCode; import java.util.concurrent.ConcurrentHashMap; @@ -85,6 +86,14 @@ public static String get(String name, boolean computeIfAbsent) { } } + /** + * used for `@Bean` method + */ + @Nullable + public String tryGet(String name) { + return get(name, false); + } + // protected static final ConcurrentHashMap Secrets = new ConcurrentHashMap<>(); diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java index 08e4a1b06..cd64475db 100644 --- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java +++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java @@ -9,14 +9,13 @@ import org.apache.commons.logging.LogFactory; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.runner.ApplicationReadyEventRunner; import pro.fessional.wings.silencer.spring.WingsOrdered; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.prop.SilencerAutoLogProp; -import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp; import java.util.HashSet; import java.util.Iterator; @@ -27,7 +26,8 @@ * @since 2019-06-26 */ @Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = SilencerEnabledProp.Key$autoLog, havingValue = "true") +@ConditionalWingsEnabled +@ConditionalOnClass(ConsoleAppender.class) @EnableConfigurationProperties(SilencerAutoLogProp.class) public class SilencerAutoLogConfiguration { @@ -37,8 +37,8 @@ public class SilencerAutoLogConfiguration { * Configuration is complete and the log is switched before the service starts */ @Bean - @ConditionalOnClass(ConsoleAppender.class) - public ApplicationReadyEventRunner runnerSilenceLogbackConsole(SilencerAutoLogProp autoLog) { + @ConditionalWingsEnabled + public ApplicationReadyEventRunner silenceLogbackConsoleRunner(SilencerAutoLogProp autoLog) { log.info("SilencerCurse spring-runs runnerSilenceLogbackConsole"); return new ApplicationReadyEventRunner(WingsOrdered.Lv1Config, ignored -> { final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME); diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java index caa51e549..5eb1ea0da 100644 --- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java +++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java @@ -1,9 +1,7 @@ package pro.fessional.wings.silencer.spring.bean; -import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -12,7 +10,7 @@ import pro.fessional.mirana.code.LeapCode; import pro.fessional.mirana.code.RandCode; import pro.fessional.wings.silencer.encrypt.SecretProvider; -import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.prop.SilencerEncryptProp; import java.util.Arrays; @@ -23,17 +21,15 @@ * @since 2019-06-26 */ @Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = SilencerEnabledProp.Key$encrypt, havingValue = "true") +@ConditionalWingsEnabled @EnableConfigurationProperties(SilencerEncryptProp.class) -@RequiredArgsConstructor public class SilencerEncryptConfiguration { private static final Log log = LogFactory.getLog(SilencerEncryptConfiguration.class); - private final SilencerEncryptProp prop; - @Bean - public Crc8Long crc8Long() { + @ConditionalWingsEnabled + public Crc8Long crc8Long(SilencerEncryptProp prop) { int[] seed = prop.getCrc8Long(); if (seed == null || seed.length == 0) { log.warn("SilencerCurse spring-bean crc8Long, should NOT use default"); @@ -46,7 +42,8 @@ public Crc8Long crc8Long() { } @Bean - public LeapCode leapCode() { + @ConditionalWingsEnabled + public LeapCode leapCode(SilencerEncryptProp prop) { String seed = prop.getLeapCode(); if (seed == null) { log.warn("SilencerCurse spring-bean leapCode, should NOT use default"); @@ -59,7 +56,8 @@ public LeapCode leapCode() { } @Bean - public Aes256 aes256() { + @ConditionalWingsEnabled + public Aes256 aes256(SilencerEncryptProp prop) { String key = prop.getAesKey().get(SecretProvider.System); if (key == null || key.isEmpty()) { log.warn("SilencerCurse spring-bean aes256, should NOT use random"); @@ -72,7 +70,8 @@ public Aes256 aes256() { } @Bean - public SecretProvider secretProvider() { + @ConditionalWingsEnabled + public SecretProvider secretProvider(SilencerEncryptProp prop) { log.info("SilencerCurse spring-bean secretProvider"); return new SecretProvider() {{ for (Map.Entry en : prop.getAesKey().entrySet()) { diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java index bdc63d160..b17456b3e 100644 --- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java +++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java @@ -2,14 +2,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.runner.ApplicationInspectRunner; import pro.fessional.wings.silencer.spring.WingsOrdered; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.help.ApplicationContextHelper; -import pro.fessional.wings.silencer.spring.prop.SilencerInspectProp; import java.util.ArrayList; import java.util.LinkedHashMap; @@ -17,15 +15,19 @@ import java.util.Map; /** + * audit the file and cascading relationship of properties key/value + * * @author trydofor * @since 2022-10-27 */ @Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = SilencerInspectProp.Key$properties, havingValue = "true") -@EnableConfigurationProperties(SilencerInspectProp.class) +@ConditionalWingsEnabled(false) public class SilencerInspectConfiguration { private static final Log log = LogFactory.getLog(SilencerInspectConfiguration.class); + /** + * audit the file and cascading relationship of properties key/value + */ @Bean public ApplicationInspectRunner inspectApplicationRunner() { log.info("SilencerCurse spring-bean inspectApplicationRunner"); diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRuntimeConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerModeWiredConfiguration.java similarity index 74% rename from wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRuntimeConfiguration.java rename to wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerModeWiredConfiguration.java index e3a259f08..5c24f50b1 100644 --- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRuntimeConfiguration.java +++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerModeWiredConfiguration.java @@ -6,6 +6,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.modulate.RuntimeMode; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.prop.SilencerRuntimeProp; /** @@ -13,13 +14,14 @@ * @since 2019-12-01 */ @Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled @EnableConfigurationProperties(SilencerRuntimeProp.class) -public class SilencerRuntimeConfiguration { +public class SilencerModeWiredConfiguration { - private final static Log log = LogFactory.getLog(SilencerRuntimeConfiguration.class); + private final static Log log = LogFactory.getLog(SilencerModeWiredConfiguration.class); @Autowired - public void autowireRuntimeMode(SilencerRuntimeProp prop) { + public void auto(SilencerRuntimeProp prop) { log.info("Silencer spring-auto runnerRuntimeMode"); new RuntimeMode() {{ runMode = prop.getRunMode(); diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java index b2e1fd28f..97d05be34 100644 --- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java +++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java @@ -16,6 +16,7 @@ import pro.fessional.mirana.evil.ThreadLocalAttention; import pro.fessional.mirana.pain.CodeException; import pro.fessional.mirana.time.ThreadNow; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.prop.SilencerTweakProp; import pro.fessional.wings.silencer.tweak.TweakLogger; @@ -27,57 +28,70 @@ * @since 2022-10-27 */ @Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled @EnableConfigurationProperties(SilencerTweakProp.class) public class SilencerTweakConfiguration { private static final Log log = LogFactory.getLog(SilencerTweakConfiguration.class); - @Autowired - public void autowireCodeExceptionTweak(SilencerTweakProp prop) throws ThreadLocalAttention { - log.info("SilencerCurse spring-auto initCodeExceptionTweak with TransmittableThreadLocal, stack=" + prop.isCodeStack()); - CodeException.TweakStack.initThread(new TransmittableThreadLocal<>(), false); - CodeException.TweakStack.initDefault(prop::isCodeStack); - } - - @Autowired - public void autowireThreadClockTweak(SilencerTweakProp prop) throws ThreadLocalAttention { - final long ms = prop.getClockOffset(); - log.info("SilencerCurse spring-auto initThreadClockTweak with TransmittableThreadLocal, offset=" + ms); - ThreadNow.TweakClock.initThread(new TransmittableThreadLocal<>(), false); - final Duration dr = Duration.ofMillis(ms); - if (!dr.isZero()) { - final Clock clock = ThreadNow.TweakClock.current(true); - ThreadNow.TweakClock.initDefault(Clock.offset(clock, dr)); + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + public static class ClockWired { + @Autowired + public void auto(SilencerTweakProp prop) throws ThreadLocalAttention { + final long ms = prop.getClockOffset(); + log.info("SilencerCurse spring-auto initThreadClockTweak with TransmittableThreadLocal, offset=" + ms); + ThreadNow.TweakClock.initThread(new TransmittableThreadLocal<>(), false); + final Duration dr = Duration.ofMillis(ms); + if (!dr.isZero()) { + final Clock clock = ThreadNow.TweakClock.current(true); + ThreadNow.TweakClock.initDefault(Clock.offset(clock, dr)); + } } } - @Autowired - @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") - public void autowireLogbackTweak(SilencerTweakProp prop, - LoggingSystem loggingSystem, - LoggerGroups loggerGroups, - @Value("${debug:false}") boolean debug, - @Value("${trace:false}") boolean trace - ) { - log.info("SilencerCurse spring-auto autowireLogbackTweak, init TtlMDC"); - TtlMDCAdapter.initMdc();// init as early as possible + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + public static class LogbackWired { + @Autowired + @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection") + public void auto(SilencerTweakProp prop, + LoggingSystem loggingSystem, + LoggerGroups loggerGroups, + @Value("${debug:false}") boolean debug, + @Value("${trace:false}") boolean trace + ) { + log.info("SilencerCurse spring-auto autowireLogbackTweak, init TtlMDC"); + TtlMDCAdapter.initMdc();// init as early as possible - if (prop.isMdcThreshold()) { - log.info("SilencerCurse spring-conf autowireLogbackTweak WingsMdcThresholdFilter"); - LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); - lc.getTurboFilterList().add(0, TweakLogger.MdcThresholdFilter); - } - // init as late as possible - final LogLevel core; - if (debug) { - core = LogLevel.DEBUG; + if (prop.isMdcThreshold()) { + log.info("SilencerCurse spring-conf autowireLogbackTweak WingsMdcThresholdFilter"); + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); + lc.getTurboFilterList().add(0, TweakLogger.MdcThresholdFilter); + } + // init as late as possible + final LogLevel core; + if (debug) { + core = LogLevel.DEBUG; + } + else if (trace) { + core = LogLevel.TRACE; + } + else { + core = null; + } + log.info("SilencerCurse spring-conf autowireLogbackTweak TweakLogger, coreLevel=" + core); + TweakLogger.initGlobal(loggingSystem, loggerGroups, core); } - else if (trace) { - core = LogLevel.TRACE; - } - else { - core = null; + } + + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + public static class StackWired { + @Autowired + public void auto(SilencerTweakProp prop) throws ThreadLocalAttention { + log.info("SilencerCurse spring-auto initCodeExceptionTweak with TransmittableThreadLocal, stack=" + prop.isCodeStack()); + CodeException.TweakStack.initThread(new TransmittableThreadLocal<>(), false); + CodeException.TweakStack.initDefault(prop::isCodeStack); } - log.info("SilencerCurse spring-conf autowireLogbackTweak TweakLogger, coreLevel=" + core); - TweakLogger.initGlobal(loggingSystem, loggerGroups, core); } } diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java index 0a86d3e34..d48786146 100644 --- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java +++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java @@ -1,26 +1,25 @@ package pro.fessional.wings.silencer.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Import; import pro.fessional.wings.silencer.spring.bean.SilencerAutoLogConfiguration; import pro.fessional.wings.silencer.spring.bean.SilencerEncryptConfiguration; import pro.fessional.wings.silencer.spring.bean.SilencerInspectConfiguration; -import pro.fessional.wings.silencer.spring.bean.SilencerRuntimeConfiguration; +import pro.fessional.wings.silencer.spring.bean.SilencerModeWiredConfiguration; import pro.fessional.wings.silencer.spring.bean.SilencerTweakConfiguration; -import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** * @author trydofor * @since 2019-07-11 */ @AutoConfiguration -@ConditionalOnProperty(name = SilencerEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration({ +@ConditionalWingsEnabled +@Import({ SilencerAutoLogConfiguration.class, SilencerEncryptConfiguration.class, SilencerInspectConfiguration.class, - SilencerRuntimeConfiguration.class, + SilencerModeWiredConfiguration.class, SilencerTweakConfiguration.class, }) public class SilencerCurseAutoConfiguration { diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerInspectProp.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerInspectProp.java deleted file mode 100644 index 39e636a89..000000000 --- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerInspectProp.java +++ /dev/null @@ -1,27 +0,0 @@ -package pro.fessional.wings.silencer.spring.prop; - -import lombok.Data; -import org.springframework.boot.context.properties.ConfigurationProperties; - -/** - * Inspect and audit the Application - * - * @author trydofor - * @see #Key - * @since 2021-02-14 - */ -@Data -@ConfigurationProperties(SilencerInspectProp.Key) -public class SilencerInspectProp { - - public static final String Key = "wings.silencer.inspect"; - - /** - * Whether to audit the file and cascading relationship of properties key/value - * - * @see #Key$properties - */ - private boolean properties = false; - public static final String Key$properties = Key + ".properties"; - -} diff --git a/wings/silencer-curse/src/main/resources/wings-conf/wings-inspect-79.properties b/wings/silencer-curse/src/main/resources/wings-conf/wings-inspect-79.properties deleted file mode 100644 index 86efd5241..000000000 --- a/wings/silencer-curse/src/main/resources/wings-conf/wings-inspect-79.properties +++ /dev/null @@ -1,4 +0,0 @@ -## Inspect and audit the Application - -## Whether to audit the file and cascading relationship of properties key/value, default false -wings.silencer.inspect.properties=false diff --git a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/SpringOrderConfiguration.java b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/SpringOrderConfiguration.java index 6cd4c3b1b..51d2614bb 100644 --- a/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/SpringOrderConfiguration.java +++ b/wings/silencer-curse/src/test/java/pro/fessional/wings/silencer/app/conf/SpringOrderConfiguration.java @@ -39,7 +39,7 @@ public class SpringOrderConfiguration implements InitializingBean { private static final Log log = LogFactory.getLog(SpringOrderConfiguration.class); public SpringOrderConfiguration(SilencerEnabledProp prop) { - log.info(">>>>> constructor can inject parameter AutoLog=" + prop.isAutoLog()); + log.info(">>>>> constructor can inject parameter Autoconf=" + prop.isAutoconf()); } @@ -50,8 +50,8 @@ public CollectionInjectTest.Dto dto2() { @Bean public CommandLineRunner testBean1(SilencerEnabledProp prop) { - log.info(">>>>> testBean1 can inject parameter AutoLog=" + prop.isAutoLog()); - return ignored -> log.info(">>>>> CommandLineRunner1 " + prop.isAutoLog()); + log.info(">>>>> testBean1 can inject parameter autoconf=" + prop.isAutoconf()); + return ignored -> log.info(">>>>> CommandLineRunner1 " + prop.isAutoconf()); } @PostConstruct @@ -61,7 +61,7 @@ public void postConstruct1() { @Autowired public void testAutowired1(SilencerEnabledProp prop) { - log.info(">>>>> testAutowired1 can inject parameter AutoLog=" + prop.isAutoLog()); + log.info(">>>>> testAutowired1 can inject parameter autoconf=" + prop.isAutoconf()); } @PostConstruct @@ -71,8 +71,8 @@ public void postConstruct2() { @Bean public CommandLineRunner testBean2(SilencerEnabledProp prop) { - log.info(">>>>> testBean2 AutoLog=" + prop.isAutoLog()); - return ignored -> log.info(">>>>> CommandLineRunner2 AutoLog=" + prop.isAutoLog()); + log.info(">>>>> testBean2 autoconf=" + prop.isAutoconf()); + return ignored -> log.info(">>>>> CommandLineRunner2 autoconf=" + prop.isAutoconf()); } @EventListener diff --git a/wings/silencer-curse/src/test/resources/application.properties b/wings/silencer-curse/src/test/resources/application.properties index d37b0c7fd..3e1e5096a 100644 --- a/wings/silencer-curse/src/test/resources/application.properties +++ b/wings/silencer-curse/src/test/resources/application.properties @@ -1,3 +1,3 @@ spring.application.name=curse debug=true -#spring.wings.silencer.enabled.autoconf=false \ No newline at end of file +#spring.wings.enabled.silencer.autoconf=false \ No newline at end of file diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/CombinableMessageSource.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/CombinableMessageSource.java index 137b41c98..9dd969245 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/CombinableMessageSource.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/CombinableMessageSource.java @@ -1,11 +1,11 @@ package pro.fessional.wings.silencer.message; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.springframework.context.HierarchicalMessageSource; import org.springframework.context.MessageSource; import org.springframework.context.support.AbstractMessageSource; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.springframework.util.Assert; import java.text.MessageFormat; @@ -13,7 +13,6 @@ import java.util.Comparator; import java.util.Locale; import java.util.Map; -import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; /** @@ -59,16 +58,6 @@ public void removeMessage(String code, Locale locale) { } } - private > void remove(Map map, String code, Locale locale) { - Map mapStr = map.get(code); - if (mapStr != null) { - mapStr.remove(locale); - if (mapStr.isEmpty()) { - map.remove(code); - } - } - } - public void addMessage(String code, Locale locale, String msg) { Assert.notNull(code, "Code must not be null"); Assert.notNull(locale, "Locale must not be null"); @@ -85,14 +74,15 @@ public void addMessage(String code, Locale locale, String msg) { } } - public void addMessages(Map messages, Locale locale) { + public void addMessage(Map messages, Locale locale) { Assert.notNull(messages, "Messages Map must not be null"); - messages.forEach((code, msg) -> addMessage(code, locale, msg)); - } - - public void addMessages(Properties messages, Locale locale) { - Assert.notNull(messages, "Properties must not be null"); - messages.forEach((code, msg) -> addMessage(code.toString(), locale, msg.toString())); + for (Map.Entry en : messages.entrySet()) { + Object key = en.getKey(); + Object value = en.getValue(); + if (key != null && value != null) { + addMessage(key.toString(), locale, value.toString()); + } + } } @Override @@ -115,7 +105,7 @@ public void setParentMessageSource(@Nullable MessageSource parent) { * @param messageSource other messageSource * @param order order Integer#MIN_VALUE means remove */ - public void addMessages(HierarchicalMessageSource messageSource, int order) { + public void addMessage(HierarchicalMessageSource messageSource, int order) { Assert.notNull(messageSource, "messageSource must not be null"); synchronized (orderedBrotherSources) { final int size = orderedBrotherSources.size(); @@ -148,18 +138,21 @@ public void addMessages(HierarchicalMessageSource messageSource, int order) { * * @param messageSource to be removed */ - public void removeMessages(HierarchicalMessageSource messageSource) { - addMessages(messageSource, Integer.MIN_VALUE); + public void removeMessage(HierarchicalMessageSource messageSource) { + addMessage(messageSource, Integer.MIN_VALUE); } - private static class OrderedMessageSource { - private OrderedMessageSource(HierarchicalMessageSource source, int order) { - this.order = order; - this.source = source; + private > void remove(Map map, String code, Locale locale) { + Map mapStr = map.get(code); + if (mapStr != null) { + mapStr.remove(locale); + if (mapStr.isEmpty()) { + map.remove(code); + } } + } - private final int order; - private final HierarchicalMessageSource source; + private record OrderedMessageSource(HierarchicalMessageSource source, int order) { } } diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/MessageSourceHelper.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/MessageSourceHelper.java new file mode 100644 index 000000000..2a7e054de --- /dev/null +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/MessageSourceHelper.java @@ -0,0 +1,44 @@ +package pro.fessional.wings.silencer.message; + +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.springframework.context.HierarchicalMessageSource; +import org.springframework.context.MessageSource; + +/** + * @author trydofor + * @since 2023-11-24 + */ +public class MessageSourceHelper { + + private static MessageSource messageSource; + private static CombinableMessageSource combinableMessageSource; + + protected MessageSourceHelper(@NotNull MessageSource primary) { + + if (primary instanceof HierarchicalMessageSource hierarchy) { + CombinableMessageSource combinable = new CombinableMessageSource(); + MessageSource parent = hierarchy.getParentMessageSource(); + if (parent != null) { + combinable.setParentMessageSource(parent); + } + hierarchy.setParentMessageSource(combinable); + combinableMessageSource = combinable; + } + + messageSource = primary; + } + + + @Contract("true->!null") + public static MessageSource getMessageSource(boolean nonnull) { + if (nonnull && messageSource == null) throw new IllegalStateException("init before using"); + return messageSource; + } + + @Contract("true->!null") + public static CombinableMessageSource getCombinableMessageSource(boolean nonnull) { + if (nonnull && combinableMessageSource == null) throw new IllegalStateException("init before using"); + return combinableMessageSource; + } +} diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/runner/ApplicationInspectRunner.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/runner/ApplicationInspectRunner.java index 1a3927b4c..1a62f4e1f 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/runner/ApplicationInspectRunner.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/runner/ApplicationInspectRunner.java @@ -1,7 +1,6 @@ package pro.fessional.wings.silencer.runner; import lombok.Data; -import lombok.Getter; import org.springframework.beans.factory.BeanNameAware; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; @@ -15,7 +14,7 @@ */ @Data public class ApplicationInspectRunner implements Ordered, BeanNameAware { - @Getter + private final int order; private final ApplicationRunner runner; diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerConfiguration.java new file mode 100644 index 000000000..2add86da8 --- /dev/null +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerConfiguration.java @@ -0,0 +1,85 @@ +package pro.fessional.wings.silencer.spring.bean; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.ApplicationContext; +import org.springframework.context.MessageSource; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.Ordered; +import pro.fessional.wings.silencer.message.MessageSourceHelper; +import pro.fessional.wings.silencer.runner.ApplicationInspectRunner; +import pro.fessional.wings.silencer.runner.ApplicationRunnerOrdered; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.silencer.spring.prop.SilencerI18nProp; +import pro.fessional.wings.silencer.spring.prop.SilencerScannerProp; + +import java.util.Map; + +/** + * @author trydofor + * @since 2019-06-24 + */ +@Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled +@EnableConfigurationProperties({ + SilencerI18nProp.class, + SilencerScannerProp.class, +}) +public class SilencerConfiguration { + + private static final Log log = LogFactory.getLog(SilencerConfiguration.class); + + /** + * @link Internationalization + * @see org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration + */ + + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + public static class MessageSourceHelperWired { + @Autowired + public void auto(MessageSource messageSource) { + new MessageSourceHelper(messageSource) {}; + + if (MessageSourceHelper.getCombinableMessageSource(false) != null) { + log.info("Silencer spring-auto MessageSourceHelper parent to CombinableMessageSource"); + } + else { + log.info("Silencer spring-auto MessageSourceHelper skip CombinableMessageSource"); + } + } + } + + /** + * applicationRunner are executed before commandLineRunner in SpringApplication#callRunners + * + * @link Application Events and Listeners + */ + @Bean + @ConditionalWingsEnabled + public ApplicationRunnerOrdered applicationInspectRunner(ApplicationContext context) { + log.info("Silencer spring-runs applicationInspectRunner"); + return new ApplicationRunnerOrdered(Ordered.LOWEST_PRECEDENCE, args -> { + final Map beans = context.getBeansOfType(ApplicationInspectRunner.class); + if (beans.isEmpty()) { + log.info("===>>> Silencer applicationInspectRunner empty"); + return; + } + log.info("===>>> Silencer applicationInspectRunner size=" + beans.size()); + for (Map.Entry en : beans.entrySet()) { + final String name = en.getKey(); + log.info(">>> inspect=" + name); + try { + en.getValue().run(args); + } + catch (Exception e) { + throw new RuntimeException(e); + } + } + log.info("===<<< Silencer applicationInspectRunner"); + }); + } +} diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java deleted file mode 100644 index d5a6f2dd4..000000000 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerMessageConfiguration.java +++ /dev/null @@ -1,46 +0,0 @@ -package pro.fessional.wings.silencer.spring.bean; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.HierarchicalMessageSource; -import org.springframework.context.MessageSource; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.silencer.message.CombinableMessageSource; -import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp; - -/** - * @author trydofor - * @link Internationalization - * @see org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration - * @since 2019-06-24 - */ -@Configuration(proxyBeanMethods = false) -@ConditionalOnClass(MessageSource.class) -@ConditionalOnProperty(name = SilencerEnabledProp.Key$message, havingValue = "true") -public class SilencerMessageConfiguration { - - private static final Log log = LogFactory.getLog(SilencerMessageConfiguration.class); - - @Bean - public CombinableMessageSource combinableMessageSource(MessageSource messageSource) { - log.info("Silencer spring-bean combinableMessageSource"); - CombinableMessageSource combinable = new CombinableMessageSource(); - if (messageSource instanceof HierarchicalMessageSource hierarchy) { - MessageSource parent = hierarchy.getParentMessageSource(); - if (parent != null) { - log.info("Silencer set parent for CombinableMessageSource"); - combinable.setParentMessageSource(parent); - } - log.info("Silencer change messageSource's parent to CombinableMessageSource"); - hierarchy.setParentMessageSource(combinable); - } - else { - log.info("Silencer skip non HierarchicalMessageSource for CombinableMessageSource"); - } - - return combinable; - } -} diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java index d7bcd5929..e5acf5a5f 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerRunnerConfiguration.java @@ -5,20 +5,12 @@ import org.springframework.boot.ApplicationArguments; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.boot.context.event.ApplicationStartedEvent; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.event.EventListener; -import org.springframework.core.Ordered; -import pro.fessional.wings.silencer.runner.ApplicationInspectRunner; import pro.fessional.wings.silencer.runner.ApplicationReadyEventRunner; -import pro.fessional.wings.silencer.runner.ApplicationRunnerOrdered; import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner; -import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp; -import pro.fessional.wings.silencer.spring.prop.SilencerI18nProp; -import pro.fessional.wings.silencer.spring.prop.SilencerScannerProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import java.util.Map; @@ -30,74 +22,54 @@ * @since 2023-02-06 */ @Configuration(proxyBeanMethods = false) -@EnableConfigurationProperties({ - SilencerEnabledProp.class, - SilencerI18nProp.class, - SilencerScannerProp.class, -}) +@ConditionalWingsEnabled public class SilencerRunnerConfiguration { private static final Log log = LogFactory.getLog(SilencerRunnerConfiguration.class); - @EventListener - public void applicationStartedEventRunner(ApplicationStartedEvent startedEvent) { - final ConfigurableApplicationContext context = startedEvent.getApplicationContext(); - final Map beans = context.getBeansOfType(ApplicationStartedEventRunner.class); - if (beans.isEmpty()) { - log.info("===>>> Silencer applicationStartedEventRunner empty"); - return; - } - - log.info("===>>> Silencer applicationStartedEventRunner size=" + beans.size()); - final ApplicationArguments args = context.getBean(ApplicationArguments.class); - for (Map.Entry en : beans.entrySet()) { - log.info(">>> started=" + en.getKey()); - try { - en.getValue().run(args); - } - catch (Exception e) { - throw new RuntimeException(e); + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + public static class ReadyEvent { + @EventListener + public void on(ApplicationReadyEvent event) { + final ConfigurableApplicationContext context = event.getApplicationContext(); + final Map beans = context.getBeansOfType(ApplicationReadyEventRunner.class); + if (beans.isEmpty()) { + log.info("===>>> Silencer applicationReadyEventRunner empty"); + return; } - } - log.info("===<<< Silencer applicationStartedEventRunner"); - } - - @EventListener - public void applicationReadyEventRunner(ApplicationReadyEvent startedEvent) { - final ConfigurableApplicationContext context = startedEvent.getApplicationContext(); - final Map beans = context.getBeansOfType(ApplicationReadyEventRunner.class); - if (beans.isEmpty()) { - log.info("===>>> Silencer applicationReadyEventRunner empty"); - return; - } - log.info("===>>> Silencer applicationReadyEventRunner size=" + beans.size()); - final ApplicationArguments args = context.getBean(ApplicationArguments.class); - for (Map.Entry en : beans.entrySet()) { - log.info(">>> ready=" + en.getKey()); - try { - en.getValue().run(args); - } - catch (Exception e) { - throw new RuntimeException(e); + log.info("===>>> Silencer applicationReadyEventRunner size=" + beans.size()); + final ApplicationArguments args = context.getBean(ApplicationArguments.class); + for (Map.Entry en : beans.entrySet()) { + log.info(">>> ready=" + en.getKey()); + try { + en.getValue().run(args); + } + catch (Exception e) { + throw new RuntimeException(e); + } } + log.info("===<<< Silencer applicationReadyEventRunner"); } - log.info("===<<< Silencer applicationReadyEventRunner"); } - @Bean - public ApplicationRunnerOrdered applicationInspectRunner(ApplicationContext context) { - log.info("Silencer spring-runs applicationInspectRunner"); - return new ApplicationRunnerOrdered(Ordered.LOWEST_PRECEDENCE, args -> { - final Map beans = context.getBeansOfType(ApplicationInspectRunner.class); + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + public static class StartedEvent { + @EventListener + public void on(ApplicationStartedEvent startedEvent) { + final ConfigurableApplicationContext context = startedEvent.getApplicationContext(); + final Map beans = context.getBeansOfType(ApplicationStartedEventRunner.class); if (beans.isEmpty()) { - log.info("===>>> Silencer applicationInspectRunner empty"); + log.info("===>>> Silencer applicationStartedEventRunner empty"); return; } - log.info("===>>> Silencer applicationInspectRunner size=" + beans.size()); - for (Map.Entry en : beans.entrySet()) { - final String name = en.getKey(); - log.info(">>> inspect=" + name); + + log.info("===>>> Silencer applicationStartedEventRunner size=" + beans.size()); + final ApplicationArguments args = context.getBean(ApplicationArguments.class); + for (Map.Entry en : beans.entrySet()) { + log.info(">>> started=" + en.getKey()); try { en.getValue().run(args); } @@ -105,7 +77,7 @@ public ApplicationRunnerOrdered applicationInspectRunner(ApplicationContext cont throw new RuntimeException(e); } } - log.info("===<<< Silencer applicationInspectRunner"); - }); + log.info("===<<< Silencer applicationStartedEventRunner"); + } } } diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java new file mode 100644 index 000000000..911b648a6 --- /dev/null +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java @@ -0,0 +1,59 @@ +package pro.fessional.wings.silencer.spring.boot; + +import org.springframework.context.annotation.Conditional; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * use `@Conditional(WingsEnabledCondition.class)` to dynamically + * enable or disable `@Configuration`, `@Bean` and `@Component` by properties. + *

+ * true only if `this && and1 && and2 && !not1 && !not2` + * + * @author trydofor + * @see WingsEnabledCondition + * @since 2023-11-17 + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.METHOD}) +@Documented +@Conditional(WingsEnabledCondition.class) +public @interface ConditionalWingsEnabled { + + /** + * A prefix that should be applied to the property. + * inherit from the EnclosingClass non-empty prefix + */ + String prefix() default ""; + + /** + * without prefix, absolute key of properties + */ + String absKey() default ""; + + /** + * with prefix, customize key instead of ClassName-qualified + */ + String key() default ""; + + /** + * default value, if no property found + */ + boolean value() default true; + + /** + * narrow this and others properties (or annotation). + * true only if `this && and1 && and2 && !not1 && !not2` + */ + Class[] and() default {}; + + /** + * narrow this and not others properties (or annotation). + * true only if `this && and1 && and2 && !not1 && !not2` + */ + Class[] not() default {}; +} diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java index 8747235fd..6a8007383 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java @@ -64,7 +64,7 @@ public class WingsAutoConfigProcessor implements EnvironmentPostProcessor { private static final DeferredLog log = DeferredLogFactory.getLog(WingsAutoConfigProcessor.class); - public static final String WINGS_AUTO = "wings-auto-config.cnf"; + public static final String WINGS_AUTO = "wings-auto-config*.cnf"; public static final int NAKED_SEQ = 70; public static final String WINGS_I18N = "wings-i18n/**/*.properties"; @@ -450,7 +450,36 @@ else if (path.startsWith("file:") || path.startsWith("classpath*:")) { } private AutoConf processWingsAuto(PathMatchingResourcePatternResolver resolver) { - final Resource resource = resolver.getResource(WINGS_AUTO); + Resource resource = null; + try { + final Resource[] rss = resolver.getResources("classpath*:/" + WINGS_AUTO); + int len = rss.length; + if (len == 1) { + resource = rss[0]; + } + else if (len > 1) { + Arrays.sort(rss, (o1, o2) -> { + // 1. readable > unreadable + if (!o1.isReadable()) return -1; + if (!o2.isReadable()) return 1; + String f1 = o1.getFilename(); + if (f1 == null) return -1; + String f2 = o2.getFilename(); + if (f2 == null) return 1; + return f1.compareTo(f2); + }); + // take the last + resource = rss[len - 1]; + } + } + catch (IOException e) { + log.warn("failed to get " + WINGS_AUTO + " from classpath*:/", e); + } + + if (resource == null) { + resource = resolver.getResource(WINGS_AUTO); + } + AutoConf autoConf = new AutoConf(); if (resource.isReadable()) { try { diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java new file mode 100644 index 000000000..1104207ac --- /dev/null +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java @@ -0,0 +1,252 @@ +package pro.fessional.wings.silencer.spring.boot; + +import lombok.SneakyThrows; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.springframework.boot.autoconfigure.condition.ConditionMessage; +import org.springframework.boot.autoconfigure.condition.ConditionOutcome; +import org.springframework.boot.autoconfigure.condition.SpringBootCondition; +import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.core.type.AnnotatedTypeMetadata; +import org.springframework.core.type.ClassMetadata; +import org.springframework.core.type.MethodMetadata; +import org.springframework.util.StringUtils; + +import java.util.Map; + +/** + *

+ * enable or disable `@Configuration` or `@Bean` by dynamic properties
+ *
+ * key = Prefix + "." + ClassName + ("." + beanMethod)
+ * value = true/false
+ *
+ * Prefix = ConditionalWingsEnabled#Prefix, eg. "spring.wings.enabled"
+ * ClassName = ConditionalWingsEnabled class, eg. "pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition"
+ * Method = ConditionalWingsEnabled method, eg. "beanMethod"
+ *
+ * #example properties:
+ *
+ * ## @ConditionalWingsEnabled(prefix="spring.catty.enabled")
+ * ## disable @Bean catBean in WingsEnabledCatConfiguration
+ * spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.catBean=false
+ * ## disable InnerCatConfiguration and its Bean
+ * spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration$InnerCatConfiguration=false
+ *
+ * ## @Conditional(WingsEnabledCondition.class) or @ConditionalWingsEnabled
+ * ## disable @Bean dogBean in WingsEnabledDogConfiguration
+ * spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.dogBean=false
+ * ## disable InnerDogConfiguration and its Bean
+ * spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration$InnerDogConfiguration=false
+ * 
+ * + * @author trydofor + * @see ConditionalWingsEnabled + * @since 2023-11-17 + */ +@Order(Ordered.HIGHEST_PRECEDENCE + 70) +public class WingsEnabledCondition extends SpringBootCondition { + + /** + * the default prefix + */ + public static final String Prefix = "spring.wings.enabled"; + + @Override + public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { + return conditionOutcome(context, metadata); + } + + private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, @NotNull AnnotatedTypeMetadata metadata) { + + var attrs = metadata.getAnnotationAttributes(ConditionalWingsEnabled.class.getName()); + if (attrs == null) { + // without ConditionalWingsEnabled, in Conditional(WingsEnabledCondition.class) + return thisConditionOutcome(context, metadata, null); + } + + final ConditionOutcome outcome = thisConditionOutcome(context, metadata, attrs); + if (outcome.isMatch()) { + if (attrs.get("and") instanceof Class[] ands) { + for (Class clz : ands) { + final ConditionOutcome and = conditionOutcome(context, clz); + if (!and.isMatch()) { + return and; + } + } + } + + if (attrs.get("not") instanceof Class[] nots) { + for (Class clz : nots) { + final ConditionOutcome not = conditionOutcome(context, clz); + if (not.isMatch()) { + return ConditionOutcome.noMatch(not.getConditionMessage()); + } + } + } + } + + return outcome; + } + + + private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, Class meta) { + + var anno = meta.getAnnotation(ConditionalWingsEnabled.class); + if (anno == null) { + // without ConditionalWingsEnabled, in Conditional(WingsEnabledCondition.class) + return thisConditionOutcome(context, meta, null); + } + + final ConditionOutcome thisCondition = thisConditionOutcome(context, meta, anno); + if (thisCondition.isMatch()) { + + for (Class clz : anno.and()) { + final ConditionOutcome and = conditionOutcome(context, clz); + if (!and.isMatch()) { + return and; + } + } + + for (Class clz : anno.not()) { + final ConditionOutcome not = conditionOutcome(context, clz); + if (not.isMatch()) { + return ConditionOutcome.noMatch(not.getConditionMessage()); + } + } + + } + + return thisCondition; + } + + @NotNull + private ConditionOutcome thisConditionOutcome(@NotNull ConditionContext context, @NotNull AnnotatedTypeMetadata metadata, @Nullable Map attrs) { + final String propKey; + if (attrs != null && attrs.get("absKey") instanceof String abs && !abs.isBlank()) { + propKey = abs; + } + else { + String pre = null; + if (attrs != null && attrs.get("prefix") instanceof String p && !p.isBlank()) { + pre = p; + } + + String key = null; + if (attrs != null && attrs.get("key") instanceof String k && !k.isBlank()) { + key = k; + } + + // on @Component class + if (metadata instanceof ClassMetadata conf) { + if (pre == null) pre = buildEnclosingPrefix(conf.getEnclosingClassName()); + if (key == null) key = conf.getClassName(); + } + // on @Bean method + else if (metadata instanceof MethodMetadata bean) { + if (pre == null) pre = buildEnclosingPrefix(bean.getDeclaringClassName()); + if (key == null) key = bean.getDeclaringClassName() + "." + bean.getMethodName(); + } + else { + throw new IllegalArgumentException("should use on @Bean or @Configuration"); + } + + propKey = pre + "." + key; + } + + var result = conditionOutcome(context, propKey); + if (result != null) return result; + + boolean falsy = attrs != null && attrs.get("value") instanceof Boolean value && !value; + return conditionOutcome(falsy); + } + + @NotNull + private ConditionOutcome thisConditionOutcome(@NotNull ConditionContext context, @NotNull Class meta, @Nullable ConditionalWingsEnabled anno) { + final String propKey; + if (anno != null && StringUtils.hasText(anno.absKey())) { + propKey = anno.absKey(); + } + else { + final String pre; + if (anno != null && StringUtils.hasText(anno.prefix())) { + pre = anno.prefix(); + } + else { + pre = buildEnclosingPrefix(meta.getEnclosingClass()); + } + + if (anno != null && StringUtils.hasText(anno.key())) { + propKey = pre + "." + anno.key(); + } + else { + propKey = pre + "." + meta.getName(); + } + } + + var result = conditionOutcome(context, propKey); + if (result != null) return result; + + boolean falsy = anno != null && !anno.value(); + return conditionOutcome(falsy); + } + + @SneakyThrows + @NotNull + private String buildEnclosingPrefix(@Nullable String ecn) { + if (ecn != null) { + Class clz = Class.forName(ecn); + return buildEnclosingPrefix(clz); + } + + return Prefix; + } + + @NotNull + private String buildEnclosingPrefix(@Nullable Class clz) { + while (clz != null) { + final var ann = clz.getAnnotation(ConditionalWingsEnabled.class); + if (ann != null && StringUtils.hasText(ann.prefix())) { + return ann.prefix(); + } + clz = clz.getEnclosingClass(); + } + + return Prefix; + } + + @Nullable + private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, @NotNull String key) { + final String value = context.getEnvironment().getProperty(key); + + if ("false".equalsIgnoreCase(value)) { + return ConditionOutcome.noMatch(ConditionMessage + .forCondition(ConditionalWingsEnabled.class) + .found(key) + .items(value)); + } + + if ("true".equalsIgnoreCase(value)) { + return ConditionOutcome.match(ConditionMessage + .forCondition(ConditionalWingsEnabled.class) + .found(key) + .items(value)); + } + + return null; + } + + @NotNull + private ConditionOutcome conditionOutcome(boolean falsy) { + return falsy + ? ConditionOutcome.noMatch(ConditionMessage + .forCondition(ConditionalWingsEnabled.class) + .found("value") + .items("false")) + : ConditionOutcome.match(ConditionMessage + .forCondition(ConditionalWingsEnabled.class) + .because("default true")); + } +} diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java index e0342df6a..2dad171c8 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java @@ -1,12 +1,11 @@ package pro.fessional.wings.silencer.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.AutoConfigureOrder; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.core.Ordered; -import pro.fessional.wings.silencer.spring.bean.SilencerMessageConfiguration; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Import; +import pro.fessional.wings.silencer.spring.bean.SilencerConfiguration; import pro.fessional.wings.silencer.spring.bean.SilencerRunnerConfiguration; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp; /** @@ -14,10 +13,10 @@ * @since 2019-07-11 */ @AutoConfiguration -@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE) -@ConditionalOnProperty(name = SilencerEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration({ - SilencerMessageConfiguration.class, +@ConditionalWingsEnabled +@EnableConfigurationProperties(SilencerEnabledProp.class) +@Import({ + SilencerConfiguration.class, SilencerRunnerConfiguration.class, }) public class SilencerAutoConfiguration { diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerEnabledProp.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerEnabledProp.java index c127683a5..b8c274dc0 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerEnabledProp.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerEnabledProp.java @@ -2,6 +2,7 @@ import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; +import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition; /** * The default switch for toggling the Silencer feature, as follows: @@ -15,7 +16,7 @@ @ConfigurationProperties(SilencerEnabledProp.Key) public class SilencerEnabledProp { - public static final String Key = "spring.wings.silencer.enabled"; + public static final String Key = WingsEnabledCondition.Prefix + ".silencer"; /** * Whether to automatically configure, default true @@ -33,14 +34,6 @@ public class SilencerEnabledProp { private boolean verbose = false; public static final String Key$verbose = Key + ".verbose"; - /** - * Whether to automatically load /wings-i18n/ messages, default true - * - * @see #Key$message - */ - private boolean message = true; - public static final String Key$message = Key + ".message"; - /** * Whether to automatically load all classpaths ** /spring/bean/**, default true * @@ -48,20 +41,4 @@ public class SilencerEnabledProp { */ private boolean scanner = true; public static final String Key$scanner = Key + ".scanner"; - - /** - * Whether to automatically switch the console log level when a log file is available, default true - * - * @see #Key$autoLog - */ - private boolean autoLog = true; - public static final String Key$autoLog = Key + ".autolog"; - - /** - * Whether to automatically config encrypt, default true - * - * @see #Key$encrypt - */ - private boolean encrypt = true; - public static final String Key$encrypt = Key + ".encrypt"; } diff --git a/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties index ac219f4f2..a7603eb4f 100644 --- a/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties +++ b/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties @@ -1,19 +1,10 @@ ## The default switch for toggling the Silencer feature, as follows ## Whether to automatically configure, default true -spring.wings.silencer.enabled.autoconf=true +spring.wings.enabled.silencer.autoconf=true ## Whether to display the conditional information of wings, default false -spring.wings.silencer.enabled.verbose=false - -## Whether to automatically load /wings-i18n/ messages, default true -spring.wings.silencer.enabled.message=true +spring.wings.enabled.silencer.verbose=false ## Whether to automatically load all classpaths `**/spring/bean/**` (before other beans), default false -spring.wings.silencer.enabled.scanner=false - -## Whether to automatically switch the console log level when a log file is available, default true -spring.wings.silencer.enabled.autolog=true - -## Whether to automatically config encrypt, default true -spring.wings.silencer.enabled.encrypt=true +spring.wings.enabled.silencer.scanner=false \ No newline at end of file diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java new file mode 100644 index 000000000..5bd394bfa --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java @@ -0,0 +1,129 @@ +package pro.fessional.wings.silencer.app.bean; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.event.SpringApplicationEvent; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.event.EventListener; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; + +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author trydofor + * @since 2023-11-17 + */ +@ConditionalWingsEnabled(prefix = "spring.catty.enabled") +@Configuration(proxyBeanMethods = false) +public class WingsEnabledCatConfiguration { + + private static final Log log = LogFactory.getLog(WingsEnabledCatConfiguration.class); + public static final ConcurrentHashMap autowire = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap listener = new ConcurrentHashMap<>(); + + public WingsEnabledCatConfiguration() { + log.info(">>> init " + this); + autowire.put(this, false); + listener.put(this, 0); + } + + @Bean + @ConditionalWingsEnabled(key = "catBean") // inherit + public CatBean catBean() { + return new CatBean(); + } + + @EventListener + @ConditionalWingsEnabled // no effect + public void listener(SpringApplicationEvent ignore) { + log.info(">>> listener " + this); + listener.compute(this, (k, v) -> v == null ? 1 : v + 1); + } + + @Autowired + @ConditionalWingsEnabled // no effect + public void autowire(ApplicationContext ignore) { + log.info(">>> autowire " + this); + autowire.put(this, true); + } + + @Bean + @ConditionalWingsEnabled(and = InnerCatConfiguration.class) + public AndBean andBean() { + return new AndBean(); + } + + @Bean + @ConditionalWingsEnabled(not = InnerCatConfiguration.class) + public NotBean notBean() { + return new NotBean(); + } + + @Bean + @ConditionalWingsEnabled(absKey = "wings.cat.key-bean") + public KeyBean keyBean() { + return new KeyBean(); + } + + + @ConditionalWingsEnabled + @Configuration(proxyBeanMethods = false) + public static class InnerCatConfiguration { + + public InnerCatConfiguration() { + log.info(">>> init " + this); + autowire.put(this, false); + listener.put(this, 0); + } + + @EventListener + @ConditionalWingsEnabled // no effect + public void listener(SpringApplicationEvent ignore) { + log.info(">>> listener " + this); + listener.compute(this, (k, v) -> v == null ? 1 : v + 1); + } + + @Autowired + @ConditionalWingsEnabled // no effect + public void autowire(ApplicationContext ignore) { + log.info(">>> autowire " + this); + autowire.put(this, true); + } + + @Bean + @ConditionalWingsEnabled + public InnerCatBean innerCatBean() { + return new InnerCatBean(); + } + } + + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled(prefix = "spring.kitty.enabled") // no inherit + public static class ComponentScan { + public ComponentScan() { + log.info("Silencer spring-scan Component"); + } + } + + @Configuration(proxyBeanMethods = false) + public static class InnerDefault{ + } + + public static class CatBean { + } + + public static class InnerCatBean { + } + + public static class AndBean { + } + + public static class NotBean { + } + + public static class KeyBean { + } +} diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledDogConfiguration.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledDogConfiguration.java new file mode 100644 index 000000000..b5d193532 --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledDogConfiguration.java @@ -0,0 +1,90 @@ +package pro.fessional.wings.silencer.app.bean; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.event.SpringApplicationEvent; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.event.EventListener; +import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition; + +import java.util.concurrent.ConcurrentHashMap; + +/** + * @author trydofor + * @since 2023-11-17 + */ +@Conditional(WingsEnabledCondition.class) +@Configuration(proxyBeanMethods = false) +public class WingsEnabledDogConfiguration { + + private static final Log log = LogFactory.getLog(WingsEnabledDogConfiguration.class); + public static final ConcurrentHashMap autowire = new ConcurrentHashMap<>(); + public static final ConcurrentHashMap listener = new ConcurrentHashMap<>(); + + public WingsEnabledDogConfiguration() { + log.info(">>> init " + this); + autowire.put(this, false); + listener.put(this, 0); + } + + @Bean + @Conditional(WingsEnabledCondition.class) + public DogBean dogBean() { + return new DogBean(); + } + + @EventListener + @Conditional(WingsEnabledCondition.class) // no effect + public void listener(SpringApplicationEvent ignore) { + log.info(">>> listener " + this); + listener.compute(this, (k, v) -> v == null ? 1 : v + 1); + } + + @Autowired + @Conditional(WingsEnabledCondition.class) // no effect + public void autowire(ApplicationContext ignore) { + log.info(">>> autowire " + this); + autowire.put(this, true); + } + + @Conditional(WingsEnabledCondition.class) + @Configuration(proxyBeanMethods = false) + public static class InnerDogConfiguration { + + public InnerDogConfiguration() { + log.info(">>> init " + this); + autowire.put(this, false); + listener.put(this, 0); + } + + @EventListener + @Conditional(WingsEnabledCondition.class) // no effect + public void listener(SpringApplicationEvent ignore) { + log.info(">>> listener " + this); + listener.compute(this, (k, v) -> v == null ? 1 : v + 1); + } + + @Autowired + @Conditional(WingsEnabledCondition.class) // no effect + public void autowire(ApplicationContext ignore) { + log.info(">>> autowire " + this); + autowire.put(this, true); + } + + @Bean + @Conditional(WingsEnabledCondition.class) + public InnerDogBean innerDogBean() { + return new InnerDogBean(); + } + } + + public static class DogBean { + } + + public static class InnerDogBean { + } +} diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/service/ScanService.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/service/ScanService.java new file mode 100644 index 000000000..57b106a90 --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/service/ScanService.java @@ -0,0 +1,13 @@ +package pro.fessional.wings.silencer.app.service; + +import org.springframework.stereotype.Service; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; + +/** + * @author trydofor + * @since 2023-11-22 + */ +@Service +@ConditionalWingsEnabled +public class ScanService { +} diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledDefaultTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledDefaultTest.java new file mode 100644 index 000000000..828564fd9 --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledDefaultTest.java @@ -0,0 +1,80 @@ +package pro.fessional.wings.silencer.spring.boot; + +import io.qameta.allure.TmsLink; +import lombok.Setter; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration; +import pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration; +import pro.fessional.wings.silencer.app.service.ScanService; + +/** + * @author trydofor + * @since 2023-11-17 + */ +@SpringBootTest +@DirtiesContext +public class WingsEnabledDefaultTest { + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration wingsEnabledCatConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.CatBean catBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.InnerCatConfiguration innerCatConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.InnerCatBean innerCatBean; + + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration wingsEnabledDogConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.DogBean dogBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.InnerDogConfiguration innerDogConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.InnerDogBean innerDogBean; + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected ScanService scanService; + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.AndBean andBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.NotBean notBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.KeyBean keyBean; + + @Test + @TmsLink("C11027") + public void test() { + Assertions.assertNotNull(wingsEnabledCatConfiguration); + Assertions.assertNotNull(catBean); + Assertions.assertNotNull(innerCatConfiguration); + Assertions.assertNotNull(innerCatBean); + + Assertions.assertNotNull(wingsEnabledDogConfiguration); + Assertions.assertNotNull(dogBean); + Assertions.assertNotNull(innerDogConfiguration); + Assertions.assertNotNull(innerDogBean); + + Assertions.assertNotNull(scanService); + + Assertions.assertTrue(WingsEnabledCatConfiguration.autowire.get(wingsEnabledCatConfiguration)); + Assertions.assertTrue(WingsEnabledCatConfiguration.autowire.get(innerCatConfiguration)); + Assertions.assertTrue(WingsEnabledDogConfiguration.autowire.get(wingsEnabledDogConfiguration)); + Assertions.assertTrue(WingsEnabledDogConfiguration.autowire.get(innerDogConfiguration)); + + Assertions.assertTrue(WingsEnabledCatConfiguration.listener.get(wingsEnabledCatConfiguration) > 0); + Assertions.assertTrue(WingsEnabledCatConfiguration.listener.get(innerCatConfiguration) > 0); + Assertions.assertTrue(WingsEnabledDogConfiguration.listener.get(wingsEnabledDogConfiguration) > 0); + Assertions.assertTrue(WingsEnabledDogConfiguration.listener.get(innerDogConfiguration) > 0); + + Assertions.assertNotNull(andBean); + Assertions.assertNull(notBean); + Assertions.assertNotNull(keyBean); + } +} \ No newline at end of file diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java new file mode 100644 index 000000000..727dd571e --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java @@ -0,0 +1,94 @@ +package pro.fessional.wings.silencer.spring.boot; + +import io.qameta.allure.TmsLink; +import lombok.Setter; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration; +import pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration; +import pro.fessional.wings.silencer.app.service.ScanService; + +/** + * @author trydofor + * @since 2023-11-17 + */ +@SpringBootTest(properties = { + "spring.catty.enabled.catBean=false", + "spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.autowire=false", + "spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.listener=false", + "spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration$InnerCatConfiguration=false", + "spring.kitty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration$ComponentScan=false", + + "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.dogBean=false", + "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.autowire=false", + "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.listener=false", + "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration$InnerDogConfiguration=false", + "spring.wings.enabled.pro.fessional.wings.silencer.app.service.ScanService=false", + + "wings.cat.key-bean=false", +}) +@DirtiesContext +public class WingsEnabledFalseTest { + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration wingsEnabledCatConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.CatBean catBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.InnerCatConfiguration innerCatConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.InnerCatBean innerCatBean; + + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration wingsEnabledDogConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.DogBean dogBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.InnerDogConfiguration innerDogConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.InnerDogBean innerDogBean; + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected ScanService scanService; + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.AndBean andBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.NotBean notBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.KeyBean keyBean; + + @Test + @TmsLink("C11028") + public void test() { + Assertions.assertNotNull(wingsEnabledCatConfiguration); + Assertions.assertNull(catBean); + Assertions.assertNull(innerCatConfiguration); + Assertions.assertNull(innerCatBean); + + Assertions.assertNotNull(wingsEnabledDogConfiguration); + Assertions.assertNull(dogBean); + Assertions.assertNull(innerDogConfiguration); + Assertions.assertNull(innerDogBean); + + Assertions.assertNull(scanService); + + Assertions.assertTrue(WingsEnabledCatConfiguration.autowire.get(wingsEnabledCatConfiguration)); +// Assertions.assertTrue(WingsEnabledCatConfiguration.autowire.get(innerCatConfiguration)); + Assertions.assertTrue(WingsEnabledDogConfiguration.autowire.get(wingsEnabledDogConfiguration)); +// Assertions.assertTrue(WingsEnabledDogConfiguration.autowire.get(innerDogConfiguration)); + + Assertions.assertTrue(WingsEnabledCatConfiguration.listener.get(wingsEnabledCatConfiguration) > 0); +// Assertions.assertTrue(WingsEnabledCatConfiguration.listener.get(innerCatConfiguration) > 0); + Assertions.assertTrue(WingsEnabledDogConfiguration.listener.get(wingsEnabledDogConfiguration) > 0); +// Assertions.assertTrue(WingsEnabledDogConfiguration.listener.get(innerDogConfiguration) > 0); + + Assertions.assertNull(andBean); + Assertions.assertNotNull(notBean); + Assertions.assertNull(keyBean); + } +} \ No newline at end of file diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java new file mode 100644 index 000000000..298a1ac12 --- /dev/null +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java @@ -0,0 +1,60 @@ +package pro.fessional.wings.silencer.spring.boot; + +import io.qameta.allure.TmsLink; +import lombok.Setter; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.annotation.DirtiesContext; +import pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration; +import pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration; + +/** + * @author trydofor + * @since 2023-11-17 + */ +@SpringBootTest(properties = { + "spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration=false", + "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration=false", +}) +@DirtiesContext +public class WingsEnabledTopFalseTest { + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.InnerDefault innerDefault; + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration wingsEnabledCatConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.CatBean catBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.InnerCatConfiguration innerCatConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledCatConfiguration.InnerCatBean innerCatBean; + + + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration wingsEnabledDogConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.DogBean dogBean; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.InnerDogConfiguration innerDogConfiguration; + @Setter(onMethod_ = {@Autowired(required = false)}) + protected WingsEnabledDogConfiguration.InnerDogBean innerDogBean; + + @Test + @TmsLink("C11029") + public void test() { + Assertions.assertNull(wingsEnabledCatConfiguration); + Assertions.assertNull(catBean); + Assertions.assertNull(innerDefault); + Assertions.assertNull(innerCatConfiguration); + Assertions.assertNull(innerCatBean); + + Assertions.assertNull(wingsEnabledDogConfiguration); + Assertions.assertNull(dogBean); + Assertions.assertNull(innerDogConfiguration); + Assertions.assertNull(innerDogBean); + } +} \ No newline at end of file diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java index 079c83d1f..1b796cf49 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java @@ -14,7 +14,7 @@ * @since 2019-06-25 */ -@SpringBootTest(properties = {"spring.wings.silencer.enabled.autoconf=false"}) +@SpringBootTest(properties = {"spring.wings.enabled.silencer.autoconf=false"}) @ActiveProfiles("dev") public class WingsSilencerSpringTest { diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java index 44e00035f..637828d7d 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java @@ -16,7 +16,7 @@ * @since 2023-10-27 */ @SpringBootTest(properties = { - "spring.wings.silencer.enabled.scanner=true", + "spring.wings.enabled.silencer.scanner=true", "wings.silencer.scanner.bean=scanner/bean, /ti12/lgd /ti12/ar//", }) class WingsSpringBeanScannerTest { diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java index 63b0f9b26..47abebe54 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java @@ -7,28 +7,34 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.MessageSource; import org.springframework.context.support.StaticMessageSource; +import org.springframework.test.annotation.DirtiesContext; import pro.fessional.wings.silencer.message.CombinableMessageSource; +import pro.fessional.wings.silencer.message.MessageSourceHelper; import java.util.Locale; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; /** * @author trydofor * @since 2019-09-16 */ @SpringBootTest +@DirtiesContext public class CombinableMessageSourceTest { @Setter(onMethod_ = {@Autowired}) private MessageSource messageSource; - @Setter(onMethod_ = {@Autowired}) - private CombinableMessageSource combinableMessageSource; + @Test @TmsLink("C11010") public void combine() { + CombinableMessageSource combinableMessageSource = MessageSourceHelper.getCombinableMessageSource(true); + assertNotSame(messageSource, combinableMessageSource); + Object[] args = {}; String m1 = messageSource.getMessage("test.MyTest", args, Locale.CHINA); combinableMessageSource.addMessage("test.MyTest", Locale.CHINA, "啥都好用"); @@ -36,7 +42,7 @@ public void combine() { StaticMessageSource sms = new StaticMessageSource(); sms.addMessage("test.my-test", Locale.CHINA, "又一个测试"); - combinableMessageSource.addMessages(sms, 1); + combinableMessageSource.addMessage(sms, 1); String m3 = messageSource.getMessage("test.my-test", args, Locale.CHINA); assertEquals("test.MyTest", m1);// code diff --git a/wings/silencer/src/test/resources/application.properties b/wings/silencer/src/test/resources/application.properties index 15d4ad202..8be45a745 100644 --- a/wings/silencer/src/test/resources/application.properties +++ b/wings/silencer/src/test/resources/application.properties @@ -2,5 +2,5 @@ server.port=8081 spring.application.name=wings-silencer spring.application.name-empty=wings-silencer-empty debug=true -#spring.wings.silencer.enabled.scanner=true +#spring.wings.enabled.silencer.scanner=true logging.level.org.springframework=DEBUG \ No newline at end of file diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastCacheConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastConfigConfiguration.java similarity index 51% rename from wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastCacheConfiguration.java rename to wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastConfigConfiguration.java index 59dec4de4..d740a49ce 100644 --- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastCacheConfiguration.java +++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastConfigConfiguration.java @@ -1,41 +1,43 @@ package pro.fessional.wings.slardar.spring.bean; -import com.hazelcast.core.HazelcastInstance; -import com.hazelcast.spring.cache.HazelcastCacheManager; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.hazelcast.HazelcastConfigCustomizer; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.cache.hazelcast.WingsHazelcastCacheCustomizer; -import pro.fessional.wings.slardar.cache.hazelcast.WingsHazelcastCacheManager; import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp; -import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; - -import static pro.fessional.wings.slardar.cache.WingsCache.Manager; /** * @author trydofor * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = SlardarEnabledProp.Key$caching, havingValue = "true") +@ConditionalWingsEnabled @EnableConfigurationProperties(SlardarCacheProp.class) -public class HazelcastCacheConfiguration { +public class HazelcastConfigConfiguration { + + private static final Log log = LogFactory.getLog(HazelcastConfigConfiguration.class); - private static final Log log = LogFactory.getLog(HazelcastCacheConfiguration.class); + @Bean + @ConditionalWingsEnabled(false) + public HazelcastConfigCustomizer wingsHazelcastAloneCustomizer() { + log.info("SlardarHazelCaching spring-bean simulator hazelcastInstance standalone"); + return config -> { + config.setClusterName("standalone-" + System.identityHashCode(config)); + config.setProperty("hazelcast.shutdownhook.enabled", "false"); + var network = config.getNetworkConfig().getJoin(); + network.getTcpIpConfig().setEnabled(false); + network.getMulticastConfig().setEnabled(false); + }; + } @Bean + @ConditionalWingsEnabled public HazelcastConfigCustomizer wingsHazelcastCacheCustomizer(SlardarCacheProp conf) { log.info("SlardarHazelCaching spring-bean wingsHazelcastCacheCustomizer"); return new WingsHazelcastCacheCustomizer(conf); } - - @Bean(Manager.Server) - public HazelcastCacheManager hazelcastCacheManager(SlardarCacheProp conf, HazelcastInstance instance) { - log.info("SlardarHazelCaching spring-bean hazelcast as " + Manager.Server); - return new WingsHazelcastCacheManager(conf, instance); - } } diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastFlakeIdConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastFlakeIdConfiguration.java deleted file mode 100644 index fc056d13a..000000000 --- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastFlakeIdConfiguration.java +++ /dev/null @@ -1,27 +0,0 @@ -package pro.fessional.wings.slardar.spring.bean; - -import com.hazelcast.core.HazelcastInstance; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.faceless.service.flakeid.FlakeIdService; -import pro.fessional.wings.slardar.service.flakeid.FlakeIdHazelcastImpl; - -/** - * @author trydofor - * @since 2019-12-03 - */ -@Configuration(proxyBeanMethods = false) -@ConditionalOnClass(FlakeIdService.class) -public class HazelcastFlakeIdConfiguration { - - private static final Log log = LogFactory.getLog(HazelcastFlakeIdConfiguration.class); - - @Bean - public FlakeIdService hazelcastFlakeId(HazelcastInstance instance) { - log.info("SlardarHazelCaching spring-bean hazelcastFlakeId Overriding"); - return new FlakeIdHazelcastImpl(instance); - } -} diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java deleted file mode 100644 index d4bf3336b..000000000 --- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastLightIdConfiguration.java +++ /dev/null @@ -1,40 +0,0 @@ -package pro.fessional.wings.slardar.spring.bean; - -import com.hazelcast.core.HazelcastInstance; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import pro.fessional.mirana.id.LightIdProvider; -import pro.fessional.wings.faceless.service.flakeid.FlakeIdService; -import pro.fessional.wings.faceless.spring.prop.LightIdProviderProp; -import pro.fessional.wings.slardar.service.lightid.HazelcastLightIdProvider; - -/** - * @author trydofor - * @since 2019-12-03 - */ -@Configuration(proxyBeanMethods = false) -@ConditionalOnClass(FlakeIdService.class) -public class HazelcastLightIdConfiguration { - - private static final Log log = LogFactory.getLog(HazelcastLightIdConfiguration.class); - - @Bean - @ConditionalOnProperty(name = LightIdProviderProp.Key$monotonic, havingValue = "hz") - public LightIdProvider lightIdProvider(LightIdProvider.Loader lightIdLoader, LightIdProviderProp providerProp, HazelcastInstance hazelcastInstance) { - final String mono = providerProp.getMonotonic(); - log.info("Faceless spring-bean lightIdProvider via Hazelcast"); - if ("hz".equalsIgnoreCase(mono)) { - // avg=1.065ms - HazelcastLightIdProvider provider = new HazelcastLightIdProvider(lightIdLoader, hazelcastInstance); - provider.setTimeout(providerProp.getTimeout()); - return provider; - } - else { - throw new IllegalArgumentException("unsupported monotonic type=" + mono); - } - } -} diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastMockConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastMockConfiguration.java deleted file mode 100644 index 06e2b00a1..000000000 --- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastMockConfiguration.java +++ /dev/null @@ -1,39 +0,0 @@ -package pro.fessional.wings.slardar.spring.bean; - -import com.hazelcast.config.Config; -import com.hazelcast.config.NetworkConfig; -import com.hazelcast.core.Hazelcast; -import com.hazelcast.core.HazelcastInstance; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.util.StringUtils; -import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; - -/** - * @author trydofor - * @since 2019-12-03 - */ -@Configuration(proxyBeanMethods = false) -@ConditionalOnProperty(name = SlardarEnabledProp.Key$mockHazelcast, havingValue = "true") -public class HazelcastMockConfiguration { - - private static final Log log = LogFactory.getLog(HazelcastMockConfiguration.class); - - @Bean - public HazelcastInstance hazelcastInstance() { - log.info("SlardarHazelCaching spring-bean Standalone hazelcastInstance for mock"); - Config config = new Config(); - config.setClusterName("slardar-standalone"); - config.setProperty("hazelcast.shutdownhook.enabled", "false"); - NetworkConfig network = config.getNetworkConfig(); - network.getJoin().getTcpIpConfig().setEnabled(false); - network.getJoin().getMulticastConfig().setEnabled(false); - - return StringUtils.hasText(config.getInstanceName()) ? - Hazelcast.getOrCreateHazelcastInstance(config) : - Hazelcast.newHazelcastInstance(config); - } -} diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastPublisherConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastPublisherConfiguration.java deleted file mode 100644 index 06ec04e48..000000000 --- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastPublisherConfiguration.java +++ /dev/null @@ -1,27 +0,0 @@ -package pro.fessional.wings.slardar.spring.bean; - -import com.hazelcast.core.HazelcastInstance; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.slardar.event.EventPublishHelper; -import pro.fessional.wings.slardar.event.HazelcastSyncPublisher; - -/** - * @author trydofor - * @since 2019-12-03 - */ -@Configuration(proxyBeanMethods = false) -public class HazelcastPublisherConfiguration { - - private static final Log log = LogFactory.getLog(HazelcastPublisherConfiguration.class); - - @Autowired - public void autowireHazelcastSyncPublisher(HazelcastInstance instance, ApplicationEventPublisher publisher) { - HazelcastSyncPublisher global = new HazelcastSyncPublisher(instance, publisher); - EventPublishHelper.setGlobalPublisher(global); - log.info("SlardarHazelCaching spring-auto initHazelcastSyncPublisher, uuid=" + global.getMessageListenerUuid()); - } -} diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastServiceConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastServiceConfiguration.java new file mode 100644 index 000000000..b0790b656 --- /dev/null +++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastServiceConfiguration.java @@ -0,0 +1,82 @@ +package pro.fessional.wings.slardar.spring.bean; + +import com.hazelcast.core.HazelcastInstance; +import com.hazelcast.spring.cache.HazelcastCacheManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import pro.fessional.mirana.id.LightIdProvider; +import pro.fessional.wings.faceless.service.flakeid.FlakeIdService; +import pro.fessional.wings.faceless.spring.prop.LightIdProviderProp; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.slardar.cache.WingsCache; +import pro.fessional.wings.slardar.cache.hazelcast.WingsHazelcastCacheManager; +import pro.fessional.wings.slardar.concur.HazelcastGlobalLock; +import pro.fessional.wings.slardar.event.EventPublishHelper; +import pro.fessional.wings.slardar.event.HazelcastSyncPublisher; +import pro.fessional.wings.slardar.service.flakeid.FlakeIdHazelcastImpl; +import pro.fessional.wings.slardar.service.lightid.HazelcastLightIdProvider; +import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp; + +/** + * @author trydofor + * @since 2019-12-03 + */ +@Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled +public class HazelcastServiceConfiguration { + + private static final Log log = LogFactory.getLog(HazelcastServiceConfiguration.class); + + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + @ConditionalOnClass(FlakeIdService.class) + public static class FlakeIdServiceBean { + @Bean + public FlakeIdService flakeIdService(HazelcastInstance instance) { + log.info("SlardarHazelCaching spring-bean hazelcastFlakeId Overriding"); + return new FlakeIdHazelcastImpl(instance); + } + } + + @Configuration(proxyBeanMethods = false) + @ConditionalWingsEnabled + public static class GlobalPublisherWired { + @Autowired + public void auto(HazelcastInstance instance, ApplicationEventPublisher publisher) { + HazelcastSyncPublisher global = new HazelcastSyncPublisher(instance, publisher); + EventPublishHelper.setGlobalPublisher(global); + log.info("SlardarHazelCaching spring-auto initHazelcastSyncPublisher, uuid=" + global.getMessageListenerUuid()); + } + } + + @Bean + @ConditionalWingsEnabled + @ConditionalOnProperty(name = LightIdProviderProp.Key$monotonic, havingValue = "hz") + public LightIdProvider hzLightIdProvider(LightIdProvider.Loader loader, LightIdProviderProp prop, HazelcastInstance instance) { + log.info("Faceless spring-bean hzLightIdProvider"); + // avg=1.065ms + HazelcastLightIdProvider provider = new HazelcastLightIdProvider(loader, instance); + provider.setTimeout(prop.getTimeout()); + return provider; + } + + @Bean + @ConditionalWingsEnabled + public HazelcastGlobalLock hazelcastGlobalLock(HazelcastInstance hazelcastInstance) { + log.info("SlardarHazelCaching spring-bean hazelcastGlobalLock"); + return new HazelcastGlobalLock(hazelcastInstance); + } + + @Bean(WingsCache.Manager.Server) + @ConditionalWingsEnabled + public HazelcastCacheManager hazelcastCacheManager(SlardarCacheProp conf, HazelcastInstance instance) { + log.info("SlardarHazelCaching spring-bean hazelcast as " + WingsCache.Manager.Server); + return new WingsHazelcastCacheManager(conf, instance); + } +} diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java deleted file mode 100644 index 81187f636..000000000 --- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelCachingAutoConfiguration.java +++ /dev/null @@ -1,24 +0,0 @@ -package pro.fessional.wings.slardar.spring.conf; - -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration; -import pro.fessional.wings.slardar.spring.bean.HazelcastCacheConfiguration; -import pro.fessional.wings.slardar.spring.bean.HazelcastMockConfiguration; -import pro.fessional.wings.slardar.spring.bean.HazelcastPublisherConfiguration; -import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; - -/** - * @author trydofor - * @since 2019-07-11 - */ -@AutoConfiguration(before = {SlardarAutoConfiguration.class, HazelcastAutoConfiguration.class}) -@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration({ - HazelcastCacheConfiguration.class, - HazelcastMockConfiguration.class, - HazelcastPublisherConfiguration.class, -}) -public class SlardarHazelCachingAutoConfiguration { -} diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelDistIdAutoConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelDistIdAutoConfiguration.java deleted file mode 100644 index 84b5d3e46..000000000 --- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelDistIdAutoConfiguration.java +++ /dev/null @@ -1,24 +0,0 @@ -package pro.fessional.wings.slardar.spring.conf; - -import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import pro.fessional.wings.faceless.spring.conf.FacelessAutoConfiguration; -import pro.fessional.wings.slardar.spring.bean.HazelcastFlakeIdConfiguration; -import pro.fessional.wings.slardar.spring.bean.HazelcastLightIdConfiguration; -import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; - -/** - * @author trydofor - * @since 2019-07-11 - */ -@AutoConfiguration(before = {SlardarAutoConfiguration.class, FacelessAutoConfiguration.class}) -@ConditionalOnClass(FacelessAutoConfiguration.class) -@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration({ - HazelcastFlakeIdConfiguration.class, - HazelcastLightIdConfiguration.class, -}) -public class SlardarHazelDistIdAutoConfiguration { -} diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelcastAutoConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelcastAutoConfiguration.java new file mode 100644 index 000000000..4298f0770 --- /dev/null +++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelcastAutoConfiguration.java @@ -0,0 +1,22 @@ +package pro.fessional.wings.slardar.spring.conf; + +import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.context.annotation.Import; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration; +import pro.fessional.wings.slardar.spring.bean.HazelcastServiceConfiguration; + +/** + * Distributed + * + * @author trydofor + * @since 2019-07-11 + */ +@AutoConfiguration(before = SlardarCacheAutoConfiguration.class) +@ConditionalWingsEnabled +@Import({ + HazelcastConfigConfiguration.class, + HazelcastServiceConfiguration.class, +}) +public class SlardarHazelcastAutoConfiguration { +} diff --git a/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 68a34a6da..0597a0975 100644 --- a/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/slardar-hazel-caching/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,2 +1 @@ -pro.fessional.wings.slardar.spring.conf.SlardarHazelCachingAutoConfiguration -pro.fessional.wings.slardar.spring.conf.SlardarHazelDistIdAutoConfiguration +pro.fessional.wings.slardar.spring.conf.SlardarHazelcastAutoConfiguration diff --git a/wings/slardar-hazel-caching/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/slardar-hazel-caching/src/main/resources/wings-conf/spring-wings-enabled-79.properties new file mode 100644 index 000000000..79d6e363d --- /dev/null +++ b/wings/slardar-hazel-caching/src/main/resources/wings-conf/spring-wings-enabled-79.properties @@ -0,0 +1,2 @@ +## use hazelcast flake id instead +spring.wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessConfiguration.flakeIdService=false \ No newline at end of file diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java index ca8424a7b..3068c4db6 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java @@ -15,7 +15,7 @@ * @author trydofor * @since 2021-06-09 */ -@SpringBootTest(properties = "spring.wings.slardar.enabled.mock-hazelcast=false") +@SpringBootTest(properties = "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=false") @Slf4j public class EventPublishHelperTest { diff --git a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastSessionConfiguration.java b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarHazelSessionConfiguration.java similarity index 76% rename from wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastSessionConfiguration.java rename to wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarHazelSessionConfiguration.java index 9c709de79..1eed5db78 100644 --- a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastSessionConfiguration.java +++ b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarHazelSessionConfiguration.java @@ -4,13 +4,13 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.core.session.SessionRegistry; import org.springframework.session.FindByIndexNameSessionRepository; import org.springframework.session.Session; import org.springframework.session.security.SpringSessionBackedSessionRegistry; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.session.HazelcastSessionHelper; import pro.fessional.wings.slardar.session.WingsSessionHelper; @@ -19,24 +19,26 @@ * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -public class HazelcastSessionConfiguration { +@ConditionalWingsEnabled +public class SlardarHazelSessionConfiguration { - private static final Log log = LogFactory.getLog(HazelcastSessionConfiguration.class); + private static final Log log = LogFactory.getLog(SlardarHazelSessionConfiguration.class); @Bean - @ConditionalOnMissingBean(SessionRegistry.class) + @ConditionalWingsEnabled public SessionRegistry sessionRegistry(FindByIndexNameSessionRepository repository) { log.info("SlardarHazelSession spring-bean sessionRegistry"); return new SpringSessionBackedSessionRegistry<>(repository); } @Bean + @ConditionalWingsEnabled public WingsSessionHelper wingsSessionHelper( FindByIndexNameSessionRepository sessionRepository, - HazelcastInstance hzInstance, + HazelcastInstance hazelcastInstance, @Value("${spring.session.hazelcast.map-name:spring:session:sessions}") String mapName) { log.info("SlardarHazelSession spring-bean wingsSessionHelper"); - return new HazelcastSessionHelper(sessionRepository, hzInstance, mapName); + return new HazelcastSessionHelper(sessionRepository, hazelcastInstance, mapName); } } diff --git a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java index 07507dcb7..f12d9be37 100644 --- a/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java +++ b/wings/slardar-hazel-session/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarHazelSessionAutoConfiguration.java @@ -1,17 +1,16 @@ package pro.fessional.wings.slardar.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.autoconfigure.ImportAutoConfiguration; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import pro.fessional.wings.slardar.spring.bean.HazelcastSessionConfiguration; -import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; +import org.springframework.context.annotation.Import; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.slardar.spring.bean.SlardarHazelSessionConfiguration; /** * @author trydofor * @since 2019-07-11 */ -@AutoConfiguration(before = {SlardarHazelCachingAutoConfiguration.class, SlardarWebmvcAutoConfiguration.class}) -@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true") -@ImportAutoConfiguration(HazelcastSessionConfiguration.class) +@AutoConfiguration +@ConditionalWingsEnabled +@Import(SlardarHazelSessionConfiguration.class) public class SlardarHazelSessionAutoConfiguration { } diff --git a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java index d1b1827d9..cb7b98b68 100644 --- a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java +++ b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java @@ -26,7 +26,7 @@ * @since 2020-06-03 */ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - properties = "spring.wings.slardar.enabled.mock-hazelcast=false") + properties = "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=false") @AutoConfigureMockMvc public class WingsSessionLangZoneTest { diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarActuatorConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarActuatorConfiguration.java index f3bfd2a02..0a8f08005 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarActuatorConfiguration.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarActuatorConfiguration.java @@ -6,6 +6,7 @@ import org.springframework.cache.CacheManager; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.actuator.cache.SlardarCacheEndpoint; import java.util.Map; @@ -16,11 +17,13 @@ * @since 2019-12-01 */ @Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled public class SlardarActuatorConfiguration { private final static Log log = LogFactory.getLog(SlardarActuatorConfiguration.class); @Bean + @ConditionalWingsEnabled @ConditionalOnAvailableEndpoint public SlardarCacheEndpoint slardarCacheManageEndpoint(Map cacheManagers) { log.info("SlardarSprint spring-bean slardarCacheManageEndpoint"); diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminClientConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminClientConfiguration.java new file mode 100644 index 000000000..524439623 --- /dev/null +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminClientConfiguration.java @@ -0,0 +1,52 @@ +package pro.fessional.wings.slardar.spring.bean; + +import de.codecentric.boot.admin.client.config.ClientProperties; +import de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition; +import de.codecentric.boot.admin.client.registration.BlockingRegistrationClient; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.slardar.spring.prop.SlardarPasscoderProp; + + +/** + * @author trydofor + * @since 2019-12-01 + */ +@Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled +@ConditionalOnClass(SpringBootAdminClientEnabledCondition.class) +@Conditional(SpringBootAdminClientEnabledCondition.class) +@EnableConfigurationProperties(SlardarPasscoderProp.class) +public class SlardarBootAdminClientConfiguration { + private final static Log log = LogFactory.getLog(SlardarBootAdminClientConfiguration.class); + + + /** + *
+     * org.apache.http.client.protocol.ResponseProcessCookies : Invalid cookie header: "Set-Cookie: ...".
+     * Invalid 'expires' attribute: Sat, 19 Mar 2022 06:03:21 GMT
+     *
+     * As it use 'EEE, dd-MMM-yyy HH:mm:ss z' format to validate cookie, cause faile
+     * 
+ */ + @Bean + @ConditionalWingsEnabled + public BlockingRegistrationClient registrationClient(RestTemplateBuilder builder, ClientProperties prop) { + log.info("SlardarSprint spring-bean registrationClient of BootAdmin client"); + builder = builder + .setConnectTimeout(prop.getConnectTimeout()) + .setReadTimeout(prop.getReadTimeout()); + if (prop.getUsername() != null && prop.getPassword() != null) { + builder = builder.basicAuthentication(prop.getUsername(), prop.getPassword()); + } + + return new BlockingRegistrationClient(builder.build()); + } +} diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java deleted file mode 100644 index 7a9be91c9..000000000 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminConfiguration.java +++ /dev/null @@ -1,174 +0,0 @@ -package pro.fessional.wings.slardar.spring.bean; - -import de.codecentric.boot.admin.client.config.ClientProperties; -import de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration; -import de.codecentric.boot.admin.client.config.SpringBootAdminClientEnabledCondition; -import de.codecentric.boot.admin.client.registration.BlockingRegistrationClient; -import de.codecentric.boot.admin.server.config.AdminServerProperties; -import de.codecentric.boot.admin.server.config.EnableAdminServer; -import de.codecentric.boot.admin.server.domain.entities.Instance; -import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; -import de.codecentric.boot.admin.server.domain.events.InstanceEvent; -import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent; -import de.codecentric.boot.admin.server.domain.values.StatusInfo; -import de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier; -import de.codecentric.boot.admin.server.notify.Notifier; -import de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider; -import de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.InstanceCredentials; -import de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.jetbrains.annotations.NotNull; -import org.springframework.beans.BeansException; -import org.springframework.beans.factory.ObjectProvider; -import org.springframework.beans.factory.config.BeanPostProcessor; -import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Conditional; -import org.springframework.context.annotation.Configuration; -import pro.fessional.wings.slardar.monitor.WarnMetric; -import pro.fessional.wings.slardar.monitor.report.DingTalkReport; -import pro.fessional.wings.slardar.security.pass.BasicPasswordEncoder; -import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; -import pro.fessional.wings.slardar.spring.prop.SlardarPasscoderProp; -import reactor.core.publisher.Mono; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; - - -/** - * @author trydofor - * @since 2019-12-01 - */ -@Configuration(proxyBeanMethods = false) -@EnableConfigurationProperties(SlardarPasscoderProp.class) -@ConditionalOnClass(SpringBootAdminClientAutoConfiguration.class) -public class SlardarBootAdminConfiguration { - private final static Log log = LogFactory.getLog(SlardarBootAdminConfiguration.class); - - @Configuration(proxyBeanMethods = false) - @ConditionalOnClass(BlockingRegistrationClient.class) - @ConditionalOnExpression("${" + SlardarEnabledProp.Key$bootAdmin + ":false} && ${spring.boot.admin.client.enabled:false}") - public static class ClientConfiguration { - /** - *
-         * org.apache.http.client.protocol.ResponseProcessCookies : Invalid cookie header: "Set-Cookie: ...".
-         * Invalid 'expires' attribute: Sat, 19 Mar 2022 06:03:21 GMT
-         *
-         * As it use 'EEE, dd-MMM-yyy HH:mm:ss z' format to validate cookie, cause faile
-         * 
- */ - @Bean - @Conditional(SpringBootAdminClientEnabledCondition.class) - public BlockingRegistrationClient registrationClient(RestTemplateBuilder builder, ClientProperties prop) { - log.info("SlardarSprint spring-bean registrationClient of BootAdmin client"); - builder = builder - .setConnectTimeout(prop.getConnectTimeout()) - .setReadTimeout(prop.getReadTimeout()); - if (prop.getUsername() != null && prop.getPassword() != null) { - builder = builder.basicAuthentication(prop.getUsername(), prop.getPassword()); - } - - return new BlockingRegistrationClient(builder.build()); - } - } - - @Configuration(proxyBeanMethods = false) - @ConditionalOnClass(EnableAdminServer.class) - @ConditionalOnExpression("${" + SlardarEnabledProp.Key$bootAdmin + ":false} && ${spring.boot.admin.server.enabled:false}") - public static class AdminConfiguration { - - @Bean - @ConditionalOnProperty(name = "spring.wings.warlock.enabled.controller-proc", havingValue = "true") - public BeanPostProcessor bootAdminMappingOrderPostProcessor() { - log.info("SlardarSprint spring-bean bootAdminMappingOrderPostProcessor of BootAdmin server"); - return new BeanPostProcessor() { - @Override - public Object postProcessAfterInitialization(@NotNull Object bean, @NotNull String beanName) throws BeansException { - if (bean instanceof AdminControllerHandlerMapping) { - ((AdminControllerHandlerMapping) bean).setOrder(-1); - } - return bean; - } - }; - } - - @Bean - public Notifier dingTalkNotifier(InstanceRepository repository, ObjectProvider reportProvider) { - log.info("SlardarSprint spring-bean dingTalkNotifier of BootAdmin server"); - final DingTalkReport reporter = reportProvider.getIfAvailable(); - final AbstractStatusChangeNotifier bean = new AbstractStatusChangeNotifier(repository) { - @Override - protected @NotNull Mono doNotify(@NotNull InstanceEvent event, @NotNull Instance instance) { - if (reporter == null) return Mono.empty(); - - final InstanceStatusChangedEvent sev = (InstanceStatusChangedEvent) event; - final StatusInfo sts = sev.getStatusInfo(); - final Map dtl = sts.getDetails(); - List warns = new ArrayList<>(); - for (Map.Entry en : dtl.entrySet()) { - final WarnMetric.Warn wr = new WarnMetric.Warn(); - wr.setType(WarnMetric.Type.Text); - wr.setWarn(Objects.toString(en.getValue())); - wr.setRule("detail"); - wr.setKey(en.getKey()); - warns.add(wr); - } - - final String title = "status " + sts.getStatus() + " from " + getLastStatus(event.getInstance()); - return Mono.fromRunnable(() -> reporter.report(instance.getRegistration().getName(), instance.getId().getValue(), - Collections.singletonMap(title, warns))); - } - }; - bean.setEnabled(reporter != null); - return bean; - } - - @Bean - public BasicAuthHttpHeaderProvider basicAuthHttpHeadersProvider(AdminServerProperties adminProp, SlardarPasscoderProp passProp) { - log.info("SlardarSprint spring-bean basicAuthHttpHeadersProvider of BootAdmin server"); - AdminServerProperties.InstanceAuthProperties instanceAuth = adminProp.getInstanceAuth(); - final String defaultUserName; - final String defaultPassword; - final Map serviceMap; - if (instanceAuth.isEnabled()) { - defaultUserName = instanceAuth.getDefaultUserName(); - defaultPassword = instanceAuth.getDefaultPassword(); - serviceMap = instanceAuth.getServiceMap(); - } - else { - defaultUserName = null; - defaultPassword = null; - serviceMap = Collections.emptyMap(); - } - - log.info("Wings conf BootAdmin server basicAuthHttpHeadersProvider, instanceAuth=" + instanceAuth.isEnabled()); - return new BasicAuthHttpHeaderProvider(defaultUserName, defaultPassword, serviceMap) { - private final BasicPasswordEncoder encoder = new BasicPasswordEncoder(passProp.getTimeDeviationMs()); - - @Override - protected @NotNull String encode(@NotNull String username, @NotNull String password) { - final String token = encoder.encode(password); - return super.encode(username, token); - } - }; - } - -// @Bean -// public InstanceExchangeFilterFunction bootAdminSessionFilter() { -// return (instance, request, next) -> next.exchange(request).doOnSubscribe((s) -> { -// log.debug(">>>" + request.url()); -// log.debug(">>>" + request.headers()); -// log.debug(">>>" + request.cookies()); -// }); -// } - } -} diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminServerConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminServerConfiguration.java new file mode 100644 index 000000000..b27f1de23 --- /dev/null +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminServerConfiguration.java @@ -0,0 +1,139 @@ +package pro.fessional.wings.slardar.spring.bean; + +import de.codecentric.boot.admin.server.config.AdminServerProperties; +import de.codecentric.boot.admin.server.config.SpringBootAdminServerEnabledCondition; +import de.codecentric.boot.admin.server.domain.entities.Instance; +import de.codecentric.boot.admin.server.domain.entities.InstanceRepository; +import de.codecentric.boot.admin.server.domain.events.InstanceEvent; +import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent; +import de.codecentric.boot.admin.server.domain.values.StatusInfo; +import de.codecentric.boot.admin.server.notify.AbstractStatusChangeNotifier; +import de.codecentric.boot.admin.server.notify.Notifier; +import de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider; +import de.codecentric.boot.admin.server.web.client.BasicAuthHttpHeaderProvider.InstanceCredentials; +import de.codecentric.boot.admin.server.web.servlet.AdminControllerHandlerMapping; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.jetbrains.annotations.NotNull; +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.slardar.monitor.WarnMetric; +import pro.fessional.wings.slardar.monitor.report.DingTalkReport; +import pro.fessional.wings.slardar.security.pass.BasicPasswordEncoder; +import pro.fessional.wings.slardar.spring.prop.SlardarPasscoderProp; +import reactor.core.publisher.Mono; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; + + +/** + * @author trydofor + * @since 2019-12-01 + */ +@Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled +@ConditionalOnClass(SpringBootAdminServerEnabledCondition.class) +@Conditional(SpringBootAdminServerEnabledCondition.class) +@EnableConfigurationProperties(SlardarPasscoderProp.class) +public class SlardarBootAdminServerConfiguration { + private final static Log log = LogFactory.getLog(SlardarBootAdminServerConfiguration.class); + + + @Bean + @ConditionalWingsEnabled + public BeanPostProcessor bootAdminMappingOrderPostProcessor() { + log.info("SlardarSprint spring-bean bootAdminMappingOrderPostProcessor of BootAdmin server"); + return new BeanPostProcessor() { + @Override + public Object postProcessAfterInitialization(@NotNull Object bean, @NotNull String beanName) throws BeansException { + if (bean instanceof AdminControllerHandlerMapping) { + ((AdminControllerHandlerMapping) bean).setOrder(-1); + } + return bean; + } + }; + } + + @Bean + @ConditionalWingsEnabled + public Notifier dingTalkNotifier(InstanceRepository repository, ObjectProvider reportProvider) { + log.info("SlardarSprint spring-bean dingTalkNotifier of BootAdmin server"); + final DingTalkReport reporter = reportProvider.getIfAvailable(); + final AbstractStatusChangeNotifier bean = new AbstractStatusChangeNotifier(repository) { + @Override + protected @NotNull Mono doNotify(@NotNull InstanceEvent event, @NotNull Instance instance) { + if (reporter == null) return Mono.empty(); + + final InstanceStatusChangedEvent sev = (InstanceStatusChangedEvent) event; + final StatusInfo sts = sev.getStatusInfo(); + final Map dtl = sts.getDetails(); + List warns = new ArrayList<>(); + for (Map.Entry en : dtl.entrySet()) { + final WarnMetric.Warn wr = new WarnMetric.Warn(); + wr.setType(WarnMetric.Type.Text); + wr.setWarn(Objects.toString(en.getValue())); + wr.setRule("detail"); + wr.setKey(en.getKey()); + warns.add(wr); + } + + final String title = "status " + sts.getStatus() + " from " + getLastStatus(event.getInstance()); + return Mono.fromRunnable(() -> reporter.report(instance.getRegistration().getName(), instance.getId().getValue(), + Collections.singletonMap(title, warns))); + } + }; + bean.setEnabled(reporter != null); + return bean; + } + + @Bean + @ConditionalWingsEnabled + public BasicAuthHttpHeaderProvider basicAuthHttpHeadersProvider(AdminServerProperties adminProp, SlardarPasscoderProp passProp) { + log.info("SlardarSprint spring-bean basicAuthHttpHeadersProvider of BootAdmin server"); + AdminServerProperties.InstanceAuthProperties instanceAuth = adminProp.getInstanceAuth(); + final String defaultUserName; + final String defaultPassword; + final Map serviceMap; + if (instanceAuth.isEnabled()) { + defaultUserName = instanceAuth.getDefaultUserName(); + defaultPassword = instanceAuth.getDefaultPassword(); + serviceMap = instanceAuth.getServiceMap(); + } + else { + defaultUserName = null; + defaultPassword = null; + serviceMap = Collections.emptyMap(); + } + + log.info("Wings conf BootAdmin server basicAuthHttpHeadersProvider, instanceAuth=" + instanceAuth.isEnabled()); + return new BasicAuthHttpHeaderProvider(defaultUserName, defaultPassword, serviceMap) { + private final BasicPasswordEncoder encoder = new BasicPasswordEncoder(passProp.getTimeDeviationMs()); + + @Override + protected @NotNull String encode(@NotNull String username, @NotNull String password) { + final String token = encoder.encode(password); + return super.encode(username, token); + } + }; + } + +// @Bean +// public InstanceExchangeFilterFunction bootAdminSessionFilter() { +// return (instance, request, next) -> next.exchange(request).doOnSubscribe((s) -> { +// log.debug(">>>" + request.url()); +// log.debug(">>>" + request.headers()); +// log.debug(">>>" + request.cookies()); +// }); +// } +} diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java index d44ea8d19..fab3c2dd3 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java @@ -1,10 +1,8 @@ package pro.fessional.wings.slardar.spring.bean; -import lombok.RequiredArgsConstructor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; @@ -18,6 +16,7 @@ import pro.fessional.mirana.bits.MdHelp; import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered; import pro.fessional.wings.silencer.spring.WingsOrdered; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.context.TerminalContext; import pro.fessional.wings.slardar.security.PasssaltEncoder; import pro.fessional.wings.slardar.security.pass.DefaultPasssaltEncoder; @@ -32,15 +31,13 @@ * @since 2020-08-10 */ @Configuration(proxyBeanMethods = false) +@ConditionalWingsEnabled @ConditionalOnClass(SecurityConfigurer.class) @EnableConfigurationProperties(SlardarPasscoderProp.class) -@RequiredArgsConstructor public class SlardarSecurityConfiguration { private static final Log log = LogFactory.getLog(SlardarSecurityConfiguration.class); - private final SlardarPasscoderProp slardarPasscoderProp; - /** *
      * #@Async
@@ -58,27 +55,22 @@ public class SlardarSecurityConfiguration {
      * @return PasswordEncoder
      */
     @Bean
-    @ConditionalOnMissingBean(PasswordEncoder.class)
-    public PasswordEncoder passwordEncoder() {
-        final String encoder = slardarPasscoderProp.getPassEncoder();
-        final String decoder = slardarPasscoderProp.getPassDecoder();
+    @ConditionalWingsEnabled
+    public PasswordEncoder passwordEncoder(SlardarPasscoderProp prop) {
+        final String encoder = prop.getPassEncoder();
+        final String decoder = prop.getPassDecoder();
         log.info("SlardarSprint spring-bean passwordEncoder, default encoder=" + encoder + ", decoder is " + decoder);
-        Map encoders = PasswordEncoders.initEncoders(slardarPasscoderProp.getTimeDeviationMs());
+        Map encoders = PasswordEncoders.initEncoders(prop.getTimeDeviationMs());
         DelegatingPasswordEncoder passwordEncoder = new DelegatingPasswordEncoder(encoder, encoders);
         passwordEncoder.setDefaultPasswordEncoderForMatches(encoders.get(decoder));
         return passwordEncoder;
     }
 
-    @Bean
-    public HttpSessionEventPublisher httpSessionEventPublisher() {
-        log.info("SlardarSprint spring-bean httpSessionEventPublisher");
-        return new HttpSessionEventPublisher();
-    }
 
     @Bean
-    @ConditionalOnMissingBean(PasssaltEncoder.class)
-    public PasssaltEncoder passsaltEncoder() {
-        final String encoder = slardarPasscoderProp.getSaltEncoder();
+    @ConditionalWingsEnabled
+    public PasssaltEncoder passsaltEncoder(SlardarPasscoderProp prop) {
+        final String encoder = prop.getSaltEncoder();
         log.info("SlardarSprint spring-bean passsaltEncoder, default encoder=" + encoder);
 
         MdHelp md;
@@ -98,12 +90,21 @@ else if ("md5".equalsIgnoreCase(encoder)) {
     }
 
     @Bean
+    @ConditionalWingsEnabled
+    public HttpSessionEventPublisher httpSessionEventPublisher() {
+        log.info("SlardarSprint spring-bean httpSessionEventPublisher");
+        return new HttpSessionEventPublisher();
+    }
+
+    @Bean
+    @ConditionalWingsEnabled
     public WingsSecBeanInitConfigurer wingsSecBeanInitConfigurer(ApplicationContext context) {
         log.info("SlardarSprint spring-bean wingsSecBeanInitConfigurer");
         return new WingsSecBeanInitConfigurer(context);
     }
 
     @Bean
+    @ConditionalWingsEnabled
     public TerminalContext.Listener LocaleContextHolderTerminalContextListener() {
         log.info("SlardarSprint spring-bean LocaleContextHolder");
         return (del, ctx) -> {
@@ -117,8 +118,9 @@ public TerminalContext.Listener LocaleContextHolderTerminalContextListener() {
      * Sync Locale and TimeZone with TerminalContext
      */
     @Bean
-    public CommandLineRunnerOrdered runnerTerminalContextListener(Map listeners) {
-        log.info("SlardarSprint spring-runs runnerTerminalContextListener");
+    @ConditionalWingsEnabled
+    public CommandLineRunnerOrdered terminalContextListenerRunner(Map listeners) {
+        log.info("SlardarSprint spring-runs terminalContextListenerRunner");
         return new CommandLineRunnerOrdered(WingsOrdered.Lv5Supervisor, ignored -> {
             for (Map.Entry en : listeners.entrySet()) {
                 final String name = en.getKey();
diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java
index 7fb1aa82c..fe256152c 100644
--- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java
+++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarBootAdminAutoConfiguration.java
@@ -2,19 +2,22 @@
 
 import de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration;
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import pro.fessional.wings.slardar.spring.bean.SlardarBootAdminConfiguration;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
+import pro.fessional.wings.slardar.spring.bean.SlardarBootAdminClientConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarBootAdminServerConfiguration;
 
 /**
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(before = {SlardarSprintAutoConfiguration.class, SpringBootAdminClientAutoConfiguration.class})
+@AutoConfiguration(before = SpringBootAdminClientAutoConfiguration.class)
 @ConditionalOnClass(SpringBootAdminClientAutoConfiguration.class)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
-@ImportAutoConfiguration(SlardarBootAdminConfiguration.class)
+@ConditionalWingsEnabled
+@Import({
+        SlardarBootAdminClientConfiguration.class,
+        SlardarBootAdminServerConfiguration.class
+})
 public class SlardarBootAdminAutoConfiguration {
 }
diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java
index b5d8cee4c..888b0c2e4 100644
--- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java
+++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarSprintAutoConfiguration.java
@@ -1,19 +1,18 @@
 package pro.fessional.wings.slardar.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.spring.bean.SlardarActuatorConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(before = SlardarHazelSessionAutoConfiguration.class)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
-@ImportAutoConfiguration({
+@AutoConfiguration
+@ConditionalWingsEnabled
+@Import({
         SlardarActuatorConfiguration.class,
         SlardarSecurityConfiguration.class,
 })
diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/Cve2023T34035Test.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/Cve2023T34035Test.java
index ee16d3db9..6a6fa8db4 100644
--- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/Cve2023T34035Test.java
+++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/Cve2023T34035Test.java
@@ -21,9 +21,13 @@
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
         properties = {
                 "spring.mvc.servlet.path=/mvc",
-                "server.servlet.register-default-servlet=true"
+                "server.servlet.register-default-servlet=true",
         })
 @AutoConfigureMockMvc
+//@EnableAutoConfiguration(exclude = {
+//        HazelcastAutoConfiguration.class,
+//        SlardarHazelAutoConfiguration.class,
+//})
 @Slf4j
 public class Cve2023T34035Test {
 
diff --git a/wings/slardar-sprint/src/test/resources/application.properties b/wings/slardar-sprint/src/test/resources/application.properties
index f13b4e39b..6cf076045 100644
--- a/wings/slardar-sprint/src/test/resources/application.properties
+++ b/wings/slardar-sprint/src/test/resources/application.properties
@@ -9,7 +9,8 @@ logging.level.pro.fessional=DEBUG
 #wings.slardar.monitor.log.default.file=/tmp/test-slardar.log
 #logging.file.name=/tmp/test-slardar.log
 
-spring.wings.slardar.enabled.mock-hazelcast=true
-
+spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=true
+spring.boot.admin.server.enabled=false
+spring.boot.admin.client.enabled=false
 #spring.boot.admin.client.url=http://localhost:${server.port}
 #spring.boot.admin.ui.title=Wings-Slardar-Admin
diff --git a/wings/slardar-test/src/main/resources/wings-conf/spring-wings-enabled.properties b/wings/slardar-test/src/main/resources/wings-conf/spring-wings-enabled.properties
new file mode 100644
index 000000000..9479234f6
--- /dev/null
+++ b/wings/slardar-test/src/main/resources/wings-conf/spring-wings-enabled.properties
@@ -0,0 +1 @@
+spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=true
\ No newline at end of file
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/CookieRequestWrapper.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/CookieRequestWrapper.java
index 03300bc60..0b1c3d66b 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/CookieRequestWrapper.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/CookieRequestWrapper.java
@@ -3,6 +3,7 @@
 import jakarta.servlet.http.Cookie;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletRequestWrapper;
+import lombok.extern.slf4j.Slf4j;
 
 import java.util.function.Function;
 
@@ -10,26 +11,40 @@
  * @author trydofor
  * @since 2019-11-29
  */
+@Slf4j
 public class CookieRequestWrapper extends HttpServletRequestWrapper {
 
-    private final Cookie[] cookies;
+    private final Function reader;
+    private volatile Cookie[] cookies;
 
     public CookieRequestWrapper(HttpServletRequest request, Function reader) {
         super(request);
-        final Cookie[] cks = request.getCookies();
+        this.reader = reader;
+    }
+
+    @Override
+    public Cookie[] getCookies() {
+        if (cookies != null) return cookies;
+
+        final Cookie[] cks = ((HttpServletRequest) super.getRequest()).getCookies();
         if (cks == null || cks.length == 0) {
             cookies = new Cookie[0];
         }
         else {
             cookies = new Cookie[cks.length];
             for (int i = 0; i < cks.length; i++) {
-                cookies[i] = reader.apply(cks[i]);
+                Cookie ck = cks[i];
+                try {
+                    cookies[i] = reader.apply(ck);
+                }
+                catch (Exception e) {
+                    log.info("failed to wrap cookie=" + ck, e);
+                }
+
+                if (cookies[i] == null) cookies[i] = ck;
             }
         }
-    }
 
-    @Override
-    public Cookie[] getCookies() {
         return cookies;
     }
 }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/impl/WingsCookieInterceptorImpl.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/impl/WingsCookieInterceptorImpl.java
index 17c981c08..e79353b5a 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/impl/WingsCookieInterceptorImpl.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/cookie/impl/WingsCookieInterceptorImpl.java
@@ -48,7 +48,8 @@ public WingsCookieInterceptorImpl(String aesKey) {
     }
 
 
-    @Override public boolean notIntercept() {
+    @Override
+    public boolean notIntercept() {
         return prefix == null
                && coder == Coder.Nop
                && aliasEnc.isEmpty()
@@ -60,52 +61,60 @@ public WingsCookieInterceptorImpl(String aesKey) {
                && domain.isEmpty();
     }
 
-    @Override public Cookie read(Cookie cookie) {
+    @Override
+    public Cookie read(Cookie cookie) {
         if (cookie == null) return null;
 
-        boolean did = false;
+        boolean dirty = false;
         String name = cookie.getName();
         // handle prefix of name
         if (prefix != null && name.startsWith(prefix)) {
             name = name.substring(prefix.length());
-            did = true;
+            dirty = true;
         }
 
         // handle alias of name
         final String n = aliasDec.get(name);
         if (n != null) {
             name = n;
-            did = true;
+            dirty = true;
         }
 
         // decode value
         String value = cookie.getValue();
+        if (value == null) return cookie;
+
         if (codeAes.contains(name)) {
-            value = aes.decode64(value);
-            did = true;
+            if (value.length() >= 16) {
+                value = aes.decode64(value);
+                dirty = true;
+            }
         }
         else if (codeB64.contains(name)) {
-            value = Base64.de2str(value);
-            did = true;
+            if (value.length() >= 2) {
+                value = Base64.de2str(value);
+                dirty = true;
+            }
         }
         else if (codeNop.contains(name)) {
             DummyBlock.empty();
         }
         else {
-            if (coder == Coder.Aes) {
+            if (coder == Coder.Aes && value.length() >= 16) {
                 value = aes.decode64(value);
-                did = true;
+                dirty = true;
             }
-            else if (coder == Coder.B64) {
+            else if (coder == Coder.B64 && value.length() >= 2) {
                 value = Base64.de2str(value);
-                did = true;
+                dirty = true;
             }
         }
 
-        return did ? copyCookie(cookie, name, value) : cookie;
+        return dirty ? copyCookie(cookie, name, value) : cookie;
     }
 
-    @Override public Cookie write(Cookie cookie) {
+    @Override
+    public Cookie write(Cookie cookie) {
         if (cookie == null) return null;
 
         boolean did = false;
@@ -169,7 +178,8 @@ else if (coder == Coder.B64) {
         return did ? copyCookie(cookie, name, value) : cookie;
     }
 
-    @NotNull private Cookie copyCookie(Cookie cookie, String name, String value) {
+    @NotNull
+    private Cookie copyCookie(Cookie cookie, String name, String value) {
         Cookie nc = new Cookie(name, value);
         final String domain = cookie.getDomain();
         if (domain != null) {
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java
index 36ecbb68b..eefd0b8a0 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java
@@ -1,18 +1,16 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.silencer.encrypt.SecretProvider;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.servlet.cookie.WingsCookieFilter;
 import pro.fessional.wings.slardar.servlet.cookie.WingsCookieInterceptor;
 import pro.fessional.wings.slardar.servlet.cookie.impl.WingsCookieInterceptorImpl;
 import pro.fessional.wings.slardar.spring.prop.SlardarCookieProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 import java.util.Map;
 import java.util.Set;
@@ -26,21 +24,21 @@
  * @since 2021-10-07
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$cookie, havingValue = "true")
+@ConditionalWingsEnabled(false)
 @EnableConfigurationProperties(SlardarCookieProp.class)
-@RequiredArgsConstructor
 public class SlardarCookieConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarCookieConfiguration.class);
 
     @Bean
-    public WingsCookieInterceptor wingsCookieInterceptor(SlardarCookieProp slardarCookieProp) {
-        final String aesKey = SecretProvider.get(SecretProvider.Cookie, false);
+    @ConditionalWingsEnabled
+    public WingsCookieInterceptor wingsCookieInterceptor(SlardarCookieProp slardarCookieProp, SecretProvider secretProvider) {
+        final String aesKey = secretProvider.tryGet(SecretProvider.Cookie);
         if (aesKey != null && aesKey.length() > 5) {
-            log.info("SlardarWebmvc spring-bean wingsCookieInterceptor, key=" + aesKey.substring(0, 5) + "...");
+            log.info("SlardarWebmvc spring-bean wingsCookieInterceptor, key=" + aesKey.substring(0, 5) + "..., len=" + aesKey.length());
         }
         else {
-            log.info("SlardarWebmvc spring-bean wingsCookieInterceptor");
+            log.warn("SlardarWebmvc spring-bean wingsCookieInterceptor, no key");
         }
 
         WingsCookieInterceptorImpl interceptor = new WingsCookieInterceptorImpl(aesKey);
@@ -77,6 +75,7 @@ public WingsCookieInterceptor wingsCookieInterceptor(SlardarCookieProp slardarCo
     }
 
     @Bean
+    @ConditionalWingsEnabled
     public WingsCookieFilter wingsCookieFilter(WingsCookieInterceptor wingsCookieInterceptor) {
         log.info("SlardarWebmvc spring-bean wingsCookieFilter");
         return new WingsCookieFilter(wingsCookieInterceptor);
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java
index f8e7115ed..67837fa6c 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java
@@ -1,34 +1,30 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.servlet.ModelAndView;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.concur.impl.DebounceInterceptor;
 import pro.fessional.wings.slardar.servlet.response.view.PlainTextView;
 import pro.fessional.wings.slardar.spring.prop.SlardarDebounceProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$debounce, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarDebounceProp.class)
-@RequiredArgsConstructor
 public class SlardarDebounceConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarDebounceConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(DebounceInterceptor.class)
+    @ConditionalWingsEnabled
     public DebounceInterceptor debounceInterceptor(SlardarDebounceProp debounceProp) {
         final int cap = debounceProp.getCapacity();
         final int max = debounceProp.getMaxWait();
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java
index 4b178ec8d..dd3ce4b13 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java
@@ -3,7 +3,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.BeanFactoryUtils;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
@@ -11,10 +10,10 @@
 import org.springframework.core.annotation.AnnotationAwareOrderComparator;
 import org.springframework.web.servlet.HandlerMapping;
 import pro.fessional.mirana.text.Wildcard;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.domainx.DefaultDomainRequestMatcher;
 import pro.fessional.wings.slardar.domainx.WingsDomainExtendFilter;
 import pro.fessional.wings.slardar.spring.prop.DomainExtendProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -28,14 +27,15 @@
  * @since 2019-06-29
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$domainExtend, havingValue = "true")
+@ConditionalWingsEnabled(false)
 @EnableConfigurationProperties(DomainExtendProp.class)
 public class SlardarDomainExtendConfiguration {
 
     private final static Log log = LogFactory.getLog(SlardarDomainExtendConfiguration.class);
 
     @Bean
-    public WingsDomainExtendFilter wingsDomainFilter(DomainExtendProp config, ApplicationContext context) {
+    @ConditionalWingsEnabled
+    public WingsDomainExtendFilter wingsDomainExtendFilter(DomainExtendProp config, ApplicationContext context) {
         log.info("SlardarWebmvc spring-bean wingsDomainFilter");
         Map> hostMatcher = new HashMap<>();
         for (Map.Entry> entry : config.getHost().entrySet()) {
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java
index 707553d3e..36aa5c914 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java
@@ -1,37 +1,30 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.HandlerExceptionResolver;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.concur.impl.DoubleKillExceptionResolver;
 import pro.fessional.wings.slardar.spring.prop.SlardarDoubleKillProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@RequiredArgsConstructor
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$doubleKill, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarDoubleKillProp.class)
 public class SlardarDoubleKillWebConfiguration {
 
-    public static final String doubleKillExceptionResolver = "doubleKillExceptionResolver";
     private static final Log log = LogFactory.getLog(SlardarDoubleKillWebConfiguration.class);
 
-    private final SlardarDoubleKillProp doubleKillProp;
-
-    @Bean(name = doubleKillExceptionResolver)
-    @ConditionalOnMissingBean(name = doubleKillExceptionResolver)
-    public HandlerExceptionResolver doubleKillExceptionResolver() {
-        log.info("SlardarWebmvc spring-bean " + doubleKillExceptionResolver);
-        return new DoubleKillExceptionResolver(doubleKillProp);
+    @Bean
+    @ConditionalWingsEnabled
+    public HandlerExceptionResolver doubleKillExceptionResolver(SlardarDoubleKillProp prop) {
+        log.info("SlardarWebmvc spring-bean doubleKillExceptionResolver");
+        return new DoubleKillExceptionResolver(prop);
     }
 }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java
index c23e2343f..5cb40298f 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java
@@ -1,24 +1,21 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.servlet.ModelAndView;
 import pro.fessional.mirana.code.RandCode;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.concur.impl.FirstBloodHandler;
 import pro.fessional.wings.slardar.concur.impl.FirstBloodImageHandler;
 import pro.fessional.wings.slardar.concur.impl.FirstBloodInterceptor;
 import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver;
 import pro.fessional.wings.slardar.servlet.response.view.PlainTextView;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarFirstBloodProp;
 
 import java.util.List;
@@ -29,35 +26,33 @@
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$firstBlood, havingValue = "true")
+@ConditionalWingsEnabled(false)
 @EnableConfigurationProperties(SlardarFirstBloodProp.class)
-@RequiredArgsConstructor
 public class SlardarFirstBloodConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarFirstBloodConfiguration.class);
-    private final SlardarFirstBloodProp firstBloodProp;
 
     @Bean
-    @ConditionalOnProperty(name = SlardarEnabledProp.Key$firstBloodImage, havingValue = "true")
-    public FirstBloodImageHandler firstBloodImageHandler(@Autowired(required = false) WingsRemoteResolver remoteResolver) {
+    @ConditionalWingsEnabled
+    public FirstBloodImageHandler firstBloodImageHandler(@Autowired(required = false) WingsRemoteResolver remoteResolver, SlardarFirstBloodProp prop) {
         log.info("SlardarWebmvc spring-bean firstBloodImageHandler");
         final FirstBloodImageHandler handler = new FirstBloodImageHandler();
-        handler.setScenePrefix(firstBloodProp.getCaptchaPrefix());
-        handler.setClientTicketKey(firstBloodProp.getClientTicketKey());
-        handler.setQuestCaptchaKey(firstBloodProp.getQuestCaptchaKey());
-        handler.setCheckCaptchaKey(firstBloodProp.getCheckCaptchaKey());
-        handler.setBase64CaptchaKey(firstBloodProp.getBase64CaptchaKey());
-        handler.setBase64CaptchaBody(firstBloodProp.getBase64CaptchaBody());
+        handler.setScenePrefix(prop.getCaptchaPrefix());
+        handler.setClientTicketKey(prop.getClientTicketKey());
+        handler.setQuestCaptchaKey(prop.getQuestCaptchaKey());
+        handler.setCheckCaptchaKey(prop.getCheckCaptchaKey());
+        handler.setBase64CaptchaKey(prop.getBase64CaptchaKey());
+        handler.setBase64CaptchaBody(prop.getBase64CaptchaBody());
 
         ModelAndView mav = new ModelAndView();
-        PlainTextView pv = new PlainTextView(firstBloodProp.getContentType(), firstBloodProp.getResponseBody());
-        mav.setStatus(HttpStatus.valueOf(firstBloodProp.getHttpStatus()));
+        PlainTextView pv = new PlainTextView(prop.getContentType(), prop.getResponseBody());
+        mav.setStatus(HttpStatus.valueOf(prop.getHttpStatus()));
         mav.setView(pv);
 
         handler.setNeedCaptchaResponse(mav);
         handler.setWingsRemoteResolver(remoteResolver);
-        handler.setCaseIgnore(firstBloodProp.isCaseIgnore());
-        if (firstBloodProp.isChineseCaptcha()) {
+        handler.setCaseIgnore(prop.isCaseIgnore());
+        if (prop.isChineseCaptcha()) {
             log.info("SlardarWebmvc conf firstBloodImageHandler ChineseCaptcha");
             handler.setCaptchaSupplier(() -> RandCode.mix(4));
         }
@@ -65,7 +60,7 @@ public FirstBloodImageHandler firstBloodImageHandler(@Autowired(required = false
     }
 
     @Bean
-    @ConditionalOnMissingBean(FirstBloodInterceptor.class)
+    @ConditionalWingsEnabled
     public FirstBloodInterceptor firstBloodInterceptor(ObjectProvider providers) {
         final List handlers = providers.orderedStream().collect(Collectors.toList());
         log.info("SlardarWebmvc spring-bean firstBloodInterceptor, handlers count=" + handlers.size());
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java
index 27ef49464..afec7e594 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java
@@ -6,13 +6,10 @@
 import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
 import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
 import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
-import lombok.RequiredArgsConstructor;
 import lombok.val;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.MessageSource;
@@ -25,6 +22,7 @@
 import pro.fessional.mirana.i18n.I18nString;
 import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.autozone.AutoZoneType;
 import pro.fessional.wings.slardar.autozone.json.JacksonLocalDateDeserializer;
 import pro.fessional.wings.slardar.autozone.json.JacksonLocalDateTimeDeserializer;
@@ -43,7 +41,6 @@
 import pro.fessional.wings.slardar.jackson.JacksonHelper;
 import pro.fessional.wings.slardar.jackson.ResourceSerializer;
 import pro.fessional.wings.slardar.spring.prop.SlardarDatetimeProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarJacksonProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarNumberProp;
 
@@ -67,18 +64,12 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(DateSerializer.class)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$jackson, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties({SlardarJacksonProp.class, SlardarDatetimeProp.class, SlardarNumberProp.class})
-@RequiredArgsConstructor
 public class SlardarJacksonWebConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarJacksonWebConfiguration.class);
 
-    private final SlardarJacksonProp slardarJacksonProp;
-    private final SlardarDatetimeProp slardarDatetimeProp;
-    private final SlardarNumberProp slardarNumberProp;
-    private final MessageSource messageSource;
-
     /**
      * The context's Jackson2ObjectMapperBuilder can be customized by one or more
      * Jackson2ObjectMapperBuilderCustomizer beans. Such customizer beans can be ordered
@@ -92,73 +83,74 @@ public class SlardarJacksonWebConfiguration {
      * It has some useful methods to access the default and user-enhanced message converters.
      */
     @Bean
-    public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperDatetime() {
-        log.info("SlardarWebmvc spring-bean customizerObjectMapperDatetime");
+    @ConditionalWingsEnabled
+    public Jackson2ObjectMapperBuilderCustomizer customizeJacksonDatetime(SlardarDatetimeProp prop) {
+        log.info("SlardarWebmvc spring-bean customizeJacksonDatetime");
         return builder -> {
             // local
-            val date = DateTimeFormatter.ofPattern(slardarDatetimeProp.getDate().getFormat());
-            val datePsr = slardarDatetimeProp.getDate()
-                                             .getSupport()
-                                             .stream()
-                                             .map(DateTimeFormatter::ofPattern)
-                                             .collect(Collectors.toList());
+            val date = DateTimeFormatter.ofPattern(prop.getDate().getFormat());
+            val datePsr = prop.getDate()
+                              .getSupport()
+                              .stream()
+                              .map(DateTimeFormatter::ofPattern)
+                              .collect(Collectors.toList());
             builder.serializerByType(LocalDate.class, new LocalDateSerializer(date));
             builder.deserializerByType(LocalDate.class, new JacksonLocalDateDeserializer(date, datePsr));
             log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer LocalDate");
 
-            val time = DateTimeFormatter.ofPattern(slardarDatetimeProp.getTime().getFormat());
-            val timePsr = slardarDatetimeProp.getTime()
-                                             .getSupport()
-                                             .stream()
-                                             .map(DateTimeFormatter::ofPattern)
-                                             .collect(Collectors.toList());
+            val time = DateTimeFormatter.ofPattern(prop.getTime().getFormat());
+            val timePsr = prop.getTime()
+                              .getSupport()
+                              .stream()
+                              .map(DateTimeFormatter::ofPattern)
+                              .collect(Collectors.toList());
             builder.serializerByType(LocalTime.class, new LocalTimeSerializer(time));
             builder.deserializerByType(LocalTime.class, new JacksonLocalTimeDeserializer(time, timePsr));
             log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer LocalTime");
 
             // auto local
-            val full = DateTimeFormatter.ofPattern(slardarDatetimeProp.getDatetime().getFormat());
-            final AutoZoneType autoLocal = AutoZoneType.valueOf(slardarDatetimeProp.getDatetime().isAuto());
+            val full = DateTimeFormatter.ofPattern(prop.getDatetime().getFormat());
+            final AutoZoneType autoLocal = AutoZoneType.valueOf(prop.getDatetime().isAuto());
             JacksonLocalDateTimeSerializer.defaultFormatter = full;
             JacksonLocalDateTimeSerializer.defaultAutoZone = autoLocal;
             builder.serializerByType(LocalDateTime.class, new JacksonLocalDateTimeSerializer(full, autoLocal));
 
-            val fullPsr = slardarDatetimeProp.getDatetime()
-                                             .getSupport()
-                                             .stream()
-                                             .map(DateTimeFormatter::ofPattern)
-                                             .collect(Collectors.toList());
+            val fullPsr = prop.getDatetime()
+                              .getSupport()
+                              .stream()
+                              .map(DateTimeFormatter::ofPattern)
+                              .collect(Collectors.toList());
             builder.deserializerByType(LocalDateTime.class, new JacksonLocalDateTimeDeserializer(full, fullPsr, autoLocal));
             log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer LocalDateTime");
 
             // auto zoned
-            DateTimeFormatter zoned = DateTimeFormatter.ofPattern(slardarDatetimeProp.getZoned().getFormat());
-            final AutoZoneType autoZone = AutoZoneType.valueOf(slardarDatetimeProp.getZoned().isAuto());
+            DateTimeFormatter zoned = DateTimeFormatter.ofPattern(prop.getZoned().getFormat());
+            final AutoZoneType autoZone = AutoZoneType.valueOf(prop.getZoned().isAuto());
             JacksonZonedDateTimeSerializer.defaultFormatter = zoned;
             JacksonZonedDateTimeSerializer.defaultAutoZone = autoZone;
             builder.serializerByType(ZonedDateTime.class, new JacksonZonedDateTimeSerializer(zoned, autoZone));
 
-            val zonePsr = slardarDatetimeProp.getZoned()
-                                             .getSupport()
-                                             .stream()
-                                             .map(DateTimeFormatter::ofPattern)
-                                             .collect(Collectors.toList());
+            val zonePsr = prop.getZoned()
+                              .getSupport()
+                              .stream()
+                              .map(DateTimeFormatter::ofPattern)
+                              .collect(Collectors.toList());
 
             builder.deserializerByType(ZonedDateTime.class, new JacksonZonedDateTimeDeserializer(zoned, zonePsr, autoZone));
             log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer ZonedDateTime");
 
             // auto offset
-            DateTimeFormatter offset = DateTimeFormatter.ofPattern(slardarDatetimeProp.getOffset().getFormat());
-            final AutoZoneType autoOffset = AutoZoneType.valueOf(slardarDatetimeProp.getOffset().isAuto());
+            DateTimeFormatter offset = DateTimeFormatter.ofPattern(prop.getOffset().getFormat());
+            final AutoZoneType autoOffset = AutoZoneType.valueOf(prop.getOffset().isAuto());
             JacksonOffsetDateTimeSerializer.defaultFormatter = offset;
             JacksonOffsetDateTimeSerializer.defaultAutoZone = autoOffset;
             builder.serializerByType(OffsetDateTime.class, new JacksonOffsetDateTimeSerializer(offset, autoOffset));
 
-            val offPsr = slardarDatetimeProp.getZoned()
-                                            .getSupport()
-                                            .stream()
-                                            .map(DateTimeFormatter::ofPattern)
-                                            .collect(Collectors.toList());
+            val offPsr = prop.getZoned()
+                             .getSupport()
+                             .stream()
+                             .map(DateTimeFormatter::ofPattern)
+                             .collect(Collectors.toList());
 
             builder.deserializerByType(OffsetDateTime.class, new JacksonOffsetDateTimeDeserializer(offset, offPsr, autoOffset));
             log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer OffsetDateTime");
@@ -166,18 +158,22 @@ public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperDatetime() {
     }
 
     @Bean
-    public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperResource() {
-        log.info("SlardarWebmvc spring-bean customizerObjectMapperResource");
-        return builder -> builder.serializerByType(Resource.class, new ResourceSerializer());
+    @ConditionalWingsEnabled
+    public Jackson2ObjectMapperBuilderCustomizer customizeJacksonResource() {
+        log.info("SlardarWebmvc spring-bean customizeJacksonResource");
+        return builder -> {
+            log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer Resource");
+            builder.serializerByType(Resource.class, new ResourceSerializer());
+        };
     }
 
     @Bean
-    @ConditionalOnProperty(name = SlardarEnabledProp.Key$number, havingValue = "true")
-    public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperNumber() {
-        log.info("SlardarWebmvc spring-bean customizerObjectMapperNumber");
+    @ConditionalWingsEnabled
+    public Jackson2ObjectMapperBuilderCustomizer customizeJacksonNumber(SlardarNumberProp prop) {
+        log.info("SlardarWebmvc spring-bean customizeJacksonNumber");
         return builder -> {
             // Number
-            final SlardarNumberProp.Nf ints = slardarNumberProp.getInteger();
+            final SlardarNumberProp.Nf ints = prop.getInteger();
             if (ints.isEnable()) {
                 final DecimalFormat df = ints.getWellFormat();
                 final Digital digital = ints.getDigital();
@@ -188,7 +184,7 @@ public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperNumber() {
                 builder.serializerByType(Long.TYPE, new FormatNumberSerializer(Long.TYPE, df, digital));
             }
 
-            final SlardarNumberProp.Nf floats = slardarNumberProp.getFloats();
+            final SlardarNumberProp.Nf floats = prop.getFloats();
             if (floats.isEnable()) {
                 final DecimalFormat df = floats.getWellFormat();
                 final Digital digital = floats.getDigital();
@@ -199,7 +195,7 @@ public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperNumber() {
                 builder.serializerByType(Double.TYPE, new FormatNumberSerializer(Double.TYPE, df, digital));
             }
 
-            final SlardarNumberProp.Nf decimal = slardarNumberProp.getDecimal();
+            final SlardarNumberProp.Nf decimal = prop.getDecimal();
             if (decimal.isEnable()) {
                 final DecimalFormat df = decimal.getWellFormat();
                 log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer BigDecimal/BigInteger serializer");
@@ -210,25 +206,33 @@ public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperNumber() {
     }
 
     @Bean
-    public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperJackson() {
-        log.info("SlardarWebmvc spring-bean customizerObjectMapperJackson");
+    @ConditionalWingsEnabled
+    public Jackson2ObjectMapperBuilderCustomizer customizeJacksonEmpty(SlardarJacksonProp prop) {
+        log.info("SlardarWebmvc spring-bean customizeJacksonEmpty");
         return builder -> {
-            if (StringUtils.hasText(slardarJacksonProp.getEmptyDate()) ||
-                slardarJacksonProp.isEmptyMap() || slardarJacksonProp.isEmptyList()) {
+            if (StringUtils.hasText(prop.getEmptyDate()) || prop.isEmptyMap() || prop.isEmptyList()) {
                 log.info("SlardarWebmvc conf EmptyValuePropertyFilter's EmptyDateMixin");
                 builder.mixIn(Object.class, EmptyValuePropertyFilter.EmptyDateMixin.class);
             }
+        };
+    }
 
-            if (slardarJacksonProp.isI18nResult()) {
+    @Bean
+    @ConditionalWingsEnabled
+    public Jackson2ObjectMapperBuilderCustomizer customizeJacksonResult(SlardarJacksonProp prop, MessageSource source) {
+        log.info("SlardarWebmvc spring-bean customizerObjectMapperJackson");
+        return builder -> {
+            if (prop.isI18nResult()) {
                 log.info("SlardarWebmvc conf I18nResultPropertyFilter's I18nResultMixin");
-                builder.serializerByType(I18nString.class, new I18nStringSerializer(messageSource, true));
-                builder.serializerByType(CharSequence.class, new I18nStringSerializer(messageSource, false));
+                builder.serializerByType(I18nString.class, new I18nStringSerializer(source, true));
+                builder.serializerByType(CharSequence.class, new I18nStringSerializer(source, false));
                 builder.mixIn(R.class, I18nResultPropertyFilter.I18nResultMixin.class);
             }
         };
     }
 
     @Bean
+    @ConditionalWingsEnabled
     public FilterProvider slardarFilterProvider(List filters) {
         log.info("SlardarWebmvc spring-bean slardarFilterProvider");
         final SimpleFilterProvider bean = new SimpleFilterProvider();
@@ -239,15 +243,19 @@ public FilterProvider slardarFilterProvider(List fil
     }
 
     @Bean
-    @ConditionalOnBean(FilterProvider.class)
-    public Jackson2ObjectMapperBuilderCustomizer customizerObjectMapperFilterProvider(FilterProvider filterProvider) {
-        log.info("SlardarWebmvc spring-bean customizerObjectMapperFilterProvider");
-        return builder -> builder.filters(filterProvider);
+    @ConditionalWingsEnabled
+    public Jackson2ObjectMapperBuilderCustomizer customizeJacksonFilter(FilterProvider filterProvider) {
+        log.info("SlardarWebmvc spring-bean customizeJacksonFilter");
+        return builder -> {
+            log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer filters");
+            builder.filters(filterProvider);
+        };
     }
 
     @Bean
-    public ApplicationStartedEventRunner runnerJacksonHelper(Jackson2ObjectMapperBuilder builder) {
-        log.info("SlardarWebmvc spring-runs runnerJacksonHelper");
+    @ConditionalWingsEnabled
+    public ApplicationStartedEventRunner jacksonHelperRunner(Jackson2ObjectMapperBuilder builder) {
+        log.info("SlardarWebmvc spring-runs jacksonHelperRunner");
         return new ApplicationStartedEventRunner(WingsOrdered.Lv1Config, ignored -> {
             log.info("SlardarWebmvc spring-conf JacksonHelper.initGlobal");
             JacksonHelper.initGlobal(
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java
index 32dd478c4..dcb8d4d30 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java
@@ -3,13 +3,12 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.LocaleResolver;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.servlet.resolver.WingsLocaleResolver;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarLocaleProp;
 
 import static org.springframework.web.servlet.DispatcherServlet.LOCALE_RESOLVER_BEAN_NAME;
@@ -19,15 +18,16 @@
  * @since 2019-06-29
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$locale, havingValue = "true")
+@ConditionalWingsEnabled
+@ConditionalOnClass(LocaleResolver.class)
 @EnableConfigurationProperties({SlardarLocaleProp.class})
 public class SlardarLocaleConfiguration {
 
     private final Log log = LogFactory.getLog(SlardarLocaleConfiguration.class);
 
     @Bean(LOCALE_RESOLVER_BEAN_NAME)
-    @ConditionalOnClass(LocaleResolver.class)
-    public WingsLocaleResolver wingsLocaleResolver(SlardarLocaleProp conf) {
+    @ConditionalWingsEnabled
+    public WingsLocaleResolver localeResolver(SlardarLocaleProp conf) {
         log.info("SlardarWebmvc spring-bean wingsLocaleResolver");
         final WingsLocaleResolver resolver = new WingsLocaleResolver();
         resolver.addLocaleCookie(conf.getLocaleCookie());
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java
index 7e8d77f9b..73a9d2a7a 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java
@@ -4,8 +4,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
 import org.springframework.boot.autoconfigure.web.client.RestTemplateBuilderConfigurer;
 import org.springframework.boot.web.client.RestTemplateBuilder;
@@ -13,7 +11,7 @@
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
 import org.springframework.web.client.RestTemplate;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
 /**
  * @author trydofor
@@ -23,13 +21,13 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(OkHttpClient.class)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$okhttp, havingValue = "true")
+@ConditionalWingsEnabled
 public class SlardarOkhttpWebConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarOkhttpWebConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(RestTemplateBuilder.class)
+    @ConditionalWingsEnabled
     public RestTemplateBuilder restTemplateBuilder(RestTemplateBuilderConfigurer configurer, OkHttpClient client) {
         log.info("SlardarWebmvc spring-bean restTemplateBuilder");
         final RestTemplateBuilder builder = configurer.configure(new RestTemplateBuilder());
@@ -37,8 +35,8 @@ public RestTemplateBuilder restTemplateBuilder(RestTemplateBuilderConfigurer con
     }
 
     @Bean
-    @ConditionalOnMissingBean(RestTemplate.class)
-    public RestTemplate okRestTemplate(RestTemplateBuilder builder) {
+    @ConditionalWingsEnabled
+    public RestTemplate okhttpRestTemplate(RestTemplateBuilder builder) {
         log.info("SlardarWebmvc spring-bean okRestTemplate");
         return builder.build();
     }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java
index bc510d9a6..cbfdcf96b 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java
@@ -7,8 +7,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.ApplicationListener;
 import org.springframework.context.annotation.Bean;
@@ -18,9 +16,9 @@
 import org.springframework.stereotype.Component;
 import pro.fessional.mirana.best.DummyBlock;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.servlet.filter.WingsOverloadFilter;
 import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarOverloadProp;
 
 import java.io.IOException;
@@ -35,7 +33,7 @@
  */
 
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$overload, havingValue = "true")
+@ConditionalWingsEnabled(false)
 @ConditionalOnClass(Filter.class)
 @EnableConfigurationProperties(SlardarOverloadProp.class)
 @Deprecated
@@ -45,6 +43,7 @@ public class SlardarOverloadConfiguration {
 
     @Component
     @Order(WingsOrdered.Lv4Application)
+    @ConditionalWingsEnabled
     @RequiredArgsConstructor
     public class SafelyShutdown implements ApplicationListener {
         private final WingsOverloadFilter overloadFilter;
@@ -68,7 +67,7 @@ public void onApplicationEvent(@NotNull ContextClosedEvent event) {
     }
 
     @Bean
-    @ConditionalOnMissingBean(WingsOverloadFilter.FallBack.class)
+    @ConditionalWingsEnabled
     public WingsOverloadFilter.FallBack overloadFallback(WingsOverloadFilter.Config config) {
         log.info("SlardarWebmvc spring-bean overloadFallback");
         return (request, response) -> {
@@ -88,6 +87,7 @@ public WingsOverloadFilter.FallBack overloadFallback(WingsOverloadFilter.Config
     }
 
     @Bean
+    @ConditionalWingsEnabled
     public WingsOverloadFilter wingsOverloadFilter(WingsOverloadFilter.Config config,
                                                    WingsOverloadFilter.FallBack fallBack,
                                                    WingsRemoteResolver resolver) {
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java
index 83a465e4c..ae67e1f59 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java
@@ -1,14 +1,12 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.mirana.data.Null;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.spring.prop.SlardarPagequeryProp;
 import pro.fessional.wings.slardar.webmvc.PageQueryArgumentResolver;
 
@@ -17,24 +15,22 @@
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$pagequery, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarPagequeryProp.class)
-@RequiredArgsConstructor
 public class SlardarPageQueryConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarPageQueryConfiguration.class);
 
-    private final SlardarPagequeryProp config;
-
     @Bean
-    public PageQueryArgumentResolver pageQueryArgumentResolver() {
+    @ConditionalWingsEnabled
+    public PageQueryArgumentResolver pageQueryArgumentResolver(SlardarPagequeryProp prop) {
         log.info("SlardarWebmvc spring-bean pageQueryArgumentResolver");
         final PageQueryArgumentResolver resolver = new PageQueryArgumentResolver();
-        resolver.setPage(config.getPage());
-        resolver.setSize(config.getSize());
-        resolver.setPageAlias(config.getPageAlias().toArray(Null.StrArr));
-        resolver.setSizeAlias(config.getSizeAlias().toArray(Null.StrArr));
-        resolver.setSortAlias(config.getSortAlias().toArray(Null.StrArr));
+        resolver.setPage(prop.getPage());
+        resolver.setSize(prop.getSize());
+        resolver.setPageAlias(prop.getPageAlias().toArray(Null.StrArr));
+        resolver.setSizeAlias(prop.getSizeAlias().toArray(Null.StrArr));
+        resolver.setSortAlias(prop.getSortAlias().toArray(Null.StrArr));
         return resolver;
     }
 }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java
index 86f80533e..8d68f4cd6 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java
@@ -2,13 +2,12 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.silencer.spring.help.CommonPropHelper;
 import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarRemoteProp;
 
 /**
@@ -16,15 +15,16 @@
  * @since 2019-06-29
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$remote, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarRemoteProp.class)
 public class SlardarRemoteConfiguration {
 
     private final Log log = LogFactory.getLog(SlardarRemoteConfiguration.class);
 
     @Bean
-    public WingsRemoteResolver wingsTerminalResolver(SlardarRemoteProp conf) {
-        log.info("SlardarWebmvc spring-bean WingsRemoteResolver");
+    @ConditionalWingsEnabled
+    public WingsRemoteResolver wingsRemoteResolver(SlardarRemoteProp conf) {
+        log.info("SlardarWebmvc spring-bean wingsRemoteResolver");
         final WingsRemoteResolver resolver = new WingsRemoteResolver();
         resolver.addInnerIp(CommonPropHelper.onlyValue(conf.getInnerIp().values()));
         resolver.addAgentHeader(CommonPropHelper.onlyValue(conf.getAgentHeader().values()));
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRestreamConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarReuseStreamConfiguration.java
similarity index 67%
rename from wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRestreamConfiguration.java
rename to wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarReuseStreamConfiguration.java
index a264c14e3..3db8a06f5 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRestreamConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarReuseStreamConfiguration.java
@@ -3,26 +3,24 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.servlet.stream.RequestResponseLogging;
 import pro.fessional.wings.slardar.servlet.stream.WingsReuseStreamFilter;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$restream, havingValue = "true")
-public class SlardarRestreamConfiguration {
+@ConditionalWingsEnabled
+public class SlardarReuseStreamConfiguration {
 
-    private static final Log log = LogFactory.getLog(SlardarRestreamConfiguration.class);
+    private static final Log log = LogFactory.getLog(SlardarReuseStreamConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(WingsReuseStreamFilter.class)
+    @ConditionalWingsEnabled
     public WingsReuseStreamFilter wingsReuseStreamFilter(ObjectProvider logging) {
         final WingsReuseStreamFilter filter = new WingsReuseStreamFilter();
         final RequestResponseLogging lg = logging.getIfAvailable();
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java
index 6621111d4..fd52a085d 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java
@@ -1,18 +1,15 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.HandlerExceptionResolver;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.concur.impl.RighterExceptionResolver;
 import pro.fessional.wings.slardar.concur.impl.RighterInterceptor;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarRighterProp;
 
 /**
@@ -20,30 +17,25 @@
  * @since 2019-06-29
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$righter, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarRighterProp.class)
-@RequiredArgsConstructor
 public class SlardarRighterConfiguration {
-
-    public static final String righterExceptionResolver = "righterExceptionResolver";
     private final static Log log = LogFactory.getLog(SlardarRighterConfiguration.class);
-    
-    private final SlardarRighterProp slardarRighterProp;
+
 
     @Bean
-    @ConditionalOnMissingBean(RighterInterceptor.class)
-    public RighterInterceptor righterInterceptor(ObjectProvider secretProvider) {
+    @ConditionalWingsEnabled
+    public RighterInterceptor righterInterceptor(ObjectProvider secretProvider, SlardarRighterProp prop) {
         log.info("SlardarWebmvc spring-bean righterInterceptor");
-        final RighterInterceptor bean = new RighterInterceptor(slardarRighterProp);
+        final RighterInterceptor bean = new RighterInterceptor(prop);
         secretProvider.ifAvailable(bean::setSecretProvider);
         return bean;
     }
 
-    @Bean(name = righterExceptionResolver)
-    @ConditionalOnMissingBean(name = righterExceptionResolver)
-    @ConditionalOnProperty(name = SlardarEnabledProp.Key$righter, havingValue = "true")
-    public HandlerExceptionResolver righterExceptionResolver() {
-        log.info("SlardarWebmvc spring-bean " + righterExceptionResolver);
-        return new RighterExceptionResolver(slardarRighterProp);
+    @Bean
+    @ConditionalWingsEnabled
+    public HandlerExceptionResolver righterExceptionResolver(SlardarRighterProp prop) {
+        log.info("SlardarWebmvc spring-bean righterExceptionResolver");
+        return new RighterExceptionResolver(prop);
     }
 }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSessionConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSessionConfiguration.java
index a301b7f61..fb61edd98 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSessionConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSessionConfiguration.java
@@ -1,10 +1,8 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.session.DefaultCookieSerializerCustomizer;
 import org.springframework.boot.autoconfigure.web.ServerProperties;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -19,8 +17,8 @@
 import org.springframework.session.web.http.HttpSessionIdResolver;
 import org.springframework.util.StringUtils;
 import pro.fessional.mirana.best.AssertArgs;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.session.WingsSessionIdResolver;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarSessionProp;
 
 import java.util.ArrayList;
@@ -36,23 +34,22 @@
  * @since 2019-06-26
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$session, havingValue = "true")
-@EnableConfigurationProperties({ServerProperties.class,SlardarSessionProp.class})
-@RequiredArgsConstructor
+@ConditionalWingsEnabled
+@EnableConfigurationProperties({ServerProperties.class, SlardarSessionProp.class})
 public class SlardarSessionConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarSessionConfiguration.class);
 
-    private final SlardarSessionProp slardarSessionProp;
 
     @Bean
-    public DefaultCookieSerializerCustomizer slardarCookieSerializerCustomizer() {
+    @ConditionalWingsEnabled
+    public DefaultCookieSerializerCustomizer slardarCookieSerializerCustomizer(SlardarSessionProp prop) {
         log.info("SlardarWebmvc spring-bean slardarCookieSerializerCustomizer");
         return it -> {
-            final boolean base64 = slardarSessionProp.isCookieBase64();
+            final boolean base64 = prop.isCookieBase64();
             log.info("SlardarWebmvc conf Session Cookie Base64=" + base64);
             it.setUseBase64Encoding(base64);
-            final String jvmRoute = slardarSessionProp.getCookieRoute();
+            final String jvmRoute = prop.getCookieRoute();
             if (StringUtils.hasText(jvmRoute)) {
                 log.info("SlardarWebmvc conf Session Cookie jvmRoute=" + jvmRoute);
                 it.setJvmRoute(jvmRoute);
@@ -61,18 +58,20 @@ public DefaultCookieSerializerCustomizer slardarCookieSerializerCustomizer() {
     }
 
     @Bean
+    @ConditionalWingsEnabled
     public HttpSessionIdResolver httpSessionIdResolver(
             ObjectProvider serverProperties,
             ObjectProvider cookieSerializer,
-            ObjectProvider cookieSerializerCustomizers) {
+            ObjectProvider cookieSerializerCustomizers,
+            SlardarSessionProp prop) {
         log.info("SlardarWebmvc spring-bean httpSessionIdResolver");
 
         final List resolvers = new ArrayList<>();
-        if (StringUtils.hasText(slardarSessionProp.getCookieName())) {
+        if (StringUtils.hasText(prop.getCookieName())) {
             final ServerProperties server = serverProperties.getIfAvailable();
             AssertArgs.notNull(server, "need `server.servlet.session.*` config");
             Cookie cookie = server.getServlet().getSession().getCookie();
-            final String propName = slardarSessionProp.getCookieName();
+            final String propName = prop.getCookieName();
             final String servName = cookie.getName();
             if (propName.equals(servName)) {
                 log.info("SlardarWebmvc conf cookieHttpSessionIdResolver by server.servlet.session.cookie.name=" + propName);
@@ -100,7 +99,7 @@ public HttpSessionIdResolver httpSessionIdResolver(
             resolvers.add(cookieHttpSessionIdResolver);
         }
 
-        final String headerName = slardarSessionProp.getHeaderName();
+        final String headerName = prop.getHeaderName();
         if (StringUtils.hasText(headerName)) {
             final HeaderHttpSessionIdResolver headerHttpSessionIdResolver = new HeaderHttpSessionIdResolver(headerName);
             log.info("SlardarWebmvc conf headerHttpSessionIdResolver by header.name=" + headerName);
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java
index 9fafdfce9..7f910323f 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java
@@ -20,6 +20,7 @@
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.mirana.page.PageQuery;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.silencer.spring.help.CommonPropHelper;
 import pro.fessional.wings.slardar.spring.prop.SlardarPagequeryProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarSwaggerProp;
@@ -32,6 +33,7 @@
  * @since 2019-10-30
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 @ConditionalOnClass(OpenAPI.class)
 @EnableConfigurationProperties(SlardarSwaggerProp.class)
 public class SlardarSwaggerConfiguration {
@@ -39,6 +41,7 @@ public class SlardarSwaggerConfiguration {
     private static final Log log = LogFactory.getLog(SlardarSwaggerConfiguration.class);
 
     @Bean
+    @ConditionalWingsEnabled
     public OpenApiCustomizer slardarOpenApiCustomizer(SlardarSwaggerProp slardarSwaggerProp) {
         log.info("SlardarWebmvc spring-bean slardarOpenApiCustomizer");
 
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java
index 5cafbbcd5..752a60de5 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java
@@ -3,14 +3,12 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.GrantedAuthority;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.constants.SlardarServletConst;
 import pro.fessional.wings.slardar.context.SecurityContextUtil;
 import pro.fessional.wings.slardar.context.TerminalInterceptor;
@@ -18,7 +16,6 @@
 import pro.fessional.wings.slardar.security.WingsUserDetails;
 import pro.fessional.wings.slardar.servlet.resolver.WingsLocaleResolver;
 import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarTerminalProp;
 
 import java.util.ArrayList;
@@ -33,14 +30,14 @@
  * @since 2019-06-29
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$terminal, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarTerminalProp.class)
 public class SlardarTerminalConfiguration {
 
     private final Log log = LogFactory.getLog(SlardarTerminalConfiguration.class);
 
     @Bean
-    @ConditionalOnBean({WingsRemoteResolver.class})
+    @ConditionalWingsEnabled
     public TerminalInterceptor.TerminalBuilder remoteTerminalBuilder(WingsRemoteResolver resolver) {
         log.info("SlardarWebmvc spring-bean remoteTerminalBuilder");
         return (builder, request) -> builder
@@ -49,7 +46,7 @@ public TerminalInterceptor.TerminalBuilder remoteTerminalBuilder(WingsRemoteReso
     }
 
     @Bean
-    @ConditionalOnBean({WingsRemoteResolver.class})
+    @ConditionalWingsEnabled
     public TerminalInterceptor.TerminalBuilder securityTerminalBuilder(WingsLocaleResolver resolver) {
         log.info("SlardarWebmvc spring-bean securityTerminalBuilder");
         return (builder, request) -> {
@@ -78,7 +75,7 @@ public TerminalInterceptor.TerminalBuilder securityTerminalBuilder(WingsLocaleRe
     }
 
     @Bean
-    @ConditionalOnMissingBean(TerminalInterceptor.class)
+    @ConditionalWingsEnabled
     public TerminalInterceptor terminalInterceptor(SlardarTerminalProp prop, ObjectProvider builders, ObjectProvider loggers) {
         log.info("SlardarWebmvc spring-bean terminalInterceptor");
 
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarUndertowConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarUndertowConfiguration.java
index 0267d5197..47bef9783 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarUndertowConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarUndertowConfiguration.java
@@ -7,7 +7,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.web.ServerProperties;
 import org.springframework.boot.web.embedded.undertow.UndertowDeploymentInfoCustomizer;
 import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
@@ -15,7 +14,7 @@
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.util.unit.DataSize;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
 /**
  * @author trydofor
@@ -24,6 +23,7 @@
 
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(Undertow.class)
+@ConditionalWingsEnabled
 public class SlardarUndertowConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarUndertowConfiguration.class);
@@ -32,7 +32,7 @@ public class SlardarUndertowConfiguration {
      * UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
      */
     @Bean
-    @ConditionalOnProperty(name = SlardarEnabledProp.Key$undertowWs, havingValue = "true")
+    @ConditionalWingsEnabled
     public WebServerFactoryCustomizer ut026010Customizer(ServerProperties properties) {
         log.info("SlardarWebmvc spring-bean ut026010Customizer");
 
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java
index 14c2d6fb2..0c54daffc 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java
@@ -15,6 +15,7 @@
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor;
 import pro.fessional.wings.slardar.webmvc.PageQueryArgumentResolver;
 
@@ -27,6 +28,7 @@
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 public class SlardarWebMvcConfiguration implements WebMvcConfigurer {
     private static final Log log = LogFactory.getLog(SlardarWebMvcConfiguration.class);
 
@@ -81,6 +83,7 @@ public void configureAsyncSupport(@NotNull AsyncSupportConfigurer configurer) {
     }
 
     @Bean
+    @ConditionalWingsEnabled
     public MvcRequestMatcher.Builder mvcRequestMatcherBuilder(HandlerMappingIntrospector introspector) {
         log.info("SlardarWebmvc conf mvcRequestMatcherBuilder");
         return new MvcRequestMatcher.Builder(introspector);
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebFunAutoConfiguration.java
similarity index 68%
rename from wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java
rename to wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebFunAutoConfiguration.java
index 3f4d653df..8da159d00 100644
--- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebmvcAutoConfiguration.java
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebFunAutoConfiguration.java
@@ -1,48 +1,42 @@
 package pro.fessional.wings.slardar.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.spring.bean.SlardarCookieConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDebounceConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDomainExtendConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDoubleKillWebConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration;
-import pro.fessional.wings.slardar.spring.bean.SlardarLocaleConfiguration;
-import pro.fessional.wings.slardar.spring.bean.SlardarOkhttpWebConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarOverloadConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarPageQueryConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarRemoteConfiguration;
-import pro.fessional.wings.slardar.spring.bean.SlardarRestreamConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarReuseStreamConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarRighterConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarSessionConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarSwaggerConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarTerminalConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarUndertowConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarWebMvcConfiguration;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(before = {SlardarAutoConfiguration.class, WebMvcAutoConfiguration.class})
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
-@ImportAutoConfiguration({
+@AutoConfiguration
+@ConditionalWingsEnabled
+@Import({
         SlardarCookieConfiguration.class,
         SlardarDebounceConfiguration.class,
         SlardarDomainExtendConfiguration.class,
         SlardarDoubleKillWebConfiguration.class,
         SlardarFirstBloodConfiguration.class,
         SlardarJacksonWebConfiguration.class,
-        SlardarLocaleConfiguration.class,
-        SlardarOkhttpWebConfiguration.class,
         SlardarOverloadConfiguration.class,
         SlardarPageQueryConfiguration.class,
         SlardarRemoteConfiguration.class,
-        SlardarRestreamConfiguration.class,
+        SlardarReuseStreamConfiguration.class,
         SlardarRighterConfiguration.class,
         SlardarSessionConfiguration.class,
         SlardarSwaggerConfiguration.class,
@@ -50,5 +44,5 @@
         SlardarUndertowConfiguration.class,
         SlardarWebMvcConfiguration.class,
 })
-public class SlardarWebmvcAutoConfiguration {
+public class SlardarWebFunAutoConfiguration {
 }
diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebMvcAutoConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebMvcAutoConfiguration.java
new file mode 100644
index 000000000..665131738
--- /dev/null
+++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebMvcAutoConfiguration.java
@@ -0,0 +1,21 @@
+package pro.fessional.wings.slardar.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
+import pro.fessional.wings.slardar.spring.bean.SlardarLocaleConfiguration;
+import pro.fessional.wings.slardar.spring.bean.SlardarOkhttpWebConfiguration;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration(before = WebMvcAutoConfiguration.class)
+@ConditionalWingsEnabled
+@Import({
+        SlardarLocaleConfiguration.class,
+        SlardarOkhttpWebConfiguration.class,
+})
+public class SlardarWebMvcAutoConfiguration {
+}
diff --git a/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 29cf6478e..8d466bb14 100644
--- a/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1 +1,2 @@
-pro.fessional.wings.slardar.spring.conf.SlardarWebmvcAutoConfiguration
+pro.fessional.wings.slardar.spring.conf.SlardarWebMvcAutoConfiguration
+pro.fessional.wings.slardar.spring.conf.SlardarWebFunAutoConfiguration
diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarFirstBloodTestConfiguration.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarFirstBloodTestConfiguration.java
index 7d214bb59..3876b8307 100644
--- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarFirstBloodTestConfiguration.java
+++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/app/conf/SlardarFirstBloodTestConfiguration.java
@@ -5,12 +5,12 @@
 import org.apache.commons.logging.LogFactory;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.servlet.ModelAndView;
 import pro.fessional.mirana.code.RandCode;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.concur.impl.FirstBloodImageHandler;
 import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver;
 import pro.fessional.wings.slardar.servlet.response.ResponseHelper;
@@ -22,12 +22,13 @@
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled(false)
 public class SlardarFirstBloodTestConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarFirstBloodTestConfiguration.class);
 
     @Bean
-    @ConditionalOnProperty(value = "spring.wings.slardar.enabled.first-blood-image-test", havingValue = "true")
+    @ConditionalWingsEnabled
     public FirstBloodImageHandler firstBloodImageHandler(@Autowired(required = false) WingsRemoteResolver remoteResolver,
                                                          SlardarFirstBloodProp firstBloodProp) {
         log.info("Wings conf firstBloodImageHandler for test");
diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java
index 512c498a8..7c5476eaa 100644
--- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java
+++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java
@@ -25,8 +25,9 @@
 @SpringBootTest(
         webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
         properties = {
-                "spring.wings.slardar.enabled.first-blood-image=false",
-                "spring.wings.slardar.enabled.first-blood-image-test=true",
+                "spring.wings.enabled.pro.fessional.wings.slardar.app.conf.SlardarFirstBloodTestConfiguration=true",
+                "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration=true",
+                "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration.firstBloodImageHandler=false",
                 "wings.slardar.first-blood.http-status=202",
                 "wings.slardar.first-blood.content-type=text/plain",
                 "wings.slardar.first-blood.response-body=first-blood",
@@ -72,8 +73,8 @@ public void checkFirstBlood(String url) {
             assertNotNull(ck);
             assertTrue(ct.contains("text/plain"));
             assertEquals("first-blood", OkHttpClientHelper.extractString(r2, false));
-            assertTrue(ck.contains(tk));
             log.warn("get client-ticket = " + tk);
+            assertTrue(ck.contains(tk));
         }
 
         final String code;
diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java
index 65439d538..5d3d37b81 100644
--- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java
+++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java
@@ -17,7 +17,7 @@
 @SpringBootTest(
         webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
         properties = {
-                "spring.wings.slardar.enabled.domain-extend=true",
+                "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDomainExtendConfiguration=true",
                 "spring.boot.admin.server.enabled=false"
         })
 public class DomainExtendTest {
diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/DecimalFormatTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/DecimalFormatTest.java
index 4666dd9e1..a79abb959 100644
--- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/DecimalFormatTest.java
+++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/DecimalFormatTest.java
@@ -32,7 +32,6 @@
  */
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
         properties = {
-                "spring.wings.slardar.enabled.number=true",
                 "wings.slardar.number.decimal.separator=_",
                 "wings.slardar.number.floats.format=#.00",
                 "wings.slardar.number.decimal.format=#.00",
diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/WingsJacksonMapperTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/WingsJacksonMapperTest.java
index 94aecfbe3..3f209c986 100644
--- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/WingsJacksonMapperTest.java
+++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/json/WingsJacksonMapperTest.java
@@ -68,7 +68,6 @@
  */
 @SpringBootTest(properties = {
         "wings.slardar.datetime.zoned.auto=true",
-        "spring.wings.slardar.enabled.number=true",
         "wings.slardar.jackson.empty-date=1970-01-01",
         "wings.slardar.jackson.empty-list=true",
         "wings.slardar.jackson.empty-map=true",
diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java
index 31965d5e1..79ba33a68 100644
--- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java
+++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java
@@ -41,7 +41,7 @@
  */
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
         properties = {
-                "spring.wings.slardar.enabled.cookie=true",
+                "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCookieConfiguration=true",
                 "wings.slardar.cookie.prefix=" + WingsCookieTest.PREFIX,
                 "wings.slardar.cookie.coder=aes",
                 "wings.slardar.cookie.alias[ck2]=" + WingsCookieTest.CK2OTH,
diff --git a/wings/slardar-webmvc/src/test/resources/application.properties b/wings/slardar-webmvc/src/test/resources/application.properties
index 26c5fa179..e8055b326 100644
--- a/wings/slardar-webmvc/src/test/resources/application.properties
+++ b/wings/slardar-webmvc/src/test/resources/application.properties
@@ -9,7 +9,7 @@ logging.level.pro.fessional=DEBUG
 #wings.slardar.monitor.log.default.file=/tmp/test-slardar.log
 #logging.file.name=/tmp/test-slardar.log
 
-spring.wings.slardar.enabled.mock-hazelcast=true
+spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=true
 
 #spring.boot.admin.client.url=http://localhost:${server.port}
 #spring.boot.admin.ui.title=Wings-Slardar-Admin
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/spring/WingsCacheAnnoOprSource.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/spring/WingsCacheAnnoOprSource.java
index d5ad8dea6..87c282e9f 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/spring/WingsCacheAnnoOprSource.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/cache/spring/WingsCacheAnnoOprSource.java
@@ -16,8 +16,8 @@ public class WingsCacheAnnoOprSource extends AnnotationCacheOperationSource {
 
     @Override
     protected Collection findCacheOperations(@NotNull Method method) {
-        final Collection oprs = super.findCacheOperations(method);
-        WingsCacheHelper.setOperation(method, oprs);
-        return oprs;
+        final Collection ops = super.findCacheOperations(method);
+        WingsCacheHelper.setOperation(method, ops);
+        return ops;
     }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java
index 02b59a9d6..994b816e3 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java
@@ -4,8 +4,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
 import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
 import org.springframework.boot.autoconfigure.task.TaskSchedulingProperties;
@@ -19,10 +17,10 @@
 import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.async.TaskSchedulerHelper;
 import pro.fessional.wings.slardar.async.TtlThreadPoolTaskScheduler;
 import pro.fessional.wings.slardar.spring.prop.SlardarAsyncProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 import java.util.concurrent.Executor;
 
@@ -43,7 +41,7 @@
  */
 @EnableAsync
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$async, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarAsyncProp.class)
 public class SlardarAsyncConfiguration {
     public static final String slardarHeavyScheduler = "slardarHeavyScheduler";
@@ -51,7 +49,7 @@ public class SlardarAsyncConfiguration {
     private static final Log log = LogFactory.getLog(SlardarAsyncConfiguration.class);
 
     @Bean(name = DEFAULT_TASK_EXECUTOR_BEAN_NAME)
-    @ConditionalOnMissingBean(name = DEFAULT_TASK_EXECUTOR_BEAN_NAME)
+    @ConditionalWingsEnabled
     public Executor taskExecutor(TaskExecutorBuilder builder) {
         final ThreadPoolTaskExecutor executor = builder.build();
         executor.initialize();
@@ -60,7 +58,7 @@ public Executor taskExecutor(TaskExecutorBuilder builder) {
     }
 
     @Bean(name = APPLICATION_TASK_EXECUTOR_BEAN_NAME)
-    @ConditionalOnMissingBean(name = APPLICATION_TASK_EXECUTOR_BEAN_NAME)
+    @ConditionalWingsEnabled
     public AsyncTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) {
         final ThreadPoolTaskExecutor executor = builder.build();
         executor.initialize();
@@ -71,7 +69,7 @@ public AsyncTaskExecutor applicationTaskExecutor(TaskExecutorBuilder builder) {
 
     // Do NOT use @Primary to avoid overwriting the @Async thread pool.
     @Bean(name = DEFAULT_TASK_SCHEDULER_BEAN_NAME)
-    @ConditionalOnMissingBean(name = DEFAULT_TASK_SCHEDULER_BEAN_NAME)
+    @ConditionalWingsEnabled
     public ThreadPoolTaskScheduler taskScheduler(TaskSchedulerBuilder builder) {
         final TtlThreadPoolTaskScheduler scheduler = new TtlThreadPoolTaskScheduler();
         final TtlThreadPoolTaskScheduler bean = builder.configure(scheduler);
@@ -81,7 +79,7 @@ public ThreadPoolTaskScheduler taskScheduler(TaskSchedulerBuilder builder) {
 
 
     @Bean(name = slardarHeavyScheduler)
-    @ConditionalOnMissingBean(name = slardarHeavyScheduler)
+    @ConditionalWingsEnabled
     public ThreadPoolTaskScheduler slardarHeavyScheduler(SlardarAsyncProp prop) {
         final TtlThreadPoolTaskScheduler scheduler = new TtlThreadPoolTaskScheduler();
         TaskSchedulerBuilder builder = new TaskSchedulerBuilder();
@@ -96,7 +94,7 @@ public ThreadPoolTaskScheduler slardarHeavyScheduler(SlardarAsyncProp prop) {
     }
 
     @Bean
-    @ConditionalOnMissingBean
+    @ConditionalWingsEnabled
     public TaskSchedulerHelper taskSchedulerHelper(
             @Qualifier(DEFAULT_TASK_SCHEDULER_BEAN_NAME) ThreadPoolTaskScheduler light,
             @Qualifier(slardarHeavyScheduler) ThreadPoolTaskScheduler heavy) {
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java
index d11b655bc..66338040d 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java
@@ -6,9 +6,6 @@
 import org.cache2k.extra.spring.SpringCache2kCacheManager;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.cache.CacheManager;
 import org.springframework.cache.annotation.AbstractCachingConfiguration;
@@ -23,6 +20,7 @@
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Primary;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.cache.WingsCache;
 import pro.fessional.wings.slardar.cache.WingsCacheHelper;
 import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k;
@@ -32,7 +30,6 @@
 import pro.fessional.wings.slardar.cache.spring.WingsCacheInterceptor;
 import pro.fessional.wings.slardar.cache.spring.WingsCacheResolver;
 import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -46,12 +43,13 @@
  */
 @EnableCaching
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$caching, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarCacheProp.class)
 public class SlardarCacheConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarCacheConfiguration.class);
 
+    // set FeatureJmx first
     public SlardarCacheConfiguration(@Value("${spring.jmx.enabled:false}") boolean jmx) {
         log.info("Slardar spring.jmx.enabled=" + jmx + ", if can NOT disable, check IDEA 'Disable JMX agent' options");
         if (!jmx && WingsCache2k.FeatureJmx != null) {
@@ -60,30 +58,22 @@ public SlardarCacheConfiguration(@Value("${spring.jmx.enabled:false}") boolean j
         }
     }
 
-    @Bean(Manager.Memory)
-    @ConditionalOnMissingBean(SpringCache2kCacheManager.class)
-    public SpringCache2kCacheManager cache2kCacheManager(SlardarCacheProp conf) {
-        log.info("Slardar spring-bean cache2kCacheManager as " + Manager.Memory);
-        // https://github.com/cache2k/cache2k/issues/123
-        return new WingsCache2kManager("spring-wings-" + hashCode(), conf);
-    }
-
     // //////////////////// aop ////////////////////
     @Configuration(proxyBeanMethods = false)
-    @ConditionalOnExpression("${" + SlardarEnabledProp.Key$caching + ":false} && ${" + SlardarEnabledProp.Key$cachingAop + ":false}")
-    public static class SlardarCacheAopConfiguration extends AbstractCachingConfiguration {
+    @ConditionalWingsEnabled
+    public static class CacheAop extends AbstractCachingConfiguration {
 
-        @Primary
         @Bean
+        @Primary
         public CacheOperationSource wingsCacheOperationSource() {
-            log.info("Slardar spring-bean wingsCacheOperationSource Primary");
+            log.info("Slardar spring-bean wingsCacheOperationSource as Primary");
             return new WingsCacheAnnoOprSource();
         }
 
-        @Primary
         @Bean
+        @Primary
         public CacheInterceptor wingsCacheInterceptor(CacheOperationSource cacheOperationSource) {
-            log.info("Slardar spring-bean wingsCacheInterceptor Primary");
+            log.info("Slardar spring-bean wingsCacheInterceptor as Primary");
             CacheEvictMultiKeys.wingsSupport = true;
             WingsCacheInterceptor interceptor = new WingsCacheInterceptor();
             interceptor.configure(this.errorHandler, this.keyGenerator, this.cacheResolver, this.cacheManager);
@@ -93,32 +83,34 @@ public CacheInterceptor wingsCacheInterceptor(CacheOperationSource cacheOperatio
     }
 
 
-    // //////////////////// cache ////////////////////
+    // //////////////////// CacheManager ////////////////////
     @Configuration(proxyBeanMethods = false)
+    @ConditionalWingsEnabled
     @RequiredArgsConstructor
-    public static class SlardarCachingConfigurerSupport implements CachingConfigurer {
-        private final Map managers;
-        private final Map resolvers;
-        private final SlardarCacheProp cacheProp;
+    public static class CacheMgr implements CachingConfigurer {
         private final ConfigurableListableBeanFactory beanFactory;
 
         @Bean
         @Primary
         @Override
         public CacheManager cacheManager() {
-            final Map resolverMap = new HashMap<>(managers);
+            final var managers = beanFactory.getBeansOfType(CacheManager.class);
+            final var resolvers = beanFactory.getBeansOfType(AbstractCacheResolver.class);
+            final var cacheProp = beanFactory.getBean(SlardarCacheProp.class);
+
+            final Map managerMap = new HashMap<>(managers);
             for (Map.Entry en : resolvers.entrySet()) {
-                log.info("Slardar find cacheResolver bean=" + en.getKey());
-                resolverMap.put(en.getKey(), en.getValue().getCacheManager());
+                log.info("Slardar find CacheManager via resolvers, name=" + en.getKey());
+                managerMap.put(en.getKey(), en.getValue().getCacheManager());
             }
 
             // Dynamic register Bean cacheResolver
             for (Map.Entry en : managers.entrySet()) {
                 final String key = en.getKey() + WingsCache.Resolver.Suffix;
                 final CacheManager cm = en.getValue();
-                resolverMap.put(key, cm);
+                managerMap.put(key, cm);
                 if (beanFactory.containsBean(key)) {
-                    log.info("Slardar skip cacheResolver bean=" + key + ", for existed");
+                    log.debug("Slardar skip register cacheResolver bean=" + key + ", for existed");
                 }
                 else {
                     final boolean exp = cacheProp.isExpand();
@@ -129,7 +121,7 @@ public CacheManager cacheManager() {
             }
 
             // name or resolver name
-            WingsCacheHelper.putManagers(resolverMap);
+            WingsCacheHelper.putManagers(managerMap);
 
             CacheManager pre = null;
             String cnm = null;
@@ -146,8 +138,17 @@ else if (pre == null && name.startsWith(prim)) {
                     pre = en.getValue();
                 }
             }
+
             log.info("Slardar spring-bean cacheManager Primary=" + cnm);
             return pre;
         }
     }
+
+    @Bean(Manager.Memory)
+    @ConditionalWingsEnabled
+    public SpringCache2kCacheManager cache2kCacheManager(SlardarCacheProp conf) {
+        log.info("Slardar spring-bean cache2kCacheManager as " + Manager.Memory);
+        // https://github.com/cache2k/cache2k/issues/123
+        return new WingsCache2kManager("spring-wings-" + hashCode(), conf);
+    }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java
index 0bfe15d4d..9334820f4 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java
@@ -1,14 +1,13 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import lombok.val;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.convert.ApplicationConversionService;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.autozone.spring.LocalDate2StringConverter;
 import pro.fessional.wings.slardar.autozone.spring.LocalDateTime2StringConverter;
 import pro.fessional.wings.slardar.autozone.spring.LocalTime2StringConverter;
@@ -20,7 +19,6 @@
 import pro.fessional.wings.slardar.autozone.spring.String2ZonedDateTimeConverter;
 import pro.fessional.wings.slardar.autozone.spring.ZonedDateTime2StringConverter;
 import pro.fessional.wings.slardar.spring.prop.SlardarDatetimeProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 import java.time.format.DateTimeFormatter;
 import java.util.stream.Collectors;
@@ -33,102 +31,109 @@
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$datetime, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarDatetimeProp.class)
-@RequiredArgsConstructor
 public class SlardarDateTimeConfiguration {
     private static final Log log = LogFactory.getLog(SlardarDateTimeConfiguration.class);
 
-    private final SlardarDatetimeProp slardarDatetimeProp;
-
     // spring boot can expose Beans instead of WebMvcConfigurer
     @Bean
-    public String2LocalDateConverter stringLocalDateConverter() {
+    @ConditionalWingsEnabled
+    public String2LocalDateConverter stringLocalDateConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean stringLocalDateConverter");
-        val fmt = slardarDatetimeProp.getDate()
-                                     .getSupport()
-                                     .stream()
-                                     .map(DateTimeFormatter::ofPattern)
-                                     .collect(Collectors.toList());
+        val fmt = prop.getDate()
+                      .getSupport()
+                      .stream()
+                      .map(DateTimeFormatter::ofPattern)
+                      .collect(Collectors.toList());
         return new String2LocalDateConverter(fmt);
     }
 
     @Bean
-    public LocalDate2StringConverter localDateStringConverter() {
+    @ConditionalWingsEnabled
+    public LocalDate2StringConverter localDateStringConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean localDateStringConverter");
-        final DateTimeFormatter fmt = DateTimeFormatter.ofPattern(slardarDatetimeProp.getDate().getFormat());
+        final DateTimeFormatter fmt = DateTimeFormatter.ofPattern(prop.getDate().getFormat());
         return new LocalDate2StringConverter(fmt);
     }
 
     @Bean
-    public String2LocalTimeConverter stringLocalTimeConverter() {
+    @ConditionalWingsEnabled
+    public String2LocalTimeConverter stringLocalTimeConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean stringLocalTimeConverter");
-        val fmt = slardarDatetimeProp.getTime()
-                                     .getSupport()
-                                     .stream()
-                                     .map(DateTimeFormatter::ofPattern)
-                                     .collect(Collectors.toList());
+        val fmt = prop.getTime()
+                      .getSupport()
+                      .stream()
+                      .map(DateTimeFormatter::ofPattern)
+                      .collect(Collectors.toList());
         return new String2LocalTimeConverter(fmt);
     }
 
     @Bean
-    public LocalTime2StringConverter localTimeStringConverter() {
+    @ConditionalWingsEnabled
+    public LocalTime2StringConverter localTimeStringConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean localTimeStringConverter");
-        final DateTimeFormatter fmt = DateTimeFormatter.ofPattern(slardarDatetimeProp.getTime().getFormat());
+        final DateTimeFormatter fmt = DateTimeFormatter.ofPattern(prop.getTime().getFormat());
         return new LocalTime2StringConverter(fmt);
     }
 
     @Bean
-    public String2LocalDateTimeConverter stringLocalDateTimeConverter() {
+    @ConditionalWingsEnabled
+    public String2LocalDateTimeConverter stringLocalDateTimeConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean stringLocalDateTimeConverter");
-        val fmt = slardarDatetimeProp.getDatetime()
-                                     .getSupport()
-                                     .stream()
-                                     .map(DateTimeFormatter::ofPattern)
-                                     .collect(Collectors.toList());
-        return new String2LocalDateTimeConverter(fmt, slardarDatetimeProp.getDatetime().isAuto());
+        val fmt = prop.getDatetime()
+                      .getSupport()
+                      .stream()
+                      .map(DateTimeFormatter::ofPattern)
+                      .collect(Collectors.toList());
+        return new String2LocalDateTimeConverter(fmt, prop.getDatetime().isAuto());
     }
 
     @Bean
-    public LocalDateTime2StringConverter localDateTimeStringConverter() {
+    @ConditionalWingsEnabled
+    public LocalDateTime2StringConverter localDateTimeStringConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean localDateTimeStringConverter");
-        final DateTimeFormatter fmt = DateTimeFormatter.ofPattern(slardarDatetimeProp.getDatetime().getFormat());
-        return new LocalDateTime2StringConverter(fmt, slardarDatetimeProp.getDatetime().isAuto());
+        final DateTimeFormatter fmt = DateTimeFormatter.ofPattern(prop.getDatetime().getFormat());
+        return new LocalDateTime2StringConverter(fmt, prop.getDatetime().isAuto());
     }
 
     @Bean
-    public String2ZonedDateTimeConverter stringZonedDateTimeConverter() {
+    @ConditionalWingsEnabled
+    public String2ZonedDateTimeConverter stringZonedDateTimeConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean stringZonedDateTimeConverter");
-        val fmt = slardarDatetimeProp.getZoned()
-                                     .getSupport()
-                                     .stream()
-                                     .map(DateTimeFormatter::ofPattern)
-                                     .collect(Collectors.toList());
-        return new String2ZonedDateTimeConverter(fmt, slardarDatetimeProp.getZoned().isAuto());
+        val fmt = prop.getZoned()
+                      .getSupport()
+                      .stream()
+                      .map(DateTimeFormatter::ofPattern)
+                      .collect(Collectors.toList());
+        return new String2ZonedDateTimeConverter(fmt, prop.getZoned().isAuto());
     }
 
     @Bean
-    public ZonedDateTime2StringConverter zonedDateTimeStringConverter() {
+    @ConditionalWingsEnabled
+    public ZonedDateTime2StringConverter zonedDateTimeStringConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean zonedDateTimeStringConverter");
-        DateTimeFormatter fmt = DateTimeFormatter.ofPattern(slardarDatetimeProp.getZoned().getFormat());
-        return new ZonedDateTime2StringConverter(fmt, slardarDatetimeProp.getZoned().isAuto());
+        DateTimeFormatter fmt = DateTimeFormatter.ofPattern(prop.getZoned().getFormat());
+        return new ZonedDateTime2StringConverter(fmt, prop.getZoned().isAuto());
     }
 
     @Bean
-    public String2OffsetDateTimeConverter stringOffsetDateTimeConverter() {
+    @ConditionalWingsEnabled
+    public String2OffsetDateTimeConverter stringOffsetDateTimeConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean stringOffsetDateTimeConverter");
-        val fmt = slardarDatetimeProp.getOffset()
-                                     .getSupport()
-                                     .stream()
-                                     .map(DateTimeFormatter::ofPattern)
-                                     .collect(Collectors.toList());
-        return new String2OffsetDateTimeConverter(fmt, slardarDatetimeProp.getOffset().isAuto());
+        val fmt = prop.getOffset()
+                      .getSupport()
+                      .stream()
+                      .map(DateTimeFormatter::ofPattern)
+                      .collect(Collectors.toList());
+        return new String2OffsetDateTimeConverter(fmt, prop.getOffset().isAuto());
     }
 
     @Bean
-    public OffsetDateTime2StringConverter offsetDateTimeStringConverter() {
+    @ConditionalWingsEnabled
+    public OffsetDateTime2StringConverter offsetDateTimeStringConverter(SlardarDatetimeProp prop) {
         log.info("Slardar spring-bean offsetDateTimeStringConverter");
-        DateTimeFormatter fmt = DateTimeFormatter.ofPattern(slardarDatetimeProp.getOffset().getFormat());
-        return new OffsetDateTime2StringConverter(fmt, slardarDatetimeProp.getOffset().isAuto());
+        DateTimeFormatter fmt = DateTimeFormatter.ofPattern(prop.getOffset().getFormat());
+        return new OffsetDateTime2StringConverter(fmt, prop.getOffset().isAuto());
     }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
index 7b55a8fb1..de5d0f326 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java
@@ -1,14 +1,12 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.Setter;
 import okhttp3.OkHttpClient;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.notice.DingTalkNotice;
 import pro.fessional.wings.slardar.spring.prop.SlardarDingNoticeProp;
 
@@ -17,20 +15,17 @@
  * @since 2019-06-29
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarDingNoticeProp.class)
 public class SlardarDingNoticeConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarDingNoticeConfiguration.class);
 
-    @Setter(onMethod_ = {@Autowired})
-    private SlardarDingNoticeProp slardarDingNoticeProp;
-
-    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
     @Bean
-    @ConditionalOnMissingBean(DingTalkNotice.class)
-    public DingTalkNotice dingTalkNotice(OkHttpClient okHttpClient) {
+    @ConditionalWingsEnabled
+    public DingTalkNotice dingTalkNotice(OkHttpClient okHttpClient, SlardarDingNoticeProp prop) {
         log.info("Slardar spring-bean dingTalkNotice");
-        return new DingTalkNotice(okHttpClient, slardarDingNoticeProp);
+        return new DingTalkNotice(okHttpClient, prop);
     }
 
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java
index db9d994f9..007b1206c 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java
@@ -1,26 +1,24 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.concur.impl.DoubleKillAround;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@RequiredArgsConstructor
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$doubleKill, havingValue = "true")
+@ConditionalWingsEnabled
 public class SlardarDoubleKillConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarDoubleKillConfiguration.class);
 
     @Bean
+    @ConditionalWingsEnabled
     public DoubleKillAround doubleKillAround() {
         log.info("Slardar spring-bean doubleKillAround");
         return new DoubleKillAround();
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java
index a9d6d5879..1cee05aa1 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java
@@ -5,8 +5,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.task.TaskExecutionProperties;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.task.TaskExecutorBuilder;
@@ -18,10 +16,10 @@
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.event.EventPublishHelper;
 import pro.fessional.wings.slardar.event.attr.AttributeEventListener;
 import pro.fessional.wings.slardar.spring.prop.SlardarAsyncProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 import java.lang.reflect.Method;
 import java.util.concurrent.Executor;
@@ -32,7 +30,7 @@
  * @since 2023-10-31
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$event, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarAsyncProp.class)
 public class SlardarEventConfiguration {
     private static final Log log = LogFactory.getLog(SlardarEventConfiguration.class);
@@ -40,7 +38,7 @@ public class SlardarEventConfiguration {
     public static final String slardarEventExecutor = "slardarEventExecutor";
 
     @Bean(name = slardarEventExecutor)
-    @ConditionalOnMissingBean(name = slardarEventExecutor)
+    @ConditionalWingsEnabled
     public Executor slardarEventExecutor(SlardarAsyncProp prop) {
         TaskExecutorBuilder builder = new TaskExecutorBuilder();
         final TaskExecutionProperties event = prop.getEvent();
@@ -61,11 +59,12 @@ public Executor slardarEventExecutor(SlardarAsyncProp prop) {
     }
 
     @Bean
-    public ApplicationStartedEventRunner runnerEventPublishHelper(
+    @ConditionalWingsEnabled
+    public ApplicationStartedEventRunner eventPublishHelperRunner(
             ApplicationEventPublisher publisher,
             ApplicationEventMulticaster multicaster,
             @Qualifier(slardarEventExecutor) Executor executor) {
-        log.info("Slardar spring-runs runnerEventPublishHelper");
+        log.info("Slardar spring-runs eventPublishHelperRunner");
         return new ApplicationStartedEventRunner(WingsOrdered.Lv4Application, ignored -> {
             EventPublishHelper.setExecutor(executor);
             log.info("Slardar conf eventPublishHelper ApplicationEventPublisher=" + publisher.getClass());
@@ -99,7 +98,7 @@ public ApplicationStartedEventRunner runnerEventPublishHelper(
     }
 
     @Bean
-    @ConditionalOnMissingBean
+    @ConditionalWingsEnabled
     public AttributeEventListener attributeEventListener() {
         log.info("Slardar spring-bean AttributeEventListener");
         return new AttributeEventListener();
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
index 1a110c794..cbfbb922a 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarI18nConfiguration.java
@@ -1,21 +1,19 @@
 package pro.fessional.wings.slardar.spring.bean;
 
 import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean;
 import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.autodto.AutoDtoHelper;
 import pro.fessional.wings.slardar.autodto.AutoZoneVisitor;
 import pro.fessional.wings.slardar.autodto.I18nStringVisitor;
 import pro.fessional.wings.slardar.context.LocaleZoneIdUtil;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
@@ -24,13 +22,13 @@
  * @since 2019-06-26
  */
 @Configuration(proxyBeanMethods = false)
-@EnableConfigurationProperties(SlardarEnabledProp.class)
-@RequiredArgsConstructor
+@ConditionalWingsEnabled
 public class SlardarI18nConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarI18nConfiguration.class);
 
     @Bean
+    @ConditionalWingsEnabled
     public LocalValidatorFactoryBean localValidatorFactoryBean(MessageSource messageSource) {
         log.info("Slardar spring-bean localValidatorFactoryBean");
         LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
@@ -39,8 +37,9 @@ public LocalValidatorFactoryBean localValidatorFactoryBean(MessageSource message
     }
 
     @Bean
-    public ApplicationStartedEventRunner runnerAutoDtoHelper(MessageSource messageSource) {
-        log.info("Slardar spring-runs runnerAutoDtoHelper");
+    @ConditionalWingsEnabled
+    public ApplicationStartedEventRunner autoDtoHelperRunner(MessageSource messageSource) {
+        log.info("Slardar spring-runs autoDtoHelperRunner");
         return new ApplicationStartedEventRunner(WingsOrdered.Lv1Config, ignored -> new AutoDtoHelper() {{
             final I18nStringVisitor i18nStringVisitor = new I18nStringVisitor(messageSource, LocaleZoneIdUtil.LocaleNonnull);
 
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java
index 4cab4ce60..fd420e781 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java
@@ -2,23 +2,19 @@
 
 import com.fasterxml.jackson.databind.ser.std.DateSerializer;
 import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.mirana.time.DateParser;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.jackson.AutoRegisterPropertyFilter;
 import pro.fessional.wings.slardar.jackson.EmptyValuePropertyFilter;
 import pro.fessional.wings.slardar.jackson.I18nResultPropertyFilter;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarJacksonProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarNumberProp;
 
 import java.time.LocalDate;
 
@@ -29,40 +25,31 @@
  * @since 2019-06-26
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 @ConditionalOnClass(DateSerializer.class)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$jackson, havingValue = "true")
-@EnableConfigurationProperties({SlardarJacksonProp.class, SlardarNumberProp.class})
-@RequiredArgsConstructor
+@EnableConfigurationProperties(SlardarJacksonProp.class)
 public class SlardarJacksonConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarJacksonConfiguration.class);
 
-    private final SlardarJacksonProp slardarJacksonProp;
-    private final MessageSource messageSource;
-
-
     @Bean
-    @ConditionalOnProperty(name = SlardarJacksonProp.Key$i18nResult, havingValue = "true")
-    public AutoRegisterPropertyFilter i18nResultPropertyFilter() {
+    @ConditionalWingsEnabled
+    public AutoRegisterPropertyFilter i18nResultPropertyFilter(MessageSource messageSource) {
         log.info("Slardar spring-bean i18nResultPropertyFilter");
         return new I18nResultPropertyFilter(messageSource);
     }
 
     @Bean
-    // "${logging.enabled:true} and '${logging.level}'.equals('DEBUG')"
-    @ConditionalOnExpression("T(org.springframework.util.StringUtils).hasText('${" + SlardarJacksonProp.Key$emptyDate + "}') "
-                             + "|| ${" + SlardarJacksonProp.Key$emptyList + ":false}"
-                             + "|| ${" + SlardarJacksonProp.Key$emptyMap + ":false}"
-    )
-    public AutoRegisterPropertyFilter emptyValuePropertyFilter() {
+    @ConditionalWingsEnabled
+    public AutoRegisterPropertyFilter emptyValuePropertyFilter(SlardarJacksonProp prop) {
         log.info("Slardar spring-bean emptyValuePropertyFilter");
 
-        final LocalDate ed = slardarJacksonProp.getEmptyDate() == null ? null :
-                             DateParser.parseDate(slardarJacksonProp.getEmptyDate());
+        final LocalDate ed = prop.getEmptyDate() == null ? null :
+                             DateParser.parseDate(prop.getEmptyDate());
         return new EmptyValuePropertyFilter(ed,
-                slardarJacksonProp.getEmptyDateOffset(),
-                slardarJacksonProp.isEmptyList(),
-                slardarJacksonProp.isEmptyMap()
+                prop.getEmptyDateOffset(),
+                prop.isEmptyList(),
+                prop.isEmptyMap()
         );
     }
 
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java
index c12fa8903..3e48732bd 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java
@@ -1,17 +1,11 @@
 package pro.fessional.wings.slardar.spring.bean;
 
-import lombok.Setter;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.context.properties.bind.Binder;
 import org.springframework.context.EnvironmentAware;
@@ -21,13 +15,12 @@
 import org.springframework.core.env.Environment;
 import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.util.unit.DataSize;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.monitor.MonitorTask;
-import pro.fessional.wings.slardar.monitor.WarnMetric;
 import pro.fessional.wings.slardar.monitor.metric.JvmMetric;
 import pro.fessional.wings.slardar.monitor.metric.LogMetric;
 import pro.fessional.wings.slardar.monitor.report.DingTalkReport;
 import pro.fessional.wings.slardar.notice.DingTalkNotice;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 import pro.fessional.wings.slardar.spring.prop.SlardarMonitorProp;
 
 import java.io.File;
@@ -39,54 +32,31 @@
  */
 @EnableScheduling
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$monitor, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(SlardarMonitorProp.class)
 public class SlardarMonitorConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarMonitorConfiguration.class);
 
-    @Setter(onMethod_ = {@Autowired})
-    private SlardarMonitorProp slardarMonitorProp;
-
-    @Bean
-    @ConditionalOnProperty(name = SlardarEnabledProp.Key$monitorJvm, havingValue = "true")
-    public JvmMetric jvmMetric() {
-        log.info("Slardar spring-bean jvmMetric");
-        final JvmMetric.Rule rule = slardarMonitorProp.getJvm();
-        return new JvmMetric(rule);
-    }
-
-    @Bean
-    @ConditionalOnMissingBean(DingTalkReport.class)
-    public DingTalkReport dingTalkReport(DingTalkNotice dingTalkNotice) {
-        final String name = slardarMonitorProp.getDingNotice();
-        log.info("Slardar spring-bean dingTalkReport, conf=" + name);
-        return new DingTalkReport(dingTalkNotice, name);
-    }
-
-    @Bean
-    @ConditionalOnMissingBean(MonitorTask.class)
-    @ConditionalOnBean(WarnMetric.class)
-    public MonitorTask monitorTask() {
-        log.info("Slardar spring-bean monitorTask");
-        final MonitorTask bean = new MonitorTask();
-        bean.setHookSelf(slardarMonitorProp.isHook());
-        return bean;
-    }
 
     // Dynamic register Bean LogMetric
     @Configuration(proxyBeanMethods = false)
-    @ConditionalOnExpression("${" + SlardarEnabledProp.Key$monitor + ":false} && ${" + SlardarEnabledProp.Key$monitorLog + ":false}")
+    @ConditionalWingsEnabled
     @ComponentScan(basePackageClasses = MonitorTask.class)
-    public static class LogMetricBeanRegister implements BeanFactoryPostProcessor, EnvironmentAware {
+    public static class LogMetricRegister implements BeanFactoryPostProcessor, EnvironmentAware {
 
         private SlardarMonitorProp slardarMonitorProp;
 
+        /**
+         * fulfill SlardarMonitorProp via Binder
+         */
         @Override
         public void setEnvironment(@NotNull Environment environment) {
-            slardarMonitorProp = Binder.get(environment)
-                                       .bind(SlardarMonitorProp.Key, SlardarMonitorProp.class)
-                                       .get();
+            log.info("Slardar spring-scan MonitorTask");
+            slardarMonitorProp = Binder
+                    .get(environment)
+                    .bind(SlardarMonitorProp.Key, SlardarMonitorProp.class)
+                    .get();
         }
 
         @Override
@@ -136,4 +106,29 @@ private void fillDefault(LogMetric.Rule def, LogMetric.Rule use) {
             }
         }
     }
+
+    @Bean
+    @ConditionalWingsEnabled
+    public JvmMetric jvmMetric(SlardarMonitorProp prop) {
+        log.info("Slardar spring-bean jvmMetric");
+        final JvmMetric.Rule rule = prop.getJvm();
+        return new JvmMetric(rule);
+    }
+
+    @Bean
+    @ConditionalWingsEnabled
+    public DingTalkReport dingTalkReport(DingTalkNotice dingTalkNotice, SlardarMonitorProp prop) {
+        final String name = prop.getDingNotice();
+        log.info("Slardar spring-bean dingTalkReport, conf=" + name);
+        return new DingTalkReport(dingTalkNotice, name);
+    }
+
+    @Bean
+    @ConditionalWingsEnabled
+    public MonitorTask monitorTask(SlardarMonitorProp prop) {
+        log.info("Slardar spring-bean monitorTask");
+        final MonitorTask bean = new MonitorTask();
+        bean.setHookSelf(prop.isHook());
+        return bean;
+    }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java
index dcef2921a..338b51970 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java
@@ -12,21 +12,19 @@
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpClientBuilder;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpClientHelper;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpHostCookie;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpInterceptor;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpRedirectNopInterceptor;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarOkHttpProp;
+import pro.fessional.wings.slardar.spring.prop.SlardarOkhttpProp;
 
 import java.io.File;
 import java.nio.file.Files;
@@ -41,45 +39,46 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalOnClass(OkHttpClient.class)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$okhttp, havingValue = "true")
-@EnableConfigurationProperties(SlardarOkHttpProp.class)
+@ConditionalWingsEnabled
+@EnableConfigurationProperties(SlardarOkhttpProp.class)
 public class SlardarOkhttpConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarOkhttpConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(ConnectionPool.class)
-    public ConnectionPool okHttp3ConnectionPool(SlardarOkHttpProp config) {
-        log.info("Slardar spring-bean okHttp3ConnectionPool");
+    @ConditionalWingsEnabled
+    public ConnectionPool okhttpConnectionPool(SlardarOkhttpProp config) {
+        log.info("Slardar spring-bean okhttp3ConnectionPool");
         int maxIdleConnections = config.getMaxIdle();
         return new ConnectionPool(maxIdleConnections, config.getKeepAlive(), TimeUnit.SECONDS);
     }
 
     @Bean
-    @ConditionalOnProperty(value = SlardarOkHttpProp.Key$hostCookie, havingValue = "true")
-    public CookieJar hostCookieJar() {
-        log.info("Slardar spring-bean hostCookieJar");
+    @ConditionalWingsEnabled
+    public CookieJar okhttpHostCookieJar() {
+        log.info("Slardar spring-bean okhttpHostCookieJar");
         return new OkHttpHostCookie();
     }
 
     @Bean
-    @ConditionalOnExpression("${" + SlardarOkHttpProp.Key$redirectNop + ":false}"
-                             + "&& (${" + SlardarOkHttpProp.Key$followRedirect + ":false} || ${" + SlardarOkHttpProp.Key$followRedirect + ":false})")
-    public OkHttpRedirectNopInterceptor okHttpRedirectNopInterceptor() {
-        log.info("Slardar spring-bean okHttpRedirectNopInterceptor");
+    @ConditionalWingsEnabled
+    @ConditionalOnExpression("${" + SlardarOkhttpProp.Key$followRedirect + ":false} || ${" + SlardarOkhttpProp.Key$followRedirectSsl + ":false}")
+    public OkHttpRedirectNopInterceptor okhttpRedirectNopInterceptor() {
+        log.info("Slardar spring-bean okhttpRedirectNopInterceptor");
         return new OkHttpRedirectNopInterceptor();
     }
 
     @Bean
-    public Builder okHttpClientBuilder(
+    @ConditionalWingsEnabled
+    public Builder okhttpClientBuilder(
             ObjectProvider cacheProvider,
             ObjectProvider cookieProvider,
             ObjectProvider dnsProvider,
             ConnectionPool connectionPool,
             ObjectProvider interceptors,
-            SlardarOkHttpProp properties
+            SlardarOkhttpProp properties
     ) {
-        log.info("Slardar spring-bean okHttpClientBuilder");
+        log.info("Slardar spring-bean okhttpClientBuilder");
         // check builder return new ...
         final Builder builder = new Builder()
                 .connectTimeout(Duration.ofSeconds(properties.getTimeoutConn()))
@@ -93,11 +92,11 @@ public Builder okHttpClientBuilder(
         // interceptors
         interceptors.orderedStream().forEach(it -> {
             if (it instanceof OkHttpInterceptor && ((OkHttpInterceptor) it).isNetwork()) {
-                log.info("Slardar conf okHttpClient addNetworkInterceptor:" + it.getClass());
+                log.info("Slardar conf okhttpClient addNetworkInterceptor:" + it.getClass());
                 builder.addNetworkInterceptor(it);
             }
             else {
-                log.info("Slardar conf okHttpClient addInterceptor:" + it.getClass());
+                log.info("Slardar conf okhttpClient addInterceptor:" + it.getClass());
                 builder.addInterceptor(it);
             }
         });
@@ -117,46 +116,47 @@ public Builder okHttpClientBuilder(
                 catch (Exception e) {
                     log.warn("failed to create okhttp cache on dir=" + cacheDir, e);
                 }
-                log.info("Slardar conf okHttpClient cache-dir=" + properties.getCacheDirectory());
+                log.info("Slardar conf okhttpClient cache-dir=" + properties.getCacheDirectory());
             }
             else {
-                log.info("Slardar conf okHttpClient no-cache");
+                log.info("Slardar conf okhttpClient no-cache");
             }
         }
         else {
             builder.cache(cacheBean);
-            log.info("Slardar conf okHttpClient cache=" + cacheBean.getClass().getName());
+            log.info("Slardar conf okhttpClient cache=" + cacheBean.getClass().getName());
         }
 
         builder.connectionPool(connectionPool);
 
         final CookieJar ck = cookieProvider.getIfAvailable();
         if (ck != null) {
-            log.info("Slardar conf okHttpClient CookieJar=" + ck.getClass().getName());
+            log.info("Slardar conf okhttpClient CookieJar=" + ck.getClass().getName());
             builder.cookieJar(ck);
         }
         final Dns dns = dnsProvider.getIfAvailable();
         if (dns != null) {
-            log.info("Slardar conf okHttpClient dns=" + dns.getClass().getName());
+            log.info("Slardar conf okhttpClient dns=" + dns.getClass().getName());
             builder.dns(dns);
         }
 
         if (properties.isSslTrustAll()) {
-            log.info("Slardar conf okHttpClient sslTrustAll");
+            log.info("Slardar conf okhttpClient sslTrustAll");
             OkHttpClientBuilder.sslTrustAll(builder);
         }
         return builder;
     }
 
     @Bean
-    @ConditionalOnMissingBean(OkHttpClient.class)
-    public OkHttpClient okHttpClient(Builder builder) {
-        log.info("Slardar spring-bean okHttpClient");
+    @ConditionalWingsEnabled
+    public OkHttpClient okhttpClient(Builder builder) {
+        log.info("Slardar spring-bean okhttpClient");
         return builder.build();
     }
 
     @Bean
-    public CommandLineRunnerOrdered runnerOkHttpHelper(ObjectProvider opb, ObjectProvider ohc) {
+    @ConditionalWingsEnabled
+    public CommandLineRunnerOrdered okhttpHelperRunner(ObjectProvider opb, ObjectProvider ohc) {
         log.info("Slardar spring-runs runnerOkHttpHelper");
         return new CommandLineRunnerOrdered(WingsOrdered.Lv3Service, ignored -> {
             final Builder ob = opb.getIfAvailable();
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java
index af81d2222..4f40f2a71 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java
@@ -2,32 +2,33 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.event.tweak.TweakEventListener;
 import pro.fessional.wings.slardar.httprest.okhttp.OkHttpTweakLogInterceptor;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-12-03
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$tweaking, havingValue = "true")
+@ConditionalWingsEnabled
 public class SlardarTweakConfiguration {
 
     private static final Log log = LogFactory.getLog(SlardarTweakConfiguration.class);
 
     @Bean
+    @ConditionalWingsEnabled
     public TweakEventListener tweakEventListener() {
         log.info("Slardar spring-bean tweakEventListener");
         return new TweakEventListener();
     }
 
     @Bean
-    public OkHttpTweakLogInterceptor okHttpTweakLogInterceptor() {
-        log.info("Slardar spring-bean okHttpTweakLogInterceptor");
+    @ConditionalWingsEnabled
+    public OkHttpTweakLogInterceptor okhttpTweakLogInterceptor() {
+        log.info("Slardar spring-bean okhttpTweakLogInterceptor");
         return new OkHttpTweakLogInterceptor();
     }
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAsyncAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAsyncAutoConfiguration.java
index d56423390..d2d70ec27 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAsyncAutoConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAsyncAutoConfiguration.java
@@ -1,19 +1,17 @@
 package pro.fessional.wings.slardar.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
-import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(before = {SlardarAutoConfiguration.class, TaskExecutionAutoConfiguration.class, TaskSchedulingAutoConfiguration.class})
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
-@ImportAutoConfiguration(SlardarAsyncConfiguration.class)
+@AutoConfiguration(before = TaskExecutionAutoConfiguration.class)
+@ConditionalWingsEnabled
+@Import(SlardarAsyncConfiguration.class)
 public class SlardarAsyncAutoConfiguration {
 }
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
index b9611619d..b23d66fa3 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java
@@ -1,9 +1,8 @@
 package pro.fessional.wings.slardar.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import pro.fessional.wings.slardar.spring.bean.SlardarCacheConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDingNoticeConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarDoubleKillConfiguration;
@@ -13,16 +12,14 @@
 import pro.fessional.wings.slardar.spring.bean.SlardarMonitorConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration;
 import pro.fessional.wings.slardar.spring.bean.SlardarTweakConfiguration;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-07-11
  */
 @AutoConfiguration
-@ConditionalOnProperty(name = SlardarEnabledProp.Key$autoconf, havingValue = "true")
-@ImportAutoConfiguration({
-        SlardarCacheConfiguration.class,
+@ConditionalWingsEnabled
+@Import({
         SlardarDateTimeConfiguration.class,
         SlardarDingNoticeConfiguration.class,
         SlardarDoubleKillConfiguration.class,
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarCacheAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarCacheAutoConfiguration.java
new file mode 100644
index 000000000..7feebe59b
--- /dev/null
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarCacheAutoConfiguration.java
@@ -0,0 +1,16 @@
+package pro.fessional.wings.slardar.spring.conf;
+
+import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
+import pro.fessional.wings.slardar.spring.bean.SlardarCacheConfiguration;
+
+/**
+ * @author trydofor
+ * @since 2019-07-11
+ */
+@AutoConfiguration
+@ConditionalWingsEnabled
+@Import(SlardarCacheConfiguration.class)
+public class SlardarCacheAutoConfiguration {
+}
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java
deleted file mode 100644
index e6e57eda8..000000000
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java
+++ /dev/null
@@ -1,290 +0,0 @@
-package pro.fessional.wings.slardar.spring.prop;
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * spring-wings-enabled-79.properties
- *
- * @author trydofor
- * @see #Key
- * @since 2021-02-13
- */
-@Data
-@ConfigurationProperties(SlardarEnabledProp.Key)
-public class SlardarEnabledProp {
-
-    public static final String Key = "spring.wings.slardar.enabled";
-
-    /**
-     * whether to enable auto-config
-     *
-     * @see #Key$autoconf
-     */
-    private boolean autoconf = true;
-    public static final String Key$autoconf = Key + ".autoconf";
-
-    /**
-     * whether to enable jackson default config
-     *
-     * @see #Key$jackson
-     */
-    private boolean jackson = true;
-    public static final String Key$jackson = Key + ".jackson";
-
-    /**
-     * whether to enable okhttp3 default config
-     *
-     * @see #Key$okhttp
-     */
-    private boolean okhttp = true;
-    public static final String Key$okhttp = Key + ".okhttp";
-
-    /**
-     * whether to enable cache config
-     *
-     * @see #Key$caching
-     */
-    private boolean caching = true;
-    public static final String Key$caching = Key + ".caching";
-    /**
-     * whether to enable cache enhancement of aop
-     *
-     * @see #Key$cachingAop
-     */
-    private boolean cachingAop = true;
-    public static final String Key$cachingAop = Key + ".caching-aop";
-
-    /**
-     * whether to enable cookie customization
-     *
-     * @see #Key$cookie
-     */
-    private boolean cookie = true;
-    public static final String Key$cookie = Key + ".cookie";
-
-    /**
-     * whether to enable session default config
-     *
-     * @see #Key$session
-     */
-    private boolean session = true;
-    public static final String Key$session = Key + ".session";
-
-    /**
-     * whether to enable session hazelcast config
-     *
-     * @see #Key$sessionHazelcast
-     */
-    private boolean sessionHazelcast = true;
-    public static final String Key$sessionHazelcast = Key + ".session-hazelcast";
-
-    /**
-     * whether to enable spring Async and thread pool
-     *
-     * @see #Key$async
-     */
-    private boolean async = true;
-    public static final String Key$async = Key + ".async";
-
-    /**
-     * whether to enable slardar event utils
-     *
-     * @see #Key$async
-     */
-    private boolean event = true;
-    public static final String Key$event = Key + ".event";
-
-    /**
-     * whether to prevent forgery editing
-     *
-     * @see #Key$righter
-     */
-    private boolean righter = true;
-    public static final String Key$righter = Key + ".righter";
-
-    /**
-     * whether to enable Interceptor of debounce
-     *
-     * @see #Key$debounce
-     */
-    private boolean debounce = true;
-    public static final String Key$debounce = Key + ".debounce";
-
-    /**
-     * whether to enable reuse stream filter
-     *
-     * @see #Key$restream
-     */
-    private boolean restream = true;
-    public static final String Key$restream = Key + ".restream";
-
-    /**
-     * whether to enable Interceptor of FirstBlood
-     *
-     * @see #Key$firstBlood
-     */
-    private boolean firstBlood = true;
-    public static final String Key$firstBlood = Key + ".first-blood";
-
-    /**
-     * whether to enable image captcha Interceptor of FirstBlood
-     *
-     * @see #Key$firstBloodImage
-     */
-    private String firstBloodImage = "";
-    public static final String Key$firstBloodImage = Key + ".first-blood-image";
-
-    /**
-     * whether to enable DoubleKill default AOP
-     *
-     * @see #Key$doubleKill
-     */
-    private boolean doubleKill = true;
-    public static final String Key$doubleKill = Key + ".double-kill";
-
-    /**
-     * whether to enable PageQuery webmvc resolver of Wings
-     *
-     * @see #Key$pagequery
-     */
-    private boolean pagequery = true;
-    public static final String Key$pagequery = Key + ".pagequery";
-
-    /**
-     * whether to enable webmvc localdatetime converter of Wings
-     *
-     * @see #Key$datetime
-     */
-    private boolean datetime = true;
-    public static final String Key$datetime = Key + ".datetime";
-
-    /**
-     * whether to enable the Jackson precision limit of wings for Double, Float, BigDecimal
-     *
-     * @see #Key$number
-     */
-    private boolean number = true;
-    public static final String Key$number = Key + ".number";
-
-    /**
-     * whether to enable serialization of the resource into a readable URL with Wings' Jackson config
-     *
-     * @see #Key$resource
-     */
-    private boolean resource = true;
-    public static final String Key$resource = Key + ".resource";
-
-    /**
-     * whether to disable "undertow ws for UT026010: Buffer pool"
-     *
-     * @see #Key$undertowWs
-     */
-    private boolean undertowWs = true;
-    public static final String Key$undertowWs = Key + ".undertow-ws";
-
-    /**
-     * whether to enable remote Resolver
-     *
-     * @see #Key$remote
-     */
-    private boolean remote = true;
-    public static final String Key$remote = Key + ".remote";
-
-    /**
-     * whether to enable i18n Resolver
-     *
-     * @see #Key$locale
-     */
-    private boolean locale = true;
-    public static final String Key$locale = Key + ".locale";
-
-    /**
-     * whether to enable WingsTerminalContext
-     *
-     * @see #Key$terminal
-     */
-    private boolean terminal = true;
-    public static final String Key$terminal = Key + ".terminal";
-
-    /**
-     * whether to enable captcha config
-     *
-     * @see #Key$captcha
-     */
-    private boolean captcha = false;
-    public static final String Key$captcha = Key + ".captcha";
-
-    /**
-     * whether to enable overload filter
-     *
-     * @see #Key$overload
-     */
-    private boolean overload = false;
-    public static final String Key$overload = Key + ".overload";
-
-    /**
-     * whether to enable domain-extend
-     *
-     * @see #Key$domainExtend
-     */
-    private boolean domainExtend = false;
-    public static final String Key$domainExtend = Key + ".domain-extend";
-
-    /**
-     * whether to enable swagger config
-     *
-     * @see #Key$swagger
-     */
-    private boolean swagger = true;
-    public static final String Key$swagger = Key + ".swagger";
-
-    /**
-     * Start as standalone at devtool to reduce cluster impact
-     * see hazelcast-simulator
-     *
-     * @see #Key$mockHazelcast
-     */
-    private boolean mockHazelcast = false;
-    public static final String Key$mockHazelcast = Key + ".mock-hazelcast";
-
-    /**
-     * whether to enable monitor
-     *
-     * @see #Key$monitor
-     */
-    private boolean monitor = true;
-    public static final String Key$monitor = Key + ".monitor";
-
-    /**
-     * whether to enable Jvm monitor
-     *
-     * @see #Key$monitorJvm
-     */
-    private boolean monitorJvm = true;
-    public static final String Key$monitorJvm = Key + ".monitor-jvm";
-
-    /**
-     * whether to enable Log monitor
-     *
-     * @see #Key$monitorLog
-     */
-    private boolean monitorLog = true;
-    public static final String Key$monitorLog = Key + ".monitor-log";
-
-    /**
-     * whether to enable SpringBootAdmin config
-     *
-     * @see #Key$bootAdmin
-     */
-    private boolean bootAdmin = true;
-    public static final String Key$bootAdmin = Key + ".boot-admin";
-
-    /**
-     * whether to enable dynamic tweaking
-     *
-     * @see #Key$tweaking
-     */
-    private boolean tweaking = true;
-    public static final String Key$tweaking = Key + ".tweaking";
-}
diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarOkHttpProp.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarOkhttpProp.java
similarity index 95%
rename from wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarOkHttpProp.java
rename to wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarOkhttpProp.java
index e4a030cbe..528fe5bc8 100644
--- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarOkHttpProp.java
+++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarOkhttpProp.java
@@ -6,13 +6,16 @@
 import java.io.File;
 
 /**
+ * okhttp as one word in string/config
+ * OkHttp as tow word in code naming
+ *
  * @author trydofor
  * @see #Key
  * @since 2021-02-14
  */
 @Data
-@ConfigurationProperties(SlardarOkHttpProp.Key)
-public class SlardarOkHttpProp {
+@ConfigurationProperties(SlardarOkhttpProp.Key)
+public class SlardarOkhttpProp {
 
     public static final String Key = "wings.slardar.okhttp";
 
diff --git a/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index a66a43503..1daa154e5 100644
--- a/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/slardar/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1,2 +1,3 @@
 pro.fessional.wings.slardar.spring.conf.SlardarAsyncAutoConfiguration
 pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration
+pro.fessional.wings.slardar.spring.conf.SlardarCacheAutoConfiguration
diff --git a/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties
index f3a60cbd6..0d6f8159d 100644
--- a/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties
+++ b/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties
@@ -60,7 +60,7 @@ spring.wings.slardar.enabled.swagger=true
 
 ## Start as standalone at devtool to reduce cluster impact
 ## see https://github.com/hazelcast/hazelcast-simulator/blob/master/README.md
-spring.wings.slardar.enabled.mock-hazelcast=false
+spring.wings.slardar.enabled.hazelcast-simulator=false
 
 ## whether to enable monitor
 spring.wings.slardar.enabled.monitor=true
diff --git a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
index a7d240731..4ccda2b13 100644
--- a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
+++ b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java
@@ -3,8 +3,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
@@ -14,12 +12,12 @@
 import pro.fessional.wings.silencer.modulate.RuntimeMode;
 import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.serialize.JsonConversion;
 import pro.fessional.wings.slardar.serialize.KryoConversion;
 import pro.fessional.wings.warlock.database.autogen.tables.daos.SysConstantEnumDao;
 import pro.fessional.wings.warlock.service.conf.RuntimeConfService;
 import pro.fessional.wings.warlock.service.conf.impl.RuntimeConfServiceImpl;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 
 
 /**
@@ -27,18 +25,22 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 public class WarlockAwesomeConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockAwesomeConfiguration.class);
 
     @Configuration(proxyBeanMethods = false)
-    @ConditionalOnProperty(name = WarlockEnabledProp.Key$jooqAutogen, havingValue = "true")
+    @ConditionalWingsEnabled
     @ComponentScan(basePackageClasses = SysConstantEnumDao.class)
-    public static class WarlockJooqDaoConfiguration {
+    public static class JooqDaoScan {
+        public JooqDaoScan() {
+            log.info("Warlock spring-scan SysConstantEnumDao");
+        }
     }
 
     @Bean
-    @ConditionalOnMissingBean(RuntimeConfService.class)
+    @ConditionalWingsEnabled
     public RuntimeConfService runtimeConfService(ObjectProvider conversionProvider) {
         log.info("Warlock spring-bean runtimeConfService");
         final RuntimeConfServiceImpl bean = new RuntimeConfServiceImpl();
@@ -52,8 +54,9 @@ public RuntimeConfService runtimeConfService(ObjectProvider c
      * Database values override project config
      */
     @Bean
-    public CommandLineRunnerOrdered runnerRegisterRuntimeMode(ObjectProvider provider) {
-        log.info("Warlock spring-runs runnerRegisterRuntimeMode");
+    @ConditionalWingsEnabled
+    public CommandLineRunnerOrdered registerRuntimeModeRunner(ObjectProvider provider) {
+        log.info("Warlock spring-runs registerRuntimeModeRunner");
         return new CommandLineRunnerOrdered(WingsOrdered.Lv3Service, ignored -> {
             final RuntimeConfService confService = provider.getIfAvailable();
             if (confService == null) {
diff --git a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java
index 347938362..c6bde33d5 100644
--- a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java
+++ b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAwesomeAutoConfiguration.java
@@ -1,7 +1,8 @@
 package pro.fessional.wings.warlock.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.spring.bean.WarlockAwesomeConfiguration;
 
 
@@ -9,7 +10,8 @@
  * @author trydofor
  * @since 2019-12-01
  */
-@AutoConfiguration(before = WarlockAutoConfiguration.class)
-@ImportAutoConfiguration(WarlockAwesomeConfiguration.class)
+@AutoConfiguration
+@ConditionalWingsEnabled
+@Import(WarlockAwesomeConfiguration.class)
 public class WarlockAwesomeAutoConfiguration {
 }
diff --git a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java
index f19bfe38d..3b9d41147 100644
--- a/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java
+++ b/wings/warlock-awesome/src/test/java/pro/fessional/wings/warlock/service/conf/RuntimeConfServiceTest.java
@@ -32,7 +32,8 @@
  */
 @SpringBootTest(properties = {
         "wings.faceless.jooq.cud.table[win_conf_runtime]=key,current,handler",
-        "logging.level.root=debug"})
+        "logging.level.root=debug"
+})
 class RuntimeConfServiceTest {
 
     @Setter(onMethod_ = {@Autowired})
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
index 0d88f3e0b..dab34b6f7 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java
@@ -3,11 +3,10 @@
 import jakarta.annotation.PostConstruct;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.caching.CacheConst;
 import pro.fessional.wings.warlock.database.autogen.tables.WinPermEntryTable;
 import pro.fessional.wings.warlock.database.autogen.tables.WinRoleEntryTable;
@@ -27,7 +26,6 @@
 import pro.fessional.wings.warlock.service.user.impl.WarlockUserBasisServiceImpl;
 import pro.fessional.wings.warlock.service.user.impl.WarlockUserLoginServiceImpl;
 import pro.fessional.wings.warlock.spring.prop.WarlockDangerProp;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 
 
 /**
@@ -35,7 +33,7 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = WarlockEnabledProp.Key$securityBean, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(WarlockDangerProp.class)
 public class WarlockBondBeanConfiguration {
 
@@ -52,21 +50,21 @@ public void autoRegisterCacheConst() {
     ///////// AuthZ & AuthN /////////
 
     @Bean
-    @ConditionalOnMissingBean(WarlockDangerService.class)
-    public WarlockDangerService warlockDangerService(WarlockDangerProp warlockDangerProp) {
+    @ConditionalWingsEnabled
+    public WarlockDangerService warlockDangerService(WarlockDangerProp prop) {
         log.info("WarlockBond spring-bean warlockDangerService");
-        return new WarlockDangerServiceImpl(warlockDangerProp.getCacheSize(), (int) warlockDangerProp.getCacheTtl().toSeconds());
+        return new WarlockDangerServiceImpl(prop.getCacheSize(), (int) prop.getCacheTtl().toSeconds());
     }
 
     @Bean
-    @ConditionalOnMissingBean(DefaultDaoAuthnCombo.class)
+    @ConditionalWingsEnabled
     public DefaultDaoAuthnCombo defaultDaoAuthnCombo() {
         log.info("WarlockBond spring-bean defaultDaoAuthnCombo");
         return new DefaultDaoAuthnCombo();
     }
 
     @Bean
-    @ConditionalOnMissingBean(WarlockGrantService.class)
+    @ConditionalWingsEnabled
     public WarlockGrantService warlockGrantService() {
         // not needed if subclass bean exists e.g. JustAuthUserAuthnAutoReg
         log.info("WarlockBond spring-bean warlockGrantService");
@@ -75,35 +73,35 @@ public WarlockGrantService warlockGrantService() {
 
 
     @Bean
-    @ConditionalOnMissingBean(WarlockPermServiceImpl.Caching.class)
+    @ConditionalWingsEnabled
     public WarlockPermServiceImpl.Caching warlockPermServiceCaching() {
         log.info("WarlockBond spring-bean warlockPermServiceCaching");
         return new WarlockPermServiceImpl.Caching();
     }
 
     @Bean
-    @ConditionalOnMissingBean(WarlockPermService.class)
+    @ConditionalWingsEnabled
     public WarlockPermService warlockPermService(WarlockPermServiceImpl.Caching caching) {
         log.info("WarlockBond spring-bean warlockPermService");
         return new WarlockPermServiceImpl(caching);
     }
 
     @Bean
-    @ConditionalOnMissingBean(WarlockRoleServiceImpl.Caching.class)
+    @ConditionalWingsEnabled
     public WarlockRoleServiceImpl.Caching warlockRoleServiceCaching() {
         log.info("WarlockBond spring-bean warlockRoleServiceCaching");
         return new WarlockRoleServiceImpl.Caching();
     }
 
     @Bean
-    @ConditionalOnMissingBean(WarlockRoleService.class)
+    @ConditionalWingsEnabled
     public WarlockRoleService warlockRoleService(WarlockRoleServiceImpl.Caching caching) {
         log.info("WarlockBond spring-bean warlockRoleService");
         return new WarlockRoleServiceImpl(caching);
     }
 
     @Bean
-    @ConditionalOnMissingBean(WarlockUserAuthnService.class)
+    @ConditionalWingsEnabled
     public WarlockUserAuthnService warlockUserAuthnService() {
         log.info("WarlockBond spring-bean warlockUserAuthnService");
         return new WarlockUserAuthnServiceImpl();
@@ -111,7 +109,7 @@ public WarlockUserAuthnService warlockUserAuthnService() {
 
     ///////// UserDetails /////////
     @Bean
-    @ConditionalOnMissingBean(WarlockUserBasisService.class)
+    @ConditionalWingsEnabled
     public WarlockUserBasisService warlockUserBasisService() {
         log.info("WarlockBond spring-bean warlockUserBasisService");
         return new WarlockUserBasisServiceImpl();
@@ -120,7 +118,7 @@ public WarlockUserBasisService warlockUserBasisService() {
     ///////// login /////////
 
     @Bean
-    @ConditionalOnMissingBean(WarlockUserLoginService.class)
+    @ConditionalWingsEnabled
     public WarlockUserLoginService warlockUserLoginService() {
         log.info("WarlockBond spring-bean warlockUserLoginService");
         return new WarlockUserLoginServiceImpl();
diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java
index 2204520f2..025df47e2 100644
--- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java
+++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java
@@ -1,7 +1,8 @@
 package pro.fessional.wings.warlock.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration;
 
 
@@ -9,7 +10,8 @@
  * @author trydofor
  * @since 2019-12-01
  */
-@AutoConfiguration(before = WarlockShadowSecurityAutoConfiguration.class)
-@ImportAutoConfiguration(WarlockBondBeanConfiguration.class)
+@AutoConfiguration(before = WarlockSecurityAutoConfiguration.class)
+@ConditionalWingsEnabled
+@Import(WarlockBondBeanConfiguration.class)
 public class WarlockBondAutoConfiguration {
 }
diff --git a/wings/warlock-bond/src/test/resources/application.properties b/wings/warlock-bond/src/test/resources/application.properties
new file mode 100644
index 000000000..19e0b3c8c
--- /dev/null
+++ b/wings/warlock-bond/src/test/resources/application.properties
@@ -0,0 +1,2 @@
+logging.level.org.springframework.web=DEBUG
+logging.level.root=DEBUG
diff --git a/wings/warlock-codegen/src/main/java/pro/fessional/wings/warlock/project/Warlock1SchemaManager.java b/wings/warlock-codegen/src/main/java/pro/fessional/wings/warlock/project/Warlock1SchemaManager.java
index 64b000444..6630447b5 100644
--- a/wings/warlock-codegen/src/main/java/pro/fessional/wings/warlock/project/Warlock1SchemaManager.java
+++ b/wings/warlock-codegen/src/main/java/pro/fessional/wings/warlock/project/Warlock1SchemaManager.java
@@ -9,7 +9,7 @@
 
 /**
  * Provides a convenient version management of common scenarios.
- * spring.wings.faceless.flywave.enabled.module=true
+ * spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true
  *
  * @author trydofor
  * @since 2021-02-20
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/MvcController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/MvcController.java
new file mode 100644
index 000000000..88bf66781
--- /dev/null
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/MvcController.java
@@ -0,0 +1,8 @@
+package pro.fessional.wings.warlock.controller;
+
+/**
+ * @author trydofor
+ * @since 2023-11-23
+ */
+public interface MvcController {
+}
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminTweakController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminTweakController.java
index b321e6c8a..7b320b07b 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminTweakController.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminTweakController.java
@@ -1,16 +1,15 @@
 package pro.fessional.wings.warlock.controller.admin;
 
 import io.swagger.v3.oas.annotations.Operation;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 import pro.fessional.mirana.data.R;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.event.tweak.TweakClockEvent;
 import pro.fessional.wings.slardar.event.tweak.TweakLoggerEvent;
 import pro.fessional.wings.slardar.event.tweak.TweakStackEvent;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp;
 
 import static pro.fessional.wings.slardar.event.EventPublishHelper.SyncSpring;
@@ -20,7 +19,7 @@
  * @since 2022-10-31
  */
 @RestController
-@ConditionalOnProperty(name = WarlockEnabledProp.Key$controllerTweak, havingValue = "true")
+@ConditionalWingsEnabled(false)
 public class AdminTweakController {
 
     @Operation(summary = "Tweak the logging level at the thread level", description = """
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java
index 9201b35ee..8a0e57a83 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java
@@ -3,16 +3,14 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.HandlerExceptionResolver;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.errorhandle.DefaultExceptionResolver;
 import pro.fessional.wings.warlock.spring.prop.WarlockApiAuthProp;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockErrorProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp;
 
@@ -22,18 +20,17 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 @EnableConfigurationProperties({WarlockApiAuthProp.class, WarlockUrlmapProp.class, WarlockErrorProp.class})
 public class WarlockExceptionConfiguration {
 
-    public static final String defaultExceptionResolver = "defaultExceptionResolver";
 
     private final static Log log = LogFactory.getLog(WarlockExceptionConfiguration.class);
 
-    @Bean(name = defaultExceptionResolver)
-    @ConditionalOnMissingBean(name = defaultExceptionResolver)
-    @ConditionalOnProperty(name = WarlockEnabledProp.Key$defaultExceptionHandler, havingValue = "true")
+    @Bean
+    @ConditionalWingsEnabled
     public HandlerExceptionResolver defaultExceptionResolver(WarlockErrorProp prop, MessageSource messageSource, ObjectMapper objectMapper) {
-        log.info("WarlockShadow spring-bean " + defaultExceptionResolver);
+        log.info("WarlockShadow spring-bean defaultExceptionResolver");
         return new DefaultExceptionResolver(prop.getDefaultException(), messageSource, objectMapper);
     }
 }
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockHazelcastConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockHazelcastConfiguration.java
deleted file mode 100644
index 2294d60f2..000000000
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockHazelcastConfiguration.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package pro.fessional.wings.warlock.spring.bean;
-
-import com.hazelcast.core.HazelcastInstance;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.slardar.concur.HazelcastGlobalLock;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
-
-
-/**
- * @author trydofor
- * @since 2019-12-01
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalOnClass(HazelcastInstance.class)
-public class WarlockHazelcastConfiguration {
-
-    private final static Log log = LogFactory.getLog(WarlockHazelcastConfiguration.class);
-
-    @Bean
-    @ConditionalOnMissingBean(HazelcastGlobalLock.class)
-    @ConditionalOnProperty(name = WarlockEnabledProp.Key$globalLock, havingValue = "true")
-    public HazelcastGlobalLock hazelcastGlobalLock(HazelcastInstance hazelcastInstance) {
-        log.info("WarlockShadow spring-bean hazelcastGlobalLock");
-        return new HazelcastGlobalLock(hazelcastInstance);
-    }
-}
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfiguration.java
index 16ac5730a..511f7f0e2 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfiguration.java
@@ -2,14 +2,13 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Primary;
 import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.CommitJournalModify;
 import pro.fessional.wings.faceless.service.lightid.BlockIdProvider;
 import pro.fessional.wings.faceless.service.lightid.LightIdService;
-import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
-import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.service.other.TerminalJournalService;
 
 /**
@@ -17,13 +16,14 @@
  * @since 2019-06-01
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = FacelessEnabledProp.Key$journal, havingValue = "true")
+@ConditionalWingsEnabled
 public class WarlockJournalConfiguration {
 
     private static final Log log = LogFactory.getLog(WarlockJournalConfiguration.class);
 
     @Bean
-    @ConditionalOnProperty(name = SlardarEnabledProp.Key$terminal, havingValue = "true")
+    @Primary
+    @ConditionalWingsEnabled
     public TerminalJournalService terminalJournalService(
             @SuppressWarnings("all") LightIdService lightIdService,
             @SuppressWarnings("all") BlockIdProvider blockIdProvider,
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJustAuthConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJustAuthConfiguration.java
index 09d0366b2..0195ab591 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJustAuthConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJustAuthConfiguration.java
@@ -1,18 +1,16 @@
 package pro.fessional.wings.warlock.spring.bean;
 
 import com.xkcoding.http.config.HttpConfig;
-import lombok.RequiredArgsConstructor;
 import me.zhyd.oauth.cache.AuthStateCache;
 import me.zhyd.oauth.config.AuthConfig;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.util.StringUtils;
 import pro.fessional.mirana.flow.FlowEnum;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.security.WingsAuthHelper;
 import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver;
 import pro.fessional.wings.warlock.security.justauth.AuthConfigWrapper;
@@ -20,7 +18,6 @@
 import pro.fessional.wings.warlock.security.justauth.JustAuthRequestBuilder;
 import pro.fessional.wings.warlock.security.justauth.JustAuthRequestBuilder.SuccessHandler;
 import pro.fessional.wings.warlock.security.justauth.JustAuthStateCache;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockJustAuthProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockSecurityProp;
 
@@ -37,24 +34,24 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = WarlockEnabledProp.Key$justAuth, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(WarlockJustAuthProp.class)
-@RequiredArgsConstructor
 public class WarlockJustAuthConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockJustAuthConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(AuthStateCache.class)
+    @ConditionalWingsEnabled
     public AuthStateCache authStateCache(WarlockJustAuthProp justAuthProp) {
         log.info("WarlockShadow spring-bean authStateCache");
         return new JustAuthStateCache(justAuthProp.getCacheSize(), justAuthProp.getCacheLive());
     }
 
     @Bean
-    public SuccessHandler justAuthRequestBuilderMetaDataSuccessHandler(
+    @ConditionalWingsEnabled
+    public SuccessHandler justAuthRequestSuccessHandler(
             AuthStateBuilder authStateBuilder, WingsRemoteResolver remoteResolver) {
-        log.info("WarlockShadow spring-bean justAuthRequestBuilderMetaDataSuccessHandler");
+        log.info("WarlockShadow spring-bean justAuthRequestSuccessHandler");
         return (authType, request, authUser, detail) -> {
             final Map meta = detail.getMetaData();
             meta.put(WingsAuthHelper.AuthType, authType.name());
@@ -66,7 +63,7 @@ public SuccessHandler justAuthRequestBuilderMetaDataSuccessHandler(
     }
 
     @Bean
-    @ConditionalOnMissingBean(JustAuthRequestBuilder.class)
+    @ConditionalWingsEnabled
     public JustAuthRequestBuilder justAuthRequestBuilder(WarlockJustAuthProp justAuthProp, WarlockSecurityProp securityProp) {
         log.info("WarlockShadow spring-bean justAuthRequestFactory");
         JustAuthRequestBuilder bean = new JustAuthRequestBuilder();
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOauthTicketConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOauthTicketConfiguration.java
index f2247850f..1e532e0e4 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOauthTicketConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOauthTicketConfiguration.java
@@ -2,13 +2,13 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.mirana.code.RandCode;
 import pro.fessional.mirana.tk.TicketHelp;
 import pro.fessional.wings.silencer.encrypt.SecretProvider;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.service.auth.WarlockOauthService;
 import pro.fessional.wings.warlock.service.auth.WarlockTicketService;
 import pro.fessional.wings.warlock.service.auth.impl.SimpleTicketServiceImpl;
@@ -23,20 +23,21 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(WarlockTicketProp.class)
 public class WarlockOauthTicketConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockOauthTicketConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(WarlockTicketService.class)
-    public WarlockTicketService warlockTicketService(WarlockTicketProp warlockTicketProp) {
+    @ConditionalWingsEnabled
+    public WarlockTicketService warlockTicketService(WarlockTicketProp warlockTicketProp, SecretProvider secretProvider) {
         log.info("WarlockShadow spring-bean warlockTicketService");
         SimpleTicketServiceImpl bean = new SimpleTicketServiceImpl();
         bean.setAuthorizeCodeMax(warlockTicketProp.getCodeMax());
         bean.setAccessTokenMax(warlockTicketProp.getTokenMax());
 
-        String key = SecretProvider.get(SecretProvider.Ticket, false);
+        String key = secretProvider.tryGet(SecretProvider.Ticket);
         if (key == null || key.isBlank()) {
             log.info("WarlockShadow spring-conf random aes-key, may fail api-call in cluster");
             key = RandCode.strong(32);
@@ -59,7 +60,7 @@ public WarlockTicketService warlockTicketService(WarlockTicketProp warlockTicket
     }
 
     @Bean
-    @ConditionalOnMissingBean(WarlockOauthService.class)
+    @ConditionalWingsEnabled
     public WarlockOauthService warlockOauthService(WarlockTicketProp warlockTicketProp) {
         log.info("WarlockShadow spring-bean warlockOauthService");
         WarlockOauthServiceImpl bean = new WarlockOauthServiceImpl();
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOtherBeanConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOtherBeanConfiguration.java
index f5534fae2..d32547e70 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOtherBeanConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOtherBeanConfiguration.java
@@ -1,22 +1,15 @@
 package pro.fessional.wings.warlock.spring.bean;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.HandlerExceptionResolver;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.concur.impl.RighterInterceptor;
 import pro.fessional.wings.slardar.context.SecurityContextUtil;
-import pro.fessional.wings.warlock.errorhandle.DefaultExceptionResolver;
+import pro.fessional.wings.warlock.controller.MvcController;
 import pro.fessional.wings.warlock.errorhandle.auto.BindExceptionAdvice;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
-import pro.fessional.wings.warlock.spring.prop.WarlockErrorProp;
-
 
 
 /**
@@ -24,30 +17,33 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@ComponentScan("pro.fessional.wings.warlock.controller")
+@ConditionalWingsEnabled
 public class WarlockOtherBeanConfiguration {
 
-    public static final String defaultExceptionResolver = "defaultExceptionResolver";
     private final static Log log = LogFactory.getLog(WarlockOtherBeanConfiguration.class);
 
     @Configuration(proxyBeanMethods = false)
-    @ConditionalOnProperty(name = WarlockEnabledProp.Key$bindExceptionAdvice, havingValue = "true")
+    @ConditionalWingsEnabled
     @ComponentScan(basePackageClasses = BindExceptionAdvice.class)
-    public static class BindingErrorConfig {
+    public static class BindingErrorScan {
+        public BindingErrorScan() {
+            log.info("WarlockShadow spring-scan BindExceptionAdvice");
+        }
     }
 
-    @Bean(name = defaultExceptionResolver)
-    @ConditionalOnMissingBean(name = defaultExceptionResolver)
-    @ConditionalOnProperty(name = WarlockEnabledProp.Key$defaultExceptionHandler, havingValue = "true")
-    public HandlerExceptionResolver defaultExceptionResolver(WarlockErrorProp prop, MessageSource messageSource, ObjectMapper objectMapper) {
-        log.info("WarlockShadow spring-bean " + defaultExceptionResolver);
-        return new DefaultExceptionResolver(prop.getDefaultException(), messageSource, objectMapper);
+    @Configuration(proxyBeanMethods = false)
+    @ConditionalWingsEnabled
+    @ComponentScan(basePackageClasses = MvcController.class)
+    public static class MvcRestScan {
+        public MvcRestScan() {
+            log.info("WarlockShadow spring-scan controller");
+        }
     }
 
     @Bean
-    @ConditionalOnMissingBean(RighterInterceptor.SecretProvider.class)
-    public RighterInterceptor.SecretProvider righterInterceptorSecretProvider() {
-        log.info("WarlockShadow spring-bean righterInterceptorSecretProvider");
+    @ConditionalWingsEnabled
+    public RighterInterceptor.SecretProvider righterSecretProvider() {
+        log.info("WarlockShadow spring-bean righterSecretProvider");
         return ss -> {
             final Long uid = SecurityContextUtil.getUserId(false);
             return uid == null ? null : ss.getId() + uid;
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
index 4a8d1a34e..e033258ea 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java
@@ -1,22 +1,17 @@
 package pro.fessional.wings.warlock.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.cache.CacheManager;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
-import org.springframework.security.authentication.AuthenticationEventPublisher;
 import org.springframework.security.config.core.GrantedAuthorityDefaults;
-import org.springframework.security.core.userdetails.UserDetailsService;
 import org.springframework.security.web.access.AccessDeniedHandler;
 import org.springframework.security.web.authentication.AuthenticationFailureHandler;
 import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
@@ -25,6 +20,7 @@
 import org.springframework.web.servlet.LocaleResolver;
 import pro.fessional.mirana.bits.Aes;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.silencer.spring.help.CommonPropHelper;
 import pro.fessional.wings.slardar.cache.WingsCache;
 import pro.fessional.wings.slardar.security.WingsAuthDetailsSource;
@@ -60,19 +56,7 @@
 import pro.fessional.wings.warlock.service.auth.impl.DefaultUserAuthnAutoReg;
 import pro.fessional.wings.warlock.service.auth.impl.DefaultUserDetailsCombo;
 import pro.fessional.wings.warlock.service.auth.impl.MemoryTypedAuthzCombo;
-import pro.fessional.wings.warlock.service.grant.WarlockGrantService;
-import pro.fessional.wings.warlock.service.grant.impl.WarlockGrantServiceDummy;
 import pro.fessional.wings.warlock.service.perm.WarlockPermNormalizer;
-import pro.fessional.wings.warlock.service.perm.WarlockPermService;
-import pro.fessional.wings.warlock.service.perm.WarlockRoleService;
-import pro.fessional.wings.warlock.service.perm.impl.WarlockPermServiceDummy;
-import pro.fessional.wings.warlock.service.perm.impl.WarlockRoleServiceDummy;
-import pro.fessional.wings.warlock.service.user.WarlockUserAuthnService;
-import pro.fessional.wings.warlock.service.user.WarlockUserBasisService;
-import pro.fessional.wings.warlock.service.user.WarlockUserLoginService;
-import pro.fessional.wings.warlock.service.user.impl.WarlockUserAuthnServiceDummy;
-import pro.fessional.wings.warlock.service.user.impl.WarlockUserBasisServiceDummy;
-import pro.fessional.wings.warlock.service.user.impl.WarlockUserLoginServiceDummy;
 import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockJustAuthProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockSecurityProp;
@@ -94,41 +78,38 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = WarlockEnabledProp.Key$securityBean, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(WarlockSecurityProp.class)
-@RequiredArgsConstructor
 public class WarlockSecurityBeanConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockSecurityBeanConfiguration.class);
 
-    private final WarlockSecurityProp securityProp;
-    private final ApplicationContext applicationContext;
-
     @Bean
-    @ConditionalOnMissingBean({AuthenticationEventPublisher.class})
-    public WingsAuthenticationEventPublisher  authenticationEventPublisher(){
+    @ConditionalWingsEnabled
+    public WingsAuthenticationEventPublisher  authenticationEventPublisher(ApplicationContext context){
         log.info("WarlockShadow spring-bean authenticationEventPublisher");
-        return new WingsAuthenticationEventPublisher(applicationContext);
+        return new WingsAuthenticationEventPublisher(context);
     }
 
     @Bean
-    @ConditionalOnMissingBean(WingsAuthTypeParser.class)
-    public WingsAuthTypeParser wingsAuthTypeParser() {
+    @ConditionalWingsEnabled
+    public WingsAuthTypeParser wingsAuthTypeParser(WarlockSecurityProp prop) {
         log.info("WarlockShadow spring-bean wingsAuthTypeParser");
-        final Map> authType = securityProp.mapAuthTypeEnum();
-        final Enum atd = securityProp.mapAuthTypeDefault();
+        final Map> authType = prop.mapAuthTypeEnum();
+        final Enum atd = prop.mapAuthTypeDefault();
         return new DefaultWingsAuthTypeParser(atd, authType);
     }
 
     ///////// handler /////////
     @Bean
-    @ConditionalOnMissingBean(AuthenticationSuccessHandler.class)
+    @ConditionalWingsEnabled
     @ConditionalOnExpression("!'${" + WarlockSecurityProp.Key$loginSuccessBody + "}'.isEmpty()")
     public AuthenticationSuccessHandler loginSuccessHandler() {
         log.info("WarlockShadow spring-bean loginSuccessHandler");
         return new LoginSuccessHandler();
     }
     @Bean
+    @ConditionalWingsEnabled
     @ConditionalOnExpression("!'${" + WarlockSecurityProp.Key$loginFailureBody + "}'.isEmpty()")
     public LoginFailureHandler.Handler loginFailureHandlerDefault() {
         log.info("WarlockShadow spring-bean loginFailureHandlerDefault");
@@ -136,15 +117,14 @@ public LoginFailureHandler.Handler loginFailureHandlerDefault() {
     }
 
     @Bean
-    @ConditionalOnMissingBean(AuthenticationFailureHandler.class)
-    @ConditionalOnBean(LoginFailureHandler.Handler.class)
+    @ConditionalWingsEnabled
     public AuthenticationFailureHandler loginFailureHandler() {
         log.info("WarlockShadow spring-bean loginFailureHandler");
         return new LoginFailureHandler();
     }
 
     @Bean
-    @ConditionalOnMissingBean(LogoutSuccessHandler.class)
+    @ConditionalWingsEnabled
     @ConditionalOnExpression("!'${" + WarlockSecurityProp.Key$logoutSuccessBody + "}'.isEmpty()")
     public LogoutSuccessHandler logoutSuccessHandler() {
         log.info("WarlockShadow spring-bean logoutSuccessHandler");
@@ -152,7 +132,7 @@ public LogoutSuccessHandler logoutSuccessHandler() {
     }
 
     @Bean
-    @ConditionalOnMissingBean(AccessDeniedHandler.class)
+    @ConditionalWingsEnabled
     @ConditionalOnExpression("!'${" + WarlockSecurityProp.Key$logoutSuccessBody + "}'.isEmpty()")
     public AccessDeniedHandler accessDeniedHandler() {
         log.info("WarlockShadow spring-bean accessDeniedHandler");
@@ -162,7 +142,7 @@ public AccessDeniedHandler accessDeniedHandler() {
     ///////// AuthZ & AuthN /////////
 
     @Bean
-    @ConditionalOnMissingBean(WarlockPermNormalizer.class)
+    @ConditionalWingsEnabled
     public WarlockPermNormalizer warlockPermNormalizer(@SuppressWarnings("all") GrantedAuthorityDefaults gad) {
         log.info("WarlockShadow spring-bean warlockPermNormalizer");
         final WarlockPermNormalizer bean = new WarlockPermNormalizer();
@@ -171,42 +151,42 @@ public WarlockPermNormalizer warlockPermNormalizer(@SuppressWarnings("all") Gran
     }
 
     @Bean
-    @ConditionalOnMissingBean(ComboWarlockAuthnService.class)
+    @ConditionalWingsEnabled
     public ComboWarlockAuthnService comboWarlockAuthnService() {
         log.info("WarlockShadow spring-bean comboWarlockAuthnService");
         return new ComboWarlockAuthnService();
     }
 
     @Bean
-    @ConditionalOnMissingBean(ComboWarlockAuthzService.class)
-    public ComboWarlockAuthzService comboWarlockAuthzService() {
+    @ConditionalWingsEnabled
+    public ComboWarlockAuthzService comboWarlockAuthzService(WarlockSecurityProp prop) {
         log.info("WarlockShadow spring-bean comboWarlockAuthzService");
         final ComboWarlockAuthzService bean = new ComboWarlockAuthzService();
-        bean.setAuthorityRole(securityProp.isAuthorityRole());
-        bean.setAuthorityPerm(securityProp.isAuthorityPerm());
+        bean.setAuthorityRole(prop.isAuthorityRole());
+        bean.setAuthorityPerm(prop.isAuthorityPerm());
         return bean;
     }
 
     @Bean
-    @ConditionalOnMissingBean(DefaultPermRoleCombo.class)
+    @ConditionalWingsEnabled
     public DefaultPermRoleCombo defaultPermRoleCombo() {
         log.info("WarlockShadow spring-bean defaultPermRoleCombo");
         return new DefaultPermRoleCombo();
     }
 
     @Bean
-    @ConditionalOnMissingBean(DefaultUserDetailsCombo.class)
-    public DefaultUserDetailsCombo defaultUserDetailsCombo() {
+    @ConditionalWingsEnabled
+    public DefaultUserDetailsCombo defaultUserDetailsCombo(WarlockSecurityProp prop) {
         log.info("WarlockShadow spring-bean defaultUserDetailsCombo");
         final DefaultUserDetailsCombo bean = new DefaultUserDetailsCombo();
-        bean.setAutoRegisterType(securityProp.mapAutoregAuthEnum());
+        bean.setAutoRegisterType(prop.mapAutoregAuthEnum());
         return bean;
     }
 
     @Bean
     @ConditionalOnExpression("${" + WarlockEnabledProp.Key$justAuth + ":false} "
                              + " && ${" + WarlockEnabledProp.Key$comboJustAuthAutoreg + ":false}")
-    @ConditionalOnMissingBean(JustAuthUserAuthnAutoReg.class)
+    @ConditionalWingsEnabled
     public JustAuthUserAuthnAutoReg justAuthUserAuthnAutoReg() {
         log.info("WarlockShadow spring-bean justAuthUserAuthnAutoReg");
         final JustAuthUserAuthnAutoReg bean = new JustAuthUserAuthnAutoReg();
@@ -215,71 +195,35 @@ public JustAuthUserAuthnAutoReg justAuthUserAuthnAutoReg() {
     }
 
     @Bean
-    @ConditionalOnMissingBean(DefaultUserAuthnAutoReg.class)
+    @ConditionalWingsEnabled
     public DefaultUserAuthnAutoReg defaultUserAuthnAutoReg() {
         log.info("WarlockShadow spring-bean defaultUserAuthnAutoReg");
         return new DefaultUserAuthnAutoReg();
     }
 
-    @Bean
-    @ConditionalOnMissingBean(WarlockGrantService.class)
-    public WarlockGrantService warlockGrantService() {
-        log.info("WarlockShadow spring-bean WarlockGrantServiceDummy");
-        return new WarlockGrantServiceDummy();
-    }
-
-    @Bean
-    @ConditionalOnMissingBean(WarlockPermService.class)
-    public WarlockPermService warlockPermService() {
-        log.info("WarlockShadow spring-bean WarlockPermServiceDummy");
-        return new WarlockPermServiceDummy();
-    }
-
-    @Bean
-    @ConditionalOnMissingBean(WarlockRoleService.class)
-    public WarlockRoleService warlockRoleService() {
-        log.info("WarlockShadow spring-bean WarlockRoleServiceDummy");
-        return new WarlockRoleServiceDummy();
-    }
-
-    @Bean
-    @ConditionalOnMissingBean(WarlockUserAuthnService.class)
-    public WarlockUserAuthnService warlockUserAuthnService() {
-        log.info("WarlockShadow spring-bean WarlockUserAuthnServiceDummy");
-        return new WarlockUserAuthnServiceDummy();
-    }
-
     ///////// UserDetails /////////
 
     @Bean
-    @ConditionalOnMissingBean(WarlockUserBasisService.class)
-    public WarlockUserBasisService warlockUserBasisService() {
-        log.info("WarlockShadow spring-bean warlockUserBasisService");
-        return new WarlockUserBasisServiceDummy();
-    }
-
-    @Bean
-    @ConditionalOnProperty(name = WarlockEnabledProp.Key$comboNonceUserDetails, havingValue = "true")
-    @ConditionalOnMissingBean(NonceUserDetailsCombo.class)
-    public NonceUserDetailsCombo nonceUserDetailsCombo() {
+    @ConditionalWingsEnabled
+    public NonceUserDetailsCombo nonceUserDetailsCombo(WarlockSecurityProp prop, ApplicationContext context) {
         log.info("WarlockShadow spring-bean nonceUserDetailsCombo");
         final NonceUserDetailsCombo bean = new NonceUserDetailsCombo();
         bean.setOrder(WingsOrdered.Lv3Service + 200);
-        bean.setAcceptNonceType(securityProp.mapNonceAuthEnum());
-        final String cn = WingsCache.Naming.join(securityProp.getNonceCacheLevel(), NonceUserDetailsCombo.class.getName());
+        bean.setAcceptNonceType(prop.mapNonceAuthEnum());
+        final String cn = WingsCache.Naming.join(prop.getNonceCacheLevel(), NonceUserDetailsCombo.class.getName());
         bean.setCacheName(cn);
-        final CacheManager cm = applicationContext.getBean(securityProp.getNonceCacheManager(), CacheManager.class);
+        final CacheManager cm = context.getBean(prop.getNonceCacheManager(), CacheManager.class);
         bean.setCacheManager(cm);
         return bean;
     }
 
     @Bean
-    @ConditionalOnMissingBean(MemoryUserDetailsCombo.class)
-    public MemoryUserDetailsCombo memoryUserDetailsCombo(@SuppressWarnings("all") WingsAuthTypeParser typeParser) {
+    @ConditionalWingsEnabled
+    public MemoryUserDetailsCombo memoryUserDetailsCombo(@SuppressWarnings("all") WingsAuthTypeParser typeParser, WarlockSecurityProp prop) {
         log.info("WarlockShadow spring-bean memoryUserDetailsCombo");
         final MemoryUserDetailsCombo bean = new MemoryUserDetailsCombo();
         bean.setOrder(WingsOrdered.Lv3Service + 100);
-        for (Map.Entry en : securityProp.getMemUser().entrySet()) {
+        for (Map.Entry en : prop.getMemUser().entrySet()) {
             log.info("WarlockShadow conf add MemUser=" + en.getKey());
             final Mu mu = en.getValue();
             Set ats = mu.getAuthType();
@@ -306,24 +250,22 @@ public MemoryUserDetailsCombo memoryUserDetailsCombo(@SuppressWarnings("all") Wi
     }
 
     @Bean
-    @ConditionalOnMissingBean(AuthZonePermChecker.class)
-    @ConditionalOnProperty(name = "spring.wings.warlock.enabled.zone-perm-check", havingValue = "true")
-    public AuthZonePermChecker authZonePermChecker() {
+    @ConditionalWingsEnabled
+    public AuthZonePermChecker authZonePermChecker(WarlockSecurityProp prop) {
         log.info("WarlockShadow spring-bean authZonePermChecker");
         final AuthZonePermChecker bean = new AuthZonePermChecker();
-        bean.setZonePerm(securityProp.getZonePerm());
+        bean.setZonePerm(prop.getZonePerm());
         return bean;
     }
 
     @Bean
-    @ConditionalOnMissingBean(AuthAppPermChecker.class)
-    @ConditionalOnProperty(name = "spring.wings.warlock.enabled.app-perm-check", havingValue = "true")
-    public AuthAppPermChecker authAppPermChecker(@Value("${spring.application.name:wings-default}") String appName) {
+    @ConditionalWingsEnabled
+    public AuthAppPermChecker authAppPermChecker(@Value("${spring.application.name:wings-default}") String appName, WarlockSecurityProp prop) {
         log.info("WarlockShadow spring-bean authAppPermChecker");
         final AuthAppPermChecker bean = new AuthAppPermChecker();
         final Set perms = new HashSet<>();
         final AntPathMatcher matcher = new AntPathMatcher();
-        for (Map.Entry> en : securityProp.getAppPerm().entrySet()) {
+        for (Map.Entry> en : prop.getAppPerm().entrySet()) {
             final String ptn = en.getKey();
             if (matcher.match(ptn, appName)) {
                 log.info("WarlockShadow conf authAppPermChecker, " + appName + " matches " + ptn);
@@ -335,7 +277,7 @@ public AuthAppPermChecker authAppPermChecker(@Value("${spring.application.name:w
     }
 
     @Bean
-    @ConditionalOnMissingBean(ComboWingsAuthCheckService.class)
+    @ConditionalWingsEnabled
     public ComboWingsAuthCheckService comboWingsAuthCheckService(ObjectProvider combos) {
         log.info("WarlockShadow spring-bean comboWingsAuthCheckService");
         final List list = combos.orderedStream().collect(Collectors.toList());
@@ -345,9 +287,9 @@ public ComboWingsAuthCheckService comboWingsAuthCheckService(ObjectProvider> combos) {
         log.info("WarlockShadow spring-bean wingsUserDetailsService");
         ComboWingsUserDetailsService uds = new ComboWingsUserDetailsService();
@@ -368,13 +310,14 @@ public WingsUserDetailsService wingsUserDetailsService(ObjectProvider en : securityProp.getMemAuth().entrySet()) {
+        for (Map.Entry en : prop.getMemAuth().entrySet()) {
             final Ma ma = en.getValue();
             final Set role = ma.getAuthRole()
                                        .stream()
@@ -405,10 +348,11 @@ public MemoryTypedAuthzCombo memoryTypedAuthzCombo(
     }
 
     @Bean
-    @ConditionalOnMissingBean(WingsAuthDetailsSource.class)
+    @ConditionalWingsEnabled
     public WingsAuthDetailsSource wingsAuthDetailsSource(ObjectProvider> combos,
                                                             ObjectProvider rrs,
-                                                            ObjectProvider lrp
+                                                            ObjectProvider lrp,
+                                                            WarlockSecurityProp prop
                                                             ) {
         log.info("WarlockShadow spring-bean wingsAuthDetailsSource");
         final ComboWingsAuthDetailsSource uds = new ComboWingsAuthDetailsSource();
@@ -419,7 +363,7 @@ public WingsAuthDetailsSource wingsAuthDetailsSource(ObjectProvider set = new HashSet<>();
-        set.add(securityProp.getPasswordPara());
+        set.add(prop.getPasswordPara());
         uds.setIgnoredMetaKey(set);
 
         rrs.ifAvailable(uds::setWingsRemoteResolver);
@@ -431,7 +375,7 @@ public WingsAuthDetailsSource wingsAuthDetailsSource(ObjectProvider aesProvider) {
         log.info("WarlockShadow spring-bean authStateBuilder");
         final AuthStateBuilder bean = new AuthStateBuilder(CommonPropHelper.onlyValue(prop.getSafeState()));
@@ -447,14 +391,7 @@ public AuthStateBuilder authStateBuilder(WarlockJustAuthProp prop, ObjectProvide
     }
 
     @Bean
-    @ConditionalOnMissingBean(WarlockUserLoginService.class)
-    public WarlockUserLoginService warlockUserLoginService() {
-        log.info("WarlockShadow spring-bean WarlockUserLoginServiceDummy");
-        return new WarlockUserLoginServiceDummy();
-    }
-
-    @Bean
-    @ConditionalOnMissingBean(WingsAuthPageHandler.class)
+    @ConditionalWingsEnabled
     public WingsAuthPageHandler wingsAuthPageHandler(ObjectProvider combos) {
         log.info("WarlockShadow spring-bean wingsAuthPageHandler");
         ComboWingsAuthPageHandler uds = new ComboWingsAuthPageHandler();
@@ -466,37 +403,39 @@ public WingsAuthPageHandler wingsAuthPageHandler(ObjectProvider httpFirewall, ObjectProvider mvcMatcher) {
         log.info("WarlockShadow spring-bean warlockWebCustomizer");
@@ -82,6 +84,7 @@ public WebSecurityCustomizer warlockWebCustomizer(ObjectProvider h
     }
 
     @Bean
+    @ConditionalWingsEnabled
     @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityHttpBind, havingValue = "true")
     @Order(WingsOrdered.Lv4Application + 200)
     public HttpSecurityCustomizer warlockSecurityBindHttpConfigure(
@@ -151,6 +154,7 @@ public HttpSecurityCustomizer warlockSecurityBindHttpConfigure(
     }
 
     @Bean
+    @ConditionalWingsEnabled
     @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityHttpAuth, havingValue = "true")
     @Order(WingsOrdered.Lv4Application + 300)
     public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(ObjectProvider mvcMatcher) {
@@ -197,6 +201,7 @@ public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(ObjectProvider configures) throws Exception {
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityDummyConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityDummyConfiguration.java
new file mode 100644
index 000000000..be69bbcb0
--- /dev/null
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityDummyConfiguration.java
@@ -0,0 +1,80 @@
+package pro.fessional.wings.warlock.spring.bean;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
+import pro.fessional.wings.warlock.service.grant.WarlockGrantService;
+import pro.fessional.wings.warlock.service.grant.impl.WarlockGrantServiceDummy;
+import pro.fessional.wings.warlock.service.perm.WarlockPermService;
+import pro.fessional.wings.warlock.service.perm.WarlockRoleService;
+import pro.fessional.wings.warlock.service.perm.impl.WarlockPermServiceDummy;
+import pro.fessional.wings.warlock.service.perm.impl.WarlockRoleServiceDummy;
+import pro.fessional.wings.warlock.service.user.WarlockUserAuthnService;
+import pro.fessional.wings.warlock.service.user.WarlockUserBasisService;
+import pro.fessional.wings.warlock.service.user.WarlockUserLoginService;
+import pro.fessional.wings.warlock.service.user.impl.WarlockUserAuthnServiceDummy;
+import pro.fessional.wings.warlock.service.user.impl.WarlockUserBasisServiceDummy;
+import pro.fessional.wings.warlock.service.user.impl.WarlockUserLoginServiceDummy;
+
+
+/**
+ * @author trydofor
+ * @since 2019-12-01
+ */
+@Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
+public class WarlockSecurityDummyConfiguration {
+
+    private final static Log log = LogFactory.getLog(WarlockSecurityDummyConfiguration.class);
+
+    @Bean
+    @ConditionalWingsEnabled
+    @ConditionalOnMissingBean(WarlockGrantService.class)
+    public WarlockGrantService warlockGrantService() {
+        log.info("WarlockShadow spring-bean WarlockGrantServiceDummy");
+        return new WarlockGrantServiceDummy();
+    }
+
+    @Bean
+    @ConditionalWingsEnabled
+    @ConditionalOnMissingBean(WarlockPermService.class)
+    public WarlockPermService warlockPermService() {
+        log.info("WarlockShadow spring-bean WarlockPermServiceDummy");
+        return new WarlockPermServiceDummy();
+    }
+
+    @Bean
+    @ConditionalWingsEnabled
+    @ConditionalOnMissingBean(WarlockRoleService.class)
+    public WarlockRoleService warlockRoleService() {
+        log.info("WarlockShadow spring-bean WarlockRoleServiceDummy");
+        return new WarlockRoleServiceDummy();
+    }
+
+    @Bean
+    @ConditionalWingsEnabled
+    @ConditionalOnMissingBean(WarlockUserAuthnService.class)
+    public WarlockUserAuthnService warlockUserAuthnService() {
+        log.info("WarlockShadow spring-bean WarlockUserAuthnServiceDummy");
+        return new WarlockUserAuthnServiceDummy();
+    }
+
+    @Bean
+    @ConditionalWingsEnabled
+    @ConditionalOnMissingBean(WarlockUserBasisService.class)
+    public WarlockUserBasisService warlockUserBasisService() {
+        log.info("WarlockShadow spring-bean warlockUserBasisService");
+        return new WarlockUserBasisServiceDummy();
+    }
+
+    @Bean
+    @ConditionalWingsEnabled
+    @ConditionalOnMissingBean(WarlockUserLoginService.class)
+    public WarlockUserLoginService warlockUserLoginService() {
+        log.info("WarlockShadow spring-bean WarlockUserLoginServiceDummy");
+        return new WarlockUserLoginServiceDummy();
+    }
+}
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java
index ff44894f5..d530d266a 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java
@@ -3,10 +3,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.webmvc.SlowResponseInterceptor;
 import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockWatchingProp;
@@ -17,13 +17,14 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 @ConditionalOnProperty(name = WarlockEnabledProp.Key$watching, havingValue = "true")
 public class WarlockWatching2Configuration {
 
     private final static Log log = LogFactory.getLog(WarlockWatching2Configuration.class);
 
     @Bean
-    @ConditionalOnMissingBean(SlowResponseInterceptor.class)
+    @ConditionalWingsEnabled
     @ConditionalOnExpression("${" + WarlockWatchingProp.Key$controllerThreshold + ":-1} >=0")
     public SlowResponseInterceptor slowResponseInterceptor(WarlockWatchingProp prop) {
         final long ms = prop.getControllerThreshold();
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowSecurityAutoConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockSecurityAutoConfiguration.java
similarity index 68%
rename from wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowSecurityAutoConfiguration.java
rename to wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockSecurityAutoConfiguration.java
index 4dce1fb5a..2dca2aa92 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowSecurityAutoConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockSecurityAutoConfiguration.java
@@ -1,11 +1,13 @@
 package pro.fessional.wings.warlock.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
 import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
 import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration;
+import pro.fessional.wings.warlock.spring.bean.WarlockSecurityDummyConfiguration;
 
 
 /**
@@ -13,13 +15,14 @@
  * @since 2019-12-01
  */
 @AutoConfiguration(before = {
-        WarlockShadowAutoConfiguration.class,
         SecurityAutoConfiguration.class,
         UserDetailsServiceAutoConfiguration.class,
 })
-@ImportAutoConfiguration({
+@ConditionalWingsEnabled
+@Import({
         WarlockSecurityBeanConfiguration.class,
         WarlockSecurityConfConfiguration.class,
+        WarlockSecurityDummyConfiguration.class,
 })
-public class WarlockShadowSecurityAutoConfiguration {
+public class WarlockSecurityAutoConfiguration {
 }
diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java
index dcda55b4e..1f3dd0587 100644
--- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java
+++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockShadowAutoConfiguration.java
@@ -1,10 +1,9 @@
 package pro.fessional.wings.warlock.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import pro.fessional.wings.slardar.spring.conf.SlardarSprintAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.spring.bean.WarlockExceptionConfiguration;
-import pro.fessional.wings.warlock.spring.bean.WarlockHazelcastConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockJournalConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockJustAuthConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockOauthTicketConfiguration;
@@ -16,13 +15,10 @@
  * @author trydofor
  * @since 2019-12-01
  */
-@AutoConfiguration(before = {
-        SlardarSprintAutoConfiguration.class,
-        WarlockAutoConfiguration.class,
-})
-@ImportAutoConfiguration({
+@AutoConfiguration
+@ConditionalWingsEnabled
+@Import({
         WarlockExceptionConfiguration.class,
-        WarlockHazelcastConfiguration.class,
         WarlockJournalConfiguration.class,
         WarlockJustAuthConfiguration.class,
         WarlockOauthTicketConfiguration.class,
diff --git a/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
index 3b0e62534..5531846b1 100644
--- a/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ b/wings/warlock-shadow/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
@@ -1,2 +1,2 @@
 pro.fessional.wings.warlock.spring.conf.WarlockShadowAutoConfiguration
-pro.fessional.wings.warlock.spring.conf.WarlockShadowSecurityAutoConfiguration
+pro.fessional.wings.warlock.spring.conf.WarlockSecurityAutoConfiguration
diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/PasswordEncoderTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/PasswordEncoderTest.java
index 85546708a..019883977 100644
--- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/PasswordEncoderTest.java
+++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/service/auth/PasswordEncoderTest.java
@@ -17,7 +17,7 @@
  * @since 2021-06-19
  */
 @Slf4j
-@SpringBootTest(properties = "spring.wings.slardar.enabled.mock-hazelcast=true")
+@SpringBootTest
 class PasswordEncoderTest {
 
     @Setter(onMethod_ = {@Autowired})
diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalDisableTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalDisableTest.java
new file mode 100644
index 000000000..cb84281f1
--- /dev/null
+++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalDisableTest.java
@@ -0,0 +1,27 @@
+package pro.fessional.wings.warlock.spring.bean;
+
+import io.qameta.allure.TmsLink;
+import lombok.Setter;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import pro.fessional.wings.faceless.service.journal.JournalService;
+import pro.fessional.wings.warlock.service.other.TerminalJournalService;
+
+/**
+ * @author trydofor
+ * @since 2023-01-25
+ */
+@SpringBootTest(properties = "spring.wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJournalConfiguration.terminalJournalService=false")
+class WarlockJournalDisableTest {
+
+    @Setter(onMethod_ = {@Autowired})
+    protected JournalService journalService;
+
+    @Test
+    @TmsLink("C14067")
+    void terminalJournalService() {
+        Assertions.assertFalse(journalService instanceof TerminalJournalService);
+    }
+}
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
index b4a55e1a7..fa33d3d6c 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java
@@ -3,7 +3,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.ObjectProvider;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -15,6 +14,7 @@
 import pro.fessional.wings.silencer.runner.ApplicationStartedEventRunner;
 import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.spring.prop.WarlockCheckProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockI18nProp;
@@ -26,14 +26,16 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
+@ConditionalWingsEnabled
 @EnableConfigurationProperties({WarlockEnabledProp.class, WarlockCheckProp.class, WarlockI18nProp.class})
 public class WarlockAutoRunConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockAutoRunConfiguration.class);
 
     @Bean
-    public ApplicationStartedEventRunner runnerRegisterEnumUtil(ObjectProvider provider) {
-        log.info("Warlock spring-runs runnerRegisterEnumUtil");
+    @ConditionalWingsEnabled
+    public ApplicationStartedEventRunner registerEnumUtilRunner(ObjectProvider provider) {
+        log.info("Warlock spring-runs registerEnumUtilRunner");
         return new ApplicationStartedEventRunner(WingsOrdered.Lv4Application, ignored -> {
             final WarlockI18nProp warlockI18nProp = provider.getIfAvailable();
             if (warlockI18nProp == null) {
@@ -66,9 +68,9 @@ public ApplicationStartedEventRunner runnerRegisterEnumUtil(ObjectProvider {
             DatabaseChecker.version(dataSource);
             DatabaseChecker.timezone(dataSource, prop.getTzOffset(), prop.isTzFail());
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java
index 9f7a6b58b..6ab55e4c8 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java
@@ -1,16 +1,13 @@
 package pro.fessional.wings.warlock.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.jdbc.core.JdbcTemplate;
 import pro.fessional.mirana.lock.JvmStaticGlobalLock;
 import pro.fessional.wings.faceless.concur.DatabaseGlobalLock;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
 
 /**
@@ -18,22 +15,20 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@RequiredArgsConstructor
+@ConditionalWingsEnabled
 public class WarlockLockBeanConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockLockBeanConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(JvmStaticGlobalLock.class)
-    @ConditionalOnProperty(name = WarlockEnabledProp.Key$globalLock, havingValue = "true")
+    @ConditionalWingsEnabled
     public JvmStaticGlobalLock jvmStaticGlobalLock() {
         log.info("Warlock spring-bean jvmStaticGlobalLock");
         return new JvmStaticGlobalLock();
     }
 
     @Bean
-    @ConditionalOnMissingBean(DatabaseGlobalLock.class)
-    @ConditionalOnProperty(name = WarlockEnabledProp.Key$globalLock, havingValue = "true")
+    @ConditionalWingsEnabled
     public DatabaseGlobalLock databaseGlobalLock(JdbcTemplate jdbcTemplate) {
         log.info("Warlock spring-bean databaseGlobalLock");
         return new DatabaseGlobalLock(jdbcTemplate);
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java
index 77d6a5e7a..a6ada683b 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java
@@ -2,18 +2,15 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.context.ApplicationEventPublisher;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.WingsTableCudHandler;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.slardar.event.EventPublishHelper;
 import pro.fessional.wings.warlock.service.event.TableChangePublisher;
 import pro.fessional.wings.warlock.service.event.impl.TableChangePublisherImpl;
 import pro.fessional.wings.warlock.service.event.impl.WingsTableCudHandlerImpl;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 
 
 /**
@@ -21,13 +18,13 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = WarlockEnabledProp.Key$tableChange, havingValue = "true")
+@ConditionalWingsEnabled
 public class WarlockTableChangeConfiguration {
 
     private final static Log log = LogFactory.getLog(WarlockTableChangeConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(TableChangePublisher.class)
+    @ConditionalWingsEnabled
     public TableChangePublisher tableChangePublisher() {
         log.info("Warlock spring-bean tableChangePublisher");
         final ApplicationEventPublisher publisher;
@@ -43,7 +40,7 @@ public TableChangePublisher tableChangePublisher() {
     }
 
     @Bean
-    @ConditionalOnBean(TableChangePublisher.class)
+    @ConditionalWingsEnabled
     public WingsTableCudHandler wingsTableCudHandler() {
         log.info("Warlock spring-bean wingsTableCudHandler");
         return new WingsTableCudHandlerImpl();
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java
index 171e64032..ca8b5b1fc 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java
@@ -5,14 +5,12 @@
 import org.jooq.ExecuteListenerProvider;
 import org.jooq.impl.DefaultExecuteListenerProvider;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.jooq.listener.SlowSqlListener;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.silencer.watch.WatchingAround;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 import pro.fessional.wings.warlock.spring.prop.WarlockWatchingProp;
 
 
@@ -21,16 +19,14 @@
  * @since 2019-12-01
  */
 @Configuration(proxyBeanMethods = false)
-@ConditionalOnProperty(name = WarlockEnabledProp.Key$watching, havingValue = "true")
+@ConditionalWingsEnabled
 @EnableConfigurationProperties(WarlockWatchingProp.class)
 public class WarlockWatchingConfiguration {
 
-    public static final String slowSqlJooqListener = "slowSqlJooqListener";
-
     private final static Log log = LogFactory.getLog(WarlockWatchingConfiguration.class);
 
     @Bean
-    @ConditionalOnMissingBean(WatchingAround.class)
+    @ConditionalWingsEnabled
     @ConditionalOnExpression("${" + WarlockWatchingProp.Key$serviceThreshold + ":-1} >=0")
     public WatchingAround watchingAround(WarlockWatchingProp prop) {
         final long ms = prop.getServiceThreshold();
@@ -40,12 +36,12 @@ public WatchingAround watchingAround(WarlockWatchingProp prop) {
         return bean;
     }
 
-    @Bean(name = slowSqlJooqListener)
-    @ConditionalOnMissingBean(name = slowSqlJooqListener)
+    @Bean
+    @ConditionalWingsEnabled
     @ConditionalOnExpression("${" + WarlockWatchingProp.Key$jooqThreshold + ":-1} >=0")
     public ExecuteListenerProvider slowSqlJooqListener(WarlockWatchingProp prop) {
         final long ms = prop.getJooqThreshold();
-        log.info("Warlock spring-bean " + slowSqlJooqListener + ", threshold=" + ms);
+        log.info("Warlock spring-bean slowSqlJooqListener, threshold=" + ms);
         final SlowSqlListener bean = new SlowSqlListener();
         bean.setThresholdMillis(ms);
         return new DefaultExecuteListenerProvider(bean);
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java
index 382ac9e36..2d5b3143a 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java
@@ -1,23 +1,20 @@
 package pro.fessional.wings.warlock.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import pro.fessional.wings.faceless.spring.conf.FacelessJooqAutoConfiguration;
-import pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration;
+import org.springframework.context.annotation.Import;
+import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.warlock.spring.bean.WarlockAutoRunConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockLockBeanConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockTableChangeConfiguration;
 import pro.fessional.wings.warlock.spring.bean.WarlockWatchingConfiguration;
-import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp;
 
 /**
  * @author trydofor
  * @since 2019-07-11
  */
-@AutoConfiguration(before = {FacelessJooqAutoConfiguration.class, SlardarAutoConfiguration.class})
-@ConditionalOnProperty(name = WarlockEnabledProp.Key$autoconf, havingValue = "true")
-@ImportAutoConfiguration({
+@AutoConfiguration
+@ConditionalWingsEnabled
+@Import({
         WarlockAutoRunConfiguration.class,
         WarlockLockBeanConfiguration.class,
         WarlockTableChangeConfiguration.class,
diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java
index 19d918a32..f2b2ccacb 100644
--- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java
+++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java
@@ -88,15 +88,6 @@ public class WarlockEnabledProp {
     private boolean securityBean = true;
     public static final String Key$securityBean = Key + ".security-bean";
 
-
-    /**
-     * whether to inject wings global lock.
-     *
-     * @see #Key$globalLock
-     */
-    private boolean globalLock = true;
-    public static final String Key$globalLock = Key + ".global-lock";
-
     /**
      * whether to inject jooq dao.
      *
diff --git a/wings/warlock/src/main/resources/wings-conf/spring-wings-enabled-77.properties b/wings/warlock/src/main/resources/wings-conf/spring-wings-enabled-77.properties
index 59bc5d280..3d599a7a8 100644
--- a/wings/warlock/src/main/resources/wings-conf/spring-wings-enabled-77.properties
+++ b/wings/warlock/src/main/resources/wings-conf/spring-wings-enabled-77.properties
@@ -1,6 +1,6 @@
 ######### dependency override #########
 spring.wings.faceless.enabled.enumi18n=true
-spring.wings.faceless.flywave.enabled.module=true
+spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true
 ##############################
 
 ## whether to enable auto config.
@@ -30,9 +30,6 @@ spring.wings.warlock.enabled.security-http-chain=true
 ## whether to support warlock security Bean.
 spring.wings.warlock.enabled.security-bean=true
 
-## whether to inject wings global lock.
-spring.wings.warlock.enabled.global-lock=true
-
 ## whether to inject jooq dao.
 spring.wings.warlock.enabled.jooq-autogen=true
 
diff --git a/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java b/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java
index b9fb6eaaa..a92ff73c8 100644
--- a/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java
+++ b/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java
@@ -26,8 +26,8 @@
  * @since 2021-02-22
  */
 @SpringBootTest(properties = {
-        "spring.wings.faceless.flywave.enabled.module=true",
-        "spring.wings.faceless.flywave.enabled.checker=false",
+        "spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true",
+        "wings.faceless.flywave.checker=false",
 })
 @Disabled("manual initialization")
 public class BootDatabaseTest {

From e0f90f181272869f8a26121e588fd91413a57db4 Mon Sep 17 00:00:00 2001
From: trydofor 
Date: Tue, 28 Nov 2023 17:47:56 +0800
Subject: [PATCH 18/23] =?UTF-8?q?=E2=9C=A8=20@ConditionalWingsEnabled=20ab?=
 =?UTF-8?q?s-key=20for=20short=20#156?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../common/spring/prop/CommonEnabledProp.java |   2 +-
 .../wings-conf/wings-watching.properties      |   2 -
 .../wings-conf/wings-boot-admin.properties    |   2 +-
 observe/docs                                  |   2 +-
 .../wings/devs/BootDatabaseTest.java          |   2 +-
 .../src/test/resources/application.properties |   2 +-
 .../mail/controller/MailListController.java   |   3 +-
 .../mail/controller/MailSendController.java   |   3 +-
 .../spring/bean/TinyMailConfiguration.java    |  29 +-
 .../conf/TinyMailAutoConfiguration.java       |   3 +
 .../mail/spring/prop/TinyMailEnabledProp.java |  36 +++
 ...itional-spring-configuration-metadata.json |  24 ++
 .../spring-wings-enabled-79.properties        |  11 -
 .../wings-flywave-fit-79.properties           |   2 +-
 .../wings/tiny/project/BootDatabaseTest.java  |   2 +-
 .../tiny/project/TinyMailCodeGenTest.java     |   2 +-
 .../src/test/resources/application.properties |   2 +-
 .../task/controller/TaskConfController.java   |   3 +-
 .../task/controller/TaskExecController.java   |   3 +-
 .../task/controller/TaskListController.java   |   3 +-
 .../spring/bean/TinyTaskConfiguration.java    |  12 +-
 .../conf/TinyTaskAutoConfiguration.java       |   3 +
 .../task/spring/prop/TinyTaskEnabledProp.java |  52 ++++
 ...itional-spring-configuration-metadata.json |  29 ++
 .../src/test/resources/application.properties |   2 +-
 .../bean/BatriderServcombConfiguration.java   |   3 -
 .../conf/BatriderAutoConfiguration.java       |   3 +
 .../spring/prop/BatriderEnabledProp.java      |  20 ++
 .../spring-wings-enabled-79.properties        |   3 -
 .../project/ProjectSchemaManager.java         |   2 +-
 .../spring/bean/FlywaveConfiguration.java     |   8 +-
 .../spring/conf/FlywaveAutoConfiguration.java |   3 +-
 ...itional-spring-configuration-metadata.json |  19 ++
 .../src/test/resources/application.properties |   2 +-
 .../bean/FacelessJooqConfiguration.java       |   7 +-
 .../bean/FacelessJooqCudConfiguration.java    |  51 ++--
 .../spring/prop/FacelessJooqConfProp.java     |  10 +-
 ...itional-spring-configuration-metadata.json |  19 ++
 .../wings-conf/wings-jooq-conf-79.properties  |   2 +-
 .../faceless/jooq/JooqDeleteListenerTest.java |   2 +-
 .../jooq/JooqTableCudListenerTest.java        |   8 +-
 .../wings-conf/wings-jooq-cud.properties      |   2 +-
 .../FacelessShardingSphereConfiguration.java  |  45 ++-
 ...itional-spring-configuration-metadata.json |  14 +
 .../spring-wings-enabled.properties           |   5 -
 .../wings-conf/wings-enabled.properties       |   5 +
 .../wini18n/impl/StandardI18nServiceJdbc.java |  16 +-
 .../spring/bean/FacelessConfiguration.java    |   5 +-
 .../bean/FacelessLightIdConfiguration.java    |   3 -
 .../conf/FacelessAutoConfiguration.java       |   3 +
 .../spring/prop/FacelessEnabledProp.java      |  43 +++
 ...itional-spring-configuration-metadata.json |  27 ++
 .../silencer/encrypt/SecretProvider.java      |   6 +-
 .../wings/silencer/modulate/RuntimeMode.java  |  10 +-
 ...n.java => SilencerCurseConfiguration.java} |  66 ++++-
 .../bean/SilencerEncryptConfiguration.java    |  38 +--
 .../bean/SilencerInspectConfiguration.java    |  61 -----
 .../bean/SilencerModeWiredConfiguration.java  |  31 ---
 .../bean/SilencerTweakConfiguration.java      |   9 +-
 .../conf/SilencerCurseAutoConfiguration.java  |   8 +-
 ...itional-spring-configuration-metadata.json |  26 ++
 .../src/test/resources/application.properties |   2 +-
 .../silencer/message/MessageSourceHelper.java |  57 ++--
 .../spring/bean/SilencerConfiguration.java    |  29 +-
 .../spring/boot/ConditionalWingsEnabled.java  |  24 +-
 .../spring/boot/WingsAutoConfigProcessor.java |  13 +-
 .../spring/boot/WingsEnabledCondition.java    | 126 ++++-----
 .../conf/SilencerAutoConfiguration.java       |   4 +-
 .../spring/prop/SilencerEnabledProp.java      |  53 +++-
 ...itional-spring-configuration-metadata.json |  18 ++
 .../spring-wings-enabled-79.properties        |  10 -
 .../wings-conf/wings-enabled-79.properties    |  25 ++
 .../wings-conf/wings-i18n-79.properties       |   4 +-
 .../bean/WingsEnabledCatConfiguration.java    |   8 +-
 .../spring/boot/WingsEnabledDefaultTest.java  |   2 -
 .../spring/boot/WingsEnabledFalseTest.java    |  23 +-
 .../spring/boot/WingsEnabledTopFalseTest.java |  12 +-
 .../spring/boot/WingsSilencerSpringTest.java  |   2 +-
 .../boot/WingsSpringBeanScannerTest.java      |   2 +-
 .../help/CombinableMessageSourceTest.java     |  14 +-
 .../src/test/resources/application.properties |   2 +-
 .../bean/HazelcastConfigConfiguration.java    |   5 +-
 ...itional-spring-configuration-metadata.json |  21 ++
 .../spring-wings-enabled-79.properties        |   2 -
 .../slardar/event/EventPublishHelperTest.java |   2 +-
 ...itional-spring-configuration-metadata.json |  14 +
 .../webmvc/WingsSessionLangZoneTest.java      |   2 +-
 .../SlardarBootAdminClientConfiguration.java  |   3 -
 .../SlardarBootAdminServerConfiguration.java  |   2 -
 .../bean/SlardarSecurityConfiguration.java    |   6 +-
 ...itional-spring-configuration-metadata.json |  31 +++
 .../slardar/webmvc/RighterControllerTest.java |   6 +-
 .../src/test/resources/application.properties |   2 +-
 .../spring-wings-enabled.properties           |   1 -
 .../wings-conf/wings-enabled.properties       |   2 +
 .../slardar/monitor/viewer/LogViewer.java     |   4 +-
 .../bean/SlardarCookieConfiguration.java      |   5 +-
 .../bean/SlardarDebounceConfiguration.java    |   5 +-
 .../SlardarDomainExtendConfiguration.java     |   7 +-
 .../SlardarDoubleKillWebConfiguration.java    |   5 +-
 .../bean/SlardarFirstBloodConfiguration.java  |   7 +-
 .../bean/SlardarJacksonWebConfiguration.java  |  57 ++--
 .../bean/SlardarLocaleConfiguration.java      |   4 +-
 .../bean/SlardarOkhttpWebConfiguration.java   |  15 +-
 .../bean/SlardarOverloadConfiguration.java    |   3 -
 .../bean/SlardarPageQueryConfiguration.java   |   5 +-
 .../bean/SlardarRemoteConfiguration.java      |   2 -
 .../bean/SlardarReuseStreamConfiguration.java |   3 +-
 .../bean/SlardarRighterConfiguration.java     |  17 +-
 .../bean/SlardarSessionConfiguration.java     |  38 ++-
 .../bean/SlardarSwaggerConfiguration.java     |   5 +-
 .../bean/SlardarTerminalConfiguration.java    |   5 +-
 ...va => SlardarWebCnfAutoConfiguration.java} |   2 +-
 ...itional-spring-configuration-metadata.json |  79 ++++++
 ...ot.autoconfigure.AutoConfiguration.imports |   2 +-
 .../wings/slardar/concur/FirstBloodTest.java  |   6 +-
 .../slardar/domain/DomainExtendTest.java      |   3 +-
 .../wings/slardar/webmvc/WingsCookieTest.java |   2 +-
 .../src/test/resources/application.properties |   4 +-
 .../slardar/async/TaskSchedulerHelper.java    |  20 +-
 .../bean/SlardarAsyncConfiguration.java       |   8 +-
 .../bean/SlardarCacheConfiguration.java       |   4 +-
 .../bean/SlardarDateTimeConfiguration.java    |   2 -
 .../bean/SlardarDingNoticeConfiguration.java  |   2 -
 .../bean/SlardarDoubleKillConfiguration.java  |   3 +-
 .../bean/SlardarEventConfiguration.java       |   2 -
 .../bean/SlardarJacksonConfiguration.java     |   2 -
 .../bean/SlardarMonitorConfiguration.java     |  25 +-
 .../bean/SlardarOkhttpConfiguration.java      |   2 -
 .../bean/SlardarTweakConfiguration.java       |  12 +-
 .../spring/conf/SlardarAutoConfiguration.java |   3 +
 .../spring/prop/SlardarEnabledProp.java       | 183 +++++++++++++
 ...itional-spring-configuration-metadata.json | 109 ++++++--
 .../spring-wings-enabled-79.properties        |  76 ------
 .../warlock/database/WarlockDatabase.java     |   8 +
 .../bean/WarlockAwesomeConfiguration.java     |  37 +--
 ...itional-spring-configuration-metadata.json |  15 +
 .../admin/AdminAuthnController.java           |   4 +-
 .../bean/WarlockBondBeanConfiguration.java    |   2 -
 .../conf/WarlockBondAutoConfiguration.java    |   2 +-
 ...itional-spring-configuration-metadata.json |  25 ++
 .../project/Warlock1SchemaManager.java        |   2 +-
 .../admin/AdminTweakController.java           |   3 +-
 .../controller/auth/LoginPageController.java  |   4 +-
 .../controller/auth/LoginProcController.java  |   4 +-
 .../auth/SimpleOauthController.java           |   6 +-
 .../controller/mock/MockSampleController.java |   4 +-
 .../controller/test/TestEnvsController.java   |   4 +-
 .../controller/user/AuthedUserController.java |   4 +-
 .../bean/WarlockExceptionConfiguration.java   |   4 -
 .../bean/WarlockJournalConfiguration.java     |   5 +-
 .../bean/WarlockJustAuthConfiguration.java    |   2 -
 .../bean/WarlockOauthTicketConfiguration.java |  24 +-
 .../WarlockSecurityBeanConfiguration.java     |  17 +-
 .../WarlockSecurityConfConfiguration.java     |  36 +--
 .../WarlockSecurityDummyConfiguration.java    |   3 +-
 .../bean/WarlockWatching2Configuration.java   |   3 -
 ...itional-spring-configuration-metadata.json |  91 ++++++
 .../wings-conf/wings-enabled-79.properties    |   5 +
 .../controller/api/ApiAuthControllerTest.java |   3 +-
 .../bean/WarlockJournalDisableTest.java       |   5 +-
 .../src/test/resources/application.properties |   2 +
 .../bean/WarlockAutoRunConfiguration.java     |  26 +-
 .../bean/WarlockLockBeanConfiguration.java    |  12 +-
 .../bean/WarlockTableChangeConfiguration.java |   3 +-
 .../bean/WarlockWatchingConfiguration.java    |  27 +-
 .../spring/conf/WarlockAutoConfiguration.java |   3 +
 .../spring/prop/WarlockEnabledProp.java       | 258 +++++-------------
 ...itional-spring-configuration-metadata.json |  26 ++
 .../spring-wings-enabled-77.properties        | 103 -------
 .../wings/warlock/BootDatabaseTest.java       |   2 +-
 171 files changed, 1672 insertions(+), 1200 deletions(-)
 create mode 100644 radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailEnabledProp.java
 create mode 100644 radiant/tiny-mail/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 delete mode 100644 radiant/tiny-mail/src/main/resources/wings-conf/spring-wings-enabled-79.properties
 create mode 100644 radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskEnabledProp.java
 create mode 100644 radiant/tiny-task/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/prop/BatriderEnabledProp.java
 delete mode 100644 wings/batrider/src/main/resources/wings-conf/spring-wings-enabled-79.properties
 create mode 100644 wings/faceless-flywave/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/faceless-jooq/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/faceless-shard/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 delete mode 100644 wings/faceless-test/src/main/resources/wings-conf/spring-wings-enabled.properties
 create mode 100644 wings/faceless-test/src/main/resources/wings-conf/wings-enabled.properties
 create mode 100644 wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessEnabledProp.java
 create mode 100644 wings/faceless/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 rename wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/{SilencerAutoLogConfiguration.java => SilencerCurseConfiguration.java} (56%)
 delete mode 100644 wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java
 delete mode 100644 wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerModeWiredConfiguration.java
 create mode 100644 wings/silencer-curse/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/silencer/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 delete mode 100644 wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties
 create mode 100644 wings/silencer/src/main/resources/wings-conf/wings-enabled-79.properties
 create mode 100644 wings/slardar-hazel-caching/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 delete mode 100644 wings/slardar-hazel-caching/src/main/resources/wings-conf/spring-wings-enabled-79.properties
 create mode 100644 wings/slardar-hazel-session/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/slardar-sprint/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 delete mode 100644 wings/slardar-test/src/main/resources/wings-conf/spring-wings-enabled.properties
 create mode 100644 wings/slardar-test/src/main/resources/wings-conf/wings-enabled.properties
 rename wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/{SlardarWebMvcAutoConfiguration.java => SlardarWebCnfAutoConfiguration.java} (93%)
 create mode 100644 wings/slardar-webmvc/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java
 delete mode 100644 wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties
 create mode 100644 wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/WarlockDatabase.java
 create mode 100644 wings/warlock-awesome/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/warlock-bond/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/warlock-shadow/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 create mode 100644 wings/warlock-shadow/src/main/resources/wings-conf/wings-enabled-79.properties
 create mode 100644 wings/warlock/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 delete mode 100644 wings/warlock/src/main/resources/wings-conf/spring-wings-enabled-77.properties

diff --git a/example/winx-common/src/main/java/com/moilioncircle/wings/common/spring/prop/CommonEnabledProp.java b/example/winx-common/src/main/java/com/moilioncircle/wings/common/spring/prop/CommonEnabledProp.java
index b93c79755..196cbd0b1 100644
--- a/example/winx-common/src/main/java/com/moilioncircle/wings/common/spring/prop/CommonEnabledProp.java
+++ b/example/winx-common/src/main/java/com/moilioncircle/wings/common/spring/prop/CommonEnabledProp.java
@@ -4,7 +4,7 @@
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
- * spring-wings-enabled-79.properties
+ * wings-enabled-79.properties
  *
  * @author trydofor
  * @see #Key
diff --git a/example/winx-common/src/main/resources/wings-conf/wings-watching.properties b/example/winx-common/src/main/resources/wings-conf/wings-watching.properties
index 59df46672..25320e08f 100644
--- a/example/winx-common/src/main/resources/wings-conf/wings-watching.properties
+++ b/example/winx-common/src/main/resources/wings-conf/wings-watching.properties
@@ -1,5 +1,3 @@
-## Whether enable watching
-spring.wings.warlock.enabled.watching=true
 ## -1 means disable, 0 means enable, otherwise number in millis
 #wings.warlock.watching.jooq-threshold=-1
 #wings.warlock.watching.service-threshold=-1
diff --git a/example/winx-devops/src/main/resources/wings-conf/wings-boot-admin.properties b/example/winx-devops/src/main/resources/wings-conf/wings-boot-admin.properties
index 413c24085..df445ab99 100644
--- a/example/winx-devops/src/main/resources/wings-conf/wings-boot-admin.properties
+++ b/example/winx-devops/src/main/resources/wings-conf/wings-boot-admin.properties
@@ -3,7 +3,7 @@
 spring.boot.admin.server.enabled=true
 wings.warlock.security.login-forward=false
 wings.warlock.security.logout-success-body=
-#spring.wings.warlock.enabled.controller-proc=false
+#wings.enabled.warlock.mvc-proc=false
 
 spring.boot.admin.context-path=
 spring.boot.admin.ui.title=Wings-Boot-Admin
diff --git a/observe/docs b/observe/docs
index 924abad55..4e0be28d4 160000
--- a/observe/docs
+++ b/observe/docs
@@ -1 +1 @@
-Subproject commit 924abad555b3cbecf64963a60c696f4b28f87a79
+Subproject commit 4e0be28d431c1e72fcf6f0ffa285b1e438a58a3e
diff --git a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java b/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java
index 5125086ac..53407fc4e 100644
--- a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java
+++ b/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java
@@ -27,7 +27,7 @@
  * @since 2021-02-22
  */
 @SpringBootTest(properties = {
-        "spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true",
+        "wings.enabled.faceless.flywave=true",
         "wings.faceless.flywave.checker=false",
 })
 @Disabled("manual initialization")
diff --git a/radiant/devs-mvndep/src/test/resources/application.properties b/radiant/devs-mvndep/src/test/resources/application.properties
index f0bf313f8..3005f37e7 100644
--- a/radiant/devs-mvndep/src/test/resources/application.properties
+++ b/radiant/devs-mvndep/src/test/resources/application.properties
@@ -1,4 +1,4 @@
-spring.wings.enabled.silencer.scanner=false
+wings.enabled.silencer.scanner=false
 
 wings.faceless.flywave.checker=false
 
diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailListController.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailListController.java
index ff5a0f630..676bca210 100644
--- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailListController.java
+++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailListController.java
@@ -14,6 +14,7 @@
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.tiny.mail.service.TinyMailListService;
 import pro.fessional.wings.tiny.mail.service.TinyMailPlain;
+import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp;
 import pro.fessional.wings.tiny.mail.spring.prop.TinyMailUrlmapProp;
 
 /**
@@ -21,7 +22,7 @@
  * @since 2023-01-13
  */
 @RestController
-@ConditionalWingsEnabled
+@ConditionalWingsEnabled(abs = TinyMailEnabledProp.Key$mvcList)
 public class MailListController {
 
     @Setter(onMethod_ = {@Autowired})
diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailSendController.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailSendController.java
index d623bccd8..9f7c93527 100644
--- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailSendController.java
+++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/controller/MailSendController.java
@@ -12,6 +12,7 @@
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.tiny.mail.service.TinyMailPlain;
 import pro.fessional.wings.tiny.mail.service.TinyMailService;
+import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp;
 import pro.fessional.wings.tiny.mail.spring.prop.TinyMailUrlmapProp;
 
 /**
@@ -19,7 +20,7 @@
  * @since 2023-01-13
  */
 @RestController
-@ConditionalWingsEnabled
+@ConditionalWingsEnabled(abs = TinyMailEnabledProp.Key$mvcSend)
 public class MailSendController {
 
     @Setter(onMethod_ = {@Autowired})
diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java
index ca0712ad6..5e275e94d 100644
--- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java
+++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/bean/TinyMailConfiguration.java
@@ -1,10 +1,8 @@
 package pro.fessional.wings.tiny.mail.spring.bean;
 
-import lombok.RequiredArgsConstructor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
@@ -20,8 +18,6 @@
 import pro.fessional.wings.tiny.mail.service.TinyMailService;
 import pro.fessional.wings.tiny.mail.spring.prop.TinyMailConfigProp;
 import pro.fessional.wings.tiny.mail.spring.prop.TinyMailSenderProp;
-import pro.fessional.wings.tiny.mail.spring.prop.TinyMailServiceProp;
-import pro.fessional.wings.tiny.mail.spring.prop.TinyMailUrlmapProp;
 
 /**
  * @author trydofor
@@ -30,13 +26,6 @@
 
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
-@EnableConfigurationProperties({
-        TinyMailConfigProp.class,
-        TinyMailSenderProp.class,
-        TinyMailServiceProp.class,
-        TinyMailUrlmapProp.class,
-})
-@RequiredArgsConstructor
 public class TinyMailConfiguration {
 
     private static final Log log = LogFactory.getLog(TinyMailConfiguration.class);
@@ -63,16 +52,16 @@ public MvcRestScan() {
 
     @Bean
     @ConditionalWingsEnabled
-    public MailSenderProvider mailSenderProvider(JavaMailSender defaultSender) {
-        log.info("TinyMail spring-bean mailSenderProvider");
-        return new MailSenderProvider(defaultSender);
+    public MailConfigProvider mailConfigProvider(TinyMailConfigProp tinyMailConfigProp) {
+        log.info("TinyMail spring-bean mailConfigProvider");
+        return new MailConfigProvider(tinyMailConfigProp);
     }
 
     @Bean
     @ConditionalWingsEnabled
-    public MailConfigProvider mailConfigProvider(TinyMailConfigProp tinyMailConfigProp) {
-        log.info("TinyMail spring-bean mailConfigProvider");
-        return new MailConfigProvider(tinyMailConfigProp);
+    public MailNotice mailNotice(MailConfigProvider configProvider, MailSenderManager senderManager) {
+        log.info("TinyMail spring-bean mailNotice");
+        return new MailNotice(configProvider, senderManager);
     }
 
     @Bean
@@ -84,8 +73,8 @@ public MailSenderManager mailSenderManager(TinyMailSenderProp senderProp, MailSe
 
     @Bean
     @ConditionalWingsEnabled
-    public MailNotice mailNotice(MailConfigProvider configProvider, MailSenderManager senderManager) {
-        log.info("TinyMail spring-bean mailNotice");
-        return new MailNotice(configProvider, senderManager);
+    public MailSenderProvider mailSenderProvider(JavaMailSender defaultSender) {
+        log.info("TinyMail spring-bean mailSenderProvider");
+        return new MailSenderProvider(defaultSender);
     }
 }
diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java
index c2c3797ca..1c133491f 100644
--- a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java
+++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/conf/TinyMailAutoConfiguration.java
@@ -1,9 +1,11 @@
 package pro.fessional.wings.tiny.mail.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
 import org.springframework.context.annotation.Import;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration;
+import pro.fessional.wings.tiny.mail.spring.prop.TinyMailEnabledProp;
 
 /**
  * @author trydofor
@@ -11,6 +13,7 @@
  */
 @AutoConfiguration
 @ConditionalWingsEnabled
+@ConfigurationPropertiesScan(basePackageClasses = TinyMailEnabledProp.class)
 @Import(TinyMailConfiguration.class)
 public class TinyMailAutoConfiguration {
 }
diff --git a/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailEnabledProp.java b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailEnabledProp.java
new file mode 100644
index 000000000..2d4e0e227
--- /dev/null
+++ b/radiant/tiny-mail/src/main/java/pro/fessional/wings/tiny/mail/spring/prop/TinyMailEnabledProp.java
@@ -0,0 +1,36 @@
+package pro.fessional.wings.tiny.mail.spring.prop;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition;
+
+/**
+ * wings-enabled-79.properties
+ *
+ * @author trydofor
+ * @see #Key
+ * @since 2021-02-13
+ */
+@Data
+@ConfigurationProperties(TinyMailEnabledProp.Key)
+public class TinyMailEnabledProp {
+
+    public static final String Key = WingsEnabledCondition.Prefix + ".tiny.mail";
+
+
+    /**
+     * whether to enable MailListController
+     *
+     * @see #Key$mvcList
+     */
+    private boolean mvcList = true;
+    public static final String Key$mvcList = Key + ".mvc-list";
+
+    /**
+     * whether to enable MailSendController
+     *
+     * @see #Key$mvcSend
+     */
+    private boolean mvcSend = true;
+    public static final String Key$mvcSend = Key + ".mvc-send";
+}
diff --git a/radiant/tiny-mail/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/radiant/tiny-mail/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 000000000..d307a8a41
--- /dev/null
+++ b/radiant/tiny-mail/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,24 @@
+{
+  "groups": [
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.conf"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.bean"}
+  ],
+  "properties": [
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.conf.TinyMailAutoConfiguration", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration$DaoServScan", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration$MvcRestScan", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration.mailConfigProvider", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration.mailNotice", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration.mailSenderManager", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.spring.bean.TinyMailConfiguration.mailSenderProvider", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.controller.MailListController", "type": "java.lang.Boolean", "description": "wings.enabled.tiny.mail.mvc-list for short."},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.controller.MailSendController", "type": "java.lang.Boolean", "description": "wings.enabled.tiny.mail.mvc-send for short."},
+
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.service.impl.TinyMailListServiceImpl", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.mail.service.impl.TinyMailServiceImpl", "type": "java.lang.Boolean"}
+  ],
+  "hints": []
+}
\ No newline at end of file
diff --git a/radiant/tiny-mail/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/radiant/tiny-mail/src/main/resources/wings-conf/spring-wings-enabled-79.properties
deleted file mode 100644
index 32952cff7..000000000
--- a/radiant/tiny-mail/src/main/resources/wings-conf/spring-wings-enabled-79.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-## whether to enable auto config
-spring.wings.tiny.mail.enabled.autoconf=true
-
-## whether to dry run, log only without actually send
-spring.wings.tiny.mail.enabled.dryrun=false
-
-## whether to enable MailListController
-spring.wings.tiny.mail.enabled.controller-list=true
-
-## whether to enable MailSendController
-spring.wings.tiny.mail.enabled.controller-send=true
diff --git a/radiant/tiny-mail/src/main/resources/wings-conf/wings-flywave-fit-79.properties b/radiant/tiny-mail/src/main/resources/wings-conf/wings-flywave-fit-79.properties
index cd99d603a..b2857d47f 100644
--- a/radiant/tiny-mail/src/main/resources/wings-conf/wings-flywave-fit-79.properties
+++ b/radiant/tiny-mail/src/main/resources/wings-conf/wings-flywave-fit-79.properties
@@ -1,4 +1,4 @@
-spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true
+wings.enabled.faceless.flywave=true
 
 wings.faceless.flywave.fit.tiny-mail.path=classpath*:/wings-flywave/master/07-mail/*.sql
 wings.faceless.flywave.fit.tiny-mail.revi=2020_1027_01L
diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
index 06be3bfcd..4beca1139 100644
--- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
+++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/BootDatabaseTest.java
@@ -28,7 +28,7 @@
  * @since 2021-02-22
  */
 @SpringBootTest(properties = {
-        "spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true",
+        "wings.enabled.faceless.flywave=true",
         "wings.faceless.flywave.checker=false",
 })
 @Disabled("manual initialization")
diff --git a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java
index 1a17534da..8f1700aad 100644
--- a/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java
+++ b/radiant/tiny-mail/src/test/java/pro/fessional/wings/tiny/project/TinyMailCodeGenTest.java
@@ -14,7 +14,7 @@
  * @since 2021-02-22
  */
 @SpringBootTest(properties = {
-        "spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true",
+        "wings.enabled.faceless.flywave=true",
         "wings.faceless.flywave.checker=false",
         "wings.tiny.mail.service.boot-scan=0",
 })
diff --git a/radiant/tiny-mail/src/test/resources/application.properties b/radiant/tiny-mail/src/test/resources/application.properties
index 977ca96cf..440217594 100644
--- a/radiant/tiny-mail/src/test/resources/application.properties
+++ b/radiant/tiny-mail/src/test/resources/application.properties
@@ -1,7 +1,7 @@
 spring.application.name=tiny-mail-test
 server.port=8086
 debug=true
-spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true
+wings.enabled.faceless.flywave=true
 spring.mail.properties.mail.debug=true
 wings.tiny.mail.sender.force-prefix=DEBUG
 
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskConfController.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskConfController.java
index 6cb4a0a0d..8b9029353 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskConfController.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskConfController.java
@@ -15,6 +15,7 @@
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.tiny.task.schedule.conf.TaskerProp;
 import pro.fessional.wings.tiny.task.service.TinyTaskConfService;
+import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp;
 import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp;
 
 import java.util.LinkedHashMap;
@@ -25,7 +26,7 @@
  * @since 2022-12-26
  */
 @RestController
-@ConditionalWingsEnabled
+@ConditionalWingsEnabled(abs = TinyTaskEnabledProp.Key$mvcConf)
 public class TaskConfController {
 
     @Setter(onMethod_ = {@Autowired})
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskExecController.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskExecController.java
index 69f4010d4..3859fd158 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskExecController.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskExecController.java
@@ -11,6 +11,7 @@
 import pro.fessional.mirana.data.R;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.tiny.task.service.TinyTaskExecService;
+import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp;
 import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp;
 
 /**
@@ -18,7 +19,7 @@
  * @since 2022-12-26
  */
 @RestController
-@ConditionalWingsEnabled
+@ConditionalWingsEnabled(abs = TinyTaskEnabledProp.Key$mvcExec)
 public class TaskExecController {
 
     @Setter(onMethod_ = {@Autowired})
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskListController.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskListController.java
index da42b0164..325edd2b5 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskListController.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/controller/TaskListController.java
@@ -13,6 +13,7 @@
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.tiny.task.database.autogen.tables.pojos.WinTaskResult;
 import pro.fessional.wings.tiny.task.service.TinyTaskListService;
+import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp;
 import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp;
 
 /**
@@ -20,7 +21,7 @@
  * @since 2022-12-26
  */
 @RestController
-@ConditionalWingsEnabled
+@ConditionalWingsEnabled(abs = TinyTaskEnabledProp.Key$mvcList)
 public class TaskListController {
 
     @Setter(onMethod_ = {@Autowired})
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java
index a37d12013..17e8e1b0a 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/bean/TinyTaskConfiguration.java
@@ -5,7 +5,6 @@
 import org.jetbrains.annotations.NotNull;
 import org.springframework.beans.factory.ObjectProvider;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
@@ -18,9 +17,7 @@
 import pro.fessional.wings.tiny.task.database.TinyTaskDatabase;
 import pro.fessional.wings.tiny.task.schedule.TinyTasker;
 import pro.fessional.wings.tiny.task.service.TinyTaskService;
-import pro.fessional.wings.tiny.task.spring.prop.TinyTaskDefineProp;
-import pro.fessional.wings.tiny.task.spring.prop.TinyTaskExecProp;
-import pro.fessional.wings.tiny.task.spring.prop.TinyTaskUrlmapProp;
+import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp;
 
 import java.util.Map;
 
@@ -31,11 +28,6 @@
 
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
-@EnableConfigurationProperties({
-        TinyTaskDefineProp.class,
-        TinyTaskExecProp.class,
-        TinyTaskUrlmapProp.class
-})
 public class TinyTaskConfiguration {
 
     private static final Log log = LogFactory.getLog(TinyTaskConfiguration.class);
@@ -62,7 +54,7 @@ public MvcRestScan() {
      * auto start TinyTask.Auto
      */
     @Bean
-    @ConditionalWingsEnabled
+    @ConditionalWingsEnabled(abs = TinyTaskEnabledProp.Key$autorun)
     public ApplicationReadyEventRunner tinyTaskerAutoRunner(@NotNull ApplicationContext context, ObjectProvider tinyTaskService) {
         log.info("TinyTask spring-runs tinyTaskerAutoRunner");
         return new ApplicationReadyEventRunner(WingsOrdered.Lv3Service, ignored -> {
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java
index d604e38f4..46340959a 100644
--- a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/conf/TinyTaskAutoConfiguration.java
@@ -1,9 +1,11 @@
 package pro.fessional.wings.tiny.task.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
 import org.springframework.context.annotation.Import;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 import pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration;
+import pro.fessional.wings.tiny.task.spring.prop.TinyTaskEnabledProp;
 
 /**
  * @author trydofor
@@ -11,6 +13,7 @@
  */
 @AutoConfiguration
 @ConditionalWingsEnabled
+@ConfigurationPropertiesScan(basePackageClasses = TinyTaskEnabledProp.class)
 @Import(TinyTaskConfiguration.class)
 public class TinyTaskAutoConfiguration {
 }
diff --git a/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskEnabledProp.java b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskEnabledProp.java
new file mode 100644
index 000000000..76b0d8209
--- /dev/null
+++ b/radiant/tiny-task/src/main/java/pro/fessional/wings/tiny/task/spring/prop/TinyTaskEnabledProp.java
@@ -0,0 +1,52 @@
+package pro.fessional.wings.tiny.task.spring.prop;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition;
+
+/**
+ * wings-enabled-79.properties
+ *
+ * @author trydofor
+ * @see #Key
+ * @since 2021-02-13
+ */
+@Data
+@ConfigurationProperties(TinyTaskEnabledProp.Key)
+public class TinyTaskEnabledProp {
+
+    public static final String Key = WingsEnabledCondition.Prefix + ".tiny.task";
+
+    /**
+     * whether to auto register TinyTask.Auto.
+     *
+     * @see #Key$autorun
+     */
+    private boolean autorun = true;
+    public static final String Key$autorun = Key + ".autorun";
+
+    /**
+     * whether to enable TaskConfController.
+     *
+     * @see #Key$mvcConf
+     */
+    private boolean mvcConf = true;
+    public static final String Key$mvcConf = Key + ".mvc-conf";
+
+    /**
+     * whether to enable TaskExecController.
+     *
+     * @see #Key$mvcExec
+     */
+    private boolean mvcExec = true;
+    public static final String Key$mvcExec = Key + ".mvc-exec";
+
+    /**
+     * whether to enable TaskListController.
+     *
+     * @see #Key$mvcList
+     */
+    private boolean mvcList = true;
+    public static final String Key$mvcList = Key + ".mvc-list";
+
+}
diff --git a/radiant/tiny-task/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/radiant/tiny-task/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 000000000..e5a15204b
--- /dev/null
+++ b/radiant/tiny-task/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,29 @@
+{
+  "groups": [
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.conf"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.bean"}
+  ],
+  "properties": [
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.conf.TinyTaskAutoConfiguration", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration$DaoServScan", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration$MvcRestScan", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration.tinyTaskerAutoRunner", "type": "java.lang.Boolean", "description": "wings.enabled.tiny.task.autorun for short."},
+
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration.mailNotice", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration.mailSenderManager", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.spring.bean.TinyTaskConfiguration.mailSenderProvider", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.controller.TaskConfController", "type": "java.lang.Boolean", "description": "wings.enabled.tiny.task.mvc-conf for short."},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.controller.TaskExecController", "type": "java.lang.Boolean", "description": "wings.enabled.tiny.task.mvc-exec for short."},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.controller.TaskListController", "type": "java.lang.Boolean", "description": "wings.enabled.tiny.task.mvc-list for short."},
+
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.service.impl.TinyTaskBeatServiceImpl", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.service.impl.TinyTaskConfServiceImpl", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.service.impl.TinyTaskExecServiceImpl", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.service.impl.TinyTaskListServiceImpl", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.tiny.task.service.impl.TinyTaskServiceImpl", "type": "java.lang.Boolean"}
+  ],
+  "hints": []
+}
\ No newline at end of file
diff --git a/radiant/tiny-task/src/test/resources/application.properties b/radiant/tiny-task/src/test/resources/application.properties
index 44ecf7374..2b1df9c81 100644
--- a/radiant/tiny-task/src/test/resources/application.properties
+++ b/radiant/tiny-task/src/test/resources/application.properties
@@ -1,7 +1,7 @@
 spring.application.name=tiny-task-test
 server.port=8086
 debug=true
-spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true
+wings.enabled.faceless.flywave=true
 
 wings.faceless.flywave.auto-init=true
 wings.faceless.flywave.fit.tiny-task.revi=2019_0512_01L, 2019_0520_01L, 2020_1026_01L
diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java
index 450b48868..13031ed02 100644
--- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java
+++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/bean/BatriderServcombConfiguration.java
@@ -1,9 +1,7 @@
 package pro.fessional.wings.batrider.spring.bean;
 
 import org.apache.servicecomb.springboot2.starter.EnableServiceComb;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.batrider.spring.prop.BatriderHandlerProp;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
 /**
@@ -13,6 +11,5 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
 @EnableServiceComb
-@EnableConfigurationProperties(BatriderHandlerProp.class)
 public class BatriderServcombConfiguration {
 }
diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java
index 00639e1b1..7164e7fae 100644
--- a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java
+++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/conf/BatriderAutoConfiguration.java
@@ -1,8 +1,10 @@
 package pro.fessional.wings.batrider.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
 import org.springframework.context.annotation.Import;
 import pro.fessional.wings.batrider.spring.bean.BatriderServcombConfiguration;
+import pro.fessional.wings.batrider.spring.prop.BatriderEnabledProp;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
 /**
@@ -11,6 +13,7 @@
  */
 @AutoConfiguration
 @ConditionalWingsEnabled
+@ConfigurationPropertiesScan(basePackageClasses = BatriderEnabledProp.class)
 @Import(BatriderServcombConfiguration.class)
 public class BatriderAutoConfiguration {
 }
diff --git a/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/prop/BatriderEnabledProp.java b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/prop/BatriderEnabledProp.java
new file mode 100644
index 000000000..241710c28
--- /dev/null
+++ b/wings/batrider/src/main/java/pro/fessional/wings/batrider/spring/prop/BatriderEnabledProp.java
@@ -0,0 +1,20 @@
+package pro.fessional.wings.batrider.spring.prop;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition;
+
+/**
+ * wings-enabled-79.properties
+ *
+ * @author trydofor
+ * @see #Key
+ * @since 2021-02-13
+ */
+@Data
+@ConfigurationProperties(BatriderEnabledProp.Key)
+public class BatriderEnabledProp {
+
+    public static final String Key = WingsEnabledCondition.Prefix + ".batrider";
+
+}
diff --git a/wings/batrider/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/batrider/src/main/resources/wings-conf/spring-wings-enabled-79.properties
deleted file mode 100644
index bde14a0fc..000000000
--- a/wings/batrider/src/main/resources/wings-conf/spring-wings-enabled-79.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-## whether to enable auto config.
-spring.wings.batrider.enabled.autoconf=true
-
diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/project/ProjectSchemaManager.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/project/ProjectSchemaManager.java
index 00ff7caba..8822f46c2 100644
--- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/project/ProjectSchemaManager.java
+++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/project/ProjectSchemaManager.java
@@ -15,7 +15,7 @@
 
 /**
  * Provides a convenient version management of common scenarios.
- * spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true
+ * wings.enabled.faceless.flywave=true
  *
  * @author trydofor
  * @since 2021-02-20
diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/FlywaveConfiguration.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/FlywaveConfiguration.java
index 7c179b6bd..797e58448 100644
--- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/FlywaveConfiguration.java
+++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/bean/FlywaveConfiguration.java
@@ -4,7 +4,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.springframework.beans.factory.config.ConfigurableBeanFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Scope;
@@ -37,11 +36,6 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
 @ConditionalOnClass(DataSourceContext.class)
-@EnableConfigurationProperties({
-        FlywaveFitProp.class,
-        FlywaveSqlProp.class,
-        FlywaveVerProp.class,
-})
 public class FlywaveConfiguration {
 
     private static final Log log = LogFactory.getLog(FlywaveConfiguration.class);
@@ -160,7 +154,7 @@ public SchemaDefinitionLoader schemaDefinitionLoader(FlywaveSqlProp conf) {
     }
 
     @Bean
-    @ConditionalWingsEnabled(absKey = FlywaveFitProp.Key$checker)
+    @ConditionalWingsEnabled(abs = FlywaveFitProp.Key$checker)
     public ApplicationRunnerOrdered revisionCheckerRunner(DefaultRevisionManager manager, FlywaveFitProp prop) {
         log.info("FacelessFlywave spring-runs runnerRevisionChecker");
         return new ApplicationRunnerOrdered(WingsOrdered.Lv5Supervisor, ignored -> {
diff --git a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java
index b4550a441..807d1b883 100644
--- a/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java
+++ b/wings/faceless-flywave/src/main/java/pro/fessional/wings/faceless/spring/conf/FlywaveAutoConfiguration.java
@@ -3,6 +3,7 @@
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.context.annotation.Import;
 import pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration;
+import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
 /**
@@ -11,7 +12,7 @@
  */
 
 @AutoConfiguration
-@ConditionalWingsEnabled(false)
+@ConditionalWingsEnabled(abs = FacelessEnabledProp.Key$flywave, value = false)
 @Import(FlywaveConfiguration.class)
 public class FlywaveAutoConfiguration {
 }
diff --git a/wings/faceless-flywave/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/faceless-flywave/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 000000000..35722d81a
--- /dev/null
+++ b/wings/faceless-flywave/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,19 @@
+{
+  "groups": [
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.conf"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean"}
+  ],
+  "properties": [
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration.revisionCheckerRunner", "type": "java.lang.Boolean", "description": "wings.faceless.flywave.checker for short."},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration.schemaDefinitionLoader", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration.schemaFulldumpManager", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration.schemaJournalManager", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration.schemaShardingManager", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration.schemaVersionManger", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FlywaveConfiguration.sqlSegmentProcessor", "type": "java.lang.Boolean"}
+  ],
+  "hints": []
+}
\ No newline at end of file
diff --git a/wings/faceless-flywave/src/test/resources/application.properties b/wings/faceless-flywave/src/test/resources/application.properties
index 72f9921f1..a9677dfd5 100644
--- a/wings/faceless-flywave/src/test/resources/application.properties
+++ b/wings/faceless-flywave/src/test/resources/application.properties
@@ -2,4 +2,4 @@ spring.application.name=wings-faceless
 server.port=8082
 debug=true
 
-spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true
\ No newline at end of file
+wings.enabled.faceless.flywave=true
\ No newline at end of file
diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java
index af073c1dd..674e26fc0 100644
--- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java
+++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqConfiguration.java
@@ -10,7 +10,6 @@
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.jooq.DefaultConfigurationCustomizer;
 import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.jooq.WingsJooqEnv;
@@ -27,7 +26,6 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
 @ConditionalOnClass(Settings.class)
-@EnableConfigurationProperties(FacelessJooqConfProp.class)
 public class FacelessJooqConfiguration {
 
     private static final Log log = LogFactory.getLog(FacelessJooqConfiguration.class);
@@ -44,13 +42,12 @@ public class FacelessJooqConfiguration {
      * @link group_concat_max_len
      */
     @Bean
-    @ConditionalWingsEnabled(absKey = FacelessJooqConfProp.Key$autoQualify)
+    @ConditionalWingsEnabled(abs = FacelessJooqConfProp.Key$autoQualify)
     public VisitListenerProvider jooqAutoQualifyFieldListener() {
         log.info("FacelessJooq spring-bean jooqAutoQualifyFieldListener");
         return new DefaultVisitListenerProvider(new AutoQualifyFieldListener());
     }
-
-
+    
     @Bean
     @ConditionalWingsEnabled
     public DefaultConfigurationCustomizer jooqWingsConfigCustomizer(
diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqCudConfiguration.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqCudConfiguration.java
index d4a8a92b3..7fd24b945 100644
--- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqCudConfiguration.java
+++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessJooqCudConfiguration.java
@@ -11,7 +11,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.WingsTableCudHandler;
@@ -33,10 +32,33 @@
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
 @ConditionalOnClass(Settings.class)
-@EnableConfigurationProperties(FacelessJooqCudProp.class)
 public class FacelessJooqCudConfiguration {
     private static final Log log = LogFactory.getLog(FacelessJooqCudConfiguration.class);
 
+    /**
+     * listen to table's create/update/delete.
+     */
+    @Configuration(proxyBeanMethods = false)
+    @ConditionalWingsEnabled(abs = FacelessJooqConfProp.Key$listenCud)
+    public static class CudListenerBean {
+        @Bean
+        public VisitListenerProvider jooqTableCudListener(FacelessJooqCudProp prop, List handlers) {
+            final TableCudListener listener = new TableCudListener();
+
+            final String names = handlers.stream().map(it -> it.getClass().getName()).collect(Collectors.joining(","));
+            log.info("FacelessJooq spring-bean jooqTableCudListener with handler=" + names);
+            for (WingsTableCudHandler handler : handlers) {
+                handler.register(listener);
+            }
+
+            listener.setHandlers(handlers);
+            listener.setCreate(prop.isCreate());
+            listener.setUpdate(prop.isUpdate());
+            listener.setDelete(prop.isDelete());
+            listener.setTableField(prop.getTable());
+            return new DefaultVisitListenerProvider(listener);
+        }
+    }
 
     @Configuration(proxyBeanMethods = false)
     @ConditionalWingsEnabled
@@ -48,36 +70,13 @@ public void auto(@NotNull FacelessJooqCudProp prop) {
         }
     }
 
-    /**
-     * listen to table's create/update/delete.
-     */
-    @Bean
-    @ConditionalWingsEnabled(absKey = FacelessJooqConfProp.Key$listenTableCud)
-    public VisitListenerProvider jooqTableCudListener(FacelessJooqCudProp prop, List handlers) {
-        final TableCudListener listener = new TableCudListener();
-
-        final String names = handlers.stream().map(it -> it.getClass().getName()).collect(Collectors.joining(","));
-        log.info("FacelessJooq spring-bean jooqTableCudListener with handler=" + names);
-        for (WingsTableCudHandler handler : handlers) {
-            handler.register(listener);
-        }
-
-        listener.setHandlers(handlers);
-        listener.setCreate(prop.isCreate());
-        listener.setUpdate(prop.isUpdate());
-        listener.setDelete(prop.isDelete());
-        listener.setTableField(prop.getTable());
-        return new DefaultVisitListenerProvider(listener);
-    }
-
     /**
      * when deleting with commit_id, whether to update first and then delete.
      */
     @Bean
-    @ConditionalWingsEnabled(absKey = FacelessJooqConfProp.Key$journalDelete)
+    @ConditionalWingsEnabled(abs = FacelessJooqConfProp.Key$journalDelete, value = false)
     public ExecuteListenerProvider jooqJournalDeleteListener() {
         log.info("FacelessJooq spring-bean jooqJournalDeleteListener");
         return new DefaultExecuteListenerProvider(new JournalDeleteListener());
     }
-
 }
diff --git a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqConfProp.java b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqConfProp.java
index 5e8baa019..8c34dc919 100644
--- a/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqConfProp.java
+++ b/wings/faceless-jooq/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessJooqConfProp.java
@@ -21,7 +21,7 @@ public class FacelessJooqConfProp {
      *
      * @see #Key$autoQualify
      */
-    private String autoQualify = "";
+    private boolean autoQualify = true;
     public static final String Key$autoQualify = Key + ".auto-qualify";
 
 
@@ -46,16 +46,16 @@ public class FacelessJooqConfProp {
      *
      * @see #Key$journalDelete
      */
-    private String journalDelete = "";
+    private boolean journalDelete = false;
     public static final String Key$journalDelete = Key + ".journal-delete";
 
     /**
      * whether to listen to table's create/update/delete.
      *
-     * @see #Key$listenTableCud
+     * @see #Key$listenCud
      */
-    private String listenTableCud = "";
-    public static final String Key$listenTableCud = Key + ".listen-table-cud";
+    private boolean listenCud = true;
+    public static final String Key$listenCud = Key + ".listen-cud";
 
     /**
      * 
diff --git a/wings/faceless-jooq/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/faceless-jooq/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 000000000..2b122b95d
--- /dev/null
+++ b/wings/faceless-jooq/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,19 @@
+{
+  "groups": [
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.conf"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean"}
+  ],
+  "properties": [
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.conf.FacelessJooqAutoConfiguration", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessJooqConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessJooqConfiguration.jooqAutoQualifyFieldListener", "type": "java.lang.Boolean", "description": "wings.faceless.jooq.conf.auto-qualify for short."},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessJooqConfiguration.jooqWingsConfigCustomizer", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessJooqCudConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessJooqCudConfiguration$CudListenerBean", "type": "java.lang.Boolean", "description": "wings.faceless.jooq.conf.listen-cud for short."},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessJooqCudConfiguration$JournalDiffWired", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessJooqCudConfiguration.jooqJournalDeleteListener", "type": "java.lang.Boolean", "description": "wings.faceless.jooq.conf.journal-delete for short."}
+  ],
+  "hints": []
+}
\ No newline at end of file
diff --git a/wings/faceless-jooq/src/main/resources/wings-conf/wings-jooq-conf-79.properties b/wings/faceless-jooq/src/main/resources/wings-conf/wings-jooq-conf-79.properties
index 5a25149ad..1b2cfa1aa 100644
--- a/wings/faceless-jooq/src/main/resources/wings-conf/wings-jooq-conf-79.properties
+++ b/wings/faceless-jooq/src/main/resources/wings-conf/wings-jooq-conf-79.properties
@@ -5,7 +5,7 @@ wings.faceless.jooq.conf.auto-qualify=true
 wings.faceless.jooq.conf.journal-delete=false
 
 ## whether to listen to table's create/update/delete.
-wings.faceless.jooq.conf.listen-table-cud=true
+wings.faceless.jooq.conf.listen-cud=true
 
 ## whether to use efficient mysql syntax when performing bulk inserts via Dao.
 wings.faceless.jooq.conf.batch-mysql=true
diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java
index d31c2ef95..df86abb3a 100644
--- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java
+++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqDeleteListenerTest.java
@@ -36,7 +36,7 @@
  * @since 2019-09-27
  */
 
-@SpringBootTest(properties = {"spring.wings.faceless.jooq.enabled.journal-delete=true"})
+@SpringBootTest(properties = {"wings.faceless.jooq.conf.journal-delete=true"})
 @DependsOnDatabaseInitialization
 @TestMethodOrder(MethodOrderer.MethodName.class)
 @ActiveProfiles("init")
diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java
index 615a9bdfd..0f9981555 100644
--- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java
+++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/jooq/JooqTableCudListenerTest.java
@@ -14,16 +14,16 @@
 import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.ActiveProfiles;
-import pro.fessional.wings.faceless.convention.EmptyValue;
-import pro.fessional.wings.faceless.database.WingsTableCudHandler.Cud;
 import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable;
 import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao;
 import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding;
 import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord;
+import pro.fessional.wings.faceless.app.service.TestingTableCudHandler;
+import pro.fessional.wings.faceless.convention.EmptyValue;
+import pro.fessional.wings.faceless.database.WingsTableCudHandler.Cud;
 import pro.fessional.wings.faceless.database.jooq.listener.TableCudListener;
 import pro.fessional.wings.faceless.flywave.SchemaRevisionManager;
 import pro.fessional.wings.faceless.helper.WingsTestHelper;
-import pro.fessional.wings.faceless.app.service.TestingTableCudHandler;
 import pro.fessional.wings.faceless.util.FlywaveRevisionScanner;
 
 import java.time.LocalDateTime;
@@ -49,7 +49,7 @@
 @SuppressWarnings("CanBeFinal")
 @SpringBootTest(properties = {
         "wings.faceless.jooq.cud.table[tst_sharding]=id,login_info",
-        "spring.wings.faceless.jooq.enabled.listen-table-cud=true"
+        "wings.faceless.jooq.conf.listen-cud=true"
 })
 @DependsOnDatabaseInitialization
 @TestMethodOrder(MethodOrderer.MethodName.class)
diff --git a/wings/faceless-jooq/src/test/resources/wings-conf/wings-jooq-cud.properties b/wings/faceless-jooq/src/test/resources/wings-conf/wings-jooq-cud.properties
index d37c8ec13..dea1268de 100644
--- a/wings/faceless-jooq/src/test/resources/wings-conf/wings-jooq-cud.properties
+++ b/wings/faceless-jooq/src/test/resources/wings-conf/wings-jooq-cud.properties
@@ -1,4 +1,4 @@
-spring.wings.faceless.jooq.enabled.listen-table-cud=true
+wings.faceless.jooq.conf.listen-cud=true
 ## cud table and fields, case-insensitive
 wings.faceless.jooq.cud.table[win_user_basis]=id
 wings.faceless.jooq.cud.table[win_user_authn]=id
diff --git a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingSphereConfiguration.java b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingSphereConfiguration.java
index 426e5c940..651ff376e 100644
--- a/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingSphereConfiguration.java
+++ b/wings/faceless-shard/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessShardingSphereConfiguration.java
@@ -7,7 +7,6 @@
 import org.apache.shardingsphere.infra.yaml.config.pojo.YamlRootConfiguration;
 import org.apache.shardingsphere.infra.yaml.config.swapper.resource.YamlDataSourceConfigurationSwapper;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.wings.faceless.database.DataSourceContext;
@@ -31,32 +30,28 @@ public class FacelessShardingSphereConfiguration {
 
     @Bean
     @ConditionalWingsEnabled
-    public WriteRouteOnlyAround writeRouteOnlyAround() {
-        log.info("FacelessShard spring-bean writeRouteOnlyAround");
-        return new WriteRouteOnlyAround();
-    }
+    public DataSourceContext.Customizer shardingDataSourceContext(@Value("${spring.datasource.url}") String jdbcUrl) throws Exception {
+        if (!jdbcUrl.startsWith("jdbc:shardingsphere:")) {
+            log.info("FacelessShard skip shardingSphereCustomizer jdbcUrl=" + jdbcUrl);
+            return ignored -> false;
+        }
+
+        final byte[] yamlBytes = ShardingSphereDriverURLManager.getContent(jdbcUrl);
+        YamlRootConfiguration rootConfig = YamlEngine.unmarshal(yamlBytes, YamlRootConfiguration.class);
+        final YamlDataSourceConfigurationSwapper configurationSwapper = new YamlDataSourceConfigurationSwapper();
+        final Map dsMap = configurationSwapper.swapToDataSources(rootConfig.getDataSources());
+        log.info("FacelessShard spring-bean shardingSphereCustomizer backends size=" + dsMap.size());
 
+        return (ctx) -> {
+            ctx.clearBackend().addBackend(dsMap);
+            return true;
+        };
+    }
 
+    @Bean
     @ConditionalWingsEnabled
-    @ConditionalOnClass(DataSourceContext.class)
-    public static class DataSourceContextBean {
-        @Bean
-        public DataSourceContext.Customizer shardingSphereCustomizer(@Value("${spring.datasource.url}") String jdbcUrl) throws Exception {
-            if (!jdbcUrl.startsWith("jdbc:shardingsphere:")) {
-                log.info("FacelessShard skip shardingSphereCustomizer jdbcUrl=" + jdbcUrl);
-                return ignored -> false;
-            }
-
-            final byte[] yamlBytes = ShardingSphereDriverURLManager.getContent(jdbcUrl);
-            YamlRootConfiguration rootConfig = YamlEngine.unmarshal(yamlBytes, YamlRootConfiguration.class);
-            final YamlDataSourceConfigurationSwapper configurationSwapper = new YamlDataSourceConfigurationSwapper();
-            final Map dsMap = configurationSwapper.swapToDataSources(rootConfig.getDataSources());
-            log.info("FacelessShard spring-bean shardingSphereCustomizer backends size=" + dsMap.size());
-
-            return (ctx) -> {
-                ctx.clearBackend().addBackend(dsMap);
-                return true;
-            };
-        }
+    public WriteRouteOnlyAround writeRouteOnlyAround() {
+        log.info("FacelessShard spring-bean writeRouteOnlyAround");
+        return new WriteRouteOnlyAround();
     }
 }
diff --git a/wings/faceless-shard/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/faceless-shard/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 000000000..60d3a2328
--- /dev/null
+++ b/wings/faceless-shard/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,14 @@
+{
+  "groups": [
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.conf"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean"}
+  ],
+  "properties": [
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.conf.FacelessShardAutoConfiguration", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessShardingSphereConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessShardingSphereConfiguration.shardingDataSourceContext", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessShardingSphereConfiguration.writeRouteOnlyAround", "type": "java.lang.Boolean"}
+  ],
+  "hints": []
+}
\ No newline at end of file
diff --git a/wings/faceless-test/src/main/resources/wings-conf/spring-wings-enabled.properties b/wings/faceless-test/src/main/resources/wings-conf/spring-wings-enabled.properties
deleted file mode 100644
index aa5b55e6a..000000000
--- a/wings/faceless-test/src/main/resources/wings-conf/spring-wings-enabled.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-## whether to inject Flywave related beans.
-spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true
-
-## when deleting with commit_id, whether to update first and then delete.
-spring.wings.faceless.jooq.enabled.journal-delete=true
diff --git a/wings/faceless-test/src/main/resources/wings-conf/wings-enabled.properties b/wings/faceless-test/src/main/resources/wings-conf/wings-enabled.properties
new file mode 100644
index 000000000..11e3638f0
--- /dev/null
+++ b/wings/faceless-test/src/main/resources/wings-conf/wings-enabled.properties
@@ -0,0 +1,5 @@
+## whether to inject Flywave related beans.
+wings.enabled.faceless.flywave=true
+
+## when deleting with commit_id, whether to update first and then delete.
+wings.faceless.jooq.enabled.journal-delete=true
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/service/wini18n/impl/StandardI18nServiceJdbc.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/service/wini18n/impl/StandardI18nServiceJdbc.java
index b9da11652..10ba41f26 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/service/wini18n/impl/StandardI18nServiceJdbc.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/service/wini18n/impl/StandardI18nServiceJdbc.java
@@ -7,7 +7,6 @@
 import org.springframework.jdbc.core.RowMapper;
 import pro.fessional.mirana.i18n.LocaleResolver;
 import pro.fessional.wings.faceless.service.wini18n.StandardI18nService;
-import pro.fessional.wings.silencer.message.CombinableMessageSource;
 import pro.fessional.wings.silencer.message.MessageSourceHelper;
 
 import java.util.List;
@@ -51,9 +50,8 @@ public int reloadBase(String base) {
                     strExtractor,
                     base, kind, ukey, lan);
             String hint = txt == null ? "" : txt;
-            CombinableMessageSource combinable = MessageSourceHelper.getCombinableMessageSource(false);
-            if (combinable != null && !hint.isEmpty()) {
-                combinable.addMessage(code(base, kind, ukey), lang, hint);
+            if (!hint.isEmpty()) {
+                MessageSourceHelper.Combine.addMessage(code(base, kind, ukey), lang, hint);
             }
             return hint;
         });
@@ -64,12 +62,10 @@ private int cache(List pos) {
             String key = key(po.base, po.kind, po.ukey, po.lang);
             String txt = po.hint;
             cache.put(key, txt);
-            CombinableMessageSource combinable = MessageSourceHelper.getCombinableMessageSource(false);
-            if (combinable != null) {
-                String code = code(po.base, po.kind, po.ukey);
-                Locale lang = LocaleResolver.locale(po.lang);
-                combinable.addMessage(code, lang, txt);
-            }
+
+            String code = code(po.base, po.kind, po.ukey);
+            Locale lang = LocaleResolver.locale(po.lang);
+            MessageSourceHelper.Combine.addMessage(code, lang, txt);
         }
         return pos.size();
     }
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessConfiguration.java
index ec14ffb0f..695fadf75 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessConfiguration.java
@@ -17,6 +17,7 @@
 import pro.fessional.wings.faceless.service.lightid.LightIdService;
 import pro.fessional.wings.faceless.service.wini18n.StandardI18nService;
 import pro.fessional.wings.faceless.service.wini18n.impl.StandardI18nServiceJdbc;
+import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
 import javax.sql.DataSource;
@@ -95,7 +96,7 @@ public StandardI18nService standardI18nService(JdbcTemplate jdbcTemplate) {
     }
 
     @Bean
-    @ConditionalWingsEnabled
+    @ConditionalWingsEnabled(abs = FacelessEnabledProp.Key$simpleFlakeid)
     public FlakeIdService flakeIdService(LightIdService lightIdService) {
         log.info("Faceless spring-bean flakeIdService");
         return new FlakeIdLightIdImpl(lightIdService);
@@ -109,7 +110,7 @@ public CommitJournalModify commitJournalModify(JdbcTemplate jdbcTemplate) {
     }
 
     @Bean
-    @ConditionalWingsEnabled
+    @ConditionalWingsEnabled(abs = FacelessEnabledProp.Key$simpleJournal)
     public JournalService journalService(LightIdService lightIdService, BlockIdProvider blockIdProvider, CommitJournalModify journalModify) {
         log.info("Faceless spring-bean journalService");
         return new DefaultJournalService(lightIdService, blockIdProvider, journalModify);
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java
index 153013834..ff336c001 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/bean/FacelessLightIdConfiguration.java
@@ -7,7 +7,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -35,14 +34,12 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
-@EnableConfigurationProperties({LightIdInsertProp.class, LightIdProviderProp.class,})
 public class FacelessLightIdConfiguration {
 
     private static final Log log = LogFactory.getLog(FacelessLightIdConfiguration.class);
 
     @Configuration(proxyBeanMethods = false)
     @ConditionalWingsEnabled
-    @EnableConfigurationProperties(LightIdLayoutProp.class)
     public static class LayoutWired {
         @Autowired
         public void auto(@NotNull LightIdLayoutProp prop) {
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java
index c5bc9acb0..366bd1533 100644
--- a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/conf/FacelessAutoConfiguration.java
@@ -1,9 +1,11 @@
 package pro.fessional.wings.faceless.spring.conf;
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
+import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
 import org.springframework.context.annotation.Import;
 import pro.fessional.wings.faceless.spring.bean.FacelessConfiguration;
 import pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration;
+import pro.fessional.wings.faceless.spring.prop.FacelessEnabledProp;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
 /**
@@ -13,6 +15,7 @@
 
 @AutoConfiguration
 @ConditionalWingsEnabled
+@ConfigurationPropertiesScan(basePackageClasses = FacelessEnabledProp.class)
 @Import({
         FacelessConfiguration.class,
         FacelessLightIdConfiguration.class
diff --git a/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessEnabledProp.java b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessEnabledProp.java
new file mode 100644
index 000000000..fca7220f9
--- /dev/null
+++ b/wings/faceless/src/main/java/pro/fessional/wings/faceless/spring/prop/FacelessEnabledProp.java
@@ -0,0 +1,43 @@
+package pro.fessional.wings.faceless.spring.prop;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition;
+
+/**
+ * toggling the Silencer feature, wings-enabled-79.properties
+ *
+ * @author trydofor
+ * @see #Key
+ * @since 2021-02-13
+ */
+@Data
+@ConfigurationProperties(FacelessEnabledProp.Key)
+public class FacelessEnabledProp {
+
+    public static final String Key = WingsEnabledCondition.Prefix + ".faceless";
+
+    /**
+     * Whether to use the simple FlakeIdService  generated by lightId
+     *
+     * @see #Key$simpleFlakeid
+     */
+    private boolean simpleFlakeid = true;
+    public static final String Key$simpleFlakeid = Key + ".simple-flakeid";
+
+    /**
+     * Whether to use the simple JournalService without terminal info
+     *
+     * @see #Key$simpleJournal
+     */
+    private boolean simpleJournal = true;
+    public static final String Key$simpleJournal = Key + ".simple-journal";
+
+    /**
+     * whether to enable flywave auto config
+     *
+     * @see #Key$flywave
+     */
+    private boolean flywave = false;
+    public static final String Key$flywave = Key + ".flywave";
+}
diff --git a/wings/faceless/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/faceless/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 000000000..9e52c6d2b
--- /dev/null
+++ b/wings/faceless/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,27 @@
+{
+  "groups": [
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.conf"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean"}
+  ],
+  "properties": [
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.conf.FacelessAutoConfiguration", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessConfiguration.commitJournalModify", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessConfiguration.dataSourceContext", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessConfiguration.flakeIdService", "type": "java.lang.Boolean", "description": "wings.enabled.faceless.simple-flakeid for short."},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessConfiguration.journalService", "type": "java.lang.Boolean", "description": "wings.enabled.faceless.simple-journal for short."},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessConfiguration.standardI18nService", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration$LayoutWired", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration.blockProvider", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration.dbLightIdProvider", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration.jvmLightIdProvider", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration.lightIdLoader", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration.lightIdService", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration.lightSequenceModify", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessLightIdConfiguration.lightSequenceSelect", "type": "java.lang.Boolean"}
+  ],
+  "hints": []
+}
\ No newline at end of file
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/encrypt/SecretProvider.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/encrypt/SecretProvider.java
index f54b8ddd3..b660961c8 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/encrypt/SecretProvider.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/encrypt/SecretProvider.java
@@ -5,6 +5,7 @@
 import org.jetbrains.annotations.Nullable;
 import pro.fessional.mirana.code.RandCode;
 
+import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
@@ -39,6 +40,9 @@ public class SecretProvider {
      */
     public static final String Config = "config";
 
+    protected SecretProvider(@NotNull Map keys) {
+        Secrets.putAll(keys);
+    }
 
     /**
      * Generate `len` length passwords of alphabetic, case-sensitive and numeric
@@ -100,7 +104,7 @@ public String tryGet(String name) {
     /**
      * put the secret by name
      */
-    protected static void put(@NotNull String name, @NotNull String secret, boolean replace) {
+    public static void put(@NotNull String name, @NotNull String secret, boolean replace) {
         if (replace) {
             Secrets.put(name, secret);
         }
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/modulate/RuntimeMode.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/modulate/RuntimeMode.java
index 1ff9e1eb6..a0464340b 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/modulate/RuntimeMode.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/modulate/RuntimeMode.java
@@ -1,6 +1,7 @@
 package pro.fessional.wings.silencer.modulate;
 
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import java.util.concurrent.atomic.AtomicReference;
 
@@ -12,6 +13,11 @@ public class RuntimeMode {
 
     private static final AtomicReference unitTest = new AtomicReference<>(null);
 
+    protected RuntimeMode(@Nullable RunMode run, @Nullable ApiMode api) {
+        if (run != null) runMode = run;
+        if (api != null) apiMode = api;
+    }
+
     public static boolean isUnitTest() {
         Boolean b = unitTest.get();
         if (b == null) {
@@ -28,7 +34,7 @@ public static boolean isUnitTest() {
     }
 
     @NotNull
-    protected static RunMode runMode = RunMode.Nothing;
+    private static RunMode runMode = RunMode.Nothing;
 
 
     @NotNull
@@ -61,7 +67,7 @@ public static boolean hasRunMode(CharSequence... modes) {
     }
 
     @NotNull
-    protected static ApiMode apiMode = ApiMode.Nothing;
+    private static ApiMode apiMode = ApiMode.Nothing;
 
     @NotNull
     public static ApiMode getApiMode() {
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerCurseConfiguration.java
similarity index 56%
rename from wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java
rename to wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerCurseConfiguration.java
index cd64475db..e1f184df8 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerAutoLogConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerCurseConfiguration.java
@@ -9,16 +9,24 @@
 import org.apache.commons.logging.LogFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
+import pro.fessional.wings.silencer.modulate.RuntimeMode;
+import pro.fessional.wings.silencer.runner.ApplicationInspectRunner;
 import pro.fessional.wings.silencer.runner.ApplicationReadyEventRunner;
 import pro.fessional.wings.silencer.spring.WingsOrdered;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
+import pro.fessional.wings.silencer.spring.help.ApplicationContextHelper;
 import pro.fessional.wings.silencer.spring.prop.SilencerAutoLogProp;
+import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
+import pro.fessional.wings.silencer.spring.prop.SilencerRuntimeProp;
 
+import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -27,19 +35,53 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
-@ConditionalOnClass(ConsoleAppender.class)
-@EnableConfigurationProperties(SilencerAutoLogProp.class)
-public class SilencerAutoLogConfiguration {
+public class SilencerCurseConfiguration {
 
-    private static final Log log = LogFactory.getLog(SilencerAutoLogConfiguration.class);
+    private static final Log log = LogFactory.getLog(SilencerCurseConfiguration.class);
+
+    /**
+     * audit the file and cascading relationship of properties key/value
+     */
+    @Bean
+    @ConditionalWingsEnabled(abs = SilencerEnabledProp.Key$auditProp, value = false)
+    public ApplicationInspectRunner auditPropRunner() {
+        log.info("SilencerCurse spring-bean auditPropRunner");
+        return new ApplicationInspectRunner(WingsOrdered.Lv5Supervisor, ignored -> {
+            final Map> map = ApplicationContextHelper.listPropertySource();
+            final Map> key = new LinkedHashMap<>();
+
+            for (Map.Entry> en : map.entrySet()) {
+                for (String k : en.getValue()) {
+                    key.computeIfAbsent(k, ignoreK -> new ArrayList<>()).add(en.getKey());
+                }
+            }
+
+            for (Map.Entry> en : key.entrySet()) {
+                final List vs = en.getValue();
+                final String k = en.getKey();
+                log.info(k + "=" + ApplicationContextHelper.getProperties(k));
+
+                int c = 0;
+                for (String v : vs) {
+                    if (c++ == 0) {
+                        log.info("+ " + v);
+                    }
+                    else {
+                        log.info("- " + v);
+                    }
+                }
+            }
+        });
+    }
 
     /**
      * Configuration is complete and the log is switched before the service starts
      */
     @Bean
-    @ConditionalWingsEnabled
-    public ApplicationReadyEventRunner silenceLogbackConsoleRunner(SilencerAutoLogProp autoLog) {
-        log.info("SilencerCurse spring-runs runnerSilenceLogbackConsole");
+    @ConditionalWingsEnabled(abs = SilencerEnabledProp.Key$muteConsole)
+    @ConditionalOnClass(ConsoleAppender.class)
+    public ApplicationReadyEventRunner muteConsoleRunner(SilencerAutoLogProp autoLog) {
+        log.info("SilencerCurse spring-runs muteConsoleRunner");
         return new ApplicationReadyEventRunner(WingsOrdered.Lv1Config, ignored -> {
             final Logger root = (Logger) LoggerFactory.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
             final Set targets = autoLog.getTarget();
@@ -83,4 +125,12 @@ else if (exists.contains(name)) {
             tft.start();
         });
     }
+
+    @Bean
+    @ConditionalWingsEnabled
+    public RuntimeMode runtimeMode(SilencerRuntimeProp prop) {
+
+        log.info("Silencer spring-auto runtimeMode");
+        return new RuntimeMode(prop.getRunMode(), prop.getApiMode()) {};
+    }
 }
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java
index 5eb1ea0da..15d15d954 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerEncryptConfiguration.java
@@ -2,7 +2,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import pro.fessional.mirana.bits.Aes256;
@@ -14,7 +13,6 @@
 import pro.fessional.wings.silencer.spring.prop.SilencerEncryptProp;
 
 import java.util.Arrays;
-import java.util.Map;
 
 /**
  * @author trydofor
@@ -22,11 +20,24 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
-@EnableConfigurationProperties(SilencerEncryptProp.class)
 public class SilencerEncryptConfiguration {
 
     private static final Log log = LogFactory.getLog(SilencerEncryptConfiguration.class);
 
+    @Bean
+    @ConditionalWingsEnabled
+    public Aes256 aes256(SilencerEncryptProp prop) {
+        String key = prop.getAesKey().get(SecretProvider.System);
+        if (key == null || key.isEmpty()) {
+            log.warn("SilencerCurse spring-bean aes256, should NOT use random");
+            return Aes256.of(RandCode.strong(32));
+        }
+        else {
+            log.info("SilencerCurse spring-bean aes256 with system");
+            return Aes256.of(key);
+        }
+    }
+
     @Bean
     @ConditionalWingsEnabled
     public Crc8Long crc8Long(SilencerEncryptProp prop) {
@@ -55,30 +66,11 @@ public LeapCode leapCode(SilencerEncryptProp prop) {
         }
     }
 
-    @Bean
-    @ConditionalWingsEnabled
-    public Aes256 aes256(SilencerEncryptProp prop) {
-        String key = prop.getAesKey().get(SecretProvider.System);
-        if (key == null || key.isEmpty()) {
-            log.warn("SilencerCurse spring-bean aes256, should NOT use random");
-            return Aes256.of(RandCode.strong(32));
-        }
-        else {
-            log.info("SilencerCurse spring-bean aes256 with system");
-            return Aes256.of(key);
-        }
-    }
 
     @Bean
     @ConditionalWingsEnabled
     public SecretProvider secretProvider(SilencerEncryptProp prop) {
         log.info("SilencerCurse spring-bean secretProvider");
-        return new SecretProvider() {{
-            for (Map.Entry en : prop.getAesKey().entrySet()) {
-                final String name = en.getKey();
-                log.info("SilencerCurse spring-conf secretProvider, name=" + name);
-                SecretProvider.put(name, en.getValue(), false);
-            }
-        }};
+        return new SecretProvider(prop.getAesKey()) {};
     }
 }
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java
deleted file mode 100644
index b17456b3e..000000000
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerInspectConfiguration.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package pro.fessional.wings.silencer.spring.bean;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.silencer.runner.ApplicationInspectRunner;
-import pro.fessional.wings.silencer.spring.WingsOrdered;
-import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
-import pro.fessional.wings.silencer.spring.help.ApplicationContextHelper;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * audit the file and cascading relationship of properties key/value
- *
- * @author trydofor
- * @since 2022-10-27
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalWingsEnabled(false)
-public class SilencerInspectConfiguration {
-    private static final Log log = LogFactory.getLog(SilencerInspectConfiguration.class);
-
-    /**
-     * audit the file and cascading relationship of properties key/value
-     */
-    @Bean
-    public ApplicationInspectRunner inspectApplicationRunner() {
-        log.info("SilencerCurse spring-bean inspectApplicationRunner");
-        return new ApplicationInspectRunner(WingsOrdered.Lv5Supervisor, ignored -> {
-            final Map> map = ApplicationContextHelper.listPropertySource();
-            final Map> key = new LinkedHashMap<>();
-
-            for (Map.Entry> en : map.entrySet()) {
-                for (String k : en.getValue()) {
-                    key.computeIfAbsent(k, ignoreK -> new ArrayList<>()).add(en.getKey());
-                }
-            }
-
-            for (Map.Entry> en : key.entrySet()) {
-                final List vs = en.getValue();
-                final String k = en.getKey();
-                log.info(k + "=" + ApplicationContextHelper.getProperties(k));
-
-                int c = 0;
-                for (String v : vs) {
-                    if (c++ == 0) {
-                        log.info("+ " + v);
-                    }
-                    else {
-                        log.info("- " + v);
-                    }
-                }
-            }
-        });
-    }
-}
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerModeWiredConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerModeWiredConfiguration.java
deleted file mode 100644
index 5c24f50b1..000000000
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerModeWiredConfiguration.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package pro.fessional.wings.silencer.spring.bean;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-import pro.fessional.wings.silencer.modulate.RuntimeMode;
-import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
-import pro.fessional.wings.silencer.spring.prop.SilencerRuntimeProp;
-
-/**
- * @author trydofor
- * @since 2019-12-01
- */
-@Configuration(proxyBeanMethods = false)
-@ConditionalWingsEnabled
-@EnableConfigurationProperties(SilencerRuntimeProp.class)
-public class SilencerModeWiredConfiguration {
-
-    private final static Log log = LogFactory.getLog(SilencerModeWiredConfiguration.class);
-
-    @Autowired
-    public void auto(SilencerRuntimeProp prop) {
-        log.info("Silencer spring-auto runnerRuntimeMode");
-        new RuntimeMode() {{
-            runMode = prop.getRunMode();
-            apiMode = prop.getApiMode();
-        }};
-    }
-}
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java
index 97d05be34..b9a6f5f59 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerTweakConfiguration.java
@@ -8,7 +8,6 @@
 import org.slf4j.TtlMDCAdapter;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.logging.LogLevel;
 import org.springframework.boot.logging.LoggerGroups;
 import org.springframework.boot.logging.LoggingSystem;
@@ -17,6 +16,7 @@
 import pro.fessional.mirana.pain.CodeException;
 import pro.fessional.mirana.time.ThreadNow;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
+import pro.fessional.wings.silencer.spring.prop.SilencerEnabledProp;
 import pro.fessional.wings.silencer.spring.prop.SilencerTweakProp;
 import pro.fessional.wings.silencer.tweak.TweakLogger;
 
@@ -29,12 +29,11 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
-@EnableConfigurationProperties(SilencerTweakProp.class)
 public class SilencerTweakConfiguration {
     private static final Log log = LogFactory.getLog(SilencerTweakConfiguration.class);
 
     @Configuration(proxyBeanMethods = false)
-    @ConditionalWingsEnabled
+    @ConditionalWingsEnabled(abs = SilencerEnabledProp.Key$tweakClock)
     public static class ClockWired {
         @Autowired
         public void auto(SilencerTweakProp prop) throws ThreadLocalAttention {
@@ -50,7 +49,7 @@ public void auto(SilencerTweakProp prop) throws ThreadLocalAttention {
     }
 
     @Configuration(proxyBeanMethods = false)
-    @ConditionalWingsEnabled
+    @ConditionalWingsEnabled(abs = SilencerEnabledProp.Key$tweakLogback)
     public static class LogbackWired {
         @Autowired
         @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
@@ -85,7 +84,7 @@ else if (trace) {
     }
 
     @Configuration(proxyBeanMethods = false)
-    @ConditionalWingsEnabled
+    @ConditionalWingsEnabled(abs = SilencerEnabledProp.Key$tweakStack)
     public static class StackWired {
         @Autowired
         public void auto(SilencerTweakProp prop) throws ThreadLocalAttention {
diff --git a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java
index d48786146..aedf329e8 100644
--- a/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java
+++ b/wings/silencer-curse/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerCurseAutoConfiguration.java
@@ -2,10 +2,8 @@
 
 import org.springframework.boot.autoconfigure.AutoConfiguration;
 import org.springframework.context.annotation.Import;
-import pro.fessional.wings.silencer.spring.bean.SilencerAutoLogConfiguration;
+import pro.fessional.wings.silencer.spring.bean.SilencerCurseConfiguration;
 import pro.fessional.wings.silencer.spring.bean.SilencerEncryptConfiguration;
-import pro.fessional.wings.silencer.spring.bean.SilencerInspectConfiguration;
-import pro.fessional.wings.silencer.spring.bean.SilencerModeWiredConfiguration;
 import pro.fessional.wings.silencer.spring.bean.SilencerTweakConfiguration;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
 
@@ -16,10 +14,8 @@
 @AutoConfiguration
 @ConditionalWingsEnabled
 @Import({
-        SilencerAutoLogConfiguration.class,
+        SilencerCurseConfiguration.class,
         SilencerEncryptConfiguration.class,
-        SilencerInspectConfiguration.class,
-        SilencerModeWiredConfiguration.class,
         SilencerTweakConfiguration.class,
 })
 public class SilencerCurseAutoConfiguration {
diff --git a/wings/silencer-curse/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/silencer-curse/src/main/resources/META-INF/additional-spring-configuration-metadata.json
new file mode 100644
index 000000000..9f7823986
--- /dev/null
+++ b/wings/silencer-curse/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -0,0 +1,26 @@
+{
+  "groups": [
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.conf"},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean"}
+  ],
+  "properties": [
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.conf.SilencerCurseAutoConfiguration", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerCurseConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerCurseConfiguration.auditPropRunner", "type": "java.lang.Boolean", "description": "wings.enabled.silencer.audit-prop for short."},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerCurseConfiguration.muteConsoleRunner", "type": "java.lang.Boolean", "description": "wings.enabled.silencer.mute-console for short."},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerCurseConfiguration.runtimeMode", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerEncryptConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerEncryptConfiguration.aes256", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerEncryptConfiguration.crc8Long", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerEncryptConfiguration.leapCode", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerEncryptConfiguration.secretProvider", "type": "java.lang.Boolean"},
+
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerTweakConfiguration", "type": "java.lang.Boolean"},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerTweakConfiguration$ClockWired", "type": "java.lang.Boolean", "description": "wings.enabled.silencer.tweak-clock for short."},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerTweakConfiguration$LogbackWired", "type": "java.lang.Boolean", "description": "wings.enabled.silencer.tweak-logback for short."},
+    {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerTweakConfiguration$StackWired", "type": "java.lang.Boolean", "description": "wings.enabled.silencer.tweak-stack for short."}
+  ],
+  "hints": []
+}
\ No newline at end of file
diff --git a/wings/silencer-curse/src/test/resources/application.properties b/wings/silencer-curse/src/test/resources/application.properties
index 3e1e5096a..538150b1a 100644
--- a/wings/silencer-curse/src/test/resources/application.properties
+++ b/wings/silencer-curse/src/test/resources/application.properties
@@ -1,3 +1,3 @@
 spring.application.name=curse
 debug=true
-#spring.wings.enabled.silencer.autoconf=false
\ No newline at end of file
+#wings.enabled.silencer.autoconf=false
\ No newline at end of file
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/MessageSourceHelper.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/MessageSourceHelper.java
index 2a7e054de..90d9b8d68 100644
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/MessageSourceHelper.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/message/MessageSourceHelper.java
@@ -1,9 +1,12 @@
 package pro.fessional.wings.silencer.message;
 
-import org.jetbrains.annotations.Contract;
 import org.jetbrains.annotations.NotNull;
 import org.springframework.context.HierarchicalMessageSource;
 import org.springframework.context.MessageSource;
+import org.springframework.context.MessageSourceResolvable;
+import org.springframework.context.NoSuchMessageException;
+
+import java.util.Locale;
 
 /**
  * @author trydofor
@@ -11,34 +14,40 @@
  */
 public class MessageSourceHelper {
 
-    private static MessageSource messageSource;
-    private static CombinableMessageSource combinableMessageSource;
-
-    protected MessageSourceHelper(@NotNull MessageSource primary) {
+    public static final CombinableMessageSource Combine = new CombinableMessageSource();
+    public static volatile MessageSource Primary = new MessageSource() {
+        @Override
+        public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
+            throw new IllegalStateException("should bind before using");
+        }
 
-        if (primary instanceof HierarchicalMessageSource hierarchy) {
-            CombinableMessageSource combinable = new CombinableMessageSource();
-            MessageSource parent = hierarchy.getParentMessageSource();
-            if (parent != null) {
-                combinable.setParentMessageSource(parent);
-            }
-            hierarchy.setParentMessageSource(combinable);
-            combinableMessageSource = combinable;
+        @Override
+        public String getMessage(String code, Object[] args, Locale locale) throws NoSuchMessageException {
+            throw new IllegalStateException("should bind before using");
         }
 
-        messageSource = primary;
-    }
+        @Override
+        public String getMessage(MessageSourceResolvable resolvable, Locale locale) throws NoSuchMessageException {
+            throw new IllegalStateException("should bind before using");
+        }
+    };
 
+    public static volatile boolean hasPrimary = false;
+    public static volatile boolean hasCombine = false;
 
-    @Contract("true->!null")
-    public static MessageSource getMessageSource(boolean nonnull) {
-        if (nonnull && messageSource == null) throw new IllegalStateException("init before using");
-        return messageSource;
-    }
+    protected MessageSourceHelper(@NotNull MessageSource primary) {
+        synchronized (MessageSourceHelper.class) {
+            if (primary instanceof HierarchicalMessageSource hierarchy) {
+                MessageSource parent = hierarchy.getParentMessageSource();
+                if (parent != null) {
+                    Combine.setParentMessageSource(parent);
+                }
+                hierarchy.setParentMessageSource(Combine);
+                hasCombine = true;
+            }
 
-    @Contract("true->!null")
-    public static CombinableMessageSource getCombinableMessageSource(boolean nonnull) {
-        if (nonnull && combinableMessageSource == null) throw new IllegalStateException("init before using");
-        return combinableMessageSource;
+            Primary = primary;
+            hasPrimary = true;
+        }
     }
 }
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerConfiguration.java
index 2add86da8..9d59e3d7d 100644
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerConfiguration.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/bean/SilencerConfiguration.java
@@ -2,8 +2,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.MessageSource;
 import org.springframework.context.annotation.Bean;
@@ -13,8 +11,6 @@
 import pro.fessional.wings.silencer.runner.ApplicationInspectRunner;
 import pro.fessional.wings.silencer.runner.ApplicationRunnerOrdered;
 import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled;
-import pro.fessional.wings.silencer.spring.prop.SilencerI18nProp;
-import pro.fessional.wings.silencer.spring.prop.SilencerScannerProp;
 
 import java.util.Map;
 
@@ -24,10 +20,6 @@
  */
 @Configuration(proxyBeanMethods = false)
 @ConditionalWingsEnabled
-@EnableConfigurationProperties({
-        SilencerI18nProp.class,
-        SilencerScannerProp.class,
-})
 public class SilencerConfiguration {
 
     private static final Log log = LogFactory.getLog(SilencerConfiguration.class);
@@ -37,20 +29,17 @@ public class SilencerConfiguration {
      * @see org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration
      */
 
-    @Configuration(proxyBeanMethods = false)
+    @Bean
     @ConditionalWingsEnabled
-    public static class MessageSourceHelperWired {
-        @Autowired
-        public void auto(MessageSource messageSource) {
-            new MessageSourceHelper(messageSource) {};
-
-            if (MessageSourceHelper.getCombinableMessageSource(false) != null) {
-                log.info("Silencer spring-auto MessageSourceHelper parent to CombinableMessageSource");
-            }
-            else {
-                log.info("Silencer spring-auto MessageSourceHelper skip CombinableMessageSource");
-            }
+    public MessageSourceHelper messageSourceHelper(MessageSource messageSource) {
+        var bean = new MessageSourceHelper(messageSource) {};
+        if (MessageSourceHelper.hasCombine) {
+            log.info("Silencer spring-auto MessageSourceHelper parent to CombinableMessageSource");
+        }
+        else {
+            log.info("Silencer spring-auto MessageSourceHelper skip CombinableMessageSource");
         }
+        return bean;
     }
 
     /**
diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java
index 911b648a6..2299b64b6 100644
--- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java
+++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java
@@ -9,10 +9,18 @@
 import java.lang.annotation.Target;
 
 /**
- * use `@Conditional(WingsEnabledCondition.class)` to dynamically
- * enable or disable `@Configuration`, `@Bean` and `@Component` by properties.
- * 

- * true only if `this && and1 && and2 && !not1 && !not2` + *

+ * enhanced `@Conditional(WingsEnabledCondition.class)` to dynamically
+ * disable `@Configuration`, `@Bean` and `@Component` by properties.
+ *
+ * `true` only if `this && and1 && and2 && !not1 && !not2`
+ *
+ * the key priority from high to low
+ * - qualified-key = `prefix()` + `ClassName` + `methodName`?
+ * - absolute-key = `abs()`
+ * - relative-key = `prefix()` + `key()`
+ * - default = `value()`
+ * 
* * @author trydofor * @see WingsEnabledCondition @@ -31,17 +39,17 @@ String prefix() default ""; /** - * without prefix, absolute key of properties + * absolute-key, without prefix, priority lower then qualified-key */ - String absKey() default ""; + String abs() default ""; /** - * with prefix, customize key instead of ClassName-qualified + * relative-key, with prefix, priority lower then absolute-key */ String key() default ""; /** - * default value, if no property found + * default value, the lowest priority, if no property found */ boolean value() default true; diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java index 6a8007383..6c8d59f0e 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java @@ -77,12 +77,17 @@ public class WingsAutoConfigProcessor implements EnvironmentPostProcessor { public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication ignored) { final String en = environment.getProperty(SilencerEnabledProp.Key$autoconf); if ("false".equalsIgnoreCase(en)) { - log.info("🦁 Wings AutoConfig is disabled, skip it."); + log.info("🦁 Wings AutoConfig is disabled by property, skip it."); + return; } - else { - processWingsConf(environment); - processWingsI18n(environment); + + if (!"true".equalsIgnoreCase(en) && !new SilencerEnabledProp().isAutoconf()) { + log.info("🦁 Wings AutoConfig is disabled by default, skip it."); + return; } + + processWingsConf(environment); + processWingsI18n(environment); } // /////////////////////////////////////////////////////// diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java index 1104207ac..aa5e21719 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java @@ -9,23 +9,24 @@ import org.springframework.context.annotation.ConditionContext; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; +import org.springframework.core.env.Environment; import org.springframework.core.type.AnnotatedTypeMetadata; import org.springframework.core.type.ClassMetadata; import org.springframework.core.type.MethodMetadata; import org.springframework.util.StringUtils; +import java.lang.reflect.Method; import java.util.Map; /** *
- * enable or disable `@Configuration` or `@Bean` by dynamic properties
+ * disable `@Configuration`, `@Bean` and any `@Component` by properties
  *
- * key = Prefix + "." + ClassName + ("." + beanMethod)
- * value = true/false
+ * `qualified-key` = `Prefix.` + `ClassName` + `.beanMethod`? = `true|false`
  *
- * Prefix = ConditionalWingsEnabled#Prefix, eg. "spring.wings.enabled"
- * ClassName = ConditionalWingsEnabled class, eg. "pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition"
- * Method = ConditionalWingsEnabled method, eg. "beanMethod"
+ * - Prefix - default {@link #Prefix}
+ * - ClassName - {@link Class#getName()} eg. pro.fessional.wings.silencer.spring.bean.SilencerConfiguration
+ * - beanMethod - {@link Method#getName()} eg. applicationInspectRunner
  *
  * #example properties:
  *
@@ -37,9 +38,9 @@
  *
  * ## @Conditional(WingsEnabledCondition.class) or @ConditionalWingsEnabled
  * ## disable @Bean dogBean in WingsEnabledDogConfiguration
- * spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.dogBean=false
+ * wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.dogBean=false
  * ## disable InnerDogConfiguration and its Bean
- * spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration$InnerDogConfiguration=false
+ * wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration$InnerDogConfiguration=false
  * 
* * @author trydofor @@ -52,7 +53,7 @@ public class WingsEnabledCondition extends SpringBootCondition { /** * the default prefix */ - public static final String Prefix = "spring.wings.enabled"; + public static final String Prefix = "wings.enabled"; @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { @@ -124,39 +125,35 @@ private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, Cla @NotNull private ConditionOutcome thisConditionOutcome(@NotNull ConditionContext context, @NotNull AnnotatedTypeMetadata metadata, @Nullable Map attrs) { - final String propKey; - if (attrs != null && attrs.get("absKey") instanceof String abs && !abs.isBlank()) { - propKey = abs; + String pre = null; + if (attrs != null && attrs.get("prefix") instanceof String p && !p.isBlank()) { + pre = p; } - else { - String pre = null; - if (attrs != null && attrs.get("prefix") instanceof String p && !p.isBlank()) { - pre = p; - } - String key = null; - if (attrs != null && attrs.get("key") instanceof String k && !k.isBlank()) { - key = k; - } + final String[] keys = new String[3]; + // on @Component class + if (metadata instanceof ClassMetadata conf) { + if (pre == null) pre = buildEnclosingPrefix(conf.getEnclosingClassName()); + keys[0] = pre + "." + conf.getClassName(); + } + // on @Bean method + else if (metadata instanceof MethodMetadata bean) { + if (pre == null) pre = buildEnclosingPrefix(bean.getDeclaringClassName()); + keys[0] = pre + "." + bean.getDeclaringClassName() + "." + bean.getMethodName(); + } + else { + throw new IllegalArgumentException("should use on @Bean or @Configuration"); + } - // on @Component class - if (metadata instanceof ClassMetadata conf) { - if (pre == null) pre = buildEnclosingPrefix(conf.getEnclosingClassName()); - if (key == null) key = conf.getClassName(); - } - // on @Bean method - else if (metadata instanceof MethodMetadata bean) { - if (pre == null) pre = buildEnclosingPrefix(bean.getDeclaringClassName()); - if (key == null) key = bean.getDeclaringClassName() + "." + bean.getMethodName(); + if (attrs != null) { + if (attrs.get("abs") instanceof String abs && !abs.isBlank()) { + keys[1] = abs; } - else { - throw new IllegalArgumentException("should use on @Bean or @Configuration"); + else if (attrs.get("key") instanceof String key && !key.isBlank()) { + keys[2] = pre + "." + key; } - - propKey = pre + "." + key; } - - var result = conditionOutcome(context, propKey); + var result = conditionOutcome(context, keys); if (result != null) return result; boolean falsy = attrs != null && attrs.get("value") instanceof Boolean value && !value; @@ -165,28 +162,27 @@ else if (metadata instanceof MethodMetadata bean) { @NotNull private ConditionOutcome thisConditionOutcome(@NotNull ConditionContext context, @NotNull Class meta, @Nullable ConditionalWingsEnabled anno) { - final String propKey; - if (anno != null && StringUtils.hasText(anno.absKey())) { - propKey = anno.absKey(); + final String pre; + if (anno != null && StringUtils.hasText(anno.prefix())) { + pre = anno.prefix(); } else { - final String pre; - if (anno != null && StringUtils.hasText(anno.prefix())) { - pre = anno.prefix(); - } - else { - pre = buildEnclosingPrefix(meta.getEnclosingClass()); - } + pre = buildEnclosingPrefix(meta.getEnclosingClass()); + } - if (anno != null && StringUtils.hasText(anno.key())) { - propKey = pre + "." + anno.key(); + final String[] keys = new String[3]; + keys[0] = pre + "." + meta.getName(); + + if (anno != null) { + if (StringUtils.hasText(anno.abs())) { + keys[1] = anno.abs(); } - else { - propKey = pre + "." + meta.getName(); + else if (StringUtils.hasText(anno.key())) { + keys[2] = pre + "." + anno.key(); } } - var result = conditionOutcome(context, propKey); + var result = conditionOutcome(context, keys); if (result != null) return result; boolean falsy = anno != null && !anno.value(); @@ -218,21 +214,23 @@ private String buildEnclosingPrefix(@Nullable Class clz) { } @Nullable - private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, @NotNull String key) { - final String value = context.getEnvironment().getProperty(key); + private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, String @NotNull [] keys) { + + final Environment environment = context.getEnvironment(); + for (String key : keys) { + if (key == null) continue; + Boolean enabled = asBool(environment.getProperty(key)); + if (enabled == null) continue; - if ("false".equalsIgnoreCase(value)) { - return ConditionOutcome.noMatch(ConditionMessage + return enabled + ? ConditionOutcome.match(ConditionMessage .forCondition(ConditionalWingsEnabled.class) .found(key) - .items(value)); - } - - if ("true".equalsIgnoreCase(value)) { - return ConditionOutcome.match(ConditionMessage + .items(true)) + : ConditionOutcome.noMatch(ConditionMessage .forCondition(ConditionalWingsEnabled.class) .found(key) - .items(value)); + .items(false)); } return null; @@ -249,4 +247,10 @@ private ConditionOutcome conditionOutcome(boolean falsy) { .forCondition(ConditionalWingsEnabled.class) .because("default true")); } + + private Boolean asBool(String value) { + if ("false".equalsIgnoreCase(value)) return Boolean.FALSE; + if ("true".equalsIgnoreCase(value)) return Boolean.TRUE; + return null; + } } diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java index 2dad171c8..35dab4a67 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/conf/SilencerAutoConfiguration.java @@ -1,7 +1,7 @@ package pro.fessional.wings.silencer.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; import org.springframework.context.annotation.Import; import pro.fessional.wings.silencer.spring.bean.SilencerConfiguration; import pro.fessional.wings.silencer.spring.bean.SilencerRunnerConfiguration; @@ -14,7 +14,7 @@ */ @AutoConfiguration @ConditionalWingsEnabled -@EnableConfigurationProperties(SilencerEnabledProp.class) +@ConfigurationPropertiesScan(basePackageClasses = SilencerEnabledProp.class) @Import({ SilencerConfiguration.class, SilencerRunnerConfiguration.class, diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerEnabledProp.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerEnabledProp.java index b8c274dc0..19bc3f4c0 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerEnabledProp.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerEnabledProp.java @@ -5,8 +5,7 @@ import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition; /** - * The default switch for toggling the Silencer feature, as follows: - * spring-wings-enabled-79.properties + * toggling the Silencer feature, wings-enabled-79.properties * * @author trydofor * @see #Key @@ -19,7 +18,7 @@ public class SilencerEnabledProp { public static final String Key = WingsEnabledCondition.Prefix + ".silencer"; /** - * Whether to automatically configure, default true + * Whether to automatically configure `wings-conf` and `wings-i18n` * * @see #Key$autoconf */ @@ -27,7 +26,7 @@ public class SilencerEnabledProp { public static final String Key$autoconf = Key + ".autoconf"; /** - * Whether to display the conditional information of wings, default false + * Whether to display the conditional information of wings * * @see #Key$verbose */ @@ -35,10 +34,52 @@ public class SilencerEnabledProp { public static final String Key$verbose = Key + ".verbose"; /** - * Whether to automatically load all classpaths ** /spring/bean/**, default true + * Whether to Automatically scan component from `**/spring/bean/**/*.class` on ApplicationPreparedEvent before `@AutoConfiguration * * @see #Key$scanner */ - private boolean scanner = true; + private boolean scanner = false; public static final String Key$scanner = Key + ".scanner"; + + ////// abs-key for short ///////// + + /** + * Whether to audit the file and cascading relationship of properties key/value + * + * @see #Key$auditProp + */ + private boolean auditProp = false; + public static final String Key$auditProp = Key + ".audit-prop"; + + /** + * Whether to automatically switch the console log level when a log file is available + * + * @see #Key$muteConsole + */ + private boolean muteConsole = true; + public static final String Key$muteConsole = Key + ".mute-console"; + + /** + * Whether to tweak the clock in global or thread + * + * @see #Key$tweakClock + */ + private boolean tweakClock = true; + public static final String Key$tweakClock = Key + ".tweak-clock"; + + /** + * Whether to tweak log level of logback in global or thread + * + * @see #Key$tweakLogback + */ + private boolean tweakLogback = true; + public static final String Key$tweakLogback = Key + ".tweak-logback"; + + /** + * Whether to tweak the CodeException stack in global or thread + * + * @see #Key$tweakStack + */ + private boolean tweakStack = true; + public static final String Key$tweakStack = Key + ".tweak-stack"; } diff --git a/wings/silencer/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/silencer/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..588b4deb9 --- /dev/null +++ b/wings/silencer/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,18 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.conf.SilencerAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerConfiguration.applicationInspectRunner", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerConfiguration.messageSourceHelper", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerRunnerConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerRunnerConfiguration$ReadyEvent", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.silencer.spring.bean.SilencerRunnerConfiguration$StartedEvent", "type": "java.lang.Boolean"} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties deleted file mode 100644 index a7603eb4f..000000000 --- a/wings/silencer/src/main/resources/wings-conf/spring-wings-enabled-79.properties +++ /dev/null @@ -1,10 +0,0 @@ -## The default switch for toggling the Silencer feature, as follows - -## Whether to automatically configure, default true -spring.wings.enabled.silencer.autoconf=true - -## Whether to display the conditional information of wings, default false -spring.wings.enabled.silencer.verbose=false - -## Whether to automatically load all classpaths `**/spring/bean/**` (before other beans), default false -spring.wings.enabled.silencer.scanner=false \ No newline at end of file diff --git a/wings/silencer/src/main/resources/wings-conf/wings-enabled-79.properties b/wings/silencer/src/main/resources/wings-conf/wings-enabled-79.properties new file mode 100644 index 000000000..50595a193 --- /dev/null +++ b/wings/silencer/src/main/resources/wings-conf/wings-enabled-79.properties @@ -0,0 +1,25 @@ +## toggling the Silencer feature + +## Whether to automatically configure `wings-conf` and `wings-i18n` +wings.enabled.silencer.autoconf=true + +## Whether to display the conditional information of wings +wings.enabled.silencer.verbose=false + +## Whether to scan component from `**/spring/bean/**/*.class` on ApplicationPreparedEvent before `@AutoConfiguration` +wings.enabled.silencer.scanner=false + +## Whether to audit the file and cascading relationship of properties key/value +#wings.enabled.silencer.audit-prop=false + +## Whether to automatically switch the console log level when a log file is available +#wings.enabled.silencer.mute-console=true + +## Whether to tweak the clock in global or thread +#wings.enabled.silencer.tweak-clock=true + +## Whether to tweak log level of logback in global or thread +#wings.enabled.silencer.tweak-logback=true + +## Whether to tweak the CodeException stack in global or thread +#wings.enabled.silencer.tweak-stack=true \ No newline at end of file diff --git a/wings/silencer/src/main/resources/wings-conf/wings-i18n-79.properties b/wings/silencer/src/main/resources/wings-conf/wings-i18n-79.properties index dcbfffb0e..d26e7ac94 100644 --- a/wings/silencer/src/main/resources/wings-conf/wings-i18n-79.properties +++ b/wings/silencer/src/main/resources/wings-conf/wings-i18n-79.properties @@ -2,11 +2,11 @@ ## in the format `en_US`, `zh_CN`. Default system language. ## Corresponds to `user.language`, `user.country` of the system variable -wings.silencer.i18n.locale= +#wings.silencer.i18n.locale= ## such as `UTC`, `GMT+8,` `Asia/Shanghai`. Default system timezone. ## corresponding to `user.timezone` of the system variable -wings.silencer.i18n.zoneid= +#wings.silencer.i18n.zoneid= ## The default resource configuration, in comma-separated AntPath format. wings.silencer.i18n.bundle=classpath*:/wings-i18n/**/*.properties diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java index 5bd394bfa..f4ae08f3b 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java @@ -16,7 +16,7 @@ * @author trydofor * @since 2023-11-17 */ -@ConditionalWingsEnabled(prefix = "spring.catty.enabled") +@ConditionalWingsEnabled(prefix = "catty.enabled") @Configuration(proxyBeanMethods = false) public class WingsEnabledCatConfiguration { @@ -63,7 +63,7 @@ public NotBean notBean() { } @Bean - @ConditionalWingsEnabled(absKey = "wings.cat.key-bean") + @ConditionalWingsEnabled(abs = "wings.cat.key-bean") public KeyBean keyBean() { return new KeyBean(); } @@ -101,7 +101,7 @@ public InnerCatBean innerCatBean() { } @Configuration(proxyBeanMethods = false) - @ConditionalWingsEnabled(prefix = "spring.kitty.enabled") // no inherit + @ConditionalWingsEnabled(prefix = "kitty.enabled") // no inherit public static class ComponentScan { public ComponentScan() { log.info("Silencer spring-scan Component"); @@ -109,7 +109,7 @@ public ComponentScan() { } @Configuration(proxyBeanMethods = false) - public static class InnerDefault{ + public static class InnerCatConfigDefault { } public static class CatBean { diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledDefaultTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledDefaultTest.java index 828564fd9..2e78a2714 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledDefaultTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledDefaultTest.java @@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.annotation.DirtiesContext; import pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration; import pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration; import pro.fessional.wings.silencer.app.service.ScanService; @@ -16,7 +15,6 @@ * @since 2023-11-17 */ @SpringBootTest -@DirtiesContext public class WingsEnabledDefaultTest { @Setter(onMethod_ = {@Autowired(required = false)}) diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java index 727dd571e..45795e5f0 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java @@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.annotation.DirtiesContext; import pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration; import pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration; import pro.fessional.wings.silencer.app.service.ScanService; @@ -16,21 +15,21 @@ * @since 2023-11-17 */ @SpringBootTest(properties = { - "spring.catty.enabled.catBean=false", - "spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.autowire=false", - "spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.listener=false", - "spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration$InnerCatConfiguration=false", - "spring.kitty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration$ComponentScan=false", + "catty.enabled.catBean=true", + "catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.catBean=false", + "catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.autowire=false", + "catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.listener=false", + "catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration$InnerCatConfiguration=false", + "kitty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration$ComponentScan=false", - "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.dogBean=false", - "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.autowire=false", - "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.listener=false", - "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration$InnerDogConfiguration=false", - "spring.wings.enabled.pro.fessional.wings.silencer.app.service.ScanService=false", + "wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.dogBean=false", + "wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.autowire=false", + "wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration.listener=false", + "wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration$InnerDogConfiguration=false", + "wings.enabled.pro.fessional.wings.silencer.app.service.ScanService=false", "wings.cat.key-bean=false", }) -@DirtiesContext public class WingsEnabledFalseTest { @Setter(onMethod_ = {@Autowired(required = false)}) diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java index 298a1ac12..d93f6538d 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java @@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.annotation.DirtiesContext; import pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration; import pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration; @@ -15,14 +14,13 @@ * @since 2023-11-17 */ @SpringBootTest(properties = { - "spring.catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration=false", - "spring.wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration=false", + "catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration=false", + "wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration=false", }) -@DirtiesContext public class WingsEnabledTopFalseTest { @Setter(onMethod_ = {@Autowired(required = false)}) - protected WingsEnabledCatConfiguration.InnerDefault innerDefault; + protected WingsEnabledCatConfiguration.InnerCatConfigDefault innerCatConfigDefault; @Setter(onMethod_ = {@Autowired(required = false)}) protected WingsEnabledCatConfiguration wingsEnabledCatConfiguration; @@ -48,7 +46,6 @@ public class WingsEnabledTopFalseTest { public void test() { Assertions.assertNull(wingsEnabledCatConfiguration); Assertions.assertNull(catBean); - Assertions.assertNull(innerDefault); Assertions.assertNull(innerCatConfiguration); Assertions.assertNull(innerCatBean); @@ -56,5 +53,8 @@ public void test() { Assertions.assertNull(dogBean); Assertions.assertNull(innerDogConfiguration); Assertions.assertNull(innerDogBean); + + // most good, sometime wrong :D +// Assertions.assertNull(innerCatConfigDefault); } } \ No newline at end of file diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java index 1b796cf49..acc9bbfd6 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSilencerSpringTest.java @@ -14,7 +14,7 @@ * @since 2019-06-25 */ -@SpringBootTest(properties = {"spring.wings.enabled.silencer.autoconf=false"}) +@SpringBootTest(properties = {"wings.enabled.silencer.autoconf=false"}) @ActiveProfiles("dev") public class WingsSilencerSpringTest { diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java index 637828d7d..c50e994e8 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsSpringBeanScannerTest.java @@ -16,7 +16,7 @@ * @since 2023-10-27 */ @SpringBootTest(properties = { - "spring.wings.enabled.silencer.scanner=true", + "wings.enabled.silencer.scanner=true", "wings.silencer.scanner.bean=scanner/bean, /ti12/lgd /ti12/ar//", }) class WingsSpringBeanScannerTest { diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java index 47abebe54..0372027de 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/help/CombinableMessageSourceTest.java @@ -7,42 +7,38 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.MessageSource; import org.springframework.context.support.StaticMessageSource; -import org.springframework.test.annotation.DirtiesContext; -import pro.fessional.wings.silencer.message.CombinableMessageSource; import pro.fessional.wings.silencer.message.MessageSourceHelper; import java.util.Locale; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @author trydofor * @since 2019-09-16 */ @SpringBootTest -@DirtiesContext public class CombinableMessageSourceTest { @Setter(onMethod_ = {@Autowired}) private MessageSource messageSource; - @Test @TmsLink("C11010") public void combine() { - CombinableMessageSource combinableMessageSource = MessageSourceHelper.getCombinableMessageSource(true); - assertNotSame(messageSource, combinableMessageSource); + assertTrue(MessageSourceHelper.hasPrimary); + assertTrue(MessageSourceHelper.hasCombine); Object[] args = {}; String m1 = messageSource.getMessage("test.MyTest", args, Locale.CHINA); - combinableMessageSource.addMessage("test.MyTest", Locale.CHINA, "啥都好用"); + MessageSourceHelper.Combine.addMessage("test.MyTest", Locale.CHINA, "啥都好用"); String m2 = messageSource.getMessage("test.MyTest", args, Locale.CHINA); StaticMessageSource sms = new StaticMessageSource(); sms.addMessage("test.my-test", Locale.CHINA, "又一个测试"); - combinableMessageSource.addMessage(sms, 1); + MessageSourceHelper.Combine.addMessage(sms, 1); String m3 = messageSource.getMessage("test.my-test", args, Locale.CHINA); assertEquals("test.MyTest", m1);// code diff --git a/wings/silencer/src/test/resources/application.properties b/wings/silencer/src/test/resources/application.properties index 8be45a745..ff18b429f 100644 --- a/wings/silencer/src/test/resources/application.properties +++ b/wings/silencer/src/test/resources/application.properties @@ -2,5 +2,5 @@ server.port=8081 spring.application.name=wings-silencer spring.application.name-empty=wings-silencer-empty debug=true -#spring.wings.enabled.silencer.scanner=true +#wings.enabled.silencer.scanner=true logging.level.org.springframework=DEBUG \ No newline at end of file diff --git a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastConfigConfiguration.java b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastConfigConfiguration.java index d740a49ce..a4c04b28d 100644 --- a/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastConfigConfiguration.java +++ b/wings/slardar-hazel-caching/src/main/java/pro/fessional/wings/slardar/spring/bean/HazelcastConfigConfiguration.java @@ -3,12 +3,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.hazelcast.HazelcastConfigCustomizer; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.cache.hazelcast.WingsHazelcastCacheCustomizer; import pro.fessional.wings.slardar.spring.prop.SlardarCacheProp; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; /** * @author trydofor @@ -16,13 +16,12 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarCacheProp.class) public class HazelcastConfigConfiguration { private static final Log log = LogFactory.getLog(HazelcastConfigConfiguration.class); @Bean - @ConditionalWingsEnabled(false) + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$hazelcastStandalone, value = false) public HazelcastConfigCustomizer wingsHazelcastAloneCustomizer() { log.info("SlardarHazelCaching spring-bean simulator hazelcastInstance standalone"); return config -> { diff --git a/wings/slardar-hazel-caching/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/slardar-hazel-caching/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..0a5adea4f --- /dev/null +++ b/wings/slardar-hazel-caching/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,21 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarCacheAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.hazelcast-standalone for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastCacheCustomizer", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastServiceConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastServiceConfiguration$FlakeIdServiceBean", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastServiceConfiguration$GlobalPublisherWired", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastServiceConfiguration.hazelcastCacheManager", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastServiceConfiguration.hazelcastGlobalLock", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastServiceConfiguration.hzLightIdProvider", "type": "java.lang.Boolean"} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/slardar-hazel-caching/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/slardar-hazel-caching/src/main/resources/wings-conf/spring-wings-enabled-79.properties deleted file mode 100644 index 79d6e363d..000000000 --- a/wings/slardar-hazel-caching/src/main/resources/wings-conf/spring-wings-enabled-79.properties +++ /dev/null @@ -1,2 +0,0 @@ -## use hazelcast flake id instead -spring.wings.enabled.pro.fessional.wings.faceless.spring.bean.FacelessConfiguration.flakeIdService=false \ No newline at end of file diff --git a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java index 3068c4db6..fef497d0b 100644 --- a/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java +++ b/wings/slardar-hazel-caching/src/test/java/pro/fessional/wings/slardar/event/EventPublishHelperTest.java @@ -15,7 +15,7 @@ * @author trydofor * @since 2021-06-09 */ -@SpringBootTest(properties = "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=false") +@SpringBootTest(properties = "wings.enabled.slardar.hazelcast-standalone=false") @Slf4j public class EventPublishHelperTest { diff --git a/wings/slardar-hazel-session/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/slardar-hazel-session/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..175254ad1 --- /dev/null +++ b/wings/slardar-hazel-session/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,14 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarHazelSessionAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarHazelSessionConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarHazelSessionConfiguration.sessionRegistry", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarHazelSessionConfiguration.wingsSessionHelper", "type": "java.lang.Boolean"} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java index cb7b98b68..42b6c9612 100644 --- a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java +++ b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/webmvc/WingsSessionLangZoneTest.java @@ -26,7 +26,7 @@ * @since 2020-06-03 */ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - properties = "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=false") + properties = "wings.enabled.slardar.hazelcast-standalone=false") @AutoConfigureMockMvc public class WingsSessionLangZoneTest { diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminClientConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminClientConfiguration.java index 524439623..f49955ca6 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminClientConfiguration.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminClientConfiguration.java @@ -6,13 +6,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.web.client.RestTemplateBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; -import pro.fessional.wings.slardar.spring.prop.SlardarPasscoderProp; /** @@ -23,7 +21,6 @@ @ConditionalWingsEnabled @ConditionalOnClass(SpringBootAdminClientEnabledCondition.class) @Conditional(SpringBootAdminClientEnabledCondition.class) -@EnableConfigurationProperties(SlardarPasscoderProp.class) public class SlardarBootAdminClientConfiguration { private final static Log log = LogFactory.getLog(SlardarBootAdminClientConfiguration.class); diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminServerConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminServerConfiguration.java index b27f1de23..f1981c652 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminServerConfiguration.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarBootAdminServerConfiguration.java @@ -19,7 +19,6 @@ import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; @@ -45,7 +44,6 @@ @ConditionalWingsEnabled @ConditionalOnClass(SpringBootAdminServerEnabledCondition.class) @Conditional(SpringBootAdminServerEnabledCondition.class) -@EnableConfigurationProperties(SlardarPasscoderProp.class) public class SlardarBootAdminServerConfiguration { private final static Log log = LogFactory.getLog(SlardarBootAdminServerConfiguration.class); diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java index fab3c2dd3..036e541ac 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSecurityConfiguration.java @@ -3,7 +3,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -33,7 +32,6 @@ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled @ConditionalOnClass(SecurityConfigurer.class) -@EnableConfigurationProperties(SlardarPasscoderProp.class) public class SlardarSecurityConfiguration { private static final Log log = LogFactory.getLog(SlardarSecurityConfiguration.class); @@ -105,8 +103,8 @@ public WingsSecBeanInitConfigurer wingsSecBeanInitConfigurer(ApplicationContext @Bean @ConditionalWingsEnabled - public TerminalContext.Listener LocaleContextHolderTerminalContextListener() { - log.info("SlardarSprint spring-bean LocaleContextHolder"); + public TerminalContext.Listener localeContextHolderTerminalContextListener() { + log.info("SlardarSprint spring-bean localeContextHolderTerminalContextListener"); return (del, ctx) -> { if (!del) { LocaleContextHolder.setLocaleContext(new SimpleTimeZoneAwareLocaleContext(ctx.getLocale(), ctx.getTimeZone())); diff --git a/wings/slardar-sprint/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/slardar-sprint/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..c78e60017 --- /dev/null +++ b/wings/slardar-sprint/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,31 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarBootAdminAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarBootAdminClientConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarBootAdminClientConfiguration.registrationClient", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarBootAdminServerConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarBootAdminServerConfiguration.basicAuthHttpHeadersProvider", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarBootAdminServerConfiguration.bootAdminMappingOrderPostProcessor", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarBootAdminServerConfiguration.dingTalkNotifier", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarSprintAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarActuatorConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarActuatorConfiguration.slardarCacheManageEndpoint", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration.httpSessionEventPublisher", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration.localeContextHolderTerminalContextListener", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration.passsaltEncoder", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration.passwordEncoder", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration.terminalContextListenerRunner", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSecurityConfiguration.wingsSecBeanInitConfigurer", "type": "java.lang.Boolean"} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/RighterControllerTest.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/RighterControllerTest.java index 4b02e5a82..74a077658 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/RighterControllerTest.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/webmvc/RighterControllerTest.java @@ -45,9 +45,9 @@ public class RighterControllerTest { @BeforeEach public void setup() { mvc = MockMvcBuilders - .webAppContextSetup(context) - .apply(springSecurity()) - .build(); + .webAppContextSetup(context) + .apply(springSecurity()) + .build(); } @Test diff --git a/wings/slardar-sprint/src/test/resources/application.properties b/wings/slardar-sprint/src/test/resources/application.properties index 6cf076045..f56b3239c 100644 --- a/wings/slardar-sprint/src/test/resources/application.properties +++ b/wings/slardar-sprint/src/test/resources/application.properties @@ -9,7 +9,7 @@ logging.level.pro.fessional=DEBUG #wings.slardar.monitor.log.default.file=/tmp/test-slardar.log #logging.file.name=/tmp/test-slardar.log -spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=true +wings.enabled.slardar.hazelcast-standalone=true spring.boot.admin.server.enabled=false spring.boot.admin.client.enabled=false #spring.boot.admin.client.url=http://localhost:${server.port} diff --git a/wings/slardar-test/src/main/resources/wings-conf/spring-wings-enabled.properties b/wings/slardar-test/src/main/resources/wings-conf/spring-wings-enabled.properties deleted file mode 100644 index 9479234f6..000000000 --- a/wings/slardar-test/src/main/resources/wings-conf/spring-wings-enabled.properties +++ /dev/null @@ -1 +0,0 @@ -spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=true \ No newline at end of file diff --git a/wings/slardar-test/src/main/resources/wings-conf/wings-enabled.properties b/wings/slardar-test/src/main/resources/wings-conf/wings-enabled.properties new file mode 100644 index 000000000..54146156e --- /dev/null +++ b/wings/slardar-test/src/main/resources/wings-conf/wings-enabled.properties @@ -0,0 +1,2 @@ +wings.enabled.slardar.hazelcast-standalone=true +wings.enabled.faceless.simple-flakeid=false \ No newline at end of file diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/monitor/viewer/LogViewer.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/monitor/viewer/LogViewer.java index bdac12cb1..0bbe3dbe6 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/monitor/viewer/LogViewer.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/monitor/viewer/LogViewer.java @@ -8,11 +8,11 @@ import org.apache.commons.io.IOUtils; import org.cache2k.Cache; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.id.Ulid; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.cache.cache2k.WingsCache2k; import pro.fessional.wings.slardar.monitor.WarnFilter; import pro.fessional.wings.slardar.monitor.WarnMetric; @@ -35,7 +35,7 @@ */ @Slf4j @RestController -@ConditionalOnProperty(name = LogConf.Key$enable, havingValue = "true") +@ConditionalWingsEnabled(abs = LogConf.Key$enable) public class LogViewer implements WarnFilter { @Getter diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java index eefd0b8a0..9b06b8505 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCookieConfiguration.java @@ -2,7 +2,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.encrypt.SecretProvider; @@ -11,6 +10,7 @@ import pro.fessional.wings.slardar.servlet.cookie.WingsCookieInterceptor; import pro.fessional.wings.slardar.servlet.cookie.impl.WingsCookieInterceptorImpl; import pro.fessional.wings.slardar.spring.prop.SlardarCookieProp; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import java.util.Map; import java.util.Set; @@ -24,8 +24,7 @@ * @since 2021-10-07 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled(false) -@EnableConfigurationProperties(SlardarCookieProp.class) +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$cookie, value = false) public class SlardarCookieConfiguration { private static final Log log = LogFactory.getLog(SlardarCookieConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java index 67837fa6c..90666a944 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDebounceConfiguration.java @@ -2,7 +2,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; @@ -11,14 +10,14 @@ import pro.fessional.wings.slardar.concur.impl.DebounceInterceptor; import pro.fessional.wings.slardar.servlet.response.view.PlainTextView; import pro.fessional.wings.slardar.spring.prop.SlardarDebounceProp; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; /** * @author trydofor * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarDebounceProp.class) +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$debounce) public class SlardarDebounceConfiguration { private static final Log log = LogFactory.getLog(SlardarDebounceConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java index dd3ce4b13..78956fc56 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDomainExtendConfiguration.java @@ -3,7 +3,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanFactoryUtils; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -14,6 +13,7 @@ import pro.fessional.wings.slardar.domainx.DefaultDomainRequestMatcher; import pro.fessional.wings.slardar.domainx.WingsDomainExtendFilter; import pro.fessional.wings.slardar.spring.prop.DomainExtendProp; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import java.util.ArrayList; import java.util.HashMap; @@ -27,8 +27,7 @@ * @since 2019-06-29 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled(false) -@EnableConfigurationProperties(DomainExtendProp.class) +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$domainx, value = false) public class SlardarDomainExtendConfiguration { private final static Log log = LogFactory.getLog(SlardarDomainExtendConfiguration.class); @@ -36,7 +35,7 @@ public class SlardarDomainExtendConfiguration { @Bean @ConditionalWingsEnabled public WingsDomainExtendFilter wingsDomainExtendFilter(DomainExtendProp config, ApplicationContext context) { - log.info("SlardarWebmvc spring-bean wingsDomainFilter"); + log.info("SlardarWebmvc spring-bean wingsDomainExtendFilter"); Map> hostMatcher = new HashMap<>(); for (Map.Entry> entry : config.getHost().entrySet()) { Set vs = entry.getValue(); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java index 36aa5c914..8e7a9d911 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillWebConfiguration.java @@ -2,21 +2,20 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.HandlerExceptionResolver; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.concur.impl.DoubleKillExceptionResolver; import pro.fessional.wings.slardar.spring.prop.SlardarDoubleKillProp; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; /** * @author trydofor * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarDoubleKillProp.class) +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$doubleKill) public class SlardarDoubleKillWebConfiguration { private static final Log log = LogFactory.getLog(SlardarDoubleKillWebConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java index 5cb40298f..d62970b95 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarFirstBloodConfiguration.java @@ -4,7 +4,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.HttpStatus; @@ -16,6 +15,7 @@ import pro.fessional.wings.slardar.concur.impl.FirstBloodInterceptor; import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver; import pro.fessional.wings.slardar.servlet.response.view.PlainTextView; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarFirstBloodProp; import java.util.List; @@ -26,14 +26,13 @@ * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled(false) -@EnableConfigurationProperties(SlardarFirstBloodProp.class) +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$firstBlood, value = false) public class SlardarFirstBloodConfiguration { private static final Log log = LogFactory.getLog(SlardarFirstBloodConfiguration.class); @Bean - @ConditionalWingsEnabled + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$firstBloodImage) public FirstBloodImageHandler firstBloodImageHandler(@Autowired(required = false) WingsRemoteResolver remoteResolver, SlardarFirstBloodProp prop) { log.info("SlardarWebmvc spring-bean firstBloodImageHandler"); final FirstBloodImageHandler handler = new FirstBloodImageHandler(); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java index afec7e594..3ca2664a1 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java @@ -11,7 +11,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -41,6 +40,7 @@ import pro.fessional.wings.slardar.jackson.JacksonHelper; import pro.fessional.wings.slardar.jackson.ResourceSerializer; import pro.fessional.wings.slardar.spring.prop.SlardarDatetimeProp; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarJacksonProp; import pro.fessional.wings.slardar.spring.prop.SlardarNumberProp; @@ -65,7 +65,6 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(DateSerializer.class) @ConditionalWingsEnabled -@EnableConfigurationProperties({SlardarJacksonProp.class, SlardarDatetimeProp.class, SlardarNumberProp.class}) public class SlardarJacksonWebConfiguration { private static final Log log = LogFactory.getLog(SlardarJacksonWebConfiguration.class); @@ -83,7 +82,7 @@ public class SlardarJacksonWebConfiguration { * It has some useful methods to access the default and user-enhanced message converters. */ @Bean - @ConditionalWingsEnabled + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$jacksonDatetime) public Jackson2ObjectMapperBuilderCustomizer customizeJacksonDatetime(SlardarDatetimeProp prop) { log.info("SlardarWebmvc spring-bean customizeJacksonDatetime"); return builder -> { @@ -158,17 +157,19 @@ public Jackson2ObjectMapperBuilderCustomizer customizeJacksonDatetime(SlardarDat } @Bean - @ConditionalWingsEnabled - public Jackson2ObjectMapperBuilderCustomizer customizeJacksonResource() { - log.info("SlardarWebmvc spring-bean customizeJacksonResource"); + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$jacksonEmpty) + public Jackson2ObjectMapperBuilderCustomizer customizeJacksonEmpty(SlardarJacksonProp prop) { + log.info("SlardarWebmvc spring-bean customizeJacksonEmpty"); return builder -> { - log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer Resource"); - builder.serializerByType(Resource.class, new ResourceSerializer()); + if (StringUtils.hasText(prop.getEmptyDate()) || prop.isEmptyMap() || prop.isEmptyList()) { + log.info("SlardarWebmvc conf EmptyValuePropertyFilter's EmptyDateMixin"); + builder.mixIn(Object.class, EmptyValuePropertyFilter.EmptyDateMixin.class); + } }; } @Bean - @ConditionalWingsEnabled + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$jacksonNumber) public Jackson2ObjectMapperBuilderCustomizer customizeJacksonNumber(SlardarNumberProp prop) { log.info("SlardarWebmvc spring-bean customizeJacksonNumber"); return builder -> { @@ -206,19 +207,17 @@ public Jackson2ObjectMapperBuilderCustomizer customizeJacksonNumber(SlardarNumbe } @Bean - @ConditionalWingsEnabled - public Jackson2ObjectMapperBuilderCustomizer customizeJacksonEmpty(SlardarJacksonProp prop) { - log.info("SlardarWebmvc spring-bean customizeJacksonEmpty"); + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$jacksonResource) + public Jackson2ObjectMapperBuilderCustomizer customizeJacksonResource() { + log.info("SlardarWebmvc spring-bean customizeJacksonResource"); return builder -> { - if (StringUtils.hasText(prop.getEmptyDate()) || prop.isEmptyMap() || prop.isEmptyList()) { - log.info("SlardarWebmvc conf EmptyValuePropertyFilter's EmptyDateMixin"); - builder.mixIn(Object.class, EmptyValuePropertyFilter.EmptyDateMixin.class); - } + log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer Resource"); + builder.serializerByType(Resource.class, new ResourceSerializer()); }; } @Bean - @ConditionalWingsEnabled + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$jacksonResult) public Jackson2ObjectMapperBuilderCustomizer customizeJacksonResult(SlardarJacksonProp prop, MessageSource source) { log.info("SlardarWebmvc spring-bean customizerObjectMapperJackson"); return builder -> { @@ -233,8 +232,18 @@ public Jackson2ObjectMapperBuilderCustomizer customizeJacksonResult(SlardarJacks @Bean @ConditionalWingsEnabled - public FilterProvider slardarFilterProvider(List filters) { - log.info("SlardarWebmvc spring-bean slardarFilterProvider"); + public Jackson2ObjectMapperBuilderCustomizer jacksonCustomizerFilter(FilterProvider filterProvider) { + log.info("SlardarWebmvc spring-bean jacksonCustomizerFilter"); + return builder -> { + log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer filters"); + builder.filters(filterProvider); + }; + } + + @Bean + @ConditionalWingsEnabled + public FilterProvider jacksonFilterProvider(List filters) { + log.info("SlardarWebmvc spring-bean jacksonFilterProvider"); final SimpleFilterProvider bean = new SimpleFilterProvider(); for (AutoRegisterPropertyFilter filter : filters) { bean.addFilter(filter.getId(), filter); @@ -242,16 +251,6 @@ public FilterProvider slardarFilterProvider(List fil return bean; } - @Bean - @ConditionalWingsEnabled - public Jackson2ObjectMapperBuilderCustomizer customizeJacksonFilter(FilterProvider filterProvider) { - log.info("SlardarWebmvc spring-bean customizeJacksonFilter"); - return builder -> { - log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer filters"); - builder.filters(filterProvider); - }; - } - @Bean @ConditionalWingsEnabled public ApplicationStartedEventRunner jacksonHelperRunner(Jackson2ObjectMapperBuilder builder) { diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java index dcb8d4d30..fe0bb52ee 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarLocaleConfiguration.java @@ -3,7 +3,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.LocaleResolver; @@ -15,12 +15,12 @@ /** * @author trydofor + * @see WebMvcAutoConfiguration.EnableWebMvcConfiguration * @since 2019-06-29 */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled @ConditionalOnClass(LocaleResolver.class) -@EnableConfigurationProperties({SlardarLocaleProp.class}) public class SlardarLocaleConfiguration { private final Log log = LogFactory.getLog(SlardarLocaleConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java index 73a9d2a7a..6f4a16ed4 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpWebConfiguration.java @@ -26,14 +26,6 @@ public class SlardarOkhttpWebConfiguration { private static final Log log = LogFactory.getLog(SlardarOkhttpWebConfiguration.class); - @Bean - @ConditionalWingsEnabled - public RestTemplateBuilder restTemplateBuilder(RestTemplateBuilderConfigurer configurer, OkHttpClient client) { - log.info("SlardarWebmvc spring-bean restTemplateBuilder"); - final RestTemplateBuilder builder = configurer.configure(new RestTemplateBuilder()); - return builder.requestFactory(() -> new OkHttp3ClientHttpRequestFactory(client)); - } - @Bean @ConditionalWingsEnabled public RestTemplate okhttpRestTemplate(RestTemplateBuilder builder) { @@ -41,4 +33,11 @@ public RestTemplate okhttpRestTemplate(RestTemplateBuilder builder) { return builder.build(); } + @Bean + @ConditionalWingsEnabled + public RestTemplateBuilder restTemplateBuilder(RestTemplateBuilderConfigurer configurer, OkHttpClient client) { + log.info("SlardarWebmvc spring-bean restTemplateBuilder"); + final RestTemplateBuilder builder = configurer.configure(new RestTemplateBuilder()); + return builder.requestFactory(() -> new OkHttp3ClientHttpRequestFactory(client)); + } } diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java index cbfdcf96b..510152029 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOverloadConfiguration.java @@ -7,7 +7,6 @@ import org.apache.commons.logging.LogFactory; import org.jetbrains.annotations.NotNull; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationListener; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -19,7 +18,6 @@ import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.servlet.filter.WingsOverloadFilter; import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver; -import pro.fessional.wings.slardar.spring.prop.SlardarOverloadProp; import java.io.IOException; import java.io.PrintWriter; @@ -35,7 +33,6 @@ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled(false) @ConditionalOnClass(Filter.class) -@EnableConfigurationProperties(SlardarOverloadProp.class) @Deprecated public class SlardarOverloadConfiguration { diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java index ae67e1f59..d0426571d 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarPageQueryConfiguration.java @@ -2,11 +2,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.mirana.data.Null; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarPagequeryProp; import pro.fessional.wings.slardar.webmvc.PageQueryArgumentResolver; @@ -15,8 +15,7 @@ * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarPagequeryProp.class) +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$pagequery) public class SlardarPageQueryConfiguration { private static final Log log = LogFactory.getLog(SlardarPageQueryConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java index 8d68f4cd6..34a85889b 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRemoteConfiguration.java @@ -2,7 +2,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; @@ -16,7 +15,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarRemoteProp.class) public class SlardarRemoteConfiguration { private final Log log = LogFactory.getLog(SlardarRemoteConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarReuseStreamConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarReuseStreamConfiguration.java index 3db8a06f5..26e6daf73 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarReuseStreamConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarReuseStreamConfiguration.java @@ -8,13 +8,14 @@ import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.servlet.stream.RequestResponseLogging; import pro.fessional.wings.slardar.servlet.stream.WingsReuseStreamFilter; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; /** * @author trydofor * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$restream) public class SlardarReuseStreamConfiguration { private static final Log log = LogFactory.getLog(SlardarReuseStreamConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java index fd52a085d..9ac711373 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarRighterConfiguration.java @@ -3,13 +3,13 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.HandlerExceptionResolver; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.concur.impl.RighterExceptionResolver; import pro.fessional.wings.slardar.concur.impl.RighterInterceptor; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarRighterProp; /** @@ -17,11 +17,16 @@ * @since 2019-06-29 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarRighterProp.class) +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$righter) public class SlardarRighterConfiguration { private final static Log log = LogFactory.getLog(SlardarRighterConfiguration.class); + @Bean + @ConditionalWingsEnabled + public HandlerExceptionResolver righterExceptionResolver(SlardarRighterProp prop) { + log.info("SlardarWebmvc spring-bean righterExceptionResolver"); + return new RighterExceptionResolver(prop); + } @Bean @ConditionalWingsEnabled @@ -32,10 +37,4 @@ public RighterInterceptor righterInterceptor(ObjectProvider { - final boolean base64 = prop.isCookieBase64(); - log.info("SlardarWebmvc conf Session Cookie Base64=" + base64); - it.setUseBase64Encoding(base64); - final String jvmRoute = prop.getCookieRoute(); - if (StringUtils.hasText(jvmRoute)) { - log.info("SlardarWebmvc conf Session Cookie jvmRoute=" + jvmRoute); - it.setJvmRoute(jvmRoute); - } - }; - } - @Bean @ConditionalWingsEnabled public HttpSessionIdResolver httpSessionIdResolver( @@ -108,4 +90,20 @@ public HttpSessionIdResolver httpSessionIdResolver( return new WingsSessionIdResolver(resolvers); } + + @Bean + @ConditionalWingsEnabled + public DefaultCookieSerializerCustomizer slardarCookieSerializerCustomizer(SlardarSessionProp prop) { + log.info("SlardarWebmvc spring-bean slardarCookieSerializerCustomizer"); + return it -> { + final boolean base64 = prop.isCookieBase64(); + log.info("SlardarWebmvc conf Session Cookie Base64=" + base64); + it.setUseBase64Encoding(base64); + final String jvmRoute = prop.getCookieRoute(); + if (StringUtils.hasText(jvmRoute)) { + log.info("SlardarWebmvc conf Session Cookie jvmRoute=" + jvmRoute); + it.setJvmRoute(jvmRoute); + } + }; + } } diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java index 7f910323f..385d74e31 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarSwaggerConfiguration.java @@ -16,12 +16,12 @@ import org.springdoc.core.customizers.OpenApiCustomizer; import org.springdoc.core.utils.SpringDocUtils; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.mirana.page.PageQuery; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.help.CommonPropHelper; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarPagequeryProp; import pro.fessional.wings.slardar.spring.prop.SlardarSwaggerProp; @@ -33,9 +33,8 @@ * @since 2019-10-30 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$swagger) @ConditionalOnClass(OpenAPI.class) -@EnableConfigurationProperties(SlardarSwaggerProp.class) public class SlardarSwaggerConfiguration { private static final Log log = LogFactory.getLog(SlardarSwaggerConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java index 752a60de5..793c21ed2 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTerminalConfiguration.java @@ -3,7 +3,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.core.Authentication; @@ -16,6 +15,7 @@ import pro.fessional.wings.slardar.security.WingsUserDetails; import pro.fessional.wings.slardar.servlet.resolver.WingsLocaleResolver; import pro.fessional.wings.slardar.servlet.resolver.WingsRemoteResolver; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarTerminalProp; import java.util.ArrayList; @@ -30,8 +30,7 @@ * @since 2019-06-29 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarTerminalProp.class) +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$terminal) public class SlardarTerminalConfiguration { private final Log log = LogFactory.getLog(SlardarTerminalConfiguration.class); diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebMvcAutoConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebCnfAutoConfiguration.java similarity index 93% rename from wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebMvcAutoConfiguration.java rename to wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebCnfAutoConfiguration.java index 665131738..8bc0233af 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebMvcAutoConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarWebCnfAutoConfiguration.java @@ -17,5 +17,5 @@ SlardarLocaleConfiguration.class, SlardarOkhttpWebConfiguration.class, }) -public class SlardarWebMvcAutoConfiguration { +public class SlardarWebCnfAutoConfiguration { } diff --git a/wings/slardar-webmvc/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/slardar-webmvc/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..e5a60c151 --- /dev/null +++ b/wings/slardar-webmvc/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,79 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarWebCnfAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarLocaleConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarLocaleConfiguration.localeResolver", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpWebConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpWebConfiguration.okhttpRestTemplate", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpWebConfiguration.restTemplateBuilder", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarWebFunAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCookieConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.cookie for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCookieConfiguration.wingsCookieFilter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCookieConfiguration.wingsCookieInterceptor", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDebounceConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.debounce for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDebounceConfiguration.debounceInterceptor", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDomainExtendConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.domainx for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDomainExtendConfiguration.wingsDomainExtendFilter", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarDoubleKillWebConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.double-kill for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarDoubleKillWebConfiguration.doubleKillExceptionResolver", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.first-blood for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration.firstBloodImageHandler", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.first-blood-image for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration.firstBloodInterceptor", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration.customizeJacksonDatetime", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.jackson-datetime for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration.customizeJacksonEmpty", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.jackson-empty for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration.customizeJacksonNumber", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.jackson-number for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration.customizeJacksonResource", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.jackson-resource for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration.customizeJacksonResult", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.jackson-result for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration.jacksonCustomizerFilter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration.jacksonFilterProvider", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonWebConfiguration.jacksonHelperRunner", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarPageQueryConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.pagequery for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarPageQueryConfiguration.pageQueryArgumentResolver", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarRemoteConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarRemoteConfiguration.wingsRemoteResolver", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarReuseStreamConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.restream for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarReuseStreamConfiguration.wingsReuseStreamFilter", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarRighterConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.righter for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarRighterConfiguration.righterExceptionResolver", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarRighterConfiguration.righterInterceptor", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSessionConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.session for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSessionConfiguration.httpSessionIdResolver", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSessionConfiguration.slardarCookieSerializerCustomizer", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSwaggerConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.swagger for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarSwaggerConfiguration.slardarOpenApiCustomizer", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarTerminalConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.terminal for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarTerminalConfiguration.remoteTerminalBuilder", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarTerminalConfiguration.securityTerminalBuilder", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarTerminalConfiguration.terminalInterceptor", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarUndertowConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarUndertowConfiguration.ut026010Customizer", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarWebMvcConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarWebMvcConfiguration.mvcRequestMatcherBuilder", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.monitor.viewer.LogViewer", "type": "java.lang.Boolean", "description": "wings.slardar.monitor.view.enable for short."} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 8d466bb14..c247a04d1 100644 --- a/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/wings/slardar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1,2 +1,2 @@ -pro.fessional.wings.slardar.spring.conf.SlardarWebMvcAutoConfiguration +pro.fessional.wings.slardar.spring.conf.SlardarWebCnfAutoConfiguration pro.fessional.wings.slardar.spring.conf.SlardarWebFunAutoConfiguration diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java index 7c5476eaa..d1231165a 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/concur/FirstBloodTest.java @@ -25,9 +25,9 @@ @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { - "spring.wings.enabled.pro.fessional.wings.slardar.app.conf.SlardarFirstBloodTestConfiguration=true", - "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration=true", - "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarFirstBloodConfiguration.firstBloodImageHandler=false", + "wings.enabled.pro.fessional.wings.slardar.app.conf.SlardarFirstBloodTestConfiguration=true", + "wings.enabled.slardar.first-blood=true", + "wings.enabled.slardar.first-blood-image=false", "wings.slardar.first-blood.http-status=202", "wings.slardar.first-blood.content-type=text/plain", "wings.slardar.first-blood.response-body=first-blood", diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java index 5d3d37b81..ea8dedb04 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/domain/DomainExtendTest.java @@ -17,8 +17,7 @@ @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { - "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDomainExtendConfiguration=true", - "spring.boot.admin.server.enabled=false" + "wings.enabled.slardar.domainx=true", }) public class DomainExtendTest { diff --git a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java index 79ba33a68..052b83a88 100644 --- a/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java +++ b/wings/slardar-webmvc/src/test/java/pro/fessional/wings/slardar/webmvc/WingsCookieTest.java @@ -41,7 +41,7 @@ */ @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { - "spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCookieConfiguration=true", + "wings.enabled.slardar.cookie=true", "wings.slardar.cookie.prefix=" + WingsCookieTest.PREFIX, "wings.slardar.cookie.coder=aes", "wings.slardar.cookie.alias[ck2]=" + WingsCookieTest.CK2OTH, diff --git a/wings/slardar-webmvc/src/test/resources/application.properties b/wings/slardar-webmvc/src/test/resources/application.properties index e8055b326..6513444a9 100644 --- a/wings/slardar-webmvc/src/test/resources/application.properties +++ b/wings/slardar-webmvc/src/test/resources/application.properties @@ -9,7 +9,7 @@ logging.level.pro.fessional=DEBUG #wings.slardar.monitor.log.default.file=/tmp/test-slardar.log #logging.file.name=/tmp/test-slardar.log -spring.wings.enabled.pro.fessional.wings.slardar.spring.bean.HazelcastConfigConfiguration.wingsHazelcastAloneCustomizer=true - +wings.enabled.slardar.hazelcast-standalone=true +spring.boot.admin.server.enabled=false #spring.boot.admin.client.url=http://localhost:${server.port} #spring.boot.admin.ui.title=Wings-Slardar-Admin diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/async/TaskSchedulerHelper.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/async/TaskSchedulerHelper.java index 74ee67a1c..65775fc93 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/async/TaskSchedulerHelper.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/async/TaskSchedulerHelper.java @@ -1,5 +1,6 @@ package pro.fessional.wings.slardar.async; +import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.springframework.scheduling.Trigger; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; @@ -17,12 +18,17 @@ public class TaskSchedulerHelper { protected static ThreadPoolTaskScheduler LightTasker; protected static ThreadPoolTaskScheduler HeavyTasker; + protected TaskSchedulerHelper(ThreadPoolTaskScheduler light, ThreadPoolTaskScheduler heavy) { + LightTasker = light; + HeavyTasker = heavy; + } + /** * @see org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor#DEFAULT_TASK_SCHEDULER_BEAN_NAME */ - @NotNull - public static ThreadPoolTaskScheduler Light() { - if (LightTasker == null) { + @Contract("true->!null") + public static ThreadPoolTaskScheduler Light(boolean nonnull) { + if (nonnull && LightTasker == null) { throw new IllegalStateException("LightTasker must init before using"); } return LightTasker; @@ -31,9 +37,9 @@ public static ThreadPoolTaskScheduler Light() { /** * see NamingSlardarConst#slardarHeavyScheduler */ - @NotNull - public static ThreadPoolTaskScheduler Heavy() { - if (HeavyTasker == null) { + @Contract("true->!null") + public static ThreadPoolTaskScheduler Heavy(boolean nonnull) { + if (nonnull && HeavyTasker == null) { throw new IllegalStateException("HeavyTasker must init before using"); } @@ -45,7 +51,7 @@ public static ThreadPoolTaskScheduler Heavy() { */ @NotNull public static ThreadPoolTaskScheduler referScheduler(boolean fast) { - return fast ? Light() : Heavy(); + return fast ? Light(true) : Heavy(true); } /** diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java index 994b816e3..0412e1e33 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarAsyncConfiguration.java @@ -7,7 +7,6 @@ import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration; import org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration; import org.springframework.boot.autoconfigure.task.TaskSchedulingProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.task.TaskExecutorBuilder; import org.springframework.boot.task.TaskSchedulerBuilder; import org.springframework.context.annotation.Bean; @@ -42,7 +41,6 @@ @EnableAsync @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarAsyncProp.class) public class SlardarAsyncConfiguration { public static final String slardarHeavyScheduler = "slardarHeavyScheduler"; @@ -99,10 +97,6 @@ public TaskSchedulerHelper taskSchedulerHelper( @Qualifier(DEFAULT_TASK_SCHEDULER_BEAN_NAME) ThreadPoolTaskScheduler light, @Qualifier(slardarHeavyScheduler) ThreadPoolTaskScheduler heavy) { log.info("Slardar spring-bean taskSchedulerHelper"); - return new TaskSchedulerHelper() {{ - log.info("Slardar conf TaskSchedulerHelper"); - LightTasker = light; - HeavyTasker = heavy; - }}; + return new TaskSchedulerHelper(light, heavy) {}; } } diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java index 66338040d..c4c65c964 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarCacheConfiguration.java @@ -6,7 +6,6 @@ import org.cache2k.extra.spring.SpringCache2kCacheManager; import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.AbstractCachingConfiguration; import org.springframework.cache.annotation.CachingConfigurer; @@ -44,12 +43,11 @@ @EnableCaching @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarCacheProp.class) public class SlardarCacheConfiguration { private static final Log log = LogFactory.getLog(SlardarCacheConfiguration.class); - // set FeatureJmx first + // set FeatureJmx early public SlardarCacheConfiguration(@Value("${spring.jmx.enabled:false}") boolean jmx) { log.info("Slardar spring.jmx.enabled=" + jmx + ", if can NOT disable, check IDEA 'Disable JMX agent' options"); if (!jmx && WingsCache2k.FeatureJmx != null) { diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java index 9334820f4..598ff1086 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDateTimeConfiguration.java @@ -3,7 +3,6 @@ import lombok.val; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.convert.ApplicationConversionService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -32,7 +31,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarDatetimeProp.class) public class SlardarDateTimeConfiguration { private static final Log log = LogFactory.getLog(SlardarDateTimeConfiguration.class); diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java index de5d0f326..df16424a1 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDingNoticeConfiguration.java @@ -3,7 +3,6 @@ import okhttp3.OkHttpClient; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; @@ -16,7 +15,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarDingNoticeProp.class) public class SlardarDingNoticeConfiguration { private static final Log log = LogFactory.getLog(SlardarDingNoticeConfiguration.class); diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java index 007b1206c..abc46a2c8 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarDoubleKillConfiguration.java @@ -6,13 +6,14 @@ import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.concur.impl.DoubleKillAround; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; /** * @author trydofor * @since 2019-12-03 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled +@ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$doubleKill) public class SlardarDoubleKillConfiguration { private static final Log log = LogFactory.getLog(SlardarDoubleKillConfiguration.class); diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java index 1cee05aa1..cd4c97763 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarEventConfiguration.java @@ -6,7 +6,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.task.TaskExecutionProperties; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.task.TaskExecutorBuilder; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.annotation.Bean; @@ -31,7 +30,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarAsyncProp.class) public class SlardarEventConfiguration { private static final Log log = LogFactory.getLog(SlardarEventConfiguration.class); diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java index fd420e781..f243d2f9b 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonConfiguration.java @@ -5,7 +5,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -27,7 +26,6 @@ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled @ConditionalOnClass(DateSerializer.class) -@EnableConfigurationProperties(SlardarJacksonProp.class) public class SlardarJacksonConfiguration { private static final Log log = LogFactory.getLog(SlardarJacksonConfiguration.class); diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java index 3e48732bd..3e0b77309 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java @@ -6,7 +6,6 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.bind.Binder; import org.springframework.context.EnvironmentAware; import org.springframework.context.annotation.Bean; @@ -21,6 +20,7 @@ import pro.fessional.wings.slardar.monitor.metric.LogMetric; import pro.fessional.wings.slardar.monitor.report.DingTalkReport; import pro.fessional.wings.slardar.notice.DingTalkNotice; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; import pro.fessional.wings.slardar.spring.prop.SlardarMonitorProp; import java.io.File; @@ -33,7 +33,6 @@ @EnableScheduling @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarMonitorProp.class) public class SlardarMonitorConfiguration { private static final Log log = LogFactory.getLog(SlardarMonitorConfiguration.class); @@ -41,9 +40,9 @@ public class SlardarMonitorConfiguration { // Dynamic register Bean LogMetric @Configuration(proxyBeanMethods = false) - @ConditionalWingsEnabled + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$monitorLog) @ComponentScan(basePackageClasses = MonitorTask.class) - public static class LogMetricRegister implements BeanFactoryPostProcessor, EnvironmentAware { + public static class LogMonitor implements BeanFactoryPostProcessor, EnvironmentAware { private SlardarMonitorProp slardarMonitorProp; @@ -52,7 +51,7 @@ public static class LogMetricRegister implements BeanFactoryPostProcessor, Envir */ @Override public void setEnvironment(@NotNull Environment environment) { - log.info("Slardar spring-scan MonitorTask"); + log.info("Slardar spring-bind SlardarMonitorProp"); slardarMonitorProp = Binder .get(environment) .bind(SlardarMonitorProp.Key, SlardarMonitorProp.class) @@ -61,14 +60,14 @@ public void setEnvironment(@NotNull Environment environment) { @Override public void postProcessBeanFactory(@NotNull ConfigurableListableBeanFactory beanFactory) throws BeansException { - log.info("Slardar spring-proc LogMetric beans"); + log.info("Slardar spring-proc LogMonitor beans"); final Map logs = slardarMonitorProp.getLog(); LogMetric.Rule defaults = logs.get("default"); for (Map.Entry entry : logs.entrySet()) { String key = LogMetric.Rule.Key + "." + entry.getKey(); if (beanFactory.containsBean(key)) { - log.info("Slardar skip LogMetric bean=" + key + ", for existed"); + log.info("Slardar skip LogMonitor bean=" + key + ", for existed"); continue; } @@ -79,14 +78,14 @@ public void postProcessBeanFactory(@NotNull ConfigurableListableBeanFactory bean if (new File(rf).exists()) { LogMetric bean = new LogMetric(key, rule); beanFactory.registerSingleton(key, bean); - log.info("Slardar spring-bean register dynamic LogMetric bean=" + key); + log.info("Slardar spring-bean register dynamic LogMonitor bean=" + key); } else { - log.warn("Wings skip LogMetric bean for file not exist, file=" + rf); + log.warn("Wings skip LogMonitor bean for file not exist, file=" + rf); } } else { - log.info("Wings skip LogMetric bean=" + key + ", for disabled"); + log.info("Wings skip LogMonitor bean=" + key + ", for disabled"); } } } @@ -108,9 +107,9 @@ private void fillDefault(LogMetric.Rule def, LogMetric.Rule use) { } @Bean - @ConditionalWingsEnabled - public JvmMetric jvmMetric(SlardarMonitorProp prop) { - log.info("Slardar spring-bean jvmMetric"); + @ConditionalWingsEnabled(abs = SlardarEnabledProp.Key$monitorJvm) + public JvmMetric jvmMonitor(SlardarMonitorProp prop) { + log.info("Slardar spring-bean jvmMonitor"); final JvmMetric.Rule rule = prop.getJvm(); return new JvmMetric(rule); } diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java index 338b51970..c633d506e 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarOkhttpConfiguration.java @@ -13,7 +13,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.web.client.RestTemplateAutoConfiguration; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.runner.CommandLineRunnerOrdered; @@ -40,7 +39,6 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(OkHttpClient.class) @ConditionalWingsEnabled -@EnableConfigurationProperties(SlardarOkhttpProp.class) public class SlardarOkhttpConfiguration { private static final Log log = LogFactory.getLog(SlardarOkhttpConfiguration.class); diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java index 4f40f2a71..655a6c51b 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarTweakConfiguration.java @@ -20,15 +20,15 @@ public class SlardarTweakConfiguration { @Bean @ConditionalWingsEnabled - public TweakEventListener tweakEventListener() { - log.info("Slardar spring-bean tweakEventListener"); - return new TweakEventListener(); + public OkHttpTweakLogInterceptor okhttpTweakLogInterceptor() { + log.info("Slardar spring-bean okhttpTweakLogInterceptor"); + return new OkHttpTweakLogInterceptor(); } @Bean @ConditionalWingsEnabled - public OkHttpTweakLogInterceptor okhttpTweakLogInterceptor() { - log.info("Slardar spring-bean okhttpTweakLogInterceptor"); - return new OkHttpTweakLogInterceptor(); + public TweakEventListener tweakEventListener() { + log.info("Slardar spring-bean tweakEventListener"); + return new TweakEventListener(); } } diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java index b23d66fa3..ef608cf92 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/conf/SlardarAutoConfiguration.java @@ -1,6 +1,7 @@ package pro.fessional.wings.slardar.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; import org.springframework.context.annotation.Import; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration; @@ -12,6 +13,7 @@ import pro.fessional.wings.slardar.spring.bean.SlardarMonitorConfiguration; import pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration; import pro.fessional.wings.slardar.spring.bean.SlardarTweakConfiguration; +import pro.fessional.wings.slardar.spring.prop.SlardarEnabledProp; /** * @author trydofor @@ -19,6 +21,7 @@ */ @AutoConfiguration @ConditionalWingsEnabled +@ConfigurationPropertiesScan(basePackageClasses = SlardarEnabledProp.class) @Import({ SlardarDateTimeConfiguration.class, SlardarDingNoticeConfiguration.class, diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java new file mode 100644 index 000000000..472121cab --- /dev/null +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/prop/SlardarEnabledProp.java @@ -0,0 +1,183 @@ +package pro.fessional.wings.slardar.spring.prop; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition; + +/** + * wings-enabled-79.properties + * + * @author trydofor + * @see #Key + * @since 2021-02-13 + */ +@Data +@ConfigurationProperties(SlardarEnabledProp.Key) +public class SlardarEnabledProp { + + public static final String Key = WingsEnabledCondition.Prefix + ".slardar"; + + /** + * whether to enable DoubleKill by DoubleKillAround AOP + * + * @see #Key$doubleKill + */ + private boolean doubleKill = true; + public static final String Key$doubleKill = Key + ".double-kill"; + + /** + * whether to enable Jvm monitor + * + * @see #Key$monitorJvm + */ + private boolean monitorJvm = true; + public static final String Key$monitorJvm = Key + ".monitor-jvm"; + + /** + * whether to enable Log monitor + * + * @see #Key$monitorLog + */ + private boolean monitorLog = true; + public static final String Key$monitorLog = Key + ".monitor-log"; + + + /** + * Start as standalone at devtool to reduce cluster impact + * see hazelcast-simulator + * + * @see #Key$hazelcastStandalone + */ + private boolean hazelcastStandalone = false; + public static final String Key$hazelcastStandalone = Key + ".hazelcast-standalone"; + + + /** + * whether to enable cookie customization + * + * @see #Key$cookie + */ + private boolean cookie = false; + public static final String Key$cookie = Key + ".cookie"; + + /** + * whether to enable Interceptor of debounce + * + * @see #Key$debounce + */ + private boolean debounce = true; + public static final String Key$debounce = Key + ".debounce"; + + /** + * whether to enable domain-extend + * + * @see #Key$domainx + */ + private boolean domainx = false; + public static final String Key$domainx = Key + ".domainx"; + + /** + * whether to enable Interceptor of FirstBlood + * + * @see #Key$firstBlood + */ + private boolean firstBlood = false; + public static final String Key$firstBlood = Key + ".first-blood"; + + /** + * whether to enable image captcha Interceptor of FirstBlood + * + * @see #Key$firstBloodImage + */ + private boolean firstBloodImage = true; + public static final String Key$firstBloodImage = Key + ".first-blood-image"; + + /** + * whether to enable webmvc date/time converter of Wings + * + * @see #Key$jacksonDatetime + */ + private boolean jacksonDatetime = true; + public static final String Key$jacksonDatetime = Key + ".jackson-datetime"; + + /** + * whether to enable webmvc empty converter of Wings + * + * @see #Key$jacksonEmpty + */ + private boolean jacksonEmpty = true; + public static final String Key$jacksonEmpty = Key + ".jackson-empty"; + + /** + * whether to enable the Jackson precision limit of wings for Double, Float, BigDecimal + * + * @see #Key$jacksonNumber + */ + private boolean jacksonNumber = true; + public static final String Key$jacksonNumber = Key + ".jackson-number"; + + /** + * whether to enable serialization of the resource into a readable URL with Wings' Jackson config + * + * @see #Key$jacksonResource + */ + private boolean jacksonResource = true; + public static final String Key$jacksonResource = Key + ".jackson-resource"; + + /** + * whether to enable webmvc result converter of Wings + * + * @see #Key$jacksonResult + */ + private boolean jacksonResult = true; + public static final String Key$jacksonResult = Key + ".jackson-result"; + + /** + * whether to enable PageQuery webmvc resolver of Wings + * + * @see #Key$pagequery + */ + private boolean pagequery = true; + public static final String Key$pagequery = Key + ".pagequery"; + + /** + * whether to enable reuse stream filter + * + * @see #Key$restream + */ + private boolean restream = true; + public static final String Key$restream = Key + ".restream"; + + + /** + * whether to prevent forgery editing + * + * @see #Key$righter + */ + private boolean righter = true; + public static final String Key$righter = Key + ".righter"; + + /** + * whether to enable wings session customization + * + * @see #Key$session + */ + private boolean session = true; + public static final String Key$session = Key + ".session"; + + /** + * whether to enable swagger config + * + * @see #Key$swagger + */ + private boolean swagger = true; + public static final String Key$swagger = Key + ".swagger"; + + /** + * whether to enable WingsTerminalContext + * + * @see #Key$terminal + */ + private boolean terminal = true; + public static final String Key$terminal = Key + ".terminal"; +} diff --git a/wings/slardar/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/slardar/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 957344b81..1c35455be 100644 --- a/wings/slardar/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/wings/slardar/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1,48 +1,97 @@ { + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarAsyncAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration.applicationTaskExecutor", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration.slardarHeavyScheduler", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration.taskExecutor", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration.taskScheduler", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarAsyncConfiguration.taskSchedulerHelper", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarCacheAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCacheConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCacheConfiguration$CacheAop", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCacheConfiguration$CacheMgr", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarCacheConfiguration.cache2kCacheManager", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.conf.SlardarAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.localDateStringConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.localDateTimeStringConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.localTimeStringConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.offsetDateTimeStringConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.stringLocalDateConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.stringLocalDateTimeConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.stringLocalTimeConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.stringOffsetDateTimeConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.stringZonedDateTimeConverter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDateTimeConfiguration.zonedDateTimeStringConverter", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDingNoticeConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDingNoticeConfiguration.dingTalkNotice", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDoubleKillConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.double-kill for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarDoubleKillConfiguration.doubleKillAround", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarEventConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarEventConfiguration.attributeEventListener", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarEventConfiguration.eventPublishHelperRunner", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarEventConfiguration.slardarEventExecutor", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarI18nConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarI18nConfiguration.autoDtoHelperRunner", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarI18nConfiguration.localValidatorFactoryBean", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration.emptyValuePropertyFilter", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration.i18nResultPropertyFilter", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration$LogMonitor", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.monitor-log for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration.dingTalkReport", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration.jvmMonitor", "type": "java.lang.Boolean", "description": "wings.enabled.slardar.monitor-jvm for short."}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarJacksonConfiguration.monitorTask", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration.okhttpClient", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration.okhttpClientBuilder", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration.okhttpConnectionPool", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration.okhttpHelperRunner", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration.okhttpHostCookieJar", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarOkhttpConfiguration.okhttpRedirectNopInterceptor", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarTweakConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarTweakConfiguration.okhttpTweakLogInterceptor", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.slardar.spring.bean.SlardarTweakConfiguration.tweakEventListener", "type": "java.lang.Boolean"} + ], "hints": [ { "name": "wings.slardar.cache.primary", "values": [ - { - "value": "Memory", - "description": "jvm cache, cache2k by default." - }, - { - "value": "Server", - "description": "server/distributed cache, hazelcast by default." - } + {"value": "Memory", "description": "jvm cache, cache2k by default."}, + {"value": "Server", "description": "server/distributed cache, hazelcast by default."} ] }, { "name": "wings.slardar.cache.level.keys", "values": [ - { - "value": "program", - "description": "program level caching, ttl available in app running." - }, - { - "value": "general", - "description": "general level 24 hours." - }, - { - "value": "service", - "description": "service level 1 hour." - }, - { - "value": "session", - "description": "session, 10 minutes." - } + {"value": "program", "description": "program level caching, ttl available in app running."}, + {"value": "general", "description": "general level 24 hours."}, + {"value": "service", "description": "service level 1 hour."}, + {"value": "session", "description": "session, 10 minutes."} ] }, { "name": "wings.slardar.cache.level.values", "providers": [ - { - "name": "handle-as", - "parameters": { - "target": "pro.fessional.wings.slardar.spring.prop.SlardarCacheProp$Conf" - } - } + {"name": "handle-as", "parameters": {"target": "pro.fessional.wings.slardar.spring.prop.SlardarCacheProp$Conf"}} ] } ] diff --git a/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties b/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties deleted file mode 100644 index 0d6f8159d..000000000 --- a/wings/slardar/src/main/resources/wings-conf/spring-wings-enabled-79.properties +++ /dev/null @@ -1,76 +0,0 @@ -## whether to enable auto-config -spring.wings.slardar.enabled.autoconf=true -## whether to enable jackson default config -spring.wings.slardar.enabled.jackson=true -## whether to enable okhttp3 default config -spring.wings.slardar.enabled.okhttp=true -## whether to enable cache config -spring.wings.slardar.enabled.caching=true -## whether to enable cache enhancement of aop -spring.wings.slardar.enabled.caching-aop=true -## whether to enable cookie customization -spring.wings.slardar.enabled.cookie=false -## whether to enable session default config -spring.wings.slardar.enabled.session=true -## whether to enable session hazelcast config -spring.wings.slardar.enabled.session-hazelcast=true -## whether to enable spring Async and thread pool -spring.wings.slardar.enabled.async=true -## whether to enable slardar event utils -spring.wings.slardar.enabled.event=true -## whether to prevent forgery editing -spring.wings.slardar.enabled.righter=true -## whether to enable Interceptor of debounce -spring.wings.slardar.enabled.debounce=true -## whether to enable reuse stream filter -spring.wings.slardar.enabled.restream=true -## whether to enable Interceptor of FirstBlood -spring.wings.slardar.enabled.first-blood=true -## whether to enable image captcha Interceptor of FirstBlood -spring.wings.slardar.enabled.first-blood-image=true -## whether to enable DoubleKill default AOP -spring.wings.slardar.enabled.double-kill=true -## whether to enable PageQuery webmvc resolver of Wings -spring.wings.slardar.enabled.pagequery=true -## whether to enable webmvc localdatetime converter of Wings -spring.wings.slardar.enabled.datetime=true -## whether to enable the Jackson precision limit of wings for Double, Float, BigDecimal -spring.wings.slardar.enabled.number=true -## whether to enable serialization of the resource into a readable URL with Wings' Jackson config -spring.wings.slardar.enabled.resource=true - -## whether to disable "undertow ws for UT026010: Buffer pool" -spring.wings.slardar.enabled.undertow-ws=true -## whether to enable remote Resolver -spring.wings.slardar.enabled.remote=true -## whether to enable i18n Resolver -spring.wings.slardar.enabled.locale=true -## whether to enable WingsTerminalContext -spring.wings.slardar.enabled.terminal=true -## whether to enable captcha config -spring.wings.slardar.enabled.captcha=false -## whether to enable overload filter -spring.wings.slardar.enabled.overload=false - -## whether to enable domain-extend -spring.wings.slardar.enabled.domain-extend=false - -## whether to enable swagger config -spring.wings.slardar.enabled.swagger=true - -## Start as standalone at devtool to reduce cluster impact -## see https://github.com/hazelcast/hazelcast-simulator/blob/master/README.md -spring.wings.slardar.enabled.hazelcast-simulator=false - -## whether to enable monitor -spring.wings.slardar.enabled.monitor=true -## whether to enable Jvm monitor -spring.wings.slardar.enabled.monitor-jvm=true -## whether to enable Log monitor -spring.wings.slardar.enabled.monitor-log=true - -## whether to enable SpringBootAdmin config -spring.wings.slardar.enabled.boot-admin=true - -## whether to enable dynamic tweaking -spring.wings.slardar.enabled.tweaking=true diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/WarlockDatabase.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/WarlockDatabase.java new file mode 100644 index 000000000..4120dda59 --- /dev/null +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/WarlockDatabase.java @@ -0,0 +1,8 @@ +package pro.fessional.wings.warlock.database; + +/** + * @author trydofor + * @since 2023-11-22 + */ +public interface WarlockDatabase { +} diff --git a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java index 4ccda2b13..d5f173e89 100644 --- a/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java +++ b/wings/warlock-awesome/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAwesomeConfiguration.java @@ -15,7 +15,7 @@ import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.serialize.JsonConversion; import pro.fessional.wings.slardar.serialize.KryoConversion; -import pro.fessional.wings.warlock.database.autogen.tables.daos.SysConstantEnumDao; +import pro.fessional.wings.warlock.database.WarlockDatabase; import pro.fessional.wings.warlock.service.conf.RuntimeConfService; import pro.fessional.wings.warlock.service.conf.impl.RuntimeConfServiceImpl; @@ -32,24 +32,13 @@ public class WarlockAwesomeConfiguration { @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled - @ComponentScan(basePackageClasses = SysConstantEnumDao.class) + @ComponentScan(basePackageClasses = WarlockDatabase.class) public static class JooqDaoScan { public JooqDaoScan() { log.info("Warlock spring-scan SysConstantEnumDao"); } } - @Bean - @ConditionalWingsEnabled - public RuntimeConfService runtimeConfService(ObjectProvider conversionProvider) { - log.info("Warlock spring-bean runtimeConfService"); - final RuntimeConfServiceImpl bean = new RuntimeConfServiceImpl(); - conversionProvider.ifAvailable(it -> bean.addHandler(RuntimeConfServiceImpl.PropHandler, it)); - bean.addHandler(RuntimeConfServiceImpl.JsonHandler, new JsonConversion()); - bean.addHandler(RuntimeConfServiceImpl.KryoHandler, new KryoConversion()); - return bean; - } - /** * Database values override project config */ @@ -66,15 +55,19 @@ public CommandLineRunnerOrdered registerRuntimeModeRunner(ObjectProvider bean.addHandler(RuntimeConfServiceImpl.PropHandler, it)); + bean.addHandler(RuntimeConfServiceImpl.JsonHandler, new JsonConversion()); + bean.addHandler(RuntimeConfServiceImpl.KryoHandler, new KryoConversion()); + return bean; + } } diff --git a/wings/warlock-awesome/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/warlock-awesome/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..cbd5ec17e --- /dev/null +++ b/wings/warlock-awesome/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,15 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf.WarlockAwesomeAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockAwesomeConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockAwesomeConfiguration$JooqDaoScan", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockAwesomeConfiguration.registerRuntimeModeRunner", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockAwesomeConfiguration.runtimeConfService", "type": "java.lang.Boolean"} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminAuthnController.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminAuthnController.java index d8d685400..3bb020863 100644 --- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminAuthnController.java +++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminAuthnController.java @@ -5,12 +5,12 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.data.R; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.security.WingsAuthTypeParser; import pro.fessional.wings.warlock.service.user.WarlockUserAuthnService; import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; @@ -23,8 +23,8 @@ * @since 2022-10-31 */ @RestController +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$mvcAuth) @Slf4j -@ConditionalOnProperty(name = WarlockEnabledProp.Key$controllerAuth, havingValue = "true") public class AdminAuthnController { @Setter(onMethod_ = {@Autowired}) diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java index dab34b6f7..3db7d7f7b 100644 --- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java +++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockBondBeanConfiguration.java @@ -3,7 +3,6 @@ import jakarta.annotation.PostConstruct; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; @@ -34,7 +33,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(WarlockDangerProp.class) public class WarlockBondBeanConfiguration { private final static Log log = LogFactory.getLog(WarlockBondBeanConfiguration.class); diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java index 025df47e2..c063da6bc 100644 --- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java +++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockBondAutoConfiguration.java @@ -10,7 +10,7 @@ * @author trydofor * @since 2019-12-01 */ -@AutoConfiguration(before = WarlockSecurityAutoConfiguration.class) +@AutoConfiguration @ConditionalWingsEnabled @Import(WarlockBondBeanConfiguration.class) public class WarlockBondAutoConfiguration { diff --git a/wings/warlock-bond/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/warlock-bond/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..66ec30098 --- /dev/null +++ b/wings/warlock-bond/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,25 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf.WarlockBondAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.autoRegisterCacheConst", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.defaultDaoAuthnCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockDangerService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockGrantService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockPermService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockPermServiceCaching", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockRoleService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockRoleServiceCaching", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockUserAuthnService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockUserBasisService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockBondBeanConfiguration.warlockUserLoginService", "type": "java.lang.Boolean"}, + + {"name": "pro.fessional.wings.warlock.controller.admin.AdminAuthnController", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.mvc-auth for short."} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/warlock-codegen/src/main/java/pro/fessional/wings/warlock/project/Warlock1SchemaManager.java b/wings/warlock-codegen/src/main/java/pro/fessional/wings/warlock/project/Warlock1SchemaManager.java index 6630447b5..af931f907 100644 --- a/wings/warlock-codegen/src/main/java/pro/fessional/wings/warlock/project/Warlock1SchemaManager.java +++ b/wings/warlock-codegen/src/main/java/pro/fessional/wings/warlock/project/Warlock1SchemaManager.java @@ -9,7 +9,7 @@ /** * Provides a convenient version management of common scenarios. - * spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true + * wings.enabled.faceless.flywave=true * * @author trydofor * @since 2021-02-20 diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminTweakController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminTweakController.java index 7b320b07b..abde7a586 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminTweakController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/admin/AdminTweakController.java @@ -10,6 +10,7 @@ import pro.fessional.wings.slardar.event.tweak.TweakClockEvent; import pro.fessional.wings.slardar.event.tweak.TweakLoggerEvent; import pro.fessional.wings.slardar.event.tweak.TweakStackEvent; +import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp; import static pro.fessional.wings.slardar.event.EventPublishHelper.SyncSpring; @@ -19,7 +20,7 @@ * @since 2022-10-31 */ @RestController -@ConditionalWingsEnabled(false) +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$mvcTweak, value = false) public class AdminTweakController { @Operation(summary = "Tweak the logging level at the thread level", description = """ diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java index 0c5ab3afa..38a20b920 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginPageController.java @@ -7,7 +7,6 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; @@ -21,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.data.Null; import pro.fessional.mirana.data.R; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.security.WingsAuthHelper; import pro.fessional.wings.slardar.security.WingsAuthPageHandler; import pro.fessional.wings.slardar.security.WingsAuthTypeParser; @@ -38,9 +38,9 @@ * @since 2021-02-16 */ @RestController +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$mvcLogin) @RequiredArgsConstructor @Slf4j -@ConditionalOnProperty(name = WarlockEnabledProp.Key$controllerAuth, havingValue = "true") public class LoginPageController { private final WingsAuthPageHandler wingsAuthPageHandler; diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginProcController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginProcController.java index 143adf928..50837e900 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginProcController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/LoginProcController.java @@ -3,13 +3,13 @@ import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.data.R; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.security.WingsAuthHelper; import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; import pro.fessional.wings.warlock.spring.prop.WarlockSecurityProp; @@ -19,9 +19,9 @@ * @since 2021-02-16 */ @RestController +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$mvcProc) @RequiredArgsConstructor @Slf4j -@ConditionalOnProperty(name = WarlockEnabledProp.Key$controllerProc, havingValue = "true") public class LoginProcController { @Operation(summary = "Logout entry, handled by filter, used for document only", description = """ diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/SimpleOauthController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/SimpleOauthController.java index 16b681849..1b246f382 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/SimpleOauthController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/auth/SimpleOauthController.java @@ -6,13 +6,13 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.servlet.response.ResponseHelper; import pro.fessional.wings.warlock.service.auth.WarlockOauthService; import pro.fessional.wings.warlock.service.auth.WarlockOauthService.OAuth; @@ -27,9 +27,9 @@ * @author trydofor * @since 2022-11-04 */ -@Slf4j @Controller -@ConditionalOnProperty(name = WarlockEnabledProp.Key$controllerOauth, havingValue = "true") +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$mvcOauth) +@Slf4j public class SimpleOauthController { @Setter(onMethod_ = {@Autowired}) diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/mock/MockSampleController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/mock/MockSampleController.java index e252325b5..fa8b80527 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/mock/MockSampleController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/mock/MockSampleController.java @@ -5,7 +5,6 @@ import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -14,6 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.data.R; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.concur.DoubleKill; import pro.fessional.wings.slardar.concur.FirstBlood; import pro.fessional.wings.slardar.concur.Righter; @@ -30,9 +30,9 @@ * @since 2021-10-19 */ @RestController +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$mvcMock) @RequiredArgsConstructor @Slf4j -@ConditionalOnProperty(name = WarlockEnabledProp.Key$controllerMock, havingValue = "true") public class MockSampleController { @Operation(summary = "Get captcha image, handle by interceptor", description = """ diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/test/TestEnvsController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/test/TestEnvsController.java index 25cebd776..dea80c3c3 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/test/TestEnvsController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/test/TestEnvsController.java @@ -1,7 +1,6 @@ package pro.fessional.wings.warlock.controller.test; import io.swagger.v3.oas.annotations.Operation; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @@ -9,6 +8,7 @@ import pro.fessional.mirana.data.R; import pro.fessional.wings.silencer.modulate.RunMode; import pro.fessional.wings.silencer.modulate.RuntimeMode; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.context.Now; import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp; @@ -18,7 +18,7 @@ * @since 2022-07-22 */ @RestController -@ConditionalOnProperty(name = WarlockEnabledProp.Key$controllerTest, havingValue = "true") +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$mvcTest) public class TestEnvsController { @Operation(summary = "Get RunMode", description = """ diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java index a0a19625c..b83101c61 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java @@ -10,13 +10,13 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.security.core.context.SecurityContext; import org.springframework.session.MapSession; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import pro.fessional.mirana.data.R; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.context.SecurityContextUtil; import pro.fessional.wings.slardar.security.WingsUserDetails; import pro.fessional.wings.slardar.session.SessionTokenEncoder; @@ -42,9 +42,9 @@ */ // @PreAuthorize("isAuthenticated()") @RestController +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$mvcUser) @RequiredArgsConstructor @Slf4j -@ConditionalOnProperty(name = WarlockEnabledProp.Key$controllerUser, havingValue = "true") public class AuthedUserController { @Setter(onMethod_ = {@Autowired}) diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java index 8a0e57a83..a5b9aaf7d 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockExceptionConfiguration.java @@ -3,16 +3,13 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.HandlerExceptionResolver; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.errorhandle.DefaultExceptionResolver; -import pro.fessional.wings.warlock.spring.prop.WarlockApiAuthProp; import pro.fessional.wings.warlock.spring.prop.WarlockErrorProp; -import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp; /** @@ -21,7 +18,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties({WarlockApiAuthProp.class, WarlockUrlmapProp.class, WarlockErrorProp.class}) public class WarlockExceptionConfiguration { diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfiguration.java index 511f7f0e2..e87ffb8e7 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalConfiguration.java @@ -4,7 +4,6 @@ import org.apache.commons.logging.LogFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; import pro.fessional.wings.faceless.database.manual.single.modify.commitjournal.CommitJournalModify; import pro.fessional.wings.faceless.service.lightid.BlockIdProvider; import pro.fessional.wings.faceless.service.lightid.LightIdService; @@ -21,8 +20,10 @@ public class WarlockJournalConfiguration { private static final Log log = LogFactory.getLog(WarlockJournalConfiguration.class); + /** + * terminal journal instead of the simple + */ @Bean - @Primary @ConditionalWingsEnabled public TerminalJournalService terminalJournalService( @SuppressWarnings("all") LightIdService lightIdService, diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJustAuthConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJustAuthConfiguration.java index 0195ab591..e3eacfde9 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJustAuthConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockJustAuthConfiguration.java @@ -5,7 +5,6 @@ import me.zhyd.oauth.config.AuthConfig; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.util.StringUtils; @@ -35,7 +34,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(WarlockJustAuthProp.class) public class WarlockJustAuthConfiguration { private final static Log log = LogFactory.getLog(WarlockJustAuthConfiguration.class); diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOauthTicketConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOauthTicketConfiguration.java index 1e532e0e4..0e8b047aa 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOauthTicketConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockOauthTicketConfiguration.java @@ -2,7 +2,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.mirana.code.RandCode; @@ -24,11 +23,21 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(WarlockTicketProp.class) public class WarlockOauthTicketConfiguration { private final static Log log = LogFactory.getLog(WarlockOauthTicketConfiguration.class); + @Bean + @ConditionalWingsEnabled + public WarlockOauthService warlockOauthService(WarlockTicketProp warlockTicketProp) { + log.info("WarlockShadow spring-bean warlockOauthService"); + WarlockOauthServiceImpl bean = new WarlockOauthServiceImpl(); + bean.setAuthCodeTtl(warlockTicketProp.getCodeTtl()); + bean.setAccessTokenTtl(warlockTicketProp.getTokenTtl()); + + return bean; + } + @Bean @ConditionalWingsEnabled public WarlockTicketService warlockTicketService(WarlockTicketProp warlockTicketProp, SecretProvider secretProvider) { @@ -58,15 +67,4 @@ public WarlockTicketService warlockTicketService(WarlockTicketProp warlockTicket } return bean; } - - @Bean - @ConditionalWingsEnabled - public WarlockOauthService warlockOauthService(WarlockTicketProp warlockTicketProp) { - log.info("WarlockShadow spring-bean warlockOauthService"); - WarlockOauthServiceImpl bean = new WarlockOauthServiceImpl(); - bean.setAuthCodeTtl(warlockTicketProp.getCodeTtl()); - bean.setAccessTokenTtl(warlockTicketProp.getTokenTtl()); - - return bean; - } } diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java index e033258ea..1a7c5ee26 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java @@ -5,8 +5,6 @@ import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cache.CacheManager; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; @@ -57,7 +55,6 @@ import pro.fessional.wings.warlock.service.auth.impl.DefaultUserDetailsCombo; import pro.fessional.wings.warlock.service.auth.impl.MemoryTypedAuthzCombo; import pro.fessional.wings.warlock.service.perm.WarlockPermNormalizer; -import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; import pro.fessional.wings.warlock.spring.prop.WarlockJustAuthProp; import pro.fessional.wings.warlock.spring.prop.WarlockSecurityProp; import pro.fessional.wings.warlock.spring.prop.WarlockSecurityProp.Ma; @@ -79,7 +76,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties(WarlockSecurityProp.class) public class WarlockSecurityBeanConfiguration { private final static Log log = LogFactory.getLog(WarlockSecurityBeanConfiguration.class); @@ -184,9 +180,7 @@ public DefaultUserDetailsCombo defaultUserDetailsCombo(WarlockSecurityProp prop) } @Bean - @ConditionalOnExpression("${" + WarlockEnabledProp.Key$justAuth + ":false} " - + " && ${" + WarlockEnabledProp.Key$comboJustAuthAutoreg + ":false}") - @ConditionalWingsEnabled + @ConditionalWingsEnabled(and = WarlockJustAuthConfiguration.class) public JustAuthUserAuthnAutoReg justAuthUserAuthnAutoReg() { log.info("WarlockShadow spring-bean justAuthUserAuthnAutoReg"); final JustAuthUserAuthnAutoReg bean = new JustAuthUserAuthnAutoReg(); @@ -287,9 +281,7 @@ public ComboWingsAuthCheckService comboWingsAuthCheckService(ObjectProvider httpFirewall, ObjectProvider mvcMatcher) { + @ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$secWebAuto) + public WebSecurityCustomizer warlockWebCustomizer(WarlockSecurityProp securityProp, ObjectProvider httpFirewall, ObjectProvider mvcMatcher) { log.info("WarlockShadow spring-bean warlockWebCustomizer"); - MvcRequestMatcher.Builder mvc = mvcMatcher.getIfAvailable(); return web -> { if (securityProp.isWebDebug()) { log.info("WarlockShadow conf WebSecurity, WebDebug=true"); @@ -72,6 +64,7 @@ public WebSecurityCustomizer warlockWebCustomizer(ObjectProvider h if (!webIgnore.isEmpty()) { final Set ignores = CommonPropHelper.onlyValue(webIgnore.values()); log.info("WarlockShadow conf WebSecurity, ignoring=" + String.join("\n,", ignores)); + MvcRequestMatcher.Builder mvc = mvcMatcher.getIfAvailable(); web.ignoring().requestMatchers(SecurityConfigHelper.requestMatchers(mvc, ignores)); } @@ -84,10 +77,11 @@ public WebSecurityCustomizer warlockWebCustomizer(ObjectProvider h } @Bean - @ConditionalWingsEnabled - @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityHttpBind, havingValue = "true") + @ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$secHttpBind) @Order(WingsOrdered.Lv4Application + 200) public HttpSecurityCustomizer warlockSecurityBindHttpConfigure( + WarlockSecurityProp securityProp, + SessionRegistry sessionRegistry, ObjectProvider authenticationSuccessHandler, ObjectProvider authenticationFailureHandler, ObjectProvider> wingsAuthDetailsSource, @@ -146,7 +140,7 @@ public HttpSecurityCustomizer warlockSecurityBindHttpConfigure( ); final AccessDeniedHandler deniedHandler = accessDeniedHandler.getIfAvailable(); - if(deniedHandler != null){ + if (deniedHandler != null) { log.info("WarlockShadow conf exceptionHandling, accessDeniedHandler=" + deniedHandler.getClass()); http.exceptionHandling().accessDeniedHandler(deniedHandler); } @@ -154,10 +148,9 @@ public HttpSecurityCustomizer warlockSecurityBindHttpConfigure( } @Bean - @ConditionalWingsEnabled - @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityHttpAuth, havingValue = "true") + @ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$secHttpAuth) @Order(WingsOrdered.Lv4Application + 300) - public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(ObjectProvider mvcMatcher) { + public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(WarlockSecurityProp securityProp, ObjectProvider mvcMatcher) { log.info("WarlockShadow spring-bean warlockSecurityAuthHttpConfigure"); MvcRequestMatcher.Builder mvc = mvcMatcher.getIfAvailable(); return http -> { @@ -201,8 +194,7 @@ public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(ObjectProvider csrf, @@ -262,10 +253,9 @@ public HttpSecurityCustomizer warlockSecurityAutoHttpConfigure( * only non-API resources in the WebSecurityConfigurer above. */ @Bean - @ConditionalWingsEnabled - @ConditionalOnProperty(name = WarlockEnabledProp.Key$securityHttpChain, havingValue = "true") + @ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$secHttpChain) @Order(WingsOrdered.Lv4Application + 900) - public SecurityFilterChain securityFilterChain(HttpSecurity http, Map configures) throws Exception { + public SecurityFilterChain securityFilterChain(WarlockSecurityProp securityProp, HttpSecurity http, Map configures) throws Exception { log.info("WarlockShadow conf securityFilterChain, begin"); for (Map.Entry en : configures.entrySet()) { log.info("WarlockShadow conf securityFilterChain, bean=" + en.getKey()); diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityDummyConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityDummyConfiguration.java index be69bbcb0..883c4487e 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityDummyConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityDummyConfiguration.java @@ -18,6 +18,7 @@ import pro.fessional.wings.warlock.service.user.impl.WarlockUserAuthnServiceDummy; import pro.fessional.wings.warlock.service.user.impl.WarlockUserBasisServiceDummy; import pro.fessional.wings.warlock.service.user.impl.WarlockUserLoginServiceDummy; +import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; /** @@ -25,7 +26,7 @@ * @since 2019-12-01 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$dummyService, value = false) public class WarlockSecurityDummyConfiguration { private final static Log log = LogFactory.getLog(WarlockSecurityDummyConfiguration.class); diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java index d530d266a..c406bf91f 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatching2Configuration.java @@ -3,12 +3,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.webmvc.SlowResponseInterceptor; -import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; import pro.fessional.wings.warlock.spring.prop.WarlockWatchingProp; @@ -18,7 +16,6 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@ConditionalOnProperty(name = WarlockEnabledProp.Key$watching, havingValue = "true") public class WarlockWatching2Configuration { private final static Log log = LogFactory.getLog(WarlockWatching2Configuration.class); diff --git a/wings/warlock-shadow/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/warlock-shadow/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..3c0d4bf18 --- /dev/null +++ b/wings/warlock-shadow/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,91 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf.WarlockShadowAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockExceptionConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockExceptionConfiguration.defaultExceptionResolver", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJournalConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJournalConfiguration.terminalJournalService", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJustAuthConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJustAuthConfiguration.authStateCache", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJustAuthConfiguration.justAuthRequestBuilder", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJustAuthConfiguration.justAuthRequestSuccessHandler", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockOauthTicketConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockOauthTicketConfiguration.warlockOauthService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockOauthTicketConfiguration.warlockTicketService", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockOtherBeanConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockOtherBeanConfiguration$BindingErrorScan", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockOtherBeanConfiguration$MvcRestScan", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockOtherBeanConfiguration.righterSecretProvider", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockWatching2Configuration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockWatching2Configuration.slowResponseInterceptor", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf.WarlockSecurityAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.accessDeniedHandler", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.authAppPermChecker", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.authenticationEventPublisher", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.authStateBuilder", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.authZonePermChecker", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.comboWarlockAuthnService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.comboWarlockAuthzService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.comboWingsAuthCheckService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.defaultPermRoleCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.defaultUserAuthnAutoReg", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.defaultUserDetailsCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.grantedAuthorityDefaults", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.justAuthLoginPageCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.justAuthUserAuthnAutoReg", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.justAuthUserDetailsCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.listAllLoginPageCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.loginFailureHandler", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.loginFailureHandlerDefault", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.loginSuccessHandler", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.logoutSuccessHandler", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.memoryTypedAuthzCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.memoryUserDetailsCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.nonceUserDetailsCombo", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.warlockFailedLoginListener", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.warlockPermNormalizer", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.warlockSuccessLoginListener", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.wingsAuthDetailsSource", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.wingsAuthPageHandler", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.wingsAuthTypeParser", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityBeanConfiguration.wingsUserDetailsService", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration.securityFilterChain", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.sec-http-chain for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration.warlockSecurityAuthHttpConfigure", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.sec-http-auth for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration.warlockSecurityAutoHttpConfigure", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.sec-http-auto for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration.warlockSecurityBindHttpConfigure", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.sec-http-bind for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration.warlockSecurityHttpBaseConfigure", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.sec-http-base for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityConfConfiguration.warlockWebCustomizer", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.sec-web-auto for short."}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityDummyConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.dummy-service for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityDummyConfiguration.warlockGrantService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityDummyConfiguration.warlockPermService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityDummyConfiguration.warlockRoleService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityDummyConfiguration.warlockUserAuthnService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityDummyConfiguration.warlockUserBasisService", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockSecurityDummyConfiguration.warlockUserLoginService", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.controller.admin.AdminTweakController", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.mvc-tweak for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.controller.auth.LoginPageController", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.mvc-login for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.controller.auth.LoginProcController", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.mvc-proc for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.controller.auth.SimpleOauthController", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.mvc-oauth for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.controller.mock.MockSampleController", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.mvc-mock for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.controller.test.TestEnvsController", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.mvc-test for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.controller.user.AuthedUserController", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.mvc-user for short."} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/warlock-shadow/src/main/resources/wings-conf/wings-enabled-79.properties b/wings/warlock-shadow/src/main/resources/wings-conf/wings-enabled-79.properties new file mode 100644 index 000000000..792be2e33 --- /dev/null +++ b/wings/warlock-shadow/src/main/resources/wings-conf/wings-enabled-79.properties @@ -0,0 +1,5 @@ +## override simple +## terminal journal instead of the simple +wings.enabled.faceless.simple-journal=false +## hazelcast flakeid instead of the simple +wings.enabled.faceless.simple-flakeid=false \ No newline at end of file diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/ApiAuthControllerTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/ApiAuthControllerTest.java index a4483b5e7..0f866f689 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/ApiAuthControllerTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/controller/api/ApiAuthControllerTest.java @@ -22,8 +22,8 @@ import pro.fessional.mirana.text.FormatUtil; import pro.fessional.wings.slardar.context.Now; import pro.fessional.wings.slardar.httprest.okhttp.OkHttpClientHelper; -import pro.fessional.wings.warlock.service.auth.WarlockOauthService; import pro.fessional.wings.warlock.app.service.WatchingService; +import pro.fessional.wings.warlock.service.auth.WarlockOauthService; import pro.fessional.wings.warlock.spring.prop.WarlockApiAuthProp; import pro.fessional.wings.warlock.spring.prop.WarlockUrlmapProp; @@ -59,6 +59,7 @@ webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { "wings.warlock.apiauth.must-signature=false", + "wings.enabled.slardar.restream=false", }) @Slf4j class ApiAuthControllerTest { diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalDisableTest.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalDisableTest.java index cb84281f1..488959f80 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalDisableTest.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/spring/bean/WarlockJournalDisableTest.java @@ -13,7 +13,10 @@ * @author trydofor * @since 2023-01-25 */ -@SpringBootTest(properties = "spring.wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJournalConfiguration.terminalJournalService=false") +@SpringBootTest(properties = { + "wings.enabled.faceless.simple-journal=true", + "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockJournalConfiguration.terminalJournalService=false" +}) class WarlockJournalDisableTest { @Setter(onMethod_ = {@Autowired}) diff --git a/wings/warlock-shadow/src/test/resources/application.properties b/wings/warlock-shadow/src/test/resources/application.properties index 9b1c55a43..06b35104b 100644 --- a/wings/warlock-shadow/src/test/resources/application.properties +++ b/wings/warlock-shadow/src/test/resources/application.properties @@ -7,3 +7,5 @@ wings.warlock.ticket.client[wings-trydofor].hosts=localhost wings.warlock.ticket.client[wings-trydofor].scopes=api1, api2 logging.level.org.springframework.web=DEBUG logging.level.root=DEBUG + +wings.enabled.warlock.dummy-service=true \ No newline at end of file diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java index fa33d3d6c..e1f8733fa 100644 --- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java +++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockAutoRunConfiguration.java @@ -3,7 +3,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.faceless.database.helper.DatabaseChecker; @@ -16,7 +15,6 @@ import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.spring.prop.WarlockCheckProp; -import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; import pro.fessional.wings.warlock.spring.prop.WarlockI18nProp; import javax.sql.DataSource; @@ -27,11 +25,23 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalWingsEnabled -@EnableConfigurationProperties({WarlockEnabledProp.class, WarlockCheckProp.class, WarlockI18nProp.class}) public class WarlockAutoRunConfiguration { private final static Log log = LogFactory.getLog(WarlockAutoRunConfiguration.class); + /** + * check database version and timezone + */ + @Bean + @ConditionalWingsEnabled + public CommandLineRunnerOrdered databaseCheckerRunner(DataSource dataSource, WarlockCheckProp prop) { + log.info("Warlock spring-runs databaseCheckerRunner"); + return new CommandLineRunnerOrdered(WingsOrdered.Lv2Resource, ignored -> { + DatabaseChecker.version(dataSource); + DatabaseChecker.timezone(dataSource, prop.getTzOffset(), prop.isTzFail()); + }); + } + @Bean @ConditionalWingsEnabled public ApplicationStartedEventRunner registerEnumUtilRunner(ObjectProvider provider) { @@ -66,14 +76,4 @@ public ApplicationStartedEventRunner registerEnumUtilRunner(ObjectProvider { - DatabaseChecker.version(dataSource); - DatabaseChecker.timezone(dataSource, prop.getTzOffset(), prop.isTzFail()); - }); - } } diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java index 6ab55e4c8..61cbced21 100644 --- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java +++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockLockBeanConfiguration.java @@ -22,15 +22,15 @@ public class WarlockLockBeanConfiguration { @Bean @ConditionalWingsEnabled - public JvmStaticGlobalLock jvmStaticGlobalLock() { - log.info("Warlock spring-bean jvmStaticGlobalLock"); - return new JvmStaticGlobalLock(); + public DatabaseGlobalLock databaseGlobalLock(JdbcTemplate jdbcTemplate) { + log.info("Warlock spring-bean databaseGlobalLock"); + return new DatabaseGlobalLock(jdbcTemplate); } @Bean @ConditionalWingsEnabled - public DatabaseGlobalLock databaseGlobalLock(JdbcTemplate jdbcTemplate) { - log.info("Warlock spring-bean databaseGlobalLock"); - return new DatabaseGlobalLock(jdbcTemplate); + public JvmStaticGlobalLock jvmStaticGlobalLock() { + log.info("Warlock spring-bean jvmStaticGlobalLock"); + return new JvmStaticGlobalLock(); } } diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java index a6ada683b..148c060c2 100644 --- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java +++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockTableChangeConfiguration.java @@ -6,6 +6,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.faceless.database.WingsTableCudHandler; +import pro.fessional.wings.faceless.spring.bean.FacelessJooqCudConfiguration; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.event.EventPublishHelper; import pro.fessional.wings.warlock.service.event.TableChangePublisher; @@ -18,7 +19,7 @@ * @since 2019-12-01 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled +@ConditionalWingsEnabled(and = FacelessJooqCudConfiguration.CudListenerBean.class) public class WarlockTableChangeConfiguration { private final static Log log = LogFactory.getLog(WarlockTableChangeConfiguration.class); diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java index ca8b5b1fc..5a2659a85 100644 --- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java +++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockWatchingConfiguration.java @@ -5,12 +5,12 @@ import org.jooq.ExecuteListenerProvider; import org.jooq.impl.DefaultExecuteListenerProvider; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; -import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import pro.fessional.wings.faceless.database.jooq.listener.SlowSqlListener; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.watch.WatchingAround; +import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; import pro.fessional.wings.warlock.spring.prop.WarlockWatchingProp; @@ -19,23 +19,11 @@ * @since 2019-12-01 */ @Configuration(proxyBeanMethods = false) -@ConditionalWingsEnabled -@EnableConfigurationProperties(WarlockWatchingProp.class) +@ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$watching, value = false) public class WarlockWatchingConfiguration { private final static Log log = LogFactory.getLog(WarlockWatchingConfiguration.class); - @Bean - @ConditionalWingsEnabled - @ConditionalOnExpression("${" + WarlockWatchingProp.Key$serviceThreshold + ":-1} >=0") - public WatchingAround watchingAround(WarlockWatchingProp prop) { - final long ms = prop.getServiceThreshold(); - log.info("Warlock spring-bean watchingAround, threshold=" + ms); - final WatchingAround bean = new WatchingAround(); - bean.setThresholdMillis(ms); - return bean; - } - @Bean @ConditionalWingsEnabled @ConditionalOnExpression("${" + WarlockWatchingProp.Key$jooqThreshold + ":-1} >=0") @@ -46,4 +34,15 @@ public ExecuteListenerProvider slowSqlJooqListener(WarlockWatchingProp prop) { bean.setThresholdMillis(ms); return new DefaultExecuteListenerProvider(bean); } + + @Bean + @ConditionalWingsEnabled + @ConditionalOnExpression("${" + WarlockWatchingProp.Key$serviceThreshold + ":-1} >=0") + public WatchingAround watchingAround(WarlockWatchingProp prop) { + final long ms = prop.getServiceThreshold(); + log.info("Warlock spring-bean watchingAround, threshold=" + ms); + final WatchingAround bean = new WatchingAround(); + bean.setThresholdMillis(ms); + return bean; + } } diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java index 2d5b3143a..ee3b41dbe 100644 --- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java +++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/conf/WarlockAutoConfiguration.java @@ -1,12 +1,14 @@ package pro.fessional.wings.warlock.spring.conf; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.context.properties.ConfigurationPropertiesScan; import org.springframework.context.annotation.Import; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.spring.bean.WarlockAutoRunConfiguration; import pro.fessional.wings.warlock.spring.bean.WarlockLockBeanConfiguration; import pro.fessional.wings.warlock.spring.bean.WarlockTableChangeConfiguration; import pro.fessional.wings.warlock.spring.bean.WarlockWatchingConfiguration; +import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; /** * @author trydofor @@ -14,6 +16,7 @@ */ @AutoConfiguration @ConditionalWingsEnabled +@ConfigurationPropertiesScan(basePackageClasses = WarlockEnabledProp.class) @Import({ WarlockAutoRunConfiguration.class, WarlockLockBeanConfiguration.class, diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java index f2b2ccacb..b1d180769 100644 --- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java +++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java @@ -2,9 +2,10 @@ import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; +import pro.fessional.wings.silencer.spring.boot.WingsEnabledCondition; /** - * spring-wings-enabled-79.properties + * wings-enabled-79.properties * * @author trydofor * @see #Key @@ -14,271 +15,134 @@ @ConfigurationProperties(WarlockEnabledProp.Key) public class WarlockEnabledProp { - public static final String Key = "spring.wings.warlock.enabled"; + public static final String Key = WingsEnabledCondition.Prefix + ".warlock"; /** - * whether to enable auto config. - * - * @see #Key$autoconf - */ - private boolean autoconf = true; - public static final String Key$autoconf = Key + ".autoconf"; - - /** - * whether to support "warlock security web and http". + * whether to enable timing watching and analysis. * - * @see #Key$securityAuto + * @see #Key$watching */ - private boolean securityAuto = true; - public static final String Key$securityAuto = Key + ".security-auto"; + private boolean watching = false; + public static final String Key$watching = Key + ".watching"; /** * whether to enable Web auto config, eg. firewall, debug, etc. * - * @see #Key$securityWebAutos + * @see #Key$secWebAuto */ - private boolean securityWebAutos = true; - public static final String Key$securityWebAutos = Key + ".security-web-autos"; - - /** - * whether to support "warlock security http wing bind". - * - * @see #Key$securityHttpBind - */ - private boolean securityHttpBind = true; - public static final String Key$securityHttpBind = Key + ".security-http-bind"; + private boolean secWebAuto = true; + public static final String Key$secWebAuto = Key + ".sec-web-auto"; /** * whether to support "warlock security http wing auth". * - * @see #Key$securityHttpAuth - */ - private boolean securityHttpAuth = true; - public static final String Key$securityHttpAuth = Key + ".security-http-auth"; - - /** - * whether to support "warlock security http base auth". - * - * @see #Key$securityHttpBase + * @see #Key$secHttpAuth */ - private boolean securityHttpBase = true; - public static final String Key$securityHttpBase = Key + ".security-http-base"; + private boolean secHttpAuth = true; + public static final String Key$secHttpAuth = Key + ".sec-http-auth"; /** * whether to support "warlock security http auto". * - * @see #Key$securityHttpAuto - */ - private boolean securityHttpAuto = true; - public static final String Key$securityHttpAuto = Key + ".security-http-auto"; - - /** - * whether to support SecurityFilterChain. - * - * @see #Key$securityHttpChain + * @see #Key$secHttpAuto */ - private boolean securityHttpChain = true; - public static final String Key$securityHttpChain = Key + ".security-http-chain"; + private boolean secHttpAuto = true; + public static final String Key$secHttpAuto = Key + ".sec-http-auto"; /** - * whether to support warlock security Bean. - * - * @see #Key$securityBean - */ - private boolean securityBean = true; - public static final String Key$securityBean = Key + ".security-bean"; - - /** - * whether to inject jooq dao. - * - * @see #Key$jooqAutogen - */ - private boolean jooqAutogen = true; - public static final String Key$jooqAutogen = Key + ".jooq-autogen"; - - /** - * whether to inject ListAllLoginPageCombo. - * - * @see #Key$comboListAllLoginPage - */ - private boolean comboListAllLoginPage = true; - public static final String Key$comboListAllLoginPage = Key + ".combo-list-all-login-page"; - - /** - * whether to inject NonceUserDetailsCombo. - * - * @see #Key$comboNonceUserDetails - */ - private boolean comboNonceUserDetails = true; - public static final String Key$comboNonceUserDetails = Key + ".combo-nonce-user-details"; - - /** - * whether to support just auth. - * - * @see #Key$justAuth - */ - private boolean justAuth = true; - public static final String Key$justAuth = Key + ".just-auth"; - - /** - * whether to inject JustAuthLoginPageCombo. - * - * @see #Key$comboJustAuthLoginPage - */ - private boolean comboJustAuthLoginPage = true; - public static final String Key$comboJustAuthLoginPage = Key + ".combo-just-auth-login-page"; - - /** - * whether to inject JustAuthUserDetailsCombo. - * - * @see #Key$comboJustAuthUserDetails - */ - private boolean comboJustAuthUserDetails = true; - public static final String Key$comboJustAuthUserDetails = Key + ".combo-just-auth-user-details"; - - /** - * whether to inject JustAuthUserAuthnAutoReg. - * - * @see #Key$comboJustAuthAutoreg - */ - private boolean comboJustAuthAutoreg = true; - public static final String Key$comboJustAuthAutoreg = Key + ".combo-just-auth-autoreg"; - - /** - * whether to support AuthZonePermChecker. - * - * @see #Key$zonePermCheck - */ - private boolean zonePermCheck = false; - public static final String Key$zonePermCheck = Key + ".zone-perm-check"; - - /** - * whether to support AuthAppPermChecker. - * - * @see #Key$appPermCheck - */ - private boolean appPermCheck = false; - public static final String Key$appPermCheck = Key + ".app-perm-check"; - - /** - * whether to inject DefaultExceptionResolver. - * - * @see #Key$defaultExceptionHandler - */ - private boolean defaultExceptionHandler = true; - public static final String Key$defaultExceptionHandler = Key + ".default-exception-handler"; - - - /** - * whether to inject BindExceptionAdvice. + * whether to support "warlock security http wing bind". * - * @see #Key$bindExceptionAdvice + * @see #Key$secHttpBind */ - private boolean bindExceptionAdvice = true; - public static final String Key$bindExceptionAdvice = Key + ".bind-exception-advice"; + private boolean secHttpBind = true; + public static final String Key$secHttpBind = Key + ".sec-http-bind"; /** - * whether to check mysql and local timezone compatibility. + * whether to support "warlock security http base auth". * - * @see #Key$checkDatabase + * @see #Key$secHttpBase */ - private boolean checkDatabase = true; - public static final String Key$checkDatabase = Key + ".check-database"; + private boolean secHttpBase = true; + public static final String Key$secHttpBase = Key + ".sec-http-base"; /** - * whether to support global inject AlternateTypeRule into Docket. + * whether to support SecurityFilterChain. * - * @see #Key$swaggerRule + * @see #Key$secHttpChain */ - private boolean swaggerRule = true; - public static final String Key$swaggerRule = Key + ".swagger-rule"; + private boolean secHttpChain = true; + public static final String Key$secHttpChain = Key + ".sec-http-chain"; /** - * whether to support global inject "java.time.Local*" into Docket. + * whether to enable security dummy service * - * @see #Key$swaggerJsr310 + * @see #Key$dummyService */ - private boolean swaggerJsr310 = true; - public static final String Key$swaggerJsr310 = Key + ".swagger-jsr-310"; + private boolean dummyService = false; + public static final String Key$dummyService = Key + ".dummy-service"; /** - * whether to enable table CUD listener. + * whether to enable the default TweakController. * - * @see #Key$tableChange + * @see #Key$mvcTest */ - private boolean tableChange = true; - public static final String Key$tableChange = Key + ".table-change"; + private boolean mvcTweak = false; + public static final String Key$mvcTweak = Key + ".mvc-tweak"; /** - * whether to enable the default auth Controller. + * whether to enable the default login page Controller. * - * @see #Key$controllerAuth + * @see #Key$mvcLogin */ - private boolean controllerAuth = true; - public static final String Key$controllerAuth = Key + ".controller-auth"; + private boolean mvcLogin = true; + public static final String Key$mvcLogin = Key + ".mvc-login"; /** * whether to enable document-only login/out proc that processed by filter. * - * @see #Key$controllerProc + * @see #Key$mvcProc */ - private boolean controllerProc = true; - public static final String Key$controllerProc = Key + ".controller-proc"; + private boolean mvcProc = true; + public static final String Key$mvcProc = Key + ".mvc-proc"; /** - * whether to enable the default user Controller. + * whether to enable the default OauthController. * - * @see #Key$controllerUser + * @see #Key$mvcOauth */ - private boolean controllerUser = true; - public static final String Key$controllerUser = Key + ".controller-user"; + private boolean mvcOauth = true; + public static final String Key$mvcOauth = Key + ".mvc-oauth"; /** * whether to enable the default mock Controller. * - * @see #Key$controllerMock + * @see #Key$mvcMock */ - private boolean controllerMock = true; - public static final String Key$controllerMock = Key + ".controller-mock"; + private boolean mvcMock = true; + public static final String Key$mvcMock = Key + ".mvc-mock"; /** * whether to enable the default test Controller. * - * @see #Key$controllerTest - */ - private boolean controllerTest = true; - public static final String Key$controllerTest = Key + ".controller-test"; - - /** - * whether to enable the default TweakController. - * - * @see #Key$controllerTest + * @see #Key$mvcTest */ - private boolean controllerTweak = false; - public static final String Key$controllerTweak = Key + ".controller-tweak"; + private boolean mvcTest = true; + public static final String Key$mvcTest = Key + ".mvc-test"; /** - * whether to enable the default OauthController. + * whether to enable the default user Controller. * - * @see #Key$controllerOauth + * @see #Key$mvcUser */ - private boolean controllerOauth = true; - public static final String Key$controllerOauth = Key + ".controller-oauth"; + private boolean mvcUser = true; + public static final String Key$mvcUser = Key + ".mvc-user"; /** - * whether to enable timing watching and analysis. - * - * @see #Key$watching - */ - private boolean watching = false; - public static final String Key$watching = Key + ".watching"; - - /** - * whether to support wings union login. + * whether to enable the default auth Controller. * - * @see #Key$uniauth + * @see #Key$mvcAuth */ - private boolean uniauth = false; - public static final String Key$uniauth = Key + ".uniauth"; + private boolean mvcAuth = true; + public static final String Key$mvcAuth = Key + ".mvc-auth"; } diff --git a/wings/warlock/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/wings/warlock/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 000000000..566ded882 --- /dev/null +++ b/wings/warlock/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,26 @@ +{ + "groups": [ + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean"} + ], + "properties": [ + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.conf.WarlockAutoConfiguration", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockAutoRunConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockAutoRunConfiguration.databaseCheckerRunner", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockAutoRunConfiguration.registerEnumUtilRunner", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockLockBeanConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockLockBeanConfiguration.databaseGlobalLock", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockLockBeanConfiguration.jvmStaticGlobalLock", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockTableChangeConfiguration", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockTableChangeConfiguration.tableChangePublisher", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockTableChangeConfiguration.wingsTableCudHandler", "type": "java.lang.Boolean"}, + + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockWatchingConfiguration", "type": "java.lang.Boolean", "description": "wings.enabled.warlock.watching for short."}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockWatchingConfiguration.slowSqlJooqListener", "type": "java.lang.Boolean"}, + {"name": "wings.enabled.pro.fessional.wings.warlock.spring.bean.WarlockWatchingConfiguration.watchingAround", "type": "java.lang.Boolean"} + ], + "hints": [] +} \ No newline at end of file diff --git a/wings/warlock/src/main/resources/wings-conf/spring-wings-enabled-77.properties b/wings/warlock/src/main/resources/wings-conf/spring-wings-enabled-77.properties deleted file mode 100644 index 3d599a7a8..000000000 --- a/wings/warlock/src/main/resources/wings-conf/spring-wings-enabled-77.properties +++ /dev/null @@ -1,103 +0,0 @@ -######### dependency override ######### -spring.wings.faceless.enabled.enumi18n=true -spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true -############################## - -## whether to enable auto config. -spring.wings.warlock.enabled.autoconf=true - -## whether to support "warlock security web and http". -spring.wings.warlock.enabled.security-auto=true - -## whether to enable Web auto config, eg. firewall, debug, etc. -spring.wings.warlock.enabled.security-web-autos=true - -## whether to support "warlock security http wing bind". -spring.wings.warlock.enabled.security-http-bind=true - -## whether to support "warlock security http wing auth". -spring.wings.warlock.enabled.security-http-auth=true - -## whether to support "warlock security http base auth". -spring.wings.warlock.enabled.security-http-base=true - -## whether to support "warlock security http auto". -spring.wings.warlock.enabled.security-http-auto=true - -## whether to support SecurityFilterChain. -spring.wings.warlock.enabled.security-http-chain=true - -## whether to support warlock security Bean. -spring.wings.warlock.enabled.security-bean=true - -## whether to inject jooq dao. -spring.wings.warlock.enabled.jooq-autogen=true - -## whether to inject ListAllLoginPageCombo. -spring.wings.warlock.enabled.combo-list-all-login-page=true - -## whether to inject NonceUserDetailsCombo. -spring.wings.warlock.enabled.combo-nonce-user-details=true - -## whether to support just auth. -spring.wings.warlock.enabled.just-auth=true - -## whether to inject JustAuthLoginPageCombo. -spring.wings.warlock.enabled.combo-just-auth-login-page=true - -## whether to inject JustAuthUserDetailsCombo. -spring.wings.warlock.enabled.combo-just-auth-user-details=true - -## whether to inject JustAuthUserAuthnAutoReg. -spring.wings.warlock.enabled.combo-just-auth-autoreg=true - -## whether to support AuthZonePermChecker. -spring.wings.warlock.enabled.zone-perm-check=false - -## whether to support AuthAppPermChecker. -spring.wings.warlock.enabled.app-perm-check=true - -## whether to inject DefaultExceptionResolver. -spring.wings.warlock.enabled.default-exception-handler=true - -## whether to inject BindExceptionAdvice. -spring.wings.warlock.enabled.bind-exception-advice=true - -## whether to check mysql and local timezone compatibility. -spring.wings.warlock.enabled.check-database=true - -## whether to support global inject AlternateTypeRule into Docket. -spring.wings.warlock.enabled.swagger-rule=true - -## whether to support global inject "java.time.Local*" into Docket. -spring.wings.warlock.enabled.swagger-jsr310=true - -## whether to enable table CUD listener. -spring.wings.warlock.enabled.table-change=true - -## whether to enable the default auth Controller. -spring.wings.warlock.enabled.controller-auth=true - -## whether to enable document-only login/out proc that processed by filter. -spring.wings.warlock.enabled.controller-proc=true - -## whether to enable the default user Controller. -spring.wings.warlock.enabled.controller-user=true - -## whether to enable the default mock Controller. -spring.wings.warlock.enabled.controller-mock=true - -## whether to enable the default test Controller. -spring.wings.warlock.enabled.controller-test=true - -## whether to enable the default TweakController. -spring.wings.warlock.enabled.controller-tweak=false - -## whether to enable the default OauthController. -spring.wings.warlock.enabled.controller-oauth=true - -## whether to enable timing watching and analysis. -spring.wings.warlock.enabled.watching=false - -## whether to support wings union login. -spring.wings.warlock.enabled.uniauth=false diff --git a/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java b/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java index a92ff73c8..62b9b67ad 100644 --- a/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java +++ b/wings/warlock/src/test/java/pro/fessional/wings/warlock/BootDatabaseTest.java @@ -26,7 +26,7 @@ * @since 2021-02-22 */ @SpringBootTest(properties = { - "spring.wings.enabled.pro.fessional.wings.faceless.spring.conf.FlywaveAutoConfiguration=true", + "wings.enabled.faceless.flywave=true", "wings.faceless.flywave.checker=false", }) @Disabled("manual initialization") From cee0d2c084b9fb6cd64f327c9e529c8cc5c1924d Mon Sep 17 00:00:00 2001 From: trydofor Date: Tue, 5 Dec 2023 11:25:21 +0800 Subject: [PATCH 19/23] =?UTF-8?q?=E2=9C=A8=20add=20@ConditionalWingsEnable?= =?UTF-8?q?d=20to=20Dao=20#155?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- observe/docs | 2 +- radiant/devs-codegen/pom.xml | 36 ++++ .../wings/devs}/AutogenDependencyTest.java | 16 +- .../wings/devs/BootDatabaseTest.java | 0 .../wings/devs/WingsDevsApplication.java | 0 .../src/test/resources/application.properties | 3 +- .../spring-datasource-99.properties | 0 radiant/{devs-mvndep => devs-mvndeps}/pom.xml | 43 +---- radiant/pom.xml | 3 +- .../autogen/tables/daos/WinMailSenderDao.java | 4 +- .../autogen/tables/daos/WinTaskDefineDao.java | 4 +- .../autogen/tables/daos/WinTaskResultDao.java | 4 +- .../faceless/jooqgen/WingsJavaGenerator.java | 4 + .../faceless/jooqgen/WingsJooqGenHelper.java | 17 +- .../jooqgen/WingsJooqGenHelperTest.java | 2 + .../tables/daos/SysConstantEnumDao.java | 4 +- .../tables/daos/SysStandardI18nDao.java | 4 +- .../tables/daos/TstNormalTableDao.java | 4 +- .../autogen/tables/daos/TstShardingDao.java | 6 +- .../tables/daos/TstNormalTableDao.java | 6 +- .../autogen/tables/daos/TstShardingDao.java | 6 +- .../spring/boot/ConditionalWingsEnabled.java | 10 +- .../spring/boot/WingsAutoConfigProcessor.java | 3 + .../spring/boot/WingsEnabledCondition.java | 177 ++++++++++++------ .../spring/prop/SilencerConditionalProp.java | 47 +++++ .../wings-conditional-79.properties | 9 + .../bean/WingsEnabledCatConfiguration.java | 6 +- .../spring/boot/WingsEnabledFalseTest.java | 1 + .../spring/boot/WingsEnabledTopFalseTest.java | 9 +- .../bean/SlardarMonitorConfiguration.java | 2 +- .../tables/daos/SysConstantEnumDao.java | 4 +- .../tables/daos/SysStandardI18nDao.java | 4 +- .../tables/daos/WinConfRuntimeDao.java | 4 +- .../autogen/tables/daos/WinPermEntryDao.java | 4 +- .../autogen/tables/daos/WinRoleEntryDao.java | 4 +- .../autogen/tables/daos/WinRoleGrantDao.java | 4 +- .../autogen/tables/daos/WinUserAuthnDao.java | 4 +- .../autogen/tables/daos/WinUserBasisDao.java | 4 +- .../autogen/tables/daos/WinUserGrantDao.java | 4 +- .../autogen/tables/daos/WinUserLoginDao.java | 4 +- 40 files changed, 318 insertions(+), 154 deletions(-) create mode 100644 radiant/devs-codegen/pom.xml rename radiant/{devs-mvndep/src/test/java/pro/fessional/wings/devs/codegen => devs-codegen/src/test/java/pro/fessional/wings/devs}/AutogenDependencyTest.java (97%) rename radiant/{devs-mvndep => devs-codegen}/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java (100%) rename radiant/{devs-mvndep => devs-codegen}/src/test/java/pro/fessional/wings/devs/WingsDevsApplication.java (100%) rename radiant/{devs-mvndep => devs-codegen}/src/test/resources/application.properties (61%) rename radiant/{devs-mvndep => devs-codegen}/src/test/resources/wings-conf/spring-datasource-99.properties (100%) rename radiant/{devs-mvndep => devs-mvndeps}/pom.xml (79%) create mode 100644 wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerConditionalProp.java create mode 100644 wings/silencer/src/main/resources/wings-conf/wings-conditional-79.properties diff --git a/observe/docs b/observe/docs index 4e0be28d4..2516f91bc 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit 4e0be28d431c1e72fcf6f0ffa285b1e438a58a3e +Subproject commit 2516f91bc1271e10e668d9992df283664a8de8a1 diff --git a/radiant/devs-codegen/pom.xml b/radiant/devs-codegen/pom.xml new file mode 100644 index 000000000..72196edfb --- /dev/null +++ b/radiant/devs-codegen/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + + pro.fessional.wings + radiant + ${revision}.${changelist} + + + devs-codegen + jar + + Radiant::Devs::CodeGen + generate the wings auto-gen code automatically + + + + + pro.fessional.wings + faceless-test + test + + + pro.fessional.wings + faceless-codegen + test + + + pro.fessional.wings + warlock-codegen + test + + + diff --git a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/codegen/AutogenDependencyTest.java b/radiant/devs-codegen/src/test/java/pro/fessional/wings/devs/AutogenDependencyTest.java similarity index 97% rename from radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/codegen/AutogenDependencyTest.java rename to radiant/devs-codegen/src/test/java/pro/fessional/wings/devs/AutogenDependencyTest.java index 71ffe41d3..30e0d9811 100644 --- a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/codegen/AutogenDependencyTest.java +++ b/radiant/devs-codegen/src/test/java/pro/fessional/wings/devs/AutogenDependencyTest.java @@ -1,4 +1,4 @@ -package pro.fessional.wings.devs.codegen; +package pro.fessional.wings.devs; import lombok.Setter; import org.junit.jupiter.api.Disabled; @@ -41,19 +41,25 @@ public class AutogenDependencyTest { private final String projectRoot = "../../"; @Test - void test01AllTestCode() { + void test01AllTestJooq() { test11FacelessJooqTest();// faceless-jooq test11FacelessShardTest();// faceless-shard } + @Test + void test01AllMainJooq() { + test21WarlockAutogenJooq();// warlock-autogen/database + test31TinyMailAutogenJooq();// tiny-autogen/mail + test31TinyTaskAutogenJooq();// tiny-autogen/task + } + @Test void test01AllMainCode() { + test01AllMainJooq(); + test10FacelessAutogen();// faceless-autogen/enums test20WarlockAutogenEnum();// warlock-autogen/enums test20WarlockAutogenAuth();// warlock-autogen/security - test21WarlockAutogenJooq();// warlock-autogen/database - test31TinyMailAutogenJooq();// tiny-autogen/mail - test31TinyTaskAutogenJooq();// tiny-autogen/task } // ////////////////// individual test ////////////////// diff --git a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java b/radiant/devs-codegen/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java similarity index 100% rename from radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java rename to radiant/devs-codegen/src/test/java/pro/fessional/wings/devs/BootDatabaseTest.java diff --git a/radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/WingsDevsApplication.java b/radiant/devs-codegen/src/test/java/pro/fessional/wings/devs/WingsDevsApplication.java similarity index 100% rename from radiant/devs-mvndep/src/test/java/pro/fessional/wings/devs/WingsDevsApplication.java rename to radiant/devs-codegen/src/test/java/pro/fessional/wings/devs/WingsDevsApplication.java diff --git a/radiant/devs-mvndep/src/test/resources/application.properties b/radiant/devs-codegen/src/test/resources/application.properties similarity index 61% rename from radiant/devs-mvndep/src/test/resources/application.properties rename to radiant/devs-codegen/src/test/resources/application.properties index 3005f37e7..7e476a31c 100644 --- a/radiant/devs-mvndep/src/test/resources/application.properties +++ b/radiant/devs-codegen/src/test/resources/application.properties @@ -2,6 +2,5 @@ wings.enabled.silencer.scanner=false wings.faceless.flywave.checker=false -spring.application.name=wings-mvndep -server.port=8086 +spring.application.name=wings-codegen debug=true diff --git a/radiant/devs-mvndep/src/test/resources/wings-conf/spring-datasource-99.properties b/radiant/devs-codegen/src/test/resources/wings-conf/spring-datasource-99.properties similarity index 100% rename from radiant/devs-mvndep/src/test/resources/wings-conf/spring-datasource-99.properties rename to radiant/devs-codegen/src/test/resources/wings-conf/spring-datasource-99.properties diff --git a/radiant/devs-mvndep/pom.xml b/radiant/devs-mvndeps/pom.xml similarity index 79% rename from radiant/devs-mvndep/pom.xml rename to radiant/devs-mvndeps/pom.xml index 515514f0e..076558b2c 100644 --- a/radiant/devs-mvndep/pom.xml +++ b/radiant/devs-mvndeps/pom.xml @@ -9,50 +9,13 @@ ${revision}.${changelist} - devs-mvndep + devs-mvndeps jar - Radiant::Devs::Mvndep - check dependency's version by maven-dependency-checker, generate the code automatically + Radiant::Devs::Mvndeps + check dependency's version by maven-dependency-checker - - - pro.fessional.wings - faceless-test - test - - - pro.fessional.wings - faceless-codegen - test - - - pro.fessional.wings - warlock-codegen - test - - - pro.fessional.wings - warlock-bond - test - - - pro.fessional.wings - warlock-shadow - - - - - pro.fessional.wings - tiny-mail - test - - - pro.fessional.wings - tiny-task - test - org.apache.shardingsphere diff --git a/radiant/pom.xml b/radiant/pom.xml index cf98f04fb..12f74093a 100644 --- a/radiant/pom.xml +++ b/radiant/pom.xml @@ -17,7 +17,8 @@ Radiant components under GhostShip Model - devs-mvndep + devs-codegen + devs-mvndeps tiny-autogen tiny-mail tiny-task diff --git a/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/mail/database/autogen/tables/daos/WinMailSenderDao.java b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/mail/database/autogen/tables/daos/WinMailSenderDao.java index fccdef4ad..f598b81e9 100644 --- a/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/mail/database/autogen/tables/daos/WinMailSenderDao.java +++ b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/mail/database/autogen/tables/daos/WinMailSenderDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.mail.database.autogen.tables.WinMailSenderTable; import pro.fessional.wings.tiny.mail.database.autogen.tables.pojos.WinMailSender; import pro.fessional.wings.tiny.mail.database.autogen.tables.records.WinMailSenderRecord; @@ -27,13 +28,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinMailSenderDao extends WingsJooqDaoJournalImpl { /** diff --git a/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskDefineDao.java b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskDefineDao.java index b42606a6a..e89e991a7 100644 --- a/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskDefineDao.java +++ b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskDefineDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskDefineTable; import pro.fessional.wings.tiny.task.database.autogen.tables.pojos.WinTaskDefine; import pro.fessional.wings.tiny.task.database.autogen.tables.records.WinTaskDefineRecord; @@ -27,13 +28,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinTaskDefineDao extends WingsJooqDaoJournalImpl { /** diff --git a/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskResultDao.java b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskResultDao.java index 7b906415b..955b1bfa2 100644 --- a/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskResultDao.java +++ b/radiant/tiny-autogen/src/main/java/pro/fessional/wings/tiny/task/database/autogen/tables/daos/WinTaskResultDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.tiny.task.database.autogen.tables.WinTaskResultTable; import pro.fessional.wings.tiny.task.database.autogen.tables.pojos.WinTaskResult; import pro.fessional.wings.tiny.task.database.autogen.tables.records.WinTaskResultRecord; @@ -27,13 +28,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinTaskResultDao extends WingsJooqDaoAliasImpl { /** diff --git a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaGenerator.java b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaGenerator.java index 06577ff74..6df7c3963 100644 --- a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaGenerator.java +++ b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaGenerator.java @@ -20,6 +20,7 @@ import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; import pro.fessional.wings.faceless.service.journal.JournalService; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import java.io.File; import java.lang.reflect.Field; @@ -241,6 +242,9 @@ else if (colType.contains("int")) { @Override // Confirm the replacement code and diff it public void generateDao(TableDefinition table, JavaWriter out) { super.generateDao(table, out); + if (generateSpringAnnotations()) { + out.ref(ConditionalWingsEnabled.class); + } // 🦁>>> final Class implClass; if (table.getColumns().stream().anyMatch(WingsJooqGenHelper.JournalAware)) { diff --git a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelper.java b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelper.java index b06acd37f..ffc090b6d 100644 --- a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelper.java +++ b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelper.java @@ -3,6 +3,7 @@ import org.jooq.meta.ColumnDefinition; import org.jooq.meta.TableDefinition; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; @@ -51,6 +52,7 @@ public class WingsJooqGenHelper { }; + private static final Pattern daoSpringRepo = Pattern.compile("(\n[ \t]*)(@Repository\\b)", Pattern.MULTILINE); private static final Pattern daoExtends = Pattern.compile("public class (\\S+)Dao extends (DAOImpl<)"); private static final Pattern daoFetchBody = Pattern.compile("\n[^\n]+ fetch[^(]+\\([^}]+\\}\n", Pattern.MULTILINE); private static final Pattern daoFetchLive = Pattern.compile("(fetch[^(]*)\\("); @@ -63,7 +65,12 @@ public static void replaceDaoJava(StringBuilder java, Class implClass) { final String tmp = java.toString(); final Matcher me = daoExtends.matcher(tmp); // "public class SysStandardI18nDao extends DAOImpl<" - final String dao = me.replaceFirst("public class $1Dao extends " + implClass.getSimpleName() + "<$1Table, "); + + String dao = me.replaceFirst("public class $1Dao extends " + implClass.getSimpleName() + "<$1Table, "); + final Matcher mr = daoSpringRepo.matcher(dao); + if (mr.find()) { + dao = mr.replaceFirst("$0$1@" + ConditionalWingsEnabled.class.getSimpleName()); + } // Reset the Content, Regexp Replacement java.setLength(0); @@ -77,10 +84,10 @@ public static void replaceDaoJava(StringBuilder java, Class implClass) { String body = md.group(); // vararg and Collection - Matcher mr = daoFetchVars.matcher(body); - if (mr.find()) { - String type = mr.group(1); - String vrg = mr.replaceAll("(Collection values)"); + Matcher mv = daoFetchVars.matcher(body); + if (mv.find()) { + String type = mv.group(1); + String vrg = mv.replaceAll("(Collection values)"); int p0 = vrg.indexOf("[values.length];"); // 16 chars if (p0 > 0) { int p1 = p0 + 16; diff --git a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelperTest.java b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelperTest.java index 9960f0003..f46d7a38b 100644 --- a/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelperTest.java +++ b/wings/faceless-codegen/src/test/java/pro/fessional/wings/faceless/jooqgen/WingsJooqGenHelperTest.java @@ -96,6 +96,7 @@ public List fetchById(Long... values) { ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository + @ConditionalWingsEnabled public class TstShardingDao extends WingsJooqDaoAliasImpl { /** @@ -228,6 +229,7 @@ public List fetchById(Long... values) { ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository + @ConditionalWingsEnabled public class TstShardingDao extends WingsJooqDaoAliasImpl { /** diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysConstantEnumDao.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysConstantEnumDao.java index 2cf89de25..7fe2d2746 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysConstantEnumDao.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysConstantEnumDao.java @@ -18,6 +18,7 @@ import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.SysConstantEnum; import pro.fessional.wings.faceless.app.database.autogen.tables.records.SysConstantEnumRecord; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** @@ -26,13 +27,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class SysConstantEnumDao extends WingsJooqDaoAliasImpl { /** diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysStandardI18nDao.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysStandardI18nDao.java index ebe88cfd1..e9f4423ee 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysStandardI18nDao.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/SysStandardI18nDao.java @@ -18,6 +18,7 @@ import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.SysStandardI18n; import pro.fessional.wings.faceless.app.database.autogen.tables.records.SysStandardI18nRecord; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** @@ -26,13 +27,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class SysStandardI18nDao extends WingsJooqDaoAliasImpl> { /** diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java index f5859e1df..b9bd65316 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java @@ -23,6 +23,7 @@ import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstNormalTableRecord; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** @@ -31,13 +32,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class TstNormalTableDao extends WingsJooqDaoJournalImpl { /** diff --git a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java index 11e9429a4..9fd26c65f 100644 --- a/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java +++ b/wings/faceless-jooq/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java @@ -15,11 +15,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; -import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; +import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; import pro.fessional.wings.faceless.enums.autogen.StandardLanguage; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** @@ -28,13 +29,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class TstShardingDao extends WingsJooqDaoJournalImpl { /** diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java index 3c4102d31..1eaebced5 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstNormalTableDao.java @@ -18,10 +18,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstNormalTable; import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstNormalTableRecord; -import pro.fessional.wings.faceless.app.database.autogen.tables.TstNormalTableTable; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** @@ -30,13 +31,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class TstNormalTableDao extends WingsJooqDaoJournalImpl { /** diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java index d26488e09..e70fdfa25 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/app/database/autogen/tables/daos/TstShardingDao.java @@ -15,10 +15,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; +import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; -import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; /** @@ -27,13 +28,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class TstShardingDao extends WingsJooqDaoJournalImpl { /** diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java index 2299b64b6..6e8fee4a6 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/ConditionalWingsEnabled.java @@ -16,9 +16,9 @@ * `true` only if `this && and1 && and2 && !not1 && !not2` * * the key priority from high to low - * - qualified-key = `prefix()` + `ClassName` + `methodName`? + * - qualified-key = `prefix` + `ClassName` + `methodName`? * - absolute-key = `abs()` - * - relative-key = `prefix()` + `key()` + * - relative-key = `prefix` + `key()` * - default = `value()` *
* @@ -32,12 +32,6 @@ @Conditional(WingsEnabledCondition.class) public @interface ConditionalWingsEnabled { - /** - * A prefix that should be applied to the property. - * inherit from the EnclosingClass non-empty prefix - */ - String prefix() default ""; - /** * absolute-key, without prefix, priority lower then qualified-key */ diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java index 6c8d59f0e..b9168e7f0 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsAutoConfigProcessor.java @@ -75,6 +75,9 @@ public class WingsAutoConfigProcessor implements EnvironmentPostProcessor { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication ignored) { + // + WingsEnabledCondition.reset(); + final String en = environment.getProperty(SilencerEnabledProp.Key$autoconf); if ("false".equalsIgnoreCase(en)) { log.info("🦁 Wings AutoConfig is disabled by property, skip it."); diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java index aa5e21719..148ec5234 100644 --- a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledCondition.java @@ -1,11 +1,11 @@ package pro.fessional.wings.silencer.spring.boot; -import lombok.SneakyThrows; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.boot.autoconfigure.condition.ConditionMessage; import org.springframework.boot.autoconfigure.condition.ConditionOutcome; import org.springframework.boot.autoconfigure.condition.SpringBootCondition; +import org.springframework.boot.context.properties.bind.Binder; import org.springframework.context.annotation.ConditionContext; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; @@ -13,9 +13,12 @@ import org.springframework.core.type.AnnotatedTypeMetadata; import org.springframework.core.type.ClassMetadata; import org.springframework.core.type.MethodMetadata; +import org.springframework.util.AntPathMatcher; import org.springframework.util.StringUtils; +import pro.fessional.wings.silencer.spring.prop.SilencerConditionalProp; import java.lang.reflect.Method; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -50,13 +53,48 @@ @Order(Ordered.HIGHEST_PRECEDENCE + 70) public class WingsEnabledCondition extends SpringBootCondition { - /** - * the default prefix - */ public static final String Prefix = "wings.enabled"; + private static final AntPathMatcher DotMatcher = new AntPathMatcher(); + private static final Map ErrorMap = new LinkedHashMap<>(); + private static final Map PrefixMap = new LinkedHashMap<>(); + private static final Map EnableMap = new LinkedHashMap<>(); + + private static boolean Uninit = true; + + public static void reset() { + Uninit = true; + ErrorMap.clear(); + ErrorMap.clear(); + EnableMap.clear(); + } + + public static void mappingOnce(Environment env) { + if (Uninit) { + Uninit = false; + var prop = Binder.get(env).bind(SilencerConditionalProp.Key, SilencerConditionalProp.class) + .orElseGet(SilencerConditionalProp::new); + for (Map.Entry en : prop.getError().entrySet()) { + if (StringUtils.hasText(en.getKey()) && en.getValue() != null) { + ErrorMap.put(en.getKey(), en.getValue()); + } + } + for (Map.Entry en : prop.getPrefix().entrySet()) { + if (StringUtils.hasText(en.getKey()) && StringUtils.hasText(en.getValue())) { + PrefixMap.put(en.getKey(), en.getValue()); + } + } + for (Map.Entry en : prop.getEnable().entrySet()) { + if (StringUtils.hasText(en.getKey()) && en.getValue() != null) { + EnableMap.put(en.getKey(), en.getValue()); + } + } + } + } + @Override public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { + mappingOnce(context.getEnvironment()); return conditionOutcome(context, metadata); } @@ -125,96 +163,113 @@ private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, Cla @NotNull private ConditionOutcome thisConditionOutcome(@NotNull ConditionContext context, @NotNull AnnotatedTypeMetadata metadata, @Nullable Map attrs) { - String pre = null; - if (attrs != null && attrs.get("prefix") instanceof String p && !p.isBlank()) { - pre = p; - } - final String[] keys = new String[3]; + final String id; // on @Component class if (metadata instanceof ClassMetadata conf) { - if (pre == null) pre = buildEnclosingPrefix(conf.getEnclosingClassName()); - keys[0] = pre + "." + conf.getClassName(); + id = conf.getClassName(); } // on @Bean method else if (metadata instanceof MethodMetadata bean) { - if (pre == null) pre = buildEnclosingPrefix(bean.getDeclaringClassName()); - keys[0] = pre + "." + bean.getDeclaringClassName() + "." + bean.getMethodName(); + id = bean.getDeclaringClassName() + "." + bean.getMethodName(); } else { - throw new IllegalArgumentException("should use on @Bean or @Configuration"); + throw new IllegalArgumentException("should use on @Bean or @Configuration, metadata=" + metadata); } - if (attrs != null) { - if (attrs.get("abs") instanceof String abs && !abs.isBlank()) { - keys[1] = abs; - } - else if (attrs.get("key") instanceof String key && !key.isBlank()) { - keys[2] = pre + "." + key; + try { + final String pre = buildPrefix(id); + final String[] keys = new String[3]; + keys[0] = pre + "." + id; + + if (attrs != null) { + if (attrs.get("abs") instanceof String abs && !abs.isBlank()) { + keys[1] = abs; + } + else if (attrs.get("key") instanceof String key && !key.isBlank()) { + keys[2] = pre + "." + key; + } } - } - var result = conditionOutcome(context, keys); - if (result != null) return result; - boolean falsy = attrs != null && attrs.get("value") instanceof Boolean value && !value; - return conditionOutcome(falsy); - } + var result = conditionOutcome(context, id, keys); + if (result != null) return result; - @NotNull - private ConditionOutcome thisConditionOutcome(@NotNull ConditionContext context, @NotNull Class meta, @Nullable ConditionalWingsEnabled anno) { - final String pre; - if (anno != null && StringUtils.hasText(anno.prefix())) { - pre = anno.prefix(); + boolean falsy = attrs != null && attrs.get("value") instanceof Boolean value && !value; + return conditionOutcome(falsy); } - else { - pre = buildEnclosingPrefix(meta.getEnclosingClass()); + catch (Throwable t) { + return handleException(id, t); } + } - final String[] keys = new String[3]; - keys[0] = pre + "." + meta.getName(); - - if (anno != null) { - if (StringUtils.hasText(anno.abs())) { - keys[1] = anno.abs(); - } - else if (StringUtils.hasText(anno.key())) { - keys[2] = pre + "." + anno.key(); + @NotNull + private ConditionOutcome thisConditionOutcome(@NotNull ConditionContext context, @NotNull Class meta, @Nullable ConditionalWingsEnabled anno) { + final String id = meta.getName(); + try { + final String pre = buildPrefix(id); + final String[] keys = new String[3]; + keys[0] = pre + "." + id; + + if (anno != null) { + if (StringUtils.hasText(anno.abs())) { + keys[1] = anno.abs(); + } + else if (StringUtils.hasText(anno.key())) { + keys[2] = pre + "." + anno.key(); + } } - } - var result = conditionOutcome(context, keys); - if (result != null) return result; + var result = conditionOutcome(context, id, keys); + if (result != null) return result; - boolean falsy = anno != null && !anno.value(); - return conditionOutcome(falsy); + boolean falsy = anno != null && !anno.value(); + return conditionOutcome(falsy); + } + catch (Throwable t) { + return handleException(id, t); + } } - @SneakyThrows @NotNull - private String buildEnclosingPrefix(@Nullable String ecn) { - if (ecn != null) { - Class clz = Class.forName(ecn); - return buildEnclosingPrefix(clz); + private String buildPrefix(String key) { + for (Map.Entry en : PrefixMap.entrySet()) { + if (DotMatcher.match(en.getKey(), key)) { + return en.getValue(); + } } - return Prefix; } @NotNull - private String buildEnclosingPrefix(@Nullable Class clz) { - while (clz != null) { - final var ann = clz.getAnnotation(ConditionalWingsEnabled.class); - if (ann != null && StringUtils.hasText(ann.prefix())) { - return ann.prefix(); + private ConditionOutcome handleException(String id, Throwable t) { + for (Map.Entry en : ErrorMap.entrySet()) { + if (DotMatcher.match(en.getKey(), id)) { + return en.getValue() == Boolean.TRUE + ? ConditionOutcome.match(t.getMessage()) + : ConditionOutcome.noMatch(t.getMessage()); } - clz = clz.getEnclosingClass(); } - return Prefix; + throw new IllegalStateException("set " + SilencerConditionalProp.Key$error + "[" + id + "]=true/false to skip error by match/no-match", t); } + @Nullable - private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, String @NotNull [] keys) { + private ConditionOutcome conditionOutcome(@NotNull ConditionContext context, String id, String @NotNull [] keys) { + for (Map.Entry en : EnableMap.entrySet()) { + String ek = en.getKey(); + if (DotMatcher.match(ek, id)) { + return en.getValue() == Boolean.TRUE + ? ConditionOutcome.match(ConditionMessage + .forCondition(ConditionalWingsEnabled.class) + .found(ek) + .items(true)) + : ConditionOutcome.noMatch(ConditionMessage + .forCondition(ConditionalWingsEnabled.class) + .found(ek) + .items(false)); + } + } final Environment environment = context.getEnvironment(); for (String key : keys) { diff --git a/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerConditionalProp.java b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerConditionalProp.java new file mode 100644 index 000000000..a52532550 --- /dev/null +++ b/wings/silencer/src/main/java/pro/fessional/wings/silencer/spring/prop/SilencerConditionalProp.java @@ -0,0 +1,47 @@ +package pro.fessional.wings.silencer.spring.prop; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.Collections; +import java.util.Map; + +/** + * WingsEnabledCondition properties wings-conditional-79.properties + * + * @author trydofor + * @see #Key + * @since 2023-12-04 + */ +@Data +@ConfigurationProperties(SilencerConditionalProp.Key) +public class SilencerConditionalProp { + + public static final String Key = "wings.silencer.conditional"; + + /** + * the mapping of qualified-key (ant-matcher) and its error handling + * `true`: match; `false`: not match; otherwise: throw exception + * + * @see #Key$error + */ + private Map error = Collections.emptyMap(); + public static final String Key$error = Key + ".error"; + + /** + * the mapping of qualified-key (ant-matcher) and its prefix + * + * @see #Key$prefix + */ + private Map prefix = Collections.emptyMap(); + public static final String Key$prefix = Key + ".prefix"; + + + /** + * the mapping of qualified-key (ant-matcher) and its enable + * + * @see #Key$enable + */ + private Map enable = Collections.emptyMap(); + public static final String Key$enable = Key + ".enable"; +} diff --git a/wings/silencer/src/main/resources/wings-conf/wings-conditional-79.properties b/wings/silencer/src/main/resources/wings-conf/wings-conditional-79.properties new file mode 100644 index 000000000..cb18ff207 --- /dev/null +++ b/wings/silencer/src/main/resources/wings-conf/wings-conditional-79.properties @@ -0,0 +1,9 @@ +## the mapping of qualified-key (ant-matcher) and its error handling +## `true`: match; `false`: not match; +#wings.silencer.conditional.error[*]=true + +## the mapping of qualified-key (ant-matcher) and its prefix +#wings.silencer.conditional.prefix[*]=wings.enabled + +## the mapping of qualified-key (ant-matcher) and its enable +#wings.silencer.conditional.enable[pro.fessional.wings.warlock.database.autogen.tables.daos.*]=false \ No newline at end of file diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java index f4ae08f3b..92cf41391 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/app/bean/WingsEnabledCatConfiguration.java @@ -16,7 +16,7 @@ * @author trydofor * @since 2023-11-17 */ -@ConditionalWingsEnabled(prefix = "catty.enabled") +@ConditionalWingsEnabled @Configuration(proxyBeanMethods = false) public class WingsEnabledCatConfiguration { @@ -31,7 +31,7 @@ public WingsEnabledCatConfiguration() { } @Bean - @ConditionalWingsEnabled(key = "catBean") // inherit + @ConditionalWingsEnabled(key = "catBean") public CatBean catBean() { return new CatBean(); } @@ -101,7 +101,7 @@ public InnerCatBean innerCatBean() { } @Configuration(proxyBeanMethods = false) - @ConditionalWingsEnabled(prefix = "kitty.enabled") // no inherit + @ConditionalWingsEnabled public static class ComponentScan { public ComponentScan() { log.info("Silencer spring-scan Component"); diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java index 45795e5f0..d3da36fa3 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledFalseTest.java @@ -15,6 +15,7 @@ * @since 2023-11-17 */ @SpringBootTest(properties = { + "wings.silencer.conditional.prefix[pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration*]=catty.enabled", "catty.enabled.catBean=true", "catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.catBean=false", "catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration.autowire=false", diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java index d93f6538d..0ac58ed17 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java @@ -14,8 +14,8 @@ * @since 2023-11-17 */ @SpringBootTest(properties = { - "catty.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration=false", - "wings.enabled.pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration=false", + "wings.silencer.conditional.enable[pro.fessional.wings.silencer.app.bean.WingsEnabledCatConfiguration]=false", + "wings.silencer.conditional.enable[pro.fessional.wings.silencer.app.bean.WingsEnabledDogConfiguration]=false", }) public class WingsEnabledTopFalseTest { @@ -44,6 +44,8 @@ public class WingsEnabledTopFalseTest { @Test @TmsLink("C11029") public void test() { + Assertions.assertNull(innerCatConfigDefault,"comment/unconment this to recompile"); + Assertions.assertNull(wingsEnabledCatConfiguration); Assertions.assertNull(catBean); Assertions.assertNull(innerCatConfiguration); @@ -53,8 +55,5 @@ public void test() { Assertions.assertNull(dogBean); Assertions.assertNull(innerDogConfiguration); Assertions.assertNull(innerDogBean); - - // most good, sometime wrong :D -// Assertions.assertNull(innerCatConfigDefault); } } \ No newline at end of file diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java index 3e0b77309..dfb2340a6 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java @@ -55,7 +55,7 @@ public void setEnvironment(@NotNull Environment environment) { slardarMonitorProp = Binder .get(environment) .bind(SlardarMonitorProp.Key, SlardarMonitorProp.class) - .get(); + .orElseGet(SlardarMonitorProp::new); } @Override diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/SysConstantEnumDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/SysConstantEnumDao.java index ede2a6dba..7197b8773 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/SysConstantEnumDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/SysConstantEnumDao.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.SysConstantEnumTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.SysConstantEnum; import pro.fessional.wings.warlock.database.autogen.tables.records.SysConstantEnumRecord; @@ -26,13 +27,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class SysConstantEnumDao extends WingsJooqDaoAliasImpl { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/SysStandardI18nDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/SysStandardI18nDao.java index 39df74f7b..29dd947bd 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/SysStandardI18nDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/SysStandardI18nDao.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.SysStandardI18nTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.SysStandardI18n; import pro.fessional.wings.warlock.database.autogen.tables.records.SysStandardI18nRecord; @@ -26,13 +27,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class SysStandardI18nDao extends WingsJooqDaoAliasImpl> { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinConfRuntimeDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinConfRuntimeDao.java index 321b36400..117e68de0 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinConfRuntimeDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinConfRuntimeDao.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.WinConfRuntimeTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinConfRuntime; import pro.fessional.wings.warlock.database.autogen.tables.records.WinConfRuntimeRecord; @@ -26,13 +27,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinConfRuntimeDao extends WingsJooqDaoAliasImpl { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinPermEntryDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinPermEntryDao.java index 9f37c176a..1df28ca32 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinPermEntryDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinPermEntryDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.WinPermEntryTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinPermEntry; import pro.fessional.wings.warlock.database.autogen.tables.records.WinPermEntryRecord; @@ -27,13 +28,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinPermEntryDao extends WingsJooqDaoJournalImpl { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinRoleEntryDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinRoleEntryDao.java index a8d4db4e0..1ea680331 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinRoleEntryDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinRoleEntryDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.WinRoleEntryTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinRoleEntry; import pro.fessional.wings.warlock.database.autogen.tables.records.WinRoleEntryRecord; @@ -27,13 +28,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinRoleEntryDao extends WingsJooqDaoJournalImpl { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinRoleGrantDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinRoleGrantDao.java index 72bf2ce08..dae607a15 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinRoleGrantDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinRoleGrantDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.WinRoleGrantTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinRoleGrant; import pro.fessional.wings.warlock.database.autogen.tables.records.WinRoleGrantRecord; @@ -28,13 +29,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinRoleGrantDao extends WingsJooqDaoJournalImpl> { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserAuthnDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserAuthnDao.java index 182f8cd4f..a6d7c46a9 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserAuthnDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserAuthnDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.WinUserAuthnTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinUserAuthn; import pro.fessional.wings.warlock.database.autogen.tables.records.WinUserAuthnRecord; @@ -27,13 +28,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinUserAuthnDao extends WingsJooqDaoJournalImpl { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserBasisDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserBasisDao.java index b381db215..48198c266 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserBasisDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserBasisDao.java @@ -18,6 +18,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.WinUserBasisTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinUserBasis; import pro.fessional.wings.warlock.database.autogen.tables.records.WinUserBasisRecord; @@ -31,13 +32,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinUserBasisDao extends WingsJooqDaoJournalImpl { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserGrantDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserGrantDao.java index c6661f589..d0e3ea1d3 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserGrantDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserGrantDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoJournalImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.WinUserGrantTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinUserGrant; import pro.fessional.wings.warlock.database.autogen.tables.records.WinUserGrantRecord; @@ -28,13 +29,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinUserGrantDao extends WingsJooqDaoJournalImpl> { /** diff --git a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserLoginDao.java b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserLoginDao.java index 005adb104..9ec915cf7 100644 --- a/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserLoginDao.java +++ b/wings/warlock-autogen/src/main/java/pro/fessional/wings/warlock/database/autogen/tables/daos/WinUserLoginDao.java @@ -16,6 +16,7 @@ import org.springframework.stereotype.Repository; import pro.fessional.wings.faceless.database.jooq.WingsJooqDaoAliasImpl; +import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.warlock.database.autogen.tables.WinUserLoginTable; import pro.fessional.wings.warlock.database.autogen.tables.pojos.WinUserLogin; import pro.fessional.wings.warlock.database.autogen.tables.records.WinUserLoginRecord; @@ -27,13 +28,14 @@ @Generated( value = { "https://www.jooq.org", - "jOOQ version:3.17.14", + "jOOQ version:3.17.16", "schema version:2020102701" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Repository +@ConditionalWingsEnabled public class WinUserLoginDao extends WingsJooqDaoAliasImpl { /** From 7240b8ef9e46c09b8f608981d000e93afdca5541 Mon Sep 17 00:00:00 2001 From: trydofor Date: Wed, 6 Dec 2023 08:51:38 +0800 Subject: [PATCH 20/23] =?UTF-8?q?=E2=9C=A8=20authedPerm=20support=20or=20c?= =?UTF-8?q?heck=20#157?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- observe/docs | 2 +- .../controller/user/AuthedUserController.java | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/observe/docs b/observe/docs index 2516f91bc..a9ca9f274 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit 2516f91bc1271e10e668d9992df283664a8de8a1 +Subproject commit a9ca9f274ee09d1442445fe9d209eec11dc3113e diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java index b83101c61..556229356 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/controller/user/AuthedUserController.java @@ -117,8 +117,10 @@ public static class Ins { private Map alias; @Schema(description = "set of perm/role", example = "[\"ROLE_ADMIN\",\"ROLE_SYSTEM\"]") private Set perms; - @Schema(description = "perm/role to check, if not fully contain, then invalidate session", example = "[\"ROLE_ADMIN\"]") + @Schema(description = "perm/role to check, if not contain (all/any), then invalidate session", example = "[\"ROLE_ADMIN\"]") private Set check; + @Schema(description = "check any or all", example = "true") + private boolean any = false; } @Operation(summary = "Check the perm/role (case-insensitive) of the current user and returns the existing", description = """ @@ -128,6 +130,7 @@ public static class Ins { * @param ins.alias - alias as map value for historical legacy * @param ins.perms - perm/role original name * @param ins.check - perm/role to check + * @param ins.any - check any or all ## Returns * @return {200 | Result(string[])} logined and perms * @return {200 | Result(false)} not logined and the URL without perm @@ -144,15 +147,17 @@ public R> authedPerm(HttpServletRequest request, @RequestBody Ins in .collect(Collectors.toSet()); if (ck != null && !ck.isEmpty()) { - final Set lt = new HashSet<>(); + final Set ng = new HashSet<>(); for (String s : ck) { if (!pm.contains(s.toLowerCase())) { - lt.add(s); + ng.add(s); } } - if (!lt.isEmpty()) { + + int ns = ng.size(); + if ((ns > 0 && !ins.any) || (ins.any && ns == ck.size())) { request.getSession().invalidate(); - return R.ngData(lt); + return R.ngData(ng); } } From b889d34858af64cb15666f751a441d7b19c5890e Mon Sep 17 00:00:00 2001 From: trydofor Date: Thu, 7 Dec 2023 17:55:18 +0800 Subject: [PATCH 21/23] =?UTF-8?q?=F0=9F=90=9B=20StackOverflowError=20endle?= =?UTF-8?q?ss=20loop=20#158?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- observe/docs | 2 +- .../faceless/jooqgen/WingsCodeGenerator.java | 27 +-- .../faceless/jooqgen/WingsJavaGenerator.java | 27 +-- .../faceless/jooqgen/WingsJavaStrategy.java | 3 +- .../sample/TestWingsInitDatabaseSample.java | 3 +- .../wings/faceless/jooq/JooqShardingTest.java | 49 ++-- .../spring/boot/WingsEnabledTopFalseTest.java | 18 -- .../app/conf/TestSecurityConfiguration.java | 5 +- .../conf/WingsHttpPermitConfigurer.java | 11 +- .../spring/help/SecurityConfigHelper.java | 69 ++++-- .../app/conf/TestSecurityConfiguration.java | 3 +- .../request/FakeHttpServletRequest.java | 225 ++++++++++++++++++ .../bean/SlardarJacksonWebConfiguration.java | 17 +- .../bean/SlardarWebMvcConfiguration.java | 10 - .../slardar/webmvc/RequestMappingHelper.java | 2 + .../bean/SlardarMonitorConfiguration.java | 2 +- .../auth/impl/DefaultDaoAuthnCombo.java | 3 +- .../WarlockSecurityBeanConfiguration.java | 1 - .../WarlockSecurityConfConfiguration.java | 155 +++++++++++- .../spring/prop/WarlockSecurityProp.java | 8 + .../wings-warlock-security-77.properties | 2 + .../warlock/security/AccessDeny403Test.java | 3 +- .../spring/prop/WarlockEnabledProp.java | 9 + 23 files changed, 504 insertions(+), 150 deletions(-) create mode 100644 wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/request/FakeHttpServletRequest.java diff --git a/observe/docs b/observe/docs index a9ca9f274..469b6ee2d 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit a9ca9f274ee09d1442445fe9d209eec11dc3113e +Subproject commit 469b6ee2d35b8d70369a3cda764b976b3650321a diff --git a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsCodeGenerator.java b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsCodeGenerator.java index 13d1f53e8..9ce3f4e17 100644 --- a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsCodeGenerator.java +++ b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsCodeGenerator.java @@ -1,6 +1,5 @@ package pro.fessional.wings.faceless.jooqgen; -import lombok.val; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jooq.Converter; @@ -66,11 +65,11 @@ public class WingsCodeGenerator { } try { - val src = conf.getGenerator().getTarget().getDirectory(); - val pkg = conf.getGenerator().getTarget().getPackageName().replace('.', '/'); + var src = conf.getGenerator().getTarget().getDirectory(); + var pkg = conf.getGenerator().getTarget().getPackageName().replace('.', '/'); // tmp dir - val tmp = Files.createTempDirectory("jooq-safe-gen").toFile(); - val tdr = tmp.getAbsolutePath(); + var tmp = Files.createTempDirectory("jooq-safe-gen").toFile(); + var tdr = tmp.getAbsolutePath(); conf.getGenerator().getTarget().setDirectory(tdr); log.info("safely generate, tmp-dir={}", tdr); @@ -137,8 +136,8 @@ private static Map walkDir(String root, String child) throws IOExc private static void safeCopy(String tmp, String src, String pkg, boolean inc) throws IOException { - val from = walkDir(tmp, pkg); - val dest = walkDir(src, pkg); + var from = walkDir(tmp, pkg); + var dest = walkDir(src, pkg); if (!inc && !dest.isEmpty()) { log.info("not incremental, Removing excess files in {}", new File(src, pkg).getCanonicalPath()); @@ -157,7 +156,7 @@ private static void safeCopy(String tmp, String src, String pkg, boolean inc) th // date = "2019-09-09T01:33:51.762Z", // schema version:2019090903 // serialVersionUID = 319604016; - val ignoreRegex = Pattern.compile(String.join("|", + var ignoreRegex = Pattern.compile(String.join("|", "(import +[^\r\n]+;[\r\n ]+)+", "The\\s+table\\s+[^.]+", "The\\s+schema\\s+[^<]+", @@ -166,19 +165,19 @@ private static void safeCopy(String tmp, String src, String pkg, boolean inc) th "[\r\n]+"), Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); for (Map.Entry entry : from.entrySet()) { - val k = entry.getKey(); - val f = entry.getValue(); - val d = dest.get(k); + var k = entry.getKey(); + var f = entry.getValue(); + var d = dest.get(k); if (d == null) { - val t = new File(src, k); + var t = new File(src, k); //noinspection ResultOfMethodCallIgnored t.getParentFile().mkdirs(); Files.copy(f.toPath(), t.toPath(), StandardCopyOption.REPLACE_EXISTING); log.info("create new file={}", k); } else { - val ft = ignoreRegex.matcher(InputStreams.readText(new FileInputStream(f))).replaceAll(Null.Str); - val dt = ignoreRegex.matcher(InputStreams.readText(new FileInputStream(d))).replaceAll(Null.Str); + var ft = ignoreRegex.matcher(InputStreams.readText(new FileInputStream(f))).replaceAll(Null.Str); + var dt = ignoreRegex.matcher(InputStreams.readText(new FileInputStream(d))).replaceAll(Null.Str); if (ft.equals(dt)) { log.info("skip main same file={}", k); } diff --git a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaGenerator.java b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaGenerator.java index 6df7c3963..9beb27043 100644 --- a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaGenerator.java +++ b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaGenerator.java @@ -1,6 +1,5 @@ package pro.fessional.wings.faceless.jooqgen; -import lombok.val; import org.jetbrains.annotations.NotNull; import org.jooq.Condition; import org.jooq.codegen.GeneratorStrategy; @@ -92,8 +91,8 @@ public void printSingletonInstance(JavaWriter out, Definition definition) { // table is TableDefinition : SysCommitJournalTable, SysCommitJournal final String className = getStrategy().getJavaClassName(definition); final String identifier = getStrategy().getJavaIdentifier(definition); - val aliasName = genAlias(identifier); // N6 - val aliasLower = "pro.fessional.wings.faceless.database.jooq.WingsJooqEnv.uniqueAlias()"; // n6 + var aliasName = genAlias(identifier); // N6 + var aliasLower = "pro.fessional.wings.faceless.database.jooq.WingsJooqEnv.uniqueAlias()"; // n6 // public static final SysCommitJournalTable asN6 = SysCommitJournal.as(WingsJooqEnv.uniqueRuntimeAlias()); out.println("public static final %s %s = %s.as(%s);", className, aliasName, identifier, aliasLower); // 🦁<<< @@ -105,7 +104,7 @@ public void generateTableClassFooter(TableDefinition table, JavaWriter out) { // table is TableDefinition : SysCommitJournalTable, SysCommitJournal final String className = getStrategy().getJavaClassName(table); final String identifier = getStrategy().getJavaIdentifier(table); - val aliasName = genAlias(identifier); // N6 + var aliasName = genAlias(identifier); // N6 out.ref(NotNull.class); final List columns = table.getColumns(); @@ -130,8 +129,8 @@ public void generateTableClassFooter(TableDefinition table, JavaWriter out) { out.println("return %s;", aliasName); out.println("}"); - val logicCol = columns.stream().filter(it -> { - val col = it.getOutputName(); + var logicCol = columns.stream().filter(it -> { + var col = it.getOutputName(); return col.equalsIgnoreCase(COL_DELETE_DT) || col.equalsIgnoreCase(COL_IS_DELETED); }).findFirst(); @@ -142,14 +141,14 @@ public void generateTableClassFooter(TableDefinition table, JavaWriter out) { out.ref(Map.class); out.ref(HashMap.class); out.ref(JournalService.class); - val fldDel = reflectMethodRef(out, getStrategy().getJavaIdentifier(colDel), colRefSegments(colDel)); + var fldDel = reflectMethodRef(out, getStrategy().getJavaIdentifier(colDel), colRefSegments(colDel)); - val namDel = colDel.getOutputName(); + var namDel = colDel.getOutputName(); out.println(""); out.javadoc("The colDel %s condition", namDel); final String markDelete; if (namDel.equalsIgnoreCase(COL_DELETE_DT)) { - val colType = colDel.getDefinedType().getType().toLowerCase(); + var colType = colDel.getDefinedType().getType().toLowerCase(); if (colType.contains("time")) { markDelete = "commit.getCommitDt()"; if (WingsCodeGenConf.isLiveDataByMax()) { @@ -202,11 +201,11 @@ else if (colType.contains("int")) { out.println("Map, Object> map = new HashMap<>();"); out.println("map.put(%s, %s);", fldDel, markDelete); - val commitCol = columns.stream().filter(it -> + var commitCol = columns.stream().filter(it -> it.getOutputName().equalsIgnoreCase(COL_COMMIT_ID)).findFirst(); if (commitCol.isPresent()) { final ColumnDefinition colCid = commitCol.get(); - val fldCid = reflectMethodRef(out, getStrategy().getJavaIdentifier(colCid), colRefSegments(colCid)); + var fldCid = reflectMethodRef(out, getStrategy().getJavaIdentifier(colCid), colRefSegments(colCid)); out.println("map.put(%s, commit.getCommitId());", fldCid); } out.println("return map;"); @@ -269,9 +268,9 @@ public void generateDao(TableDefinition table, JavaWriter out) { private String genAlias(String id) { final String chr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - val ix = id.hashCode() % chr.length(); - val cd = ix < 0 ? chr.charAt(-ix) : chr.charAt(ix); - val sq = id.length() % 10; + var ix = id.hashCode() % chr.length(); + var cd = ix < 0 ? chr.charAt(-ix) : chr.charAt(ix); + var sq = id.length() % 10; return ("as" + cd) + sq; } diff --git a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaStrategy.java b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaStrategy.java index 63dfee4b2..fe7137bab 100644 --- a/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaStrategy.java +++ b/wings/faceless-codegen/src/main/java/pro/fessional/wings/faceless/jooqgen/WingsJavaStrategy.java @@ -1,6 +1,5 @@ package pro.fessional.wings.faceless.jooqgen; -import lombok.val; import org.jooq.codegen.DefaultGeneratorStrategy; import org.jooq.codegen.GeneratorStrategy; import org.jooq.meta.ColumnDefinition; @@ -22,7 +21,7 @@ public class WingsJavaStrategy extends DefaultGeneratorStrategy { @Override public List getJavaClassImplements(Definition definition, Mode mode) { - val impls = super.getJavaClassImplements(definition, mode); + var impls = super.getJavaClassImplements(definition, mode); if (!(definition instanceof TableDefinition)) return impls; List columns = ((TableDefinition) definition).getColumns(); diff --git a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsInitDatabaseSample.java b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsInitDatabaseSample.java index 3fd4260cf..21a997f03 100644 --- a/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsInitDatabaseSample.java +++ b/wings/faceless-flywave/src/test/java/pro/fessional/wings/faceless/sample/TestWingsInitDatabaseSample.java @@ -2,7 +2,6 @@ import io.qameta.allure.TmsLink; import lombok.Setter; -import lombok.val; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -30,7 +29,7 @@ public class TestWingsInitDatabaseSample { @TmsLink("C12024") public void init0601() { // init - val sqls = scan(REVISION_PATH_MASTER, WingsRevision.V01_19_0521_01_EnumI18n.classpath()); + var sqls = scan(REVISION_PATH_MASTER, WingsRevision.V01_19_0521_01_EnumI18n.classpath()); schemaRevisionManager.publishRevision(WingsRevision.V00_19_0512_01_Schema.revision(), 0); schemaRevisionManager.checkAndInitSql(sqls, 0, false); diff --git a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java index 6064a2925..7f3fa831f 100644 --- a/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java +++ b/wings/faceless-shard/src/test/java/pro/fessional/wings/faceless/jooq/JooqShardingTest.java @@ -3,7 +3,6 @@ import io.qameta.allure.TmsLink; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import lombok.val; import org.apache.shardingsphere.infra.hint.HintManager; import org.jooq.Field; import org.jooq.impl.DSL; @@ -14,11 +13,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.sql.init.dependency.DependsOnDatabaseInitialization; import org.springframework.boot.test.context.SpringBootTest; -import pro.fessional.wings.faceless.convention.EmptyValue; import pro.fessional.wings.faceless.app.database.autogen.tables.TstShardingTable; import pro.fessional.wings.faceless.app.database.autogen.tables.daos.TstShardingDao; import pro.fessional.wings.faceless.app.database.autogen.tables.pojos.TstSharding; import pro.fessional.wings.faceless.app.database.autogen.tables.records.TstShardingRecord; +import pro.fessional.wings.faceless.convention.EmptyValue; import pro.fessional.wings.faceless.flywave.SchemaRevisionManager; import pro.fessional.wings.faceless.flywave.SchemaShardingManager; import pro.fessional.wings.faceless.helper.WingsTestHelper; @@ -82,7 +81,7 @@ public void test3SplitTable5() { @Test @TmsLink("C12138") public void test4InsertSeeLog() { - val rd = new TstSharding(id, + var rd = new TstSharding(id, LocalDateTime.now(), EmptyValue.DATE_TIME, EmptyValue.DATE_TIME, @@ -105,9 +104,9 @@ public void test4InsertSeeLog() { @Test @TmsLink("C12139") public void test5UpdateSeeLog() { - val tp = TstShardingTable.TstSharding; + var tp = TstShardingTable.TstSharding; // update `tst_sharding` set `modify_dt` = ?, `login_info` = ? where `id` <= ? - val rp = dao.ctx().update(tp) + var rp = dao.ctx().update(tp) .set(tp.ModifyDt, LocalDateTime.now()) .set(tp.LoginInfo, "update 5") .where(tp.Id.eq(id)) @@ -115,8 +114,8 @@ public void test5UpdateSeeLog() { testcaseNotice("plain updated= $rp"); testcaseNotice("update `tst_sharding_1` set `modify_dt` = ?, `login_info` = ? where `id` = ?"); - val tw = dao.getTable(); - val rw = dao.ctx().update(tw) + var tw = dao.getTable(); + var rw = dao.ctx().update(tw) .set(tw.ModifyDt, LocalDateTime.now()) .set(tw.LoginInfo, "update 5") .where(tw.Id.eq(id)) @@ -124,8 +123,8 @@ public void test5UpdateSeeLog() { testcaseNotice("write updated= $rw"); testcaseNotice("update `tst_sharding_1` set `modify_dt` = ?, `login_info` = ? where `id` = ?"); - val tr = dao.getAlias(); - val rr = dao.ctx().update(tr) + var tr = dao.getAlias(); + var rr = dao.ctx().update(tr) .set(tr.ModifyDt, LocalDateTime.now()) .set(tr.LoginInfo, "update 5") .where(tr.Id.eq(id)) @@ -147,8 +146,8 @@ public void test5UpdateSeeLog() { public void test6SelectSeeLog() { try (HintManager it = HintManager.getInstance()) { it.setWriteRouteOnly(); - val ta = TstShardingTable.asP1; - val ra = dao.ctx().select(ta.Id) + var ta = TstShardingTable.asP1; + var ra = dao.ctx().select(ta.Id) .from(ta) .where(ta.Id.le(id)) .limit(DSL.inline(1)) // RC3 @@ -157,8 +156,8 @@ public void test6SelectSeeLog() { testcaseNotice("alias select", ra); testcaseNotice("select `y8`.`id` from `tst_sharding` as `y8` where `y8`.`id` <= ?"); - val tp = TstShardingTable.TstSharding; - val rp = dao.ctx().select(tp.Id) + var tp = TstShardingTable.TstSharding; + var rp = dao.ctx().select(tp.Id) .from(tp) .where(tp.Id.le(id)) // .limit(1) // https://github.com/apache/incubator-shardingsphere/issues/3330 @@ -167,8 +166,8 @@ public void test6SelectSeeLog() { testcaseNotice("plain select", rp); testcaseNotice("select `id` from `tst_sharding` where `id` <= ?"); - val da = dao.getAlias(); - val rd = dao.fetch(da, da.Id.eq(id)); + var da = dao.getAlias(); + var rd = dao.fetch(da, da.Id.eq(id)); testcaseNotice("dao select= $rd"); testcaseNotice("select `y8`.`id`, `y8`.`create_dt`, ... from `tst_sharding` as `y8` where `y8`.`id` = ?"); @@ -184,8 +183,8 @@ public void test6SelectSeeLog() { @Test @TmsLink("C12141") public void test7DeleteSeeLog() { - val tp = TstShardingTable.TstSharding; - val rp = dao.ctx().delete(tp) + var tp = TstShardingTable.TstSharding; + var rp = dao.ctx().delete(tp) .where(tp.Id.eq(id)) // Inline strategy cannot support range sharding. .and(tp.CommitId.isNotNull()) .getSQL(); @@ -193,8 +192,8 @@ public void test7DeleteSeeLog() { testcaseNotice("plain delete= $rp"); testcaseNotice("delete from `tst_sharding` where (`id` <= ? and `commit_id` is not null)"); - val dw = dao.getTable(); - val rw = dao.delete(dw, dw.Id.eq(id)); + var dw = dao.getTable(); + var rw = dao.delete(dw, dw.Id.eq(id)); testcaseNotice("dao delete= $rw"); testcaseNotice("delete from `tst_sharding_3` where `id` = ? "); @@ -212,17 +211,17 @@ public void test7DeleteSeeLog() { @Test @TmsLink("C12142") public void test8BatchSeeLog() { - val rds = Arrays.asList( + var rds = Arrays.asList( new TstShardingRecord(119L, now, now, now, 9L, "Batch merge 119", "test8", ZH_CN.getId()), new TstShardingRecord(308L, now, now, now, 9L, "Batch merge 308", "test8", ZH_CN.getId()), new TstShardingRecord(309L, now, now, now, 9L, "Batch merge 309", "test8", ZH_CN.getId()) ); testcaseNotice("Batch Insert, check log, ignore in 2 batch, 119 ignore; 308, 309 insert"); - val rs1 = dao.batchInsert(rds, 2, true); + var rs1 = dao.batchInsert(rds, 2, true); Assertions.assertArrayEquals(new int[]{1, 1, 1}, rs1); testcaseNotice("select first, then insert 310, or update 308, 309"); - val rs3 = dao.batchMerge(tbl, new Field[]{tbl.Id}, Arrays.asList( + var rs3 = dao.batchMerge(tbl, new Field[]{tbl.Id}, Arrays.asList( new TstShardingRecord(310L, now, now, now, 9L, "Batch merge 310", "Other 310", ZH_CN.getId()), new TstShardingRecord(308L, now, now, now, 9L, "Batch merge 308", "Other 308", ZH_CN.getId()), new TstShardingRecord(309L, now, now, now, 9L, "Batch merge 309", "Other 309", ZH_CN.getId()) @@ -233,14 +232,14 @@ public void test8BatchSeeLog() { @Test @TmsLink("C12143") public void test9BatchSeeLog() { - val rds = Arrays.asList( + var rds = Arrays.asList( new TstShardingRecord(119L, now, now, now, 9L, "Batch load 307", "test9", ZH_CN.getId()), new TstShardingRecord(318L, now, now, now, 9L, "Batch load 318", "test9", ZH_CN.getId()), new TstShardingRecord(319L, now, now, now, 9L, "Batch load 319", "test9", ZH_CN.getId()) ); testcaseNotice("Batch Insert, check log, replace 119, new318,319, in 2 batch, replace into"); try { - val rs2 = dao.batchInsert(rds, 2, false); + var rs2 = dao.batchInsert(rds, 2, false); log.info(Arrays.toString(rs2)); Assertions.assertArrayEquals(new int[]{2, 1, 1}, rs2); } @@ -252,7 +251,7 @@ public void test9BatchSeeLog() { testcaseNotice("Batch Merge, check log, new 320, on dupkey 318,319, in 2 batch, duplicate"); testcaseNotice("insert into `tst_sharding` (`id`, .., `other_info`) values (?,..., ?) on duplicate key update `login_info` = ?, `other_info` = ?"); try { - val rs3 = dao.batchMerge(tbl, Arrays.asList( + var rs3 = dao.batchMerge(tbl, Arrays.asList( new TstShardingRecord(320L, now, now, now, 9L, "Batch merge 320", "Other 320", ZH_CN.getId()), new TstShardingRecord(318L, now, now, now, 9L, "Batch merge 318", "Other 318", ZH_CN.getId()), new TstShardingRecord(319L, now, now, now, 9L, "Batch merge 319", "Other 319", ZH_CN.getId()) diff --git a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java index 0ac58ed17..a0a795d64 100644 --- a/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java +++ b/wings/silencer/src/test/java/pro/fessional/wings/silencer/spring/boot/WingsEnabledTopFalseTest.java @@ -19,41 +19,23 @@ }) public class WingsEnabledTopFalseTest { - @Setter(onMethod_ = {@Autowired(required = false)}) - protected WingsEnabledCatConfiguration.InnerCatConfigDefault innerCatConfigDefault; - - @Setter(onMethod_ = {@Autowired(required = false)}) - protected WingsEnabledCatConfiguration wingsEnabledCatConfiguration; @Setter(onMethod_ = {@Autowired(required = false)}) protected WingsEnabledCatConfiguration.CatBean catBean; @Setter(onMethod_ = {@Autowired(required = false)}) - protected WingsEnabledCatConfiguration.InnerCatConfiguration innerCatConfiguration; - @Setter(onMethod_ = {@Autowired(required = false)}) protected WingsEnabledCatConfiguration.InnerCatBean innerCatBean; - - @Setter(onMethod_ = {@Autowired(required = false)}) - protected WingsEnabledDogConfiguration wingsEnabledDogConfiguration; @Setter(onMethod_ = {@Autowired(required = false)}) protected WingsEnabledDogConfiguration.DogBean dogBean; @Setter(onMethod_ = {@Autowired(required = false)}) - protected WingsEnabledDogConfiguration.InnerDogConfiguration innerDogConfiguration; - @Setter(onMethod_ = {@Autowired(required = false)}) protected WingsEnabledDogConfiguration.InnerDogBean innerDogBean; @Test @TmsLink("C11029") public void test() { - Assertions.assertNull(innerCatConfigDefault,"comment/unconment this to recompile"); - - Assertions.assertNull(wingsEnabledCatConfiguration); Assertions.assertNull(catBean); - Assertions.assertNull(innerCatConfiguration); Assertions.assertNull(innerCatBean); - Assertions.assertNull(wingsEnabledDogConfiguration); Assertions.assertNull(dogBean); - Assertions.assertNull(innerDogConfiguration); Assertions.assertNull(innerDogBean); } } \ No newline at end of file diff --git a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java index 249e79682..5f580f28b 100644 --- a/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java +++ b/wings/slardar-hazel-session/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java @@ -9,7 +9,6 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.core.session.SessionRegistry; import org.springframework.security.web.SecurityFilterChain; -import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher; import pro.fessional.wings.slardar.security.handler.TestLoginHandler; @@ -47,10 +46,10 @@ public class TestSecurityConfiguration { * only non-API resources in the WebSecurityConfigurer above. */ @Bean - public SecurityFilterChain securityFilterChain(HttpSecurity http, MvcRequestMatcher.Builder mvcMatcher) throws Exception { + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { log.info("config HttpSecurity"); http.authorizeHttpRequests(conf -> conf - .requestMatchers(mvcMatcher.pattern("/authed/*")).authenticated() + .requestMatchers("/authed/*").authenticated() ) .formLogin(conf -> conf .loginPage("/user/login.json") // 401 page diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/WingsHttpPermitConfigurer.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/WingsHttpPermitConfigurer.java index 4b15f60b0..5e7094cde 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/WingsHttpPermitConfigurer.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/conf/WingsHttpPermitConfigurer.java @@ -3,11 +3,9 @@ import lombok.SneakyThrows; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import org.springframework.context.ApplicationContext; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; import org.springframework.security.config.annotation.web.configurers.AuthorizeHttpRequestsConfigurer; -import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher; import pro.fessional.wings.slardar.spring.help.SecurityConfigHelper; /** @@ -46,17 +44,10 @@ public WingsHttpPermitConfigurer permitTest() { return this; } - /** - * user mvcMatcher if exist MvcRequestMatcher.Builder, otherwise antMatcher - * - * @see SecurityConfigHelper#requestMatchers(MvcRequestMatcher.Builder, String...) - */ @SneakyThrows @NotNull public AuthorizeHttpRequestsConfigurer.AuthorizedUrl requestMatchers(String... paths) { final HttpSecurity http = getBuilder(); - final ApplicationContext ctx = http.getSharedObject(ApplicationContext.class); - final MvcRequestMatcher.Builder mat = ctx == null ? null : ctx.getBean(MvcRequestMatcher.Builder.class); - return http.authorizeHttpRequests().requestMatchers(SecurityConfigHelper.requestMatchers(mat, paths)); + return http.authorizeHttpRequests().requestMatchers(paths); } } diff --git a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/help/SecurityConfigHelper.java b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/help/SecurityConfigHelper.java index 19a329c06..3c5fda979 100644 --- a/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/help/SecurityConfigHelper.java +++ b/wings/slardar-sprint/src/main/java/pro/fessional/wings/slardar/spring/help/SecurityConfigHelper.java @@ -2,21 +2,26 @@ import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import org.springframework.context.ApplicationContext; import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; -import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher; -import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfigurationSource; +import org.springframework.web.util.pattern.PathPattern; import pro.fessional.wings.slardar.security.WingsUserDetailsService; +import pro.fessional.wings.slardar.servlet.request.FakeHttpServletRequest; import pro.fessional.wings.slardar.spring.conf.WingsBindAuthnConfigurer; import pro.fessional.wings.slardar.spring.conf.WingsBindLoginConfigurer; import pro.fessional.wings.slardar.spring.conf.WingsHttpPermitConfigurer; -import java.util.Collection; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Consumer; /** *
@@ -30,7 +35,6 @@
  */
 public class SecurityConfigHelper {
 
-
     /**
      * 
      * protected void configure(HttpSecurity http) throws Exception {
@@ -42,6 +46,7 @@ public class SecurityConfigHelper {
      * }
      * 
*/ + @NotNull public static HttpHelper http() { return new HttpHelper(); } @@ -62,39 +67,59 @@ public HttpHelper bindLogin(Customizer customizer) thr } } + public static class MatcherHelper extends AbstractRequestMatcherRegistry { + private final Consumer> matchersConsumer; + + public MatcherHelper(ApplicationContext context, Consumer> matchersConsumer) { + this.matchersConsumer = matchersConsumer; + setApplicationContext(context); + } + + @Override + protected MatcherHelper chainRequestMatchers(List requestMatchers) { + matchersConsumer.accept(requestMatchers); + return this; + } + + public static MatcherHelper of(ApplicationContext context, AtomicReference ref) { + return new MatcherHelper(context, it -> ref.set(it.get(0))); + } + public static MatcherHelper of(ApplicationContext context, RequestMatcher[] ref) { + return new MatcherHelper(context, it -> it.toArray(ref)); + } + } + @NotNull public static WingsBindAuthnConfigurer auth() { return new WingsBindAuthnConfigurer<>(); } /** - * CVE-2023-34035: Authorization rules can be misconfigured when using multiple servlets + * encode PathPattern token to url + * + * @see PathPattern */ @NotNull - public static RequestMatcher[] requestMatchers(@Nullable MvcRequestMatcher.Builder mvcMatcher, String... path) { - RequestMatcher[] matchers = new RequestMatcher[path.length]; - for (int index = 0; index < path.length; index++) { - String p = path[index]; - matchers[index] = mvcMatcher == null ? new AntPathRequestMatcher(p, null) : mvcMatcher.pattern(p); - } - return matchers; + public static String encodePathPattern(@NotNull String path) { + path = URLEncoder.encode(path, StandardCharsets.UTF_8); + path = path.replace("%2F", "/"); + return path; } /** - * CVE-2023-34035: Authorization rules can be misconfigured when using multiple servlets + * fake the HttpServletRequest to test matcher */ @NotNull - public static RequestMatcher[] requestMatchers(@Nullable MvcRequestMatcher.Builder mvcMatcher, Collection path) { - RequestMatcher[] matchers = new RequestMatcher[path.size()]; - int index = 0; - for (String p : path) { - matchers[index++] = mvcMatcher == null ? new AntPathRequestMatcher(p, null) : mvcMatcher.pattern(p); - } - return matchers; + public static FakeHttpServletRequest fakeMatcherRequest(@NotNull String path) { + path = encodePathPattern(path); + FakeHttpServletRequest request = new FakeHttpServletRequest(); + request.setPathInfo(path); + request.setRequestURI(path); + return request; } - // //// + @NotNull public static CorsConfigurationSource corsPermitAll() { return request -> { CorsConfiguration conf = new CorsConfiguration(); diff --git a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java index 3effbb26e..6cd8a7119 100644 --- a/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java +++ b/wings/slardar-sprint/src/test/java/pro/fessional/wings/slardar/app/conf/TestSecurityConfiguration.java @@ -6,7 +6,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.web.SecurityFilterChain; -import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher; import org.springframework.security.web.util.matcher.AntPathRequestMatcher; import pro.fessional.mirana.data.Null; import pro.fessional.wings.slardar.spring.help.SecurityConfigHelper; @@ -38,7 +37,7 @@ public class TestSecurityConfiguration { * only non-API resources in the WebSecurityConfigurer above. */ @Bean - public SecurityFilterChain securityFilterChain(HttpSecurity http, MvcRequestMatcher.Builder mvcMatcher) throws Exception { + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { log.info("config HttpSecurity"); http.apply(SecurityConfigHelper.http()) .httpPermit(conf -> conf diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/request/FakeHttpServletRequest.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/request/FakeHttpServletRequest.java new file mode 100644 index 000000000..93c8cbb2e --- /dev/null +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/servlet/request/FakeHttpServletRequest.java @@ -0,0 +1,225 @@ +package pro.fessional.wings.slardar.servlet.request; + +import jakarta.servlet.AsyncContext; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.RequestDispatcher; +import jakarta.servlet.ServletConnection; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletInputStream; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpSession; +import jakarta.servlet.http.HttpUpgradeHandler; +import jakarta.servlet.http.Part; +import lombok.Getter; +import lombok.Setter; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import pro.fessional.mirana.data.Null; + +import java.io.BufferedReader; +import java.security.Principal; +import java.util.Collection; +import java.util.Collections; +import java.util.Enumeration; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +/* + * @author trydofor + * @since 2023-12-06 + */ +@Getter +@Setter +public class FakeHttpServletRequest implements HttpServletRequest { + + private String authType; + private Cookie[] cookies; + private String method; + private String pathInfo = ""; + private String pathTranslated; + private String contextPath = ""; + private String queryString; + private String remoteUser; + private Principal userPrincipal; + private String requestedSessionId; + private String requestURI = ""; + private StringBuffer requestURL; + private String servletPath = ""; + private HttpSession session; + private boolean requestedSessionIdValid = true; + private boolean requestedSessionIdFromCookie = true; + private boolean requestedSessionIdFromURL = false; + private String characterEncoding; + private int contentLength = 0; + private String contentType = ""; + private ServletInputStream inputStream; + private String protocol = "HTTP/1.1"; + private String scheme = "http"; + private String serverName = "localhost"; + private int serverPort; + private BufferedReader reader; + private String remoteAddr; + private String remoteHost; + private Locale locale = Locale.US; + private boolean secure = false; + private RequestDispatcher requestDispatcher; + private int remotePort = 8080; + private String localName = "localhost"; + private String localAddr = "127.0.0.1"; + private int localPort = 1234; + private ServletContext servletContext; + private AsyncContext asyncContext; + private boolean asyncStarted = false; + private boolean asyncSupported = false; + private DispatcherType dispatcherType; + private String requestId; + private String protocolRequestId; + private ServletConnection servletConnection; + + private final Map parts = new LinkedHashMap<>(); + private final Map attributes = new LinkedHashMap<>(); + private final MultiValueMap headers = new LinkedMultiValueMap<>(); + private final Map parameterMap = new LinkedHashMap<>(); + + @Override + public long getDateHeader(String name) { + var h = getHeader(name); + return h == null ? 0 : Long.parseLong(h); + } + + @Override + public String getHeader(String name) { + var h = headers.get(name); + return h.isEmpty() ? null : h.get(0); + } + + @Override + public Enumeration getHeaders(String name) { + return Collections.enumeration(headers.get(name)); + } + + @Override + public Enumeration getHeaderNames() { + return Collections.enumeration(headers.keySet()); + } + + @Override + public int getIntHeader(String name) { + var h = getHeader(name); + return h == null ? 0 : Integer.parseInt(h); + } + + @Override + public boolean isUserInRole(String role) { + return false; + } + + @Override + public HttpSession getSession(boolean create) { + return getSession(); + } + + @Override + public String changeSessionId() { + return null; + } + + @Override + public boolean authenticate(HttpServletResponse response) { + return false; + } + + @Override + public void login(String username, String password) { + } + + @Override + public void logout() throws ServletException { + } + + @Override + public Collection getParts() { + return parts.values(); + } + + @Override + public Part getPart(String name) { + return parts.get(name); + } + + @Override + public T upgrade(Class handlerClass) { + return null; + } + + @Override + public Object getAttribute(String name) { + return attributes.get(name); + } + + @Override + public Enumeration getAttributeNames() { + return Collections.enumeration(attributes.keySet()); + } + + @Override + public long getContentLengthLong() { + return getContentLength(); + } + + @Override + public String getParameter(String name) { + var p = parameterMap.get(name); + return p == null || p.length == 0 ? null : p[0]; + } + + @Override + public Enumeration getParameterNames() { + return Collections.enumeration(parameterMap.keySet()); + } + + @Override + public String[] getParameterValues(String name) { + var p = parameterMap.get(name); + return p == null ? Null.StrArr : p; + } + + @Override + public void setAttribute(String name, Object o) { + attributes.put(name, o); + } + + @Override + public void removeAttribute(String name) { + attributes.remove(name); + } + + @Override + public Enumeration getLocales() { + return Collections.enumeration(List.of(getLocale())); + } + + + @Override + public RequestDispatcher getRequestDispatcher(String path) { + return getRequestDispatcher(); + } + + @Override + public AsyncContext startAsync() { + return getAsyncContext(); + } + + @Override + public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) { + return getAsyncContext(); + } + +} diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java index 3ca2664a1..baea815bf 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarJacksonWebConfiguration.java @@ -6,7 +6,6 @@ import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer; -import lombok.val; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -87,8 +86,8 @@ public Jackson2ObjectMapperBuilderCustomizer customizeJacksonDatetime(SlardarDat log.info("SlardarWebmvc spring-bean customizeJacksonDatetime"); return builder -> { // local - val date = DateTimeFormatter.ofPattern(prop.getDate().getFormat()); - val datePsr = prop.getDate() + var date = DateTimeFormatter.ofPattern(prop.getDate().getFormat()); + var datePsr = prop.getDate() .getSupport() .stream() .map(DateTimeFormatter::ofPattern) @@ -97,8 +96,8 @@ public Jackson2ObjectMapperBuilderCustomizer customizeJacksonDatetime(SlardarDat builder.deserializerByType(LocalDate.class, new JacksonLocalDateDeserializer(date, datePsr)); log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer LocalDate"); - val time = DateTimeFormatter.ofPattern(prop.getTime().getFormat()); - val timePsr = prop.getTime() + var time = DateTimeFormatter.ofPattern(prop.getTime().getFormat()); + var timePsr = prop.getTime() .getSupport() .stream() .map(DateTimeFormatter::ofPattern) @@ -108,13 +107,13 @@ public Jackson2ObjectMapperBuilderCustomizer customizeJacksonDatetime(SlardarDat log.info("SlardarWebmvc conf Jackson2ObjectMapperBuilderCustomizer LocalTime"); // auto local - val full = DateTimeFormatter.ofPattern(prop.getDatetime().getFormat()); + var full = DateTimeFormatter.ofPattern(prop.getDatetime().getFormat()); final AutoZoneType autoLocal = AutoZoneType.valueOf(prop.getDatetime().isAuto()); JacksonLocalDateTimeSerializer.defaultFormatter = full; JacksonLocalDateTimeSerializer.defaultAutoZone = autoLocal; builder.serializerByType(LocalDateTime.class, new JacksonLocalDateTimeSerializer(full, autoLocal)); - val fullPsr = prop.getDatetime() + var fullPsr = prop.getDatetime() .getSupport() .stream() .map(DateTimeFormatter::ofPattern) @@ -129,7 +128,7 @@ public Jackson2ObjectMapperBuilderCustomizer customizeJacksonDatetime(SlardarDat JacksonZonedDateTimeSerializer.defaultAutoZone = autoZone; builder.serializerByType(ZonedDateTime.class, new JacksonZonedDateTimeSerializer(zoned, autoZone)); - val zonePsr = prop.getZoned() + var zonePsr = prop.getZoned() .getSupport() .stream() .map(DateTimeFormatter::ofPattern) @@ -145,7 +144,7 @@ public Jackson2ObjectMapperBuilderCustomizer customizeJacksonDatetime(SlardarDat JacksonOffsetDateTimeSerializer.defaultAutoZone = autoOffset; builder.serializerByType(OffsetDateTime.class, new JacksonOffsetDateTimeSerializer(offset, autoOffset)); - val offPsr = prop.getZoned() + var offPsr = prop.getZoned() .getSupport() .stream() .map(DateTimeFormatter::ofPattern) diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java index 0c54daffc..b80ade471 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarWebMvcConfiguration.java @@ -5,16 +5,13 @@ import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.task.AsyncTaskExecutor; -import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher; import org.springframework.web.method.support.HandlerMethodArgumentResolver; import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer; import org.springframework.web.servlet.config.annotation.InterceptorRegistration; import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.slardar.webmvc.AutoRegisterInterceptor; import pro.fessional.wings.slardar.webmvc.PageQueryArgumentResolver; @@ -81,11 +78,4 @@ public void configureAsyncSupport(@NotNull AsyncSupportConfigurer configurer) { configurer.setTaskExecutor(applicationTaskExecutor); } } - - @Bean - @ConditionalWingsEnabled - public MvcRequestMatcher.Builder mvcRequestMatcherBuilder(HandlerMappingIntrospector introspector) { - log.info("SlardarWebmvc conf mvcRequestMatcherBuilder"); - return new MvcRequestMatcher.Builder(introspector); - } } diff --git a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/webmvc/RequestMappingHelper.java b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/webmvc/RequestMappingHelper.java index 0ab00cd4d..bf80d7e8a 100644 --- a/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/webmvc/RequestMappingHelper.java +++ b/wings/slardar-webmvc/src/main/java/pro/fessional/wings/slardar/webmvc/RequestMappingHelper.java @@ -6,6 +6,7 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.DispatcherServlet; +import org.springframework.web.servlet.handler.HandlerMappingIntrospector; import org.springframework.web.servlet.mvc.condition.PathPatternsRequestCondition; import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition; import org.springframework.web.servlet.mvc.method.RequestMappingInfo; @@ -24,6 +25,7 @@ * Note, not all mapping in the container * * @see DispatcherServlet#getHandlerMappings() + * @see HandlerMappingIntrospector#getHandlerMappings() */ public class RequestMappingHelper { diff --git a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java index dfb2340a6..885d64723 100644 --- a/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java +++ b/wings/slardar/src/main/java/pro/fessional/wings/slardar/spring/bean/SlardarMonitorConfiguration.java @@ -81,7 +81,7 @@ public void postProcessBeanFactory(@NotNull ConfigurableListableBeanFactory bean log.info("Slardar spring-bean register dynamic LogMonitor bean=" + key); } else { - log.warn("Wings skip LogMonitor bean for file not exist, file=" + rf); + log.warn("Slardar skip LogMonitor bean for file not exist, bean=" + key + ", file=" + rf); } } else { diff --git a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java index ae11d5052..9205fe0b5 100644 --- a/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java +++ b/wings/warlock-bond/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultDaoAuthnCombo.java @@ -3,7 +3,6 @@ import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import lombok.val; import org.jetbrains.annotations.NotNull; import org.jooq.Condition; import org.springframework.beans.factory.annotation.Autowired; @@ -143,7 +142,7 @@ public void onFailure(@NotNull Enum authType, String username, String details final String at = wingsAuthTypeParser.parse(authType); final WinUserAuthnTable ta = winUserAuthnDao.getTable(); - val auth = winUserAuthnDao + var auth = winUserAuthnDao .ctx() .select(ta.UserId, ta.FailedCnt, ta.FailedMax, ta.Id) .from(ta) diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java index 1a7c5ee26..d00b863af 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityBeanConfiguration.java @@ -129,7 +129,6 @@ public LogoutSuccessHandler logoutSuccessHandler() { @Bean @ConditionalWingsEnabled - @ConditionalOnExpression("!'${" + WarlockSecurityProp.Key$logoutSuccessBody + "}'.isEmpty()") public AccessDeniedHandler accessDeniedHandler() { log.info("WarlockShadow spring-bean accessDeniedHandler"); return new AccessFailureHandler(); diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityConfConfiguration.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityConfConfiguration.java index 1279d0969..17eaa3b64 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityConfConfiguration.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/bean/WarlockSecurityConfConfiguration.java @@ -1,10 +1,10 @@ package pro.fessional.wings.warlock.spring.bean; import jakarta.servlet.http.HttpServletResponse; -import lombok.val; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; +import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; @@ -19,23 +19,28 @@ import org.springframework.security.web.csrf.CsrfTokenRepository; import org.springframework.security.web.firewall.HttpFirewall; import org.springframework.security.web.savedrequest.RequestCache; -import org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher; +import org.springframework.security.web.util.matcher.RequestMatcher; import org.springframework.util.StringUtils; import pro.fessional.mirana.data.Null; +import pro.fessional.wings.silencer.runner.ApplicationRunnerOrdered; import pro.fessional.wings.silencer.spring.WingsOrdered; import pro.fessional.wings.silencer.spring.boot.ConditionalWingsEnabled; import pro.fessional.wings.silencer.spring.help.CommonPropHelper; import pro.fessional.wings.slardar.security.WingsAuthDetailsSource; +import pro.fessional.wings.slardar.servlet.request.FakeHttpServletRequest; import pro.fessional.wings.slardar.servlet.response.ResponseHelper; import pro.fessional.wings.slardar.spring.help.SecurityConfigHelper; +import pro.fessional.wings.slardar.spring.help.SecurityConfigHelper.MatcherHelper; import pro.fessional.wings.warlock.spring.conf.HttpSecurityCustomizer; import pro.fessional.wings.warlock.spring.prop.WarlockEnabledProp; import pro.fessional.wings.warlock.spring.prop.WarlockSecurityProp; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; import java.util.TreeMap; +import java.util.concurrent.atomic.AtomicReference; /** @@ -50,7 +55,7 @@ public class WarlockSecurityConfConfiguration { @Bean @ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$secWebAuto) - public WebSecurityCustomizer warlockWebCustomizer(WarlockSecurityProp securityProp, ObjectProvider httpFirewall, ObjectProvider mvcMatcher) { + public WebSecurityCustomizer warlockWebCustomizer(WarlockSecurityProp securityProp, ObjectProvider httpFirewall) { log.info("WarlockShadow spring-bean warlockWebCustomizer"); return web -> { if (securityProp.isWebDebug()) { @@ -64,8 +69,7 @@ public WebSecurityCustomizer warlockWebCustomizer(WarlockSecurityProp securityPr if (!webIgnore.isEmpty()) { final Set ignores = CommonPropHelper.onlyValue(webIgnore.values()); log.info("WarlockShadow conf WebSecurity, ignoring=" + String.join("\n,", ignores)); - MvcRequestMatcher.Builder mvc = mvcMatcher.getIfAvailable(); - web.ignoring().requestMatchers(SecurityConfigHelper.requestMatchers(mvc, ignores)); + web.ignoring().requestMatchers(ignores.toArray(String[]::new)); } final HttpFirewall firewall = httpFirewall.getIfAvailable(); @@ -137,7 +141,13 @@ public HttpSecurityCustomizer warlockSecurityBindHttpConfigure( HttpServletResponse response = event.getResponse(); ResponseHelper.writeBodyUtf8(response, securityProp.getSessionExpiredBody()); }) - ); + ) + .anonymous(conf -> { + if (!securityProp.isAnonymous()) { + log.info("WarlockShadow conf HttpSecurity, disable anonymous"); + conf.disable(); + } + }); final AccessDeniedHandler deniedHandler = accessDeniedHandler.getIfAvailable(); if (deniedHandler != null) { @@ -150,23 +160,23 @@ public HttpSecurityCustomizer warlockSecurityBindHttpConfigure( @Bean @ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$secHttpAuth) @Order(WingsOrdered.Lv4Application + 300) - public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(WarlockSecurityProp securityProp, ObjectProvider mvcMatcher) { + public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(WarlockSecurityProp securityProp) { log.info("WarlockShadow spring-bean warlockSecurityAuthHttpConfigure"); - MvcRequestMatcher.Builder mvc = mvcMatcher.getIfAvailable(); + return http -> { - val conf = http.authorizeHttpRequests(); + final var conf = http.authorizeHttpRequests(); // 1 PermitAll final Set permed = CommonPropHelper.onlyValue(securityProp.getPermitAll().values()); if (!permed.isEmpty()) { log.info("WarlockShadow conf HttpSecurity, bind PermitAll=" + String.join("\n,", permed)); - conf.requestMatchers(SecurityConfigHelper.requestMatchers(mvc, permed)).permitAll(); + conf.requestMatchers(permed.toArray(String[]::new)).permitAll(); } // 2 Authenticated final Set authed = CommonPropHelper.onlyValue(securityProp.getAuthenticated().values()); if (!authed.isEmpty()) { log.info("WarlockShadow conf HttpSecurity, bind Authenticated=" + String.join("\n,", authed)); - conf.requestMatchers(SecurityConfigHelper.requestMatchers(mvc, authed)).authenticated(); + conf.requestMatchers(authed.toArray(String[]::new)).authenticated(); } // 3 Authority @@ -187,7 +197,7 @@ public HttpSecurityCustomizer warlockSecurityAuthHttpConfigure(WarlockSecurityPr final String url = en.getKey(); final Set pms = CommonPropHelper.onlyValue(en.getValue()); log.info("WarlockShadow conf HttpSecurity, bind url=" + url + ", any-permit=[" + String.join(",", pms) + "]"); - conf.requestMatchers(SecurityConfigHelper.requestMatchers(mvc, url)).hasAnyAuthority(pms.toArray(Null.StrArr)); + conf.requestMatchers(url).hasAnyAuthority(pms.toArray(Null.StrArr)); } } }; @@ -266,7 +276,7 @@ public SecurityFilterChain securityFilterChain(WarlockSecurityProp securityProp, if (StringUtils.hasText(anyRequest)) { log.info("WarlockShadow conf securityFilterChain, anyRequest=" + anyRequest); String str = anyRequest.trim(); - if ("permitAll".equalsIgnoreCase(str)) { + if (!StringUtils.hasText(str) || "permitAll".equalsIgnoreCase(str)) { http.authorizeHttpRequests().anyRequest().permitAll(); } else if ("authenticated".equalsIgnoreCase(str)) { @@ -285,4 +295,123 @@ else if ("fullyAuthenticated".equalsIgnoreCase(str)) { log.info("WarlockShadow conf securityFilterChain, done"); return http.build(); } + + + @Bean + @ConditionalWingsEnabled(abs = WarlockEnabledProp.Key$secCheckUrl) + public ApplicationRunnerOrdered securityCheckUrlRunner(WarlockSecurityProp securityProp, ApplicationContext ctx) { + log.info("WarlockShadow spring-runs securityCheckUrlRunner"); + return new ApplicationRunnerOrdered(WingsOrdered.Lv1Config, ignored -> { + log.info("WarlockShadow check security url config"); + Map matchers = new LinkedHashMap<>(); + Map requests = new LinkedHashMap<>(); + + for (var en : securityProp.getWebIgnore().entrySet()) { + String ptn = en.getValue(); + if (!StringUtils.hasText(ptn)) continue; + matchers.put("WebIgnore:" + en.getKey(), ptn); + requests.put(ptn, SecurityConfigHelper.fakeMatcherRequest(ptn)); + } + for (var en : securityProp.getPermitAll().entrySet()) { + String ptn = en.getValue(); + if (!StringUtils.hasText(ptn)) continue; + matchers.put("PermitAll:" + en.getKey(), ptn); + requests.put(ptn, SecurityConfigHelper.fakeMatcherRequest(ptn)); + } + for (var en : securityProp.getAuthenticated().entrySet()) { + String ptn = en.getValue(); + if (!StringUtils.hasText(ptn)) continue; + matchers.put("Authenticated:" + en.getKey(), ptn); + requests.put(ptn, SecurityConfigHelper.fakeMatcherRequest(ptn)); + } + for (var en : securityProp.getAuthority().entrySet()) { + int c = 0; + String k = en.getKey(); + for (String ptn : en.getValue()) { + if (!StringUtils.hasText(ptn)) continue; + matchers.put("Authority:" + k + "[" + (c++) + "]", ptn); + requests.put(ptn, SecurityConfigHelper.fakeMatcherRequest(ptn)); + } + } + final AtomicReference opt = new AtomicReference<>(); + MatcherHelper matcherHelper = MatcherHelper.of(ctx, opt); + + // check including + for (var en : matchers.entrySet()) { + String ptn = en.getValue(); + requests.remove(ptn); + if (requests.isEmpty()) break; + + matcherHelper.requestMatchers(ptn); + RequestMatcher mt = opt.get(); + for (var er : requests.entrySet()) { + if (mt.matches(er.getValue())) { + log.warn(en.getKey() + "=" + ptn + " should not contain " + er.getKey()); + } + } + } + matchers.clear(); + requests.clear(); + + // check auth url + String loginPage = securityProp.getLoginPage(); + if (StringUtils.hasText(loginPage)) { + requests.put(loginPage, SecurityConfigHelper.fakeMatcherRequest(loginPage)); + } + String logoutUrl = securityProp.getLogoutUrl(); + if (StringUtils.hasText(logoutUrl)) { + requests.put(logoutUrl, SecurityConfigHelper.fakeMatcherRequest(logoutUrl)); + } + String loginProcUrl = securityProp.getLoginProcUrl(); + if (StringUtils.hasText(loginProcUrl)) { + requests.put(loginProcUrl, SecurityConfigHelper.fakeMatcherRequest(loginProcUrl)); + } + + StringBuilder err = new StringBuilder(); + for (var en : securityProp.getWebIgnore().entrySet()) { + String ptn = en.getValue(); + if (!StringUtils.hasText(ptn)) continue; + matcherHelper.requestMatchers(ptn); + RequestMatcher mt = opt.get(); + for (var e : requests.entrySet()) { + if (mt.matches(e.getValue())) { + err.append("\nWebIgnore:").append(en.getKey()).append(" should exclude ").append(e.getKey()); + } + } + } + + String anyRequest = securityProp.getAnyRequest(); + if (!StringUtils.hasText(anyRequest) + || "permitAll".equalsIgnoreCase(anyRequest) + || "anonymous".equalsIgnoreCase(anyRequest)) { + for (var en : securityProp.getPermitAll().entrySet()) { + String ptn = en.getValue(); + if (!StringUtils.hasText(ptn)) continue; + if (requests.isEmpty()) break; + + matcherHelper.requestMatchers(ptn); + RequestMatcher mt = opt.get(); + for (var it = requests.entrySet().iterator(); it.hasNext(); ) { + var er = it.next(); + if (mt.matches(er.getValue())) { + log.debug("WarlockShadow security url permit all include " + er.getKey()); + it.remove(); + } + } + } + if (!requests.isEmpty()) { + err.append("\nPermitAll should include urls: ").append(String.join(", ", requests.keySet())); + } + } + + if (!err.isEmpty()) { + String msg = err.toString(); + log.error(msg); + throw new IllegalStateException( + "\nWarlockSecurityConfConfiguration has security url conflict to fix." + + "\nor disable checking by `wings.enabled.warlock.sec-check-url=false`" + + msg); + } + }); + } } diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockSecurityProp.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockSecurityProp.java index 617e9a5d6..b77437f16 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockSecurityProp.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockSecurityProp.java @@ -63,6 +63,14 @@ public class WarlockSecurityProp { private boolean authorityPerm = false; public static final String Key$authorityPerm = Key + ".authority-perm"; + /** + * whether to enable anonymous + * + * @see #Key$anonymous + */ + private boolean anonymous = false; + public static final String Key$anonymous = Key + ".anonymous"; + /** * true to forward in servlet, otherwise redirect(302) * diff --git a/wings/warlock-shadow/src/main/resources/wings-conf/wings-warlock-security-77.properties b/wings/warlock-shadow/src/main/resources/wings-conf/wings-warlock-security-77.properties index e481c2aab..cac770ae2 100644 --- a/wings/warlock-shadow/src/main/resources/wings-conf/wings-warlock-security-77.properties +++ b/wings/warlock-shadow/src/main/resources/wings-conf/wings-warlock-security-77.properties @@ -4,6 +4,8 @@ wings.warlock.security.web-debug=false wings.warlock.security.authority-role=true ## whether to use Perm in AuthX. wings.warlock.security.authority-perm=true +## whether to enable anonymous +wings.warlock.security.anonymous=false ## true to forward in servlet, otherwise redirect(302) wings.warlock.security.login-forward=true diff --git a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny403Test.java b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny403Test.java index 71d17b8a8..cfac5fb6a 100644 --- a/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny403Test.java +++ b/wings/warlock-shadow/src/test/java/pro/fessional/wings/warlock/security/AccessDeny403Test.java @@ -23,7 +23,8 @@ * @since 2023-08-28 */ -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, + properties = "wings.warlock.security.anonymous=true") @Slf4j class AccessDeny403Test { diff --git a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java index b1d180769..8d18a90b0 100644 --- a/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java +++ b/wings/warlock/src/main/java/pro/fessional/wings/warlock/spring/prop/WarlockEnabledProp.java @@ -25,6 +25,15 @@ public class WarlockEnabledProp { private boolean watching = false; public static final String Key$watching = Key + ".watching"; + + /** + * whether to check security url conflict + * + * @see #Key$secCheckUrl + */ + private boolean secCheckUrl = true; + public static final String Key$secCheckUrl = Key + ".sec-check-url"; + /** * whether to enable Web auto config, eg. firewall, debug, etc. * From 0bb193e7d075de113a5f84b530832ce4511e884b Mon Sep 17 00:00:00 2001 From: trydofor Date: Mon, 11 Dec 2023 12:25:42 +0800 Subject: [PATCH 22/23] =?UTF-8?q?=F0=9F=9A=9A=20replace=20.=20to=20-=20in?= =?UTF-8?q?=20git=20project=20name=20#159?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 4 ++-- observe/docs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index d3d0bc8ad..b75fae309 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,11 +1,11 @@ [submodule "observe/mirana"] path = observe/mirana - url = ../pro.fessional.mirana.git + url = ../professional-mirana.git branch = main shallow = true [submodule "observe/meepo"] path = observe/meepo - url = ../pro.fessional.meepo.git + url = ../professional-meepo.git branch = main shallow = true [submodule "observe/docs"] diff --git a/observe/docs b/observe/docs index 469b6ee2d..ac0b3d4f5 160000 --- a/observe/docs +++ b/observe/docs @@ -1 +1 @@ -Subproject commit 469b6ee2d35b8d70369a3cda764b976b3650321a +Subproject commit ac0b3d4f574fae2c81e03808495280bd111d590a From c272b418391197f09eb5e215e8a7735d645f3dc3 Mon Sep 17 00:00:00 2001 From: trydofor Date: Tue, 12 Dec 2023 11:22:26 +0800 Subject: [PATCH 23/23] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20autoreg=20split=20to?= =?UTF-8?q?=20check=20and=20do=20#161?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../userdetails/JustAuthUserAuthnAutoReg.java | 7 ++-- .../userdetails/JustAuthUserDetailsCombo.java | 3 +- .../auth/impl/DefaultUserAuthnAutoReg.java | 34 +++++++++++++------ .../auth/impl/DefaultUserDetailsCombo.java | 24 +++++++++---- 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/userdetails/JustAuthUserAuthnAutoReg.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/userdetails/JustAuthUserAuthnAutoReg.java index 298a317fd..262fdbc88 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/userdetails/JustAuthUserAuthnAutoReg.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/userdetails/JustAuthUserAuthnAutoReg.java @@ -23,7 +23,7 @@ public class JustAuthUserAuthnAutoReg extends DefaultUserAuthnAutoReg { @Override - protected void beforeSave(Basis basis, String username, WingsAuthDetails details) { + protected Long beforeSave(Basis basis, String username, WingsAuthDetails details) { AuthUser user = (AuthUser) details.getRealData(); AssertArgs.notNull(user, "need JustAuth User"); basis.setNickname(user.getNickname()); @@ -41,16 +41,19 @@ else if (aug == AuthUserGender.MALE) { basis.setRemark(user.getRemark()); basis.setStatus(UserStatus.ACTIVE); log.debug("nickName={}, Gender={}", user.getNickname(), aug); + + return null; } @Override - protected void beforeSave(Authn authn, String username, WingsAuthDetails details, long userId) { + protected Long beforeSave(Authn authn, String username, WingsAuthDetails details, long userId) { AuthUser user = (AuthUser) details.getRealData(); AssertArgs.notNull(user, "need JustAuth User"); authn.setUsername(user.getUuid()); authn.setExtraPara(JSON.toJSONString(user.getToken(), FastJsonHelper.DefaultWriter())); authn.setExtraUser(JSON.toJSONString(user.getRawUserInfo(), FastJsonHelper.DefaultWriter())); log.debug("uuid={}, userId={}", user.getUuid(), userId); + return null; } @Override diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/userdetails/JustAuthUserDetailsCombo.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/userdetails/JustAuthUserDetailsCombo.java index 2c0a70476..8491d635b 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/userdetails/JustAuthUserDetailsCombo.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/security/userdetails/JustAuthUserDetailsCombo.java @@ -6,6 +6,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import pro.fessional.wings.slardar.security.WingsAuthDetails; +import pro.fessional.wings.slardar.security.impl.DefaultWingsUserDetails; import pro.fessional.wings.warlock.service.auth.WarlockAuthnService.Details; import pro.fessional.wings.warlock.service.auth.impl.DefaultUserDetailsCombo; @@ -19,7 +20,7 @@ public class JustAuthUserDetailsCombo extends DefaultUserDetailsCombo { @Override - public boolean authed(Enum authType) { + public boolean asAuthed(@NotNull DefaultWingsUserDetails details) { return true; } diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java index fb852c12b..764029674 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserAuthnAutoReg.java @@ -32,7 +32,7 @@ @Getter @Setter public class DefaultUserAuthnAutoReg implements ComboWarlockAuthnService.AutoReg { - public static final int ORDER = WingsOrdered. Lv3Service + 10; + public static final int ORDER = WingsOrdered.Lv3Service + 10; private int order = ORDER; @Setter(onMethod_ = {@Autowired}) @@ -62,10 +62,12 @@ public Details create(@NotNull Enum authType, String username, WingsAuthDetai user.setRemark("auto register"); user.setStatus(UserStatus.UNINIT); - beforeSave(user, username, details); - long uid = warlockUserBasisService.create(user); - log.debug("auto register user authType={}, username={}, userId={}", authType, username, uid); - afterSave(user, username, details, uid); + Long uid = beforeSave(user, username, details); + if (uid == null) { + uid = warlockUserBasisService.create(user); + log.debug("auto register user authType={}, username={}, userId={}", authType, username, uid); + afterSave(user, username, details, uid); + } // Authn authn = new Authn(); authn.setAuthType(authType); @@ -79,10 +81,12 @@ public Details create(@NotNull Enum authType, String username, WingsAuthDetai // Plain text, encrypt in WarlockUserAuthnService later. authn.setPassword(RandCode.human(16)); - beforeSave(authn, username, details, uid); - long aid = warlockUserAuthnService.create(uid, authn); - log.debug("auto register auth authType={}, username={}, authId={}", authType, username, aid); - afterSave(authn, username, details, uid, aid); + Long aid = beforeSave(authn, username, details, uid); + if (aid == null) { + aid = warlockUserAuthnService.create(uid, authn); + log.debug("auto register auth authType={}, username={}, authId={}", authType, username, aid); + afterSave(authn, username, details, uid, aid); + } final Details result = new Details(); result.setUserId(uid); @@ -101,13 +105,21 @@ public Details create(@NotNull Enum authType, String username, WingsAuthDetai }); } - protected void beforeSave(Basis basis, String username, WingsAuthDetails details) { + /** + * nonnull return value means existed user + */ + protected Long beforeSave(Basis basis, String username, WingsAuthDetails details) { + return null; } protected void afterSave(Basis basis, String username, WingsAuthDetails details, long userId) { } - protected void beforeSave(Authn authn, String username, WingsAuthDetails details, long userId) { + /** + * nonnull return value means existed authn + */ + protected Long beforeSave(Authn authn, String username, WingsAuthDetails details, long userId) { + return null; } protected void afterSave(Authn authn, String username, WingsAuthDetails details, long userId, long authId) { diff --git a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserDetailsCombo.java b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserDetailsCombo.java index 3cc7ad0c3..a2c1ccd15 100644 --- a/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserDetailsCombo.java +++ b/wings/warlock-shadow/src/main/java/pro/fessional/wings/warlock/service/auth/impl/DefaultUserDetailsCombo.java @@ -44,8 +44,8 @@ public final DefaultWingsUserDetails loadOrNull(String username, @NotNull Enum authType, @Nullable WingsAuthDetails authDetail) { + /** + * register user if it can be registered + * + * @see #canRegister(String, Enum, WingsAuthDetails) + */ + protected Details doRegister(String username, @NotNull Enum authType, @Nullable WingsAuthDetails authDetail) { return warlockAuthnService.register(authType, username, authDetail); } /** - * Whether pass the auth, default false + * can register if load null. + */ + protected boolean canRegister(String username, @NotNull Enum authType, @Nullable WingsAuthDetails authDetail) { + return autoRegisterType.contains(authType); + } + + /** + * Whether to pass the auth (preAuth), default false */ - public boolean authed(Enum authType) { + public boolean asAuthed(@NotNull DefaultWingsUserDetails details) { return false; }