├── .gitignore ├── README.md ├── ch01 └── quick-start │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── wisely │ │ │ └── quickstart │ │ │ └── QuickStartApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── top │ └── wisely │ └── quickstart │ └── QuickStartApplicationTests.java ├── ch02 └── functional-programming │ ├── .gitignore │ ├── .gitignore 2 │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── wisely │ │ │ └── functionalprogramming │ │ │ ├── FunctionalProgrammingApplication.java │ │ │ ├── Gender.java │ │ │ ├── Person.java │ │ │ ├── custom_function │ │ │ ├── CustomFunctionDemo.java │ │ │ └── TriFunction.java │ │ │ ├── function │ │ │ └── FunctionDemo.java │ │ │ ├── functional_interface │ │ │ └── FunctionalInterfaceDemo.java │ │ │ ├── lambda │ │ │ └── LambdaDemo.java │ │ │ ├── method_reference │ │ │ └── MethodRefDemo.java │ │ │ ├── optional │ │ │ ├── CreateOptionalDemo.java │ │ │ └── OptioanlDemo.java │ │ │ └── stream │ │ │ ├── CreateStreamDemo.java │ │ │ ├── IntermediateOperationDemo.java │ │ │ ├── TerminalOperationDemo.java │ │ │ └── test.txt │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── top │ └── wisely │ └── functionalprogramming │ └── FunctionalProgrammingApplicationTests.java ├── ch03 └── spring-fundamentals │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ ├── io │ │ │ └── github │ │ │ │ └── wiselyman │ │ │ │ ├── annotations │ │ │ │ ├── EnableA.java │ │ │ │ ├── EnableABC.java │ │ │ │ ├── EnableB.java │ │ │ │ └── EnableC.java │ │ │ │ ├── config │ │ │ │ ├── AConfig.java │ │ │ │ ├── BLowercaseConfig.java │ │ │ │ └── BUppercaseConfig.java │ │ │ │ ├── registrar │ │ │ │ └── CBeanDefinitionRegistrar.java │ │ │ │ └── selector │ │ │ │ ├── BForABCSelector.java │ │ │ │ └── BSelector.java │ │ └── top │ │ │ └── wisely │ │ │ └── springfundamentals │ │ │ ├── SpringFundamentalsApplication.java │ │ │ ├── annotations │ │ │ ├── CustomBean.java │ │ │ ├── CustomService.java │ │ │ └── InjectLogger.java │ │ │ ├── aop │ │ │ ├── Logging.java │ │ │ ├── LoggingAspect.java │ │ │ └── PersonService.java │ │ │ ├── awared │ │ │ └── AwareSpringService.java │ │ │ ├── beans │ │ │ ├── annotated │ │ │ │ ├── AsyncTaskService.java │ │ │ │ ├── EventListenerService.java │ │ │ │ ├── EventListenerService2.java │ │ │ │ ├── EventPublishService.java │ │ │ │ ├── ForValueService.java │ │ │ │ ├── LifeService.java │ │ │ │ ├── ScopeService.java │ │ │ │ ├── ScopeService2.java │ │ │ │ ├── SomeService.java │ │ │ │ ├── SomeService2.java │ │ │ │ ├── UsePrimaryService.java │ │ │ │ ├── UseQualifierService.java │ │ │ │ ├── UseQualifierService2.java │ │ │ │ └── ValueService.java │ │ │ └── pojo │ │ │ │ ├── AnotherService.java │ │ │ │ ├── CommandService.java │ │ │ │ ├── LifeService2.java │ │ │ │ ├── ScopeService3.java │ │ │ │ └── WindowsService.java │ │ │ ├── conditions │ │ │ └── OnWindowsCondition.java │ │ │ ├── config │ │ │ ├── ExternalConfig.java │ │ │ ├── JavaConfig.java │ │ │ ├── LinuxProfileConfig.java │ │ │ ├── SystemAutoConfig.java │ │ │ └── WindowsProfileConfig.java │ │ │ ├── custom_scan │ │ │ └── CustomBeanService.java │ │ │ ├── event │ │ │ └── MessageEvent.java │ │ │ ├── injected │ │ │ ├── AnnotationInjectionService.java │ │ │ ├── AnnotationOneInjectionService.java │ │ │ ├── AnnotationPropertyInjectionService.java │ │ │ ├── AnnotationSetterInjectionService.java │ │ │ ├── DemoLoggerService.java │ │ │ ├── JavaConfigInjectService.java │ │ │ ├── MixInjectionService.java │ │ │ ├── MixInjectionService2.java │ │ │ └── ScopeInjectService.java │ │ │ └── processor │ │ │ ├── CustomBeanDefinitionRegistryPostProcessor.java │ │ │ ├── GlobalPostProcessor.java │ │ │ └── InjectLoggerAnnotationBeanPostPorcessor.java │ └── resources │ │ ├── application.properties │ │ ├── author.properties │ │ └── book.properties │ └── test │ └── java │ └── top │ └── wisely │ └── springfundamentals │ └── SpringFundamentalsApplicationTests.java ├── ch04 ├── .DS_Store └── spring-boot │ ├── custom-spring-boot-starter-demo │ ├── .gradle │ │ ├── 4.10.3 │ │ │ ├── fileChanges │ │ │ │ └── last-build.bin │ │ │ ├── fileHashes │ │ │ │ ├── fileHashes.bin │ │ │ │ └── fileHashes.lock │ │ │ ├── gc.properties │ │ │ └── taskHistory │ │ │ │ ├── taskHistory.bin │ │ │ │ └── taskHistory.lock │ │ ├── buildOutputCleanup │ │ │ ├── buildOutputCleanup.lock │ │ │ ├── cache.properties │ │ │ └── outputFiles.bin │ │ └── vcs-1 │ │ │ └── gc.properties │ ├── hello-client │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── io │ │ │ │ │ └── github │ │ │ │ │ └── wiselyman │ │ │ │ │ └── helloclient │ │ │ │ │ └── HelloClientApplication.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ │ └── test │ │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── wiselyman │ │ │ └── helloclient │ │ │ └── HelloClientApplicationTests.java │ ├── hello-starter │ │ ├── .gradle │ │ │ ├── 5.2.1 │ │ │ │ ├── executionHistory │ │ │ │ │ ├── executionHistory.bin │ │ │ │ │ └── executionHistory.lock │ │ │ │ ├── fileChanges │ │ │ │ │ └── last-build.bin │ │ │ │ ├── fileContent │ │ │ │ │ └── fileContent.lock │ │ │ │ ├── fileHashes │ │ │ │ │ ├── fileHashes.bin │ │ │ │ │ ├── fileHashes.lock │ │ │ │ │ └── resourceHashesCache.bin │ │ │ │ ├── gc.properties │ │ │ │ └── javaCompile │ │ │ │ │ ├── classAnalysis.bin │ │ │ │ │ ├── jarAnalysis.bin │ │ │ │ │ ├── javaCompile.lock │ │ │ │ │ └── taskHistory.bin │ │ │ ├── buildOutputCleanup │ │ │ │ ├── buildOutputCleanup.lock │ │ │ │ ├── cache.properties │ │ │ │ └── outputFiles.bin │ │ │ └── vcs-1 │ │ │ │ └── gc.properties │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── hello-spring-boot-autoconfigure │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── autoconfigure │ │ │ │ │ ├── GreetingAutoConfiguration.java │ │ │ │ │ └── GreetingProperties.java │ │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── spring.factories │ │ ├── hello-spring-boot-starter │ │ │ └── build.gradle │ │ └── settings.gradle │ └── hello │ │ ├── .gradle │ │ ├── 4.10.3 │ │ │ ├── fileChanges │ │ │ │ └── last-build.bin │ │ │ ├── fileHashes │ │ │ │ ├── fileHashes.bin │ │ │ │ └── fileHashes.lock │ │ │ ├── gc.properties │ │ │ └── taskHistory │ │ │ │ ├── taskHistory.bin │ │ │ │ └── taskHistory.lock │ │ ├── 5.2.1 │ │ │ ├── executionHistory │ │ │ │ ├── executionHistory.bin │ │ │ │ └── executionHistory.lock │ │ │ ├── fileChanges │ │ │ │ └── last-build.bin │ │ │ ├── fileContent │ │ │ │ └── fileContent.lock │ │ │ ├── fileHashes │ │ │ │ ├── fileHashes.bin │ │ │ │ └── fileHashes.lock │ │ │ ├── gc.properties │ │ │ └── javaCompile │ │ │ │ ├── classAnalysis.bin │ │ │ │ ├── javaCompile.lock │ │ │ │ └── taskHistory.bin │ │ ├── buildOutputCleanup │ │ │ ├── buildOutputCleanup.lock │ │ │ ├── cache.properties │ │ │ └── outputFiles.bin │ │ └── vcs-1 │ │ │ └── gc.properties │ │ ├── build.gradle │ │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── src │ │ └── main │ │ └── java │ │ └── top │ │ └── wisely │ │ └── GreetingService.java │ ├── learning-spring-boot-actuator │ ├── .gitignore │ ├── build.gradle │ ├── config │ │ └── prometheus.yml │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── learningspringbootactuator │ │ │ │ │ ├── LearningSpringBootActuatorApplication.java │ │ │ │ │ └── actuator │ │ │ │ │ ├── MyEndpoint.java │ │ │ │ │ ├── MyHealthIndicator.java │ │ │ │ │ ├── MyHttpTraceRepository.java │ │ │ │ │ └── MyMetrics.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── learningspringbootactuator │ │ │ └── LearningSpringBootActuatorApplicationTests.java │ └── stack.yml │ └── spring-boot-in-depth │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ ├── io │ │ │ └── github │ │ │ │ └── wiselyman │ │ │ │ └── service │ │ │ │ └── DemoService2.java │ │ └── top │ │ │ └── wisely │ │ │ └── springbootindepth │ │ │ ├── SpringBootInDepthApplication.java │ │ │ ├── author │ │ │ ├── AuthorConfiguration.java │ │ │ └── AuthorProperties.java │ │ │ ├── customizer │ │ │ └── MyJackson2ObjectMapperBuilderCustomizer.java │ │ │ ├── listener │ │ │ └── MyListener.java │ │ │ ├── processor │ │ │ └── MyEnvironmentPostProcessor.java │ │ │ ├── service │ │ │ └── DemoService.java │ │ │ └── task │ │ │ ├── AsyncTask.java │ │ │ └── ScheduledTask.java │ └── resources │ │ ├── META-INF │ │ └── spring.factories │ │ ├── application-dev-port.yml │ │ ├── application-prod-lazy.yml │ │ ├── application-prod-port.yml │ │ ├── application-prod.yml │ │ ├── application.properties │ │ └── application.yml │ └── test │ └── java │ └── top │ └── wisely │ └── springbootindepth │ └── SpringBootInDepthApplicationTests.java ├── ch05 ├── .DS_Store └── learning-spring-mvc │ ├── .DS_Store │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── some.html │ └── src │ ├── .DS_Store │ ├── main │ ├── .DS_Store │ ├── java │ │ ├── .DS_Store │ │ └── top │ │ │ ├── .DS_Store │ │ │ └── wisely │ │ │ ├── .DS_Store │ │ │ └── learningspringmvc │ │ │ ├── .DS_Store │ │ │ ├── LearningSpringMvcApplication.java │ │ │ ├── annotation │ │ │ ├── PersonFormat.java │ │ │ ├── ProcessTag.java │ │ │ ├── RequestPerson.java │ │ │ ├── ResponsePerson.java │ │ │ └── StrLength.java │ │ │ ├── argument_return │ │ │ ├── BeanArgumentResolver.java │ │ │ └── RequestResponsePersonMethodProcessor.java │ │ │ ├── client │ │ │ └── PersonClient.java │ │ │ ├── config │ │ │ └── WebConfiguration.java │ │ │ ├── controller │ │ │ ├── AsyncController.java │ │ │ ├── DemoController.java │ │ │ ├── PeopleController.java │ │ │ └── advice │ │ │ │ ├── CustomRequestBodyAdvice.java │ │ │ │ ├── CustomResponseBodyAdvice.java │ │ │ │ ├── ExceptionHandlerAdvice.java │ │ │ │ └── InitBinderAdvice.java │ │ │ ├── converter │ │ │ ├── AnotherPersonFormatter.java │ │ │ ├── PersonEditor.java │ │ │ ├── PersonFormatAnnotationFormatterFactory.java │ │ │ ├── PersonFormatter.java │ │ │ └── StringToLengthConverter.java │ │ │ ├── domain │ │ │ ├── AnotherPerson.java │ │ │ ├── DemoBean.java │ │ │ ├── Person.java │ │ │ └── SecondPerson.java │ │ │ ├── exception │ │ │ └── PersonNameNotFoundException.java │ │ │ ├── http_message_converter │ │ │ └── AnotherPersonHttpMessageConverter.java │ │ │ ├── interceptor │ │ │ └── CustomInterceptor.java │ │ │ ├── repository │ │ │ ├── CommonRepository.java │ │ │ └── PersonRepository.java │ │ │ ├── service │ │ │ ├── DemoService.java │ │ │ └── TaskService.java │ │ │ ├── servlet │ │ │ ├── CustomFilter.java │ │ │ ├── CustomListener.java │ │ │ ├── CustomServlet.java │ │ │ └── CustomWebServerFactoryCustomizer.java │ │ │ ├── utils │ │ │ └── MyBeanUtils.java │ │ │ └── validator │ │ │ └── PersonValidator.java │ └── resources │ │ ├── META-INF │ │ └── resources │ │ │ └── 4.html │ │ ├── application.yml │ │ ├── keystore.jks │ │ ├── my-static │ │ └── 5.html │ │ ├── public │ │ └── 3.html │ │ ├── resources │ │ └── 1.html │ │ ├── static │ │ ├── 2.html │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── push │ │ │ ├── not-push.css │ │ │ ├── not-push.js │ │ │ ├── push.css │ │ │ ├── push.html │ │ │ ├── push.js │ │ │ └── wyn.jpg │ │ ├── sse.html │ │ └── wyn.jpg │ │ └── wyn.jpg │ └── test │ └── java │ └── top │ └── wisely │ └── learningspringmvc │ └── LearningSpringMvcApplicationTests.java ├── ch06 └── spring-data │ ├── learning-caching │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── learningcaching │ │ │ │ │ ├── LearningCachingApplication.java │ │ │ │ │ ├── domain │ │ │ │ │ └── model │ │ │ │ │ │ └── Student.java │ │ │ │ │ ├── repository │ │ │ │ │ └── StudentRepository.java │ │ │ │ │ └── service │ │ │ │ │ └── StudentService.java │ │ │ └── resources │ │ │ │ ├── application.yml │ │ │ │ └── data.sql │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── learningcaching │ │ │ └── LearningCachingApplicationTests.java │ └── stack.yml │ ├── learning-spring-data-elasticsearch │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── learningspringdataelasticsearch │ │ │ │ │ ├── LearningSpringDataElasticsearchApplication.java │ │ │ │ │ ├── config │ │ │ │ │ └── RestEsConfig.java │ │ │ │ │ ├── domain │ │ │ │ │ ├── model │ │ │ │ │ │ ├── Address.java │ │ │ │ │ │ ├── AnotherPerson.java │ │ │ │ │ │ ├── Child.java │ │ │ │ │ │ └── Person.java │ │ │ │ │ └── type │ │ │ │ │ │ └── Gender.java │ │ │ │ │ └── repository │ │ │ │ │ ├── AnotherPersonRepository.java │ │ │ │ │ └── PersonRepository.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── learningspringdataelasticsearch │ │ │ └── LearningSpringDataElasticsearchApplicationTests.java │ └── stack.yml │ └── learning-spring-data-jpa │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── procedure.sql │ ├── settings.gradle │ ├── src │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── learningspringdatajpa │ │ │ │ ├── LearningSpringDataJpaApplication.java │ │ │ │ ├── controller │ │ │ │ └── PersonController.java │ │ │ │ ├── domain │ │ │ │ ├── converter │ │ │ │ │ └── SchoolConverter.java │ │ │ │ ├── domain_event │ │ │ │ │ └── PersonSaved.java │ │ │ │ ├── listener │ │ │ │ │ ├── DomainEventListener.java │ │ │ │ │ └── PersonListener.java │ │ │ │ ├── model │ │ │ │ │ ├── Address.java │ │ │ │ │ ├── AnotherPerson.java │ │ │ │ │ ├── Child.java │ │ │ │ │ ├── Company.java │ │ │ │ │ ├── Employee.java │ │ │ │ │ └── Person.java │ │ │ │ ├── projection │ │ │ │ │ ├── PersonDto.java │ │ │ │ │ ├── PersonProjectionHelper.java │ │ │ │ │ └── PersonProjectionInterface.java │ │ │ │ ├── service │ │ │ │ │ └── ListenerService.java │ │ │ │ ├── specification │ │ │ │ │ └── CustomSpecs.java │ │ │ │ └── type │ │ │ │ │ └── Gender.java │ │ │ │ └── repository │ │ │ │ ├── AnotherPersonRepository.java │ │ │ │ ├── EmployeeRepository.java │ │ │ │ └── PersonRepository.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── data.sql │ │ │ ├── db │ │ │ └── migration │ │ │ │ ├── V1_1__Some_Changes.sql │ │ │ │ └── V1__Initial_Setup.sql │ │ │ └── schema.sql │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── learningspringdatajpa │ │ └── LearningSpringDataJpaApplicationTests.java │ └── stack.yml ├── ch07 └── spring-security │ ├── learning-oauth2 │ ├── auth-server │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── authserver │ │ │ │ │ ├── AuthServerApplication.java │ │ │ │ │ ├── config │ │ │ │ │ ├── AuthServerConfig.java │ │ │ │ │ └── WebSecurityConfig.java │ │ │ │ │ ├── controller │ │ │ │ │ └── UserController.java │ │ │ │ │ ├── domain │ │ │ │ │ └── model │ │ │ │ │ │ ├── SysAuthority.java │ │ │ │ │ │ ├── SysRole.java │ │ │ │ │ │ └── SysUser.java │ │ │ │ │ ├── repository │ │ │ │ │ ├── SysAuthorityRepository.java │ │ │ │ │ ├── SysRoleRepository.java │ │ │ │ │ └── SysUserRepository.java │ │ │ │ │ └── security │ │ │ │ │ ├── CusotmUserDetailsService.java │ │ │ │ │ └── JwkSetEndpoint.java │ │ │ └── resources │ │ │ │ ├── application.yml │ │ │ │ ├── data.sql │ │ │ │ ├── keystore.jks │ │ │ │ ├── public.txt │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── authserver │ │ │ └── AuthServerApplicationTests.java │ ├── client │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── client │ │ │ │ │ ├── ClientApplication.java │ │ │ │ │ ├── config │ │ │ │ │ └── WebConfig.java │ │ │ │ │ └── controller │ │ │ │ │ └── SecurityController.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── client │ │ │ └── ClientApplicationTests.java │ └── resource-server │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── resourceserver │ │ │ │ ├── ResourceServerApplication.java │ │ │ │ ├── config │ │ │ │ └── WebSecurityConfig.java │ │ │ │ └── controller │ │ │ │ └── SecurityController.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── public.txt │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── resourceserver │ │ └── ResourceServerApplicationTests.java │ ├── learning-spring-security-in-battle │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── learningspringsecurityinbattle │ │ │ │ ├── LearningSpringSecurityInBattleApplication.java │ │ │ │ ├── config │ │ │ │ └── WebSecurityConfig.java │ │ │ │ ├── controller │ │ │ │ └── SecurityController.java │ │ │ │ ├── domain │ │ │ │ └── model │ │ │ │ │ ├── SysAuthority.java │ │ │ │ │ ├── SysRole.java │ │ │ │ │ └── SysUser.java │ │ │ │ ├── repository │ │ │ │ ├── SysAuthorityRepository.java │ │ │ │ ├── SysRoleRepository.java │ │ │ │ └── SysUserRepository.java │ │ │ │ └── security │ │ │ │ └── CusotmUserDetailsService.java │ │ └── resources │ │ │ └── application.yaml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── learningspringsecurityinbattle │ │ └── LearningSpringSecurityInBattleApplicationTests.java │ └── learning-spring-security │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── wisely │ │ │ └── learningspringsecurity │ │ │ ├── LearningSpringSecurityApplication.java │ │ │ ├── config │ │ │ └── WebSecurityConfig.java │ │ │ ├── controller │ │ │ └── IndexController.java │ │ │ ├── domain │ │ │ └── model │ │ │ │ └── SysUser.java │ │ │ ├── repository │ │ │ └── SysUserRepository.java │ │ │ └── security │ │ │ ├── CusotmUserDetailsService.java │ │ │ ├── CustomAuthenticationProvider.java │ │ │ └── WebSecurity.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── top │ └── wisely │ └── learningspringsecurity │ └── LearningSpringSecurityApplicationTests.java ├── ch08 └── reactive-programming │ ├── learning-reactive-nosql │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── learningreactivenosql │ │ │ │ │ ├── LearningReactiveNosqlApplication.java │ │ │ │ │ ├── client │ │ │ │ │ └── ControllerClient.java │ │ │ │ │ ├── controller │ │ │ │ │ └── PersonController.java │ │ │ │ │ ├── domain │ │ │ │ │ └── model │ │ │ │ │ │ └── Person.java │ │ │ │ │ └── repository │ │ │ │ │ └── PersonRepository.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── learningreactivenosql │ │ │ └── LearningReactiveNosqlApplicationTests.java │ └── stack.yml │ ├── learning-reactive-security │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── learningreactivesecurity │ │ │ │ ├── LearningReactiveSecurityApplication.java │ │ │ │ ├── client │ │ │ │ └── ControllerClient.java │ │ │ │ ├── config │ │ │ │ └── ReactiveSecurityConfig.java │ │ │ │ ├── controller │ │ │ │ ├── PersonController.java │ │ │ │ └── UserController.java │ │ │ │ ├── domain │ │ │ │ └── model │ │ │ │ │ ├── Person.java │ │ │ │ │ ├── SysAuthority.java │ │ │ │ │ └── SysUser.java │ │ │ │ ├── repository │ │ │ │ ├── PersonRepository.java │ │ │ │ └── SysUserRepository.java │ │ │ │ └── security │ │ │ │ └── CustomReactiveUserDetailsService.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── learningreactivesecurity │ │ └── LearningReactiveSecurityApplicationTests.java │ ├── learning-reactive-sql │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── learningreactivesql │ │ │ │ │ ├── LearningReactiveSqlApplication.java │ │ │ │ │ ├── client │ │ │ │ │ └── ControllerClient.java │ │ │ │ │ ├── controller │ │ │ │ │ └── PersonController.java │ │ │ │ │ ├── database │ │ │ │ │ └── ReactiveDatabaseInitializer.java │ │ │ │ │ ├── domain │ │ │ │ │ └── model │ │ │ │ │ │ └── Person.java │ │ │ │ │ └── repository │ │ │ │ │ └── PersonRepository.java │ │ │ └── resources │ │ │ │ ├── application.yml │ │ │ │ └── schema.sql │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── learningreactivesql │ │ │ └── LearningReactiveSqlApplicationTests.java │ └── stack.yml │ ├── learning-reactor │ ├── .gradle │ │ ├── 4.10.3 │ │ │ ├── fileChanges │ │ │ │ └── last-build.bin │ │ │ ├── fileContent │ │ │ │ └── fileContent.lock │ │ │ ├── fileHashes │ │ │ │ ├── fileHashes.bin │ │ │ │ └── fileHashes.lock │ │ │ ├── gc.properties │ │ │ ├── javaCompile │ │ │ │ ├── classAnalysis.bin │ │ │ │ ├── javaCompile.lock │ │ │ │ └── taskHistory.bin │ │ │ └── taskHistory │ │ │ │ ├── taskHistory.bin │ │ │ │ └── taskHistory.lock │ │ ├── buildOutputCleanup │ │ │ ├── buildOutputCleanup.lock │ │ │ ├── cache.properties │ │ │ └── outputFiles.bin │ │ └── vcs-1 │ │ │ └── gc.properties │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ └── main │ │ └── java │ │ └── top │ │ └── wisely │ │ └── FluxAndMono.java │ └── learning-spring-webflux │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── wisely │ │ │ └── learningspringwebflux │ │ │ ├── LearningSpringWebfluxApplication.java │ │ │ ├── client │ │ │ └── ControllerClient.java │ │ │ ├── config │ │ │ ├── RoutingConfiguration.java │ │ │ └── WebFluxConfig.java │ │ │ ├── controller │ │ │ ├── PersonController.java │ │ │ └── PersonHandler.java │ │ │ ├── domain │ │ │ └── model │ │ │ │ └── Person.java │ │ │ ├── repository │ │ │ ├── CommonRepository.java │ │ │ └── PersonRepository.java │ │ │ └── utils │ │ │ └── MyBeanUtils.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── top │ └── wisely │ └── learningspringwebflux │ └── LearningSpringWebfluxApplicationTests.java ├── ch09 └── spring-messaging │ ├── learning-amqp │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── learningamqp │ │ │ │ │ ├── LearningAmqpApplication.java │ │ │ │ │ └── messaging │ │ │ │ │ ├── ConfirmConsumer.java │ │ │ │ │ ├── MessageConsumer.java │ │ │ │ │ ├── MessageEvent.java │ │ │ │ │ └── MessageProducer.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── learningamqp │ │ │ └── LearningAmqpApplicationTests.java │ └── stack.yml │ ├── learning-jms │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── learningjms │ │ │ │ │ ├── LearningJmsApplication.java │ │ │ │ │ └── messaging │ │ │ │ │ ├── ConfirmConsumer.java │ │ │ │ │ ├── MessageConsumer.java │ │ │ │ │ ├── MessageEvent.java │ │ │ │ │ └── MessageProducer.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── learningjms │ │ │ └── LearningJmsApplicationTests.java │ └── stack.yml │ ├── learning-kafka │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ ├── src │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── wisely │ │ │ │ │ └── learningkafka │ │ │ │ │ ├── LearningKafkaApplication.java │ │ │ │ │ └── messaging │ │ │ │ │ ├── ConfirmConsumer.java │ │ │ │ │ ├── MessageConsumer.java │ │ │ │ │ ├── MessageEvent.java │ │ │ │ │ └── MessageProducer.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── wisely │ │ │ └── learningkafka │ │ │ └── LearningKafkaApplicationTests.java │ └── stack.yml │ ├── learning-websocket-reactive │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── learningwebsocketreactive │ │ │ │ ├── LearningWebsocketReactiveApplication.java │ │ │ │ ├── config │ │ │ │ └── WebsocketConfig.java │ │ │ │ └── handler │ │ │ │ └── HelloHandler.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── static │ │ │ └── hello.html │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── learningwebsocketreactive │ │ └── LearningWebsocketReactiveApplicationTests.java │ ├── learning-websocket │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── learningwebsocket │ │ │ │ ├── LearningWebsocketApplication.java │ │ │ │ ├── config │ │ │ │ ├── SecurityConfig.java │ │ │ │ └── WebsocketConfig.java │ │ │ │ └── controller │ │ │ │ └── ChatController.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── static │ │ │ └── chat.html │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── learningwebsocket │ │ └── LearningWebsocketApplicationTests.java │ └── rsocket │ ├── rsocket-client │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── rsocketclient │ │ │ │ ├── RsocketClientApplication.java │ │ │ │ ├── client │ │ │ │ └── ControllerClient.java │ │ │ │ ├── controller │ │ │ │ └── ClientPersonController.java │ │ │ │ └── domain │ │ │ │ └── model │ │ │ │ └── Person.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── rsocketclient │ │ └── RsocketClientApplicationTests.java │ └── rsocket-server │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── wisely │ │ │ └── rsocketserver │ │ │ ├── RsocketServerApplication.java │ │ │ ├── controller │ │ │ └── PersonController.java │ │ │ ├── domain │ │ │ └── model │ │ │ │ └── Person.java │ │ │ └── repository │ │ │ └── PersonRepository.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── top │ └── wisely │ └── rsocketserver │ └── RsocketServerApplicationTests.java ├── ch10 └── integration-batch │ ├── learning-spring-batch │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── learningspringbatch │ │ │ │ ├── LearningSpringBatchApplication.java │ │ │ │ ├── config │ │ │ │ └── BatchConfig.java │ │ │ │ ├── domain │ │ │ │ └── model │ │ │ │ │ └── Person.java │ │ │ │ ├── dto │ │ │ │ └── CsvPerson.java │ │ │ │ └── listener │ │ │ │ └── MyJobListener.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── people.csv │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── learningspringbatch │ │ └── LearningSpringBatchApplicationTests.java │ └── learning-spring-integration │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── wisely │ │ │ └── learningspringintegration │ │ │ ├── LearningSpringIntegrationApplication.java │ │ │ ├── config │ │ │ └── IntegrationConfig.java │ │ │ └── service │ │ │ └── SendingGateway.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── top │ └── wisely │ └── learningspringintegration │ └── LearningSpringIntegrationApplicationTests.java ├── ch11 └── microservices │ └── spring-cloud │ ├── address-service │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── addressservice │ │ │ │ ├── AddressServiceApplication.java │ │ │ │ ├── config │ │ │ │ └── KafkaBindings.java │ │ │ │ ├── controller │ │ │ │ ├── AddressController.java │ │ │ │ └── PersonController.java │ │ │ │ ├── domain │ │ │ │ └── model │ │ │ │ │ ├── Address.java │ │ │ │ │ └── Person.java │ │ │ │ ├── event │ │ │ │ ├── AddressSavedEvent.java │ │ │ │ └── PersonSavedEvent.java │ │ │ │ ├── repository │ │ │ │ ├── AddressRepository.java │ │ │ │ └── PersonRepository.java │ │ │ │ └── service │ │ │ │ └── in │ │ │ │ └── PersonService.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── addressservice │ │ └── AddressServiceApplicationTests.java │ ├── auth-server │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── authserver │ │ │ │ ├── AuthServerApplication.java │ │ │ │ ├── config │ │ │ │ ├── AuthServerConfig.java │ │ │ │ └── WebSecurityConfig.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── domain │ │ │ │ └── model │ │ │ │ │ ├── SysAuthority.java │ │ │ │ │ ├── SysRole.java │ │ │ │ │ └── SysUser.java │ │ │ │ ├── repository │ │ │ │ ├── SysAuthorityRepository.java │ │ │ │ ├── SysRoleRepository.java │ │ │ │ └── SysUserRepository.java │ │ │ │ └── security │ │ │ │ ├── CusotmUserDetailsService.java │ │ │ │ └── JwkSetEndpoint.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── bootstrap.yml │ │ │ ├── data.sql │ │ │ ├── keystore.jks │ │ │ ├── public.txt │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── authserver │ │ └── AuthServerApplicationTests.java │ ├── config-server │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── configserver │ │ │ │ └── ConfigServerApplication.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── config │ │ │ ├── auth-server.yml │ │ │ ├── discovery-client-dev.yml │ │ │ ├── discovery-client-prod.yml │ │ │ ├── discovery-client.yml │ │ │ ├── feign-service.yml │ │ │ ├── gateway.yml │ │ │ └── resource-server.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── configserver │ │ └── ConfigServerApplicationTests.java │ ├── discovery-client │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── discoveryclient │ │ │ │ ├── DiscoveryClientApplication.java │ │ │ │ ├── controller │ │ │ │ └── PersonController.java │ │ │ │ └── domain │ │ │ │ └── model │ │ │ │ └── Person.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── bootstrap.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── discoveryclient │ │ └── DiscoveryClientApplicationTests.java │ ├── discovery-server │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── discoveryserver │ │ │ │ └── DiscoveryServerApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── discoveryserver │ │ └── DiscoveryServerApplicationTests.java │ ├── feign-client │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── feignclient │ │ │ │ ├── FeignClientApplication.java │ │ │ │ ├── client │ │ │ │ └── PersonClient.java │ │ │ │ └── domain │ │ │ │ └── model │ │ │ │ └── Person.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── feignclient │ │ └── FeignClientApplicationTests.java │ ├── feign-service │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── feignservice │ │ │ │ ├── FeignServiceApplication.java │ │ │ │ ├── client │ │ │ │ └── ResourceClient.java │ │ │ │ ├── config │ │ │ │ └── WebSecurityConfig.java │ │ │ │ └── controller │ │ │ │ └── FeignController.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── bootstrap.yml │ │ │ └── public.txt │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── feignservice │ │ └── FeignServiceApplicationTests.java │ ├── gateway │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── gateway │ │ │ │ └── GatewayApplication.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── bootstrap.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── gateway │ │ └── GatewayApplicationTests.java │ ├── person-service │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── personservice │ │ │ │ ├── PersonServiceApplication.java │ │ │ │ ├── config │ │ │ │ └── KafkaBindings.java │ │ │ │ ├── controller │ │ │ │ ├── AddressController.java │ │ │ │ └── PersonController.java │ │ │ │ ├── domain │ │ │ │ └── model │ │ │ │ │ ├── Address.java │ │ │ │ │ └── Person.java │ │ │ │ ├── event │ │ │ │ ├── AddressSavedEvent.java │ │ │ │ └── PersonSavedEvent.java │ │ │ │ ├── repository │ │ │ │ ├── AddressRepository.java │ │ │ │ └── PersonRepository.java │ │ │ │ └── service │ │ │ │ └── in │ │ │ │ └── AddressService.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── personservice │ │ └── PersonServiceApplicationTests.java │ ├── reactive-stream-consumer │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── reactivestreamconsumer │ │ │ │ ├── ReactiveStreamConsumerApplication.java │ │ │ │ ├── event │ │ │ │ └── MessageEvent.java │ │ │ │ └── service │ │ │ │ └── ConsumerService.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── reactivestreamconsumer │ │ └── ReactiveStreamConsumerApplicationTests.java │ ├── reactive-stream-producer │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── reactivestreamproducer │ │ │ │ ├── ReactiveStreamProducerApplication.java │ │ │ │ ├── event │ │ │ │ └── MessageEvent.java │ │ │ │ └── service │ │ │ │ └── ProducerService.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── reactivestreamproducer │ │ └── ReactiveStreamProducerApplicationTests.java │ └── resource-server │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── wisely │ │ │ └── resourceserver │ │ │ ├── ResourceServerApplication.java │ │ │ ├── config │ │ │ └── WebSecurityConfig.java │ │ │ └── controller │ │ │ └── SecurityController.java │ └── resources │ │ ├── application.yml │ │ ├── bootstrap.yml │ │ └── public.txt │ └── test │ └── java │ └── top │ └── wisely │ └── resourceserver │ └── ResourceServerApplicationTests.java ├── ch12 ├── .DS_Store ├── istio │ └── demo-istio-service │ │ ├── .gitignore │ │ ├── Dockerfile │ │ ├── all.yml │ │ ├── build.gradle │ │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── runboot.sh │ │ ├── settings.gradle │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── wisely │ │ │ │ └── demoistioservice │ │ │ │ ├── DemoIstioServiceApplication.java │ │ │ │ └── controller │ │ │ │ └── HelloController.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── top │ │ └── wisely │ │ └── demoistioservice │ │ └── DemoIstioServiceApplicationTests.java └── k8s │ ├── .DS_Store │ ├── basic │ ├── ingress.yaml │ ├── pvc.yml │ ├── tomcat-deployment.yaml │ ├── tomcat-pod.yaml │ ├── tomcat-rs.yaml │ ├── tomcat-service.yaml │ └── use-pvc-deployment.yaml │ ├── devops │ ├── .DS_Store │ ├── docker-registry │ │ └── values.yaml │ └── jenkins │ │ ├── jenkins │ │ ├── .helmignore │ │ ├── Chart.yaml │ │ ├── OWNERS │ │ ├── README.md │ │ ├── ci │ │ │ ├── casc-values.yaml │ │ │ └── default-values.yaml │ │ ├── templates │ │ │ ├── NOTES.txt │ │ │ ├── _helpers.tpl │ │ │ ├── config.yaml │ │ │ ├── deprecation.yaml │ │ │ ├── home-pvc.yaml │ │ │ ├── jcasc-config.yaml │ │ │ ├── jenkins-agent-svc.yaml │ │ │ ├── jenkins-backup-cronjob.yaml │ │ │ ├── jenkins-backup-rbac.yaml │ │ │ ├── jenkins-master-alerting-rules.yaml │ │ │ ├── jenkins-master-deployment.yaml │ │ │ ├── jenkins-master-ingress.yaml │ │ │ ├── jenkins-master-networkpolicy.yaml │ │ │ ├── jenkins-master-route.yaml │ │ │ ├── jenkins-master-servicemonitor.yaml │ │ │ ├── jenkins-master-svc.yaml │ │ │ ├── jobs.yaml │ │ │ ├── rbac.yaml │ │ │ ├── secret.yaml │ │ │ ├── service-account-agent.yaml │ │ │ ├── service-account.yaml │ │ │ └── tests │ │ │ │ ├── jenkins-test.yaml │ │ │ │ └── test-config.yaml │ │ └── values.yaml │ │ └── values.yaml │ └── helm │ └── postgresql │ └── values.yaml ├── tools ├── gradle-java │ ├── .gradle │ │ ├── 5.2.1 │ │ │ ├── executionHistory │ │ │ │ ├── executionHistory.bin │ │ │ │ └── executionHistory.lock │ │ │ ├── fileChanges │ │ │ │ └── last-build.bin │ │ │ ├── fileContent │ │ │ │ └── fileContent.lock │ │ │ ├── fileHashes │ │ │ │ ├── fileHashes.bin │ │ │ │ └── fileHashes.lock │ │ │ ├── gc.properties │ │ │ └── javaCompile │ │ │ │ ├── javaCompile.lock │ │ │ │ └── taskHistory.bin │ │ ├── buildOutputCleanup │ │ │ ├── buildOutputCleanup.lock │ │ │ ├── cache.properties │ │ │ └── outputFiles.bin │ │ └── vcs-1 │ │ │ └── gc.properties │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── top │ │ └── wisely │ │ └── Hello.java ├── gradle-project │ ├── .gradle │ │ ├── 5.2.1 │ │ │ ├── executionHistory │ │ │ │ ├── executionHistory.bin │ │ │ │ └── executionHistory.lock │ │ │ ├── fileChanges │ │ │ │ └── last-build.bin │ │ │ ├── fileHashes │ │ │ │ └── fileHashes.lock │ │ │ └── gc.properties │ │ └── buildOutputCleanup │ │ │ ├── buildOutputCleanup.lock │ │ │ └── cache.properties │ └── build.gradle └── intellij-spring-boot │ ├── .gitignore │ ├── build.gradle │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── wisely │ │ │ └── intellijspringboot │ │ │ └── IntellijSpringBootApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── top │ └── wisely │ └── intellijspringboot │ └── IntellijSpringBootApplicationTests.java └── 开发必备工具.docx /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /nbbuild/ 22 | /dist/ 23 | /nbdist/ 24 | /.nb-gradle/ 25 | /build/ 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 开发必备工具.docx 2 | 为了降低书本定价,书中关于工具使用的相关内容在[《开发必备工具.docx》](https://github.com/wiselyman/spring-boot-book-source-code/blob/master/%E5%BC%80%E5%8F%91%E5%BF%85%E5%A4%87%E5%B7%A5%E5%85%B7.docx?raw=true),包含: 3 | 1. Intellij IDEA 4 | 2. Gradle 5 | 3. Lombok 6 | 4. Docker 7 | 5. 其他(Postman,Git) 8 | 其中源码中`tools`是这一章节的源码 9 | 10 | # 随书源码 11 | 《从企业级开发到云原生微服务:Spring Boot 实战》随书代码 12 | 13 | # 已知勘误 14 | 大家对书本中错误可以提ISSUE,确认后我会将勘误记录在此。 15 | 16 | - p314 “a. 弃用方法安全” -> “a. 启用方法安全” 17 | -------------------------------------------------------------------------------- /ch01/quick-start/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /ch01/quick-start/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.1.6.RELEASE' 3 | id 'java' 4 | } 5 | 6 | apply plugin: 'io.spring.dependency-management' 7 | 8 | group = 'top.wisely' 9 | version = '0.0.1-SNAPSHOT' 10 | sourceCompatibility = '1.8' 11 | 12 | repositories { 13 | mavenCentral() 14 | } 15 | 16 | dependencies { 17 | implementation 'org.springframework.boot:spring-boot-starter-web' 18 | testImplementation 'org.springframework.boot:spring-boot-starter-test' 19 | } 20 | -------------------------------------------------------------------------------- /ch01/quick-start/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch01/quick-start/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch01/quick-start/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch01/quick-start/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'quick-start' 2 | -------------------------------------------------------------------------------- /ch01/quick-start/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 -------------------------------------------------------------------------------- /ch01/quick-start/src/test/java/top/wisely/quickstart/QuickStartApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.quickstart; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class QuickStartApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ch02/functional-programming/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | /out/ 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /nbbuild/ 24 | /dist/ 25 | /nbdist/ 26 | /.nb-gradle/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | -------------------------------------------------------------------------------- /ch02/functional-programming/.gitignore 2: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | /out/ 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /nbbuild/ 24 | /dist/ 25 | /nbdist/ 26 | /.nb-gradle/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | -------------------------------------------------------------------------------- /ch02/functional-programming/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch02/functional-programming/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /ch02/functional-programming/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip 2 | -------------------------------------------------------------------------------- /ch02/functional-programming/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch02/functional-programming/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch02/functional-programming/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 18 17:19:39 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip 7 | -------------------------------------------------------------------------------- /ch02/functional-programming/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'functional-programming' 16 | -------------------------------------------------------------------------------- /ch02/functional-programming/src/main/java/top/wisely/functionalprogramming/FunctionalProgrammingApplication.java: -------------------------------------------------------------------------------- 1 | package top.wisely.functionalprogramming; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class FunctionalProgrammingApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(FunctionalProgrammingApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch02/functional-programming/src/main/java/top/wisely/functionalprogramming/Gender.java: -------------------------------------------------------------------------------- 1 | package top.wisely.functionalprogramming; 2 | 3 | public enum Gender { 4 | MALE, FEMALE 5 | } 6 | -------------------------------------------------------------------------------- /ch02/functional-programming/src/main/java/top/wisely/functionalprogramming/custom_function/CustomFunctionDemo.java: -------------------------------------------------------------------------------- 1 | package top.wisely.functionalprogramming.custom_function; 2 | 3 | public class CustomFunctionDemo { 4 | public static void main(String[] args) { 5 | TriFunction lengthTriFuntion = 6 | (str1, str2, str3) -> str1.length() + str2.length() + str3.length(); 7 | System.out.println(lengthTriFuntion.apply("wyf", "www", "foo")); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ch02/functional-programming/src/main/java/top/wisely/functionalprogramming/custom_function/TriFunction.java: -------------------------------------------------------------------------------- 1 | package top.wisely.functionalprogramming.custom_function; 2 | 3 | @FunctionalInterface 4 | public interface TriFunction { 5 | R apply(T t, U u, W w); 6 | } 7 | -------------------------------------------------------------------------------- /ch02/functional-programming/src/main/java/top/wisely/functionalprogramming/stream/test.txt: -------------------------------------------------------------------------------- 1 | www wyf foo bar -------------------------------------------------------------------------------- /ch02/functional-programming/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | /out/ 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /nbbuild/ 24 | /dist/ 25 | /nbdist/ 26 | /.nb-gradle/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch03/spring-fundamentals/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch03/spring-fundamentals/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'spring-fundamentals' 16 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/io/github/wiselyman/annotations/EnableA.java: -------------------------------------------------------------------------------- 1 | package io.github.wiselyman.annotations; 2 | 3 | import org.springframework.context.annotation.Import; 4 | import io.github.wiselyman.config.AConfig; 5 | 6 | import java.lang.annotation.*; 7 | 8 | @Target(ElementType.TYPE) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Documented 11 | @Import(AConfig.class) 12 | public @interface EnableA { 13 | } 14 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/io/github/wiselyman/annotations/EnableB.java: -------------------------------------------------------------------------------- 1 | package io.github.wiselyman.annotations; 2 | 3 | import io.github.wiselyman.selector.BSelector; 4 | import org.springframework.context.annotation.Import; 5 | 6 | import java.lang.annotation.*; 7 | 8 | @Target(ElementType.TYPE) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Documented 11 | @Import(BSelector.class) 12 | public @interface EnableB { 13 | 14 | boolean isUppercase() default true; 15 | } 16 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/io/github/wiselyman/annotations/EnableC.java: -------------------------------------------------------------------------------- 1 | package io.github.wiselyman.annotations; 2 | 3 | import io.github.wiselyman.config.AConfig; 4 | import io.github.wiselyman.registrar.CBeanDefinitionRegistrar; 5 | import org.springframework.context.annotation.Import; 6 | 7 | import java.lang.annotation.*; 8 | 9 | @Target(ElementType.TYPE) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Documented 12 | @Import(CBeanDefinitionRegistrar.class) 13 | public @interface EnableC { 14 | } 15 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/io/github/wiselyman/config/AConfig.java: -------------------------------------------------------------------------------- 1 | package io.github.wiselyman.config; 2 | 3 | import org.springframework.beans.factory.config.BeanDefinition; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.context.annotation.Role; 7 | 8 | @Configuration 9 | public class AConfig { 10 | 11 | @Bean 12 | public String a(){ 13 | return "A"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/io/github/wiselyman/config/BLowercaseConfig.java: -------------------------------------------------------------------------------- 1 | package io.github.wiselyman.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | public class BLowercaseConfig { 8 | @Bean 9 | public String b(){ 10 | return "b"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/io/github/wiselyman/config/BUppercaseConfig.java: -------------------------------------------------------------------------------- 1 | package io.github.wiselyman.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | public class BUppercaseConfig { 8 | @Bean 9 | public String b(){ 10 | return "B"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/annotations/CustomBean.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.annotations; 2 | 3 | 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Target(ElementType.TYPE) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | public @interface CustomBean { 12 | } 13 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/annotations/CustomService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.annotations; 2 | 3 | 4 | import java.lang.annotation.ElementType; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | import java.lang.annotation.Target; 8 | 9 | @Target(ElementType.TYPE) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | public @interface CustomService { 12 | } 13 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/annotations/InjectLogger.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.annotations; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.lang.annotation.*; 6 | 7 | @Target(ElementType.FIELD) 8 | @Retention(RetentionPolicy.RUNTIME) 9 | public @interface InjectLogger { 10 | } 11 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/aop/Logging.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.aop; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target(ElementType.METHOD) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface Logging { 9 | String value() default ""; 10 | } 11 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/annotated/AsyncTaskService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.annotated; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class AsyncTaskService { 7 | } 8 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/annotated/ForValueService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.annotated; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class ForValueService { 7 | public String generate(String name){ 8 | return "Hello " + name; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/annotated/ScopeService2.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.annotated; 2 | 3 | import org.springframework.beans.factory.config.BeanDefinition; 4 | import org.springframework.beans.factory.config.ConfigurableBeanFactory; 5 | import org.springframework.context.annotation.Scope; 6 | import org.springframework.stereotype.Service; 7 | 8 | @Service 9 | @Scope(BeanDefinition.SCOPE_PROTOTYPE) 10 | public class ScopeService2 { 11 | } 12 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/annotated/SomeService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.annotated; 2 | 3 | 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class SomeService { 8 | public void doSomething(){ 9 | System.out.println("我做了一些工作"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/annotated/SomeService2.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.annotated; 2 | 3 | 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service 7 | public class SomeService2 { 8 | public void doSomething(){ 9 | System.out.println("我也做了一些工作"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/pojo/AnotherService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.pojo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | @Getter 7 | @Setter 8 | public class AnotherService { 9 | private String person; 10 | 11 | public AnotherService(String person) { 12 | this.person = person; 13 | } 14 | 15 | public void doAnotherThing(){ 16 | System.out.println(person + "做了另外的事情"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/pojo/CommandService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.pojo; 2 | 3 | public class CommandService { 4 | private String listCommand; 5 | 6 | public CommandService(String listCommand) { 7 | this.listCommand = listCommand; 8 | } 9 | 10 | public void list(){ 11 | System.out.println("当前系统下列表命令是:" + listCommand); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/pojo/LifeService2.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.pojo; 2 | 3 | 4 | public class LifeService2 { 5 | public LifeService2() { 6 | System.out.println("LifeService2:正在构造"); 7 | } 8 | 9 | public void exeAfterConstruct(){ 10 | System.out.println("LifeService2:在构造完成后执行"); 11 | } 12 | 13 | public void exeBeforeDestroy(){ 14 | System.out.println("LifeService2:在销毁之前执行"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/pojo/ScopeService3.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.pojo; 2 | 3 | public class ScopeService3 { 4 | } 5 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/beans/pojo/WindowsService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.beans.pojo; 2 | 3 | public class WindowsService { 4 | public void show(){ 5 | System.out.println("当前是Windows系统"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/java/top/wisely/springfundamentals/custom_scan/CustomBeanService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals.custom_scan; 2 | 3 | 4 | import top.wisely.springfundamentals.annotations.CustomBean; 5 | 6 | @CustomBean 7 | public class CustomBeanService { 8 | public void doSomething(){ 9 | System.out.println("通过自定义的注解成功注册bean"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=dev 2 | 3 | -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/resources/author.properties: -------------------------------------------------------------------------------- 1 | author.name: wyf -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/main/resources/book.properties: -------------------------------------------------------------------------------- 1 | book.name=spring boot in battle -------------------------------------------------------------------------------- /ch03/spring-fundamentals/src/test/java/top/wisely/springfundamentals/SpringFundamentalsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springfundamentals; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class SpringFundamentalsApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ch04/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/.DS_Store -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/gc.properties -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/taskHistory/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/taskHistory/taskHistory.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/taskHistory/taskHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/4.10.3/taskHistory/taskHistory.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Tue Apr 16 00:26:22 CST 2019 2 | gradle.version=4.10.3 3 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-client/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 17 15:49:15 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip 7 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-client/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'hello-client' 16 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | greeting: 2 | user: wyf 3 | greetings: 祝你幸福 4 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileContent/fileContent.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileHashes/resourceHashesCache.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/fileHashes/resourceHashesCache.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/gc.properties -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/javaCompile/classAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/javaCompile/classAnalysis.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/javaCompile/jarAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/javaCompile/jarAnalysis.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/5.2.1/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Apr 15 22:43:44 CST 2019 2 | gradle.version=5.2.1 3 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/hello-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ 2 | top.wisely.autoconfigure.GreetingAutoConfiguration -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello-starter/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'hello-starter' 2 | include 'hello-spring-boot-autoconfigure' 3 | include 'hello-spring-boot-starter' 4 | 5 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/gc.properties -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/taskHistory/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/taskHistory/taskHistory.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/taskHistory/taskHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/4.10.3/taskHistory/taskHistory.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/fileContent/fileContent.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/gc.properties -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/javaCompile/classAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/javaCompile/classAnalysis.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/5.2.1/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Apr 15 23:49:06 CST 2019 2 | gradle.version=5.2.1 3 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/custom-spring-boot-starter-demo/hello/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'hello' 2 | 3 | -------------------------------------------------------------------------------- /ch04/spring-boot/custom-spring-boot-starter-demo/hello/src/main/java/top/wisely/GreetingService.java: -------------------------------------------------------------------------------- 1 | package top.wisely; 2 | 3 | public class GreetingService { 4 | private String user; 5 | private String greetings; 6 | 7 | public GreetingService(String user, String greetings) { 8 | this.user = user; 9 | this.greetings = greetings; 10 | } 11 | 12 | public String greeting(){ 13 | return "Hi " + this.user + "," + this.greetings; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /ch04/spring-boot/learning-spring-boot-actuator/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/learning-spring-boot-actuator/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch04/spring-boot/learning-spring-boot-actuator/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch04/spring-boot/learning-spring-boot-actuator/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/milestone' } 4 | gradlePluginPortal() 5 | } 6 | resolutionStrategy { 7 | eachPlugin { 8 | if (requested.id.id == 'org.springframework.boot') { 9 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 10 | } 11 | } 12 | } 13 | } 14 | rootProject.name = 'learning-spring-boot-actuator' 15 | -------------------------------------------------------------------------------- /ch04/spring-boot/learning-spring-boot-actuator/src/test/java/top/wisely/learningspringbootactuator/LearningSpringBootActuatorApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringbootactuator; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningSpringBootActuatorApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch04/spring-boot/spring-boot-in-depth/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'spring-boot-in-depth' 16 | -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/src/main/java/io/github/wiselyman/service/DemoService2.java: -------------------------------------------------------------------------------- 1 | package io.github.wiselyman.service; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public class DemoService2 { 7 | public void doSomething(){ 8 | System.out.println("io.github.wiselyman.service包被扫描到了"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/src/main/java/top/wisely/springbootindepth/service/DemoService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.springbootindepth.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class DemoService { 7 | public String doSomething(){ 8 | return "top.wisely.springbootindepth包被扫描到了aaa"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.context.ApplicationListener=top.wisely.springbootindepth.listener.MyListener 2 | org.springframework.boot.env.EnvironmentPostProcessor=\ 3 | top.wisely.springbootindepth.processor.MyEnvironmentPostProcessor -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/src/main/resources/application-dev-port.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8080 3 | -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/src/main/resources/application-prod-lazy.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | main: 3 | lazy-initialization: true 4 | -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/src/main/resources/application-prod-port.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8888 -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/src/main/resources/application-prod.yml: -------------------------------------------------------------------------------- 1 | spring.profiles.include: 2 | - prod-port 3 | - prod-lazy -------------------------------------------------------------------------------- /ch04/spring-boot/spring-boot-in-depth/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #spring.main.banner-mode=off 2 | #spring.main.lazy-initialization=false 3 | #spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration 4 | #server.port=1234 5 | #server.address=192.168.31.199 6 | -------------------------------------------------------------------------------- /ch05/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/.DS_Store -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/.DS_Store -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-spring-mvc' 16 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/.DS_Store -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/.DS_Store -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/java/.DS_Store -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/java/top/.DS_Store -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/java/top/wisely/.DS_Store -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/.DS_Store -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/annotation/PersonFormat.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target({ElementType.PARAMETER}) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface PersonFormat { 9 | boolean style() default true; 10 | } 11 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/annotation/ProcessTag.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc.annotation; 2 | 3 | 4 | import java.lang.annotation.*; 5 | 6 | @Target({ElementType.PARAMETER, ElementType.METHOD}) 7 | @Retention(RetentionPolicy.RUNTIME) 8 | @Documented 9 | public @interface ProcessTag { 10 | } 11 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/annotation/RequestPerson.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target({ElementType.PARAMETER}) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface RequestPerson { 9 | } 10 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/annotation/ResponsePerson.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target({ElementType.METHOD}) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface ResponsePerson { 9 | } 10 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/annotation/StrLength.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Target({ElementType.PARAMETER}) 6 | @Retention(RetentionPolicy.RUNTIME) 7 | @Documented 8 | public @interface StrLength { 9 | } 10 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/exception/PersonNameNotFoundException.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc.exception; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class PersonNameNotFoundException extends RuntimeException{ 13 | private String name; 14 | } 15 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/repository/CommonRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc.repository; 2 | 3 | import top.wisely.learningspringmvc.domain.Person; 4 | 5 | public interface CommonRepository { 6 | Person save(Person person); 7 | Person findOne(Long id); 8 | Person replace(Long id, Person person); 9 | Person patched(Long id, Person person); 10 | void delete(Long id); 11 | Person findByName(String name); 12 | } 13 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/java/top/wisely/learningspringmvc/service/DemoService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class DemoService { 7 | public String sayHello(){ 8 | return "Hello World"; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/META-INF/resources/4.html: -------------------------------------------------------------------------------- 1 | 2 | 4 3 | 4 4 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/keystore.jks -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/my-static/5.html: -------------------------------------------------------------------------------- 1 | 2 | 5 3 | 5 4 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/public/3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 3 | 3 4 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/resources/1.html: -------------------------------------------------------------------------------- 1 | 2 | 1 3 | 1 4 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/2.html: -------------------------------------------------------------------------------- 1 | 2 | 2 3 | 2 4 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/static/favicon.ico -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | index 3 | Welcome 4 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/push/not-push.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/static/push/not-push.css -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/push/not-push.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/static/push/not-push.js -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/push/push.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/static/push/push.css -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/push/push.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SSE Demo 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/push/push.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/static/push/push.js -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/push/wyn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/static/push/wyn.jpg -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/static/wyn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/static/wyn.jpg -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/main/resources/wyn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch05/learning-spring-mvc/src/main/resources/wyn.jpg -------------------------------------------------------------------------------- /ch05/learning-spring-mvc/src/test/java/top/wisely/learningspringmvc/LearningSpringMvcApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringmvc; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class LearningSpringMvcApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch06/spring-data/learning-caching/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-caching' 16 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/src/main/java/top/wisely/learningcaching/repository/StudentRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningcaching.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.learningcaching.domain.model.Student; 5 | 6 | 7 | public interface StudentRepository extends JpaRepository { 8 | } 9 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cache: 3 | type: redis 4 | redis: 5 | host: localhost 6 | password: zzzzzz 7 | port: 6379 8 | datasource: 9 | url: jdbc:mysql://localhost:3306/first_db?useSSL=false 10 | username: root 11 | password: zzzzzz 12 | driver-class-name: com.mysql.cj.jdbc.Driver 13 | initialization-mode: always 14 | continue-on-error: true 15 | jpa: 16 | show-sql: true 17 | hibernate: 18 | ddl-auto: update 19 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO student VALUES (1, "xxx"); -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/src/test/java/top/wisely/learningcaching/LearningCachingApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningcaching; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class LearningCachingApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-caching/stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | redis: 5 | image: 'bitnami/redis:5.0' 6 | environment: 7 | - REDIS_PASSWORD=zzzzzz 8 | ports: 9 | - '6379:6379' -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-elasticsearch/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-elasticsearch/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch06/spring-data/learning-spring-data-elasticsearch/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-elasticsearch/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-elasticsearch/src/main/java/top/wisely/learningspringdataelasticsearch/domain/model/Child.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdataelasticsearch.domain.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | import top.wisely.learningspringdataelasticsearch.domain.type.Gender; 7 | 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | public class Child { 12 | private String name; 13 | private Gender gender; 14 | } 15 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-elasticsearch/src/main/java/top/wisely/learningspringdataelasticsearch/domain/type/Gender.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdataelasticsearch.domain.type; 2 | 3 | public enum Gender { 4 | MALE, 5 | FEMALE 6 | } 7 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-elasticsearch/src/main/java/top/wisely/learningspringdataelasticsearch/repository/AnotherPersonRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdataelasticsearch.repository; 2 | 3 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 4 | import top.wisely.learningspringdataelasticsearch.domain.model.AnotherPerson; 5 | 6 | public interface AnotherPersonRepository extends ElasticsearchRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-elasticsearch/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | elasticsearch: 3 | rest: 4 | uris: http://localhost:9200 5 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-elasticsearch/stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | elasticsearch: 5 | image: elasticsearch:7.0.1 6 | environment: 7 | - cluster.name=docker-cluster 8 | - discovery.type=single-node 9 | ports: 10 | - "9200:9200" 11 | - "9300:9300" 12 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch06/spring-data/learning-spring-data-jpa/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun May 12 22:33:23 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip 7 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/procedure.sql: -------------------------------------------------------------------------------- 1 | DROP PROCEDURE IF EXISTS add_name_prefix; 2 | DELIMITER $$ 3 | CREATE PROCEDURE add_name_prefix(IN name VARCHAR(255), OUT prefix_name VARCHAR(255)) 4 | BEGIN 5 | set prefix_name = CONCAT('Mr./Mrs. ', name); 6 | END -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-spring-data-jpa' 16 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/java/top/wisely/learningspringdatajpa/domain/domain_event/PersonSaved.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdatajpa.domain.domain_event; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class PersonSaved { 7 | private Long id; 8 | private String name; 9 | private Integer age; 10 | } 11 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/java/top/wisely/learningspringdatajpa/domain/model/Address.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdatajpa.domain.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import javax.persistence.Embeddable; 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Embeddable 12 | public class Address { 13 | private String city; 14 | private String province; 15 | } 16 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/java/top/wisely/learningspringdatajpa/domain/model/Company.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdatajpa.domain.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import javax.persistence.*; 8 | @Data 9 | @AllArgsConstructor 10 | @NoArgsConstructor 11 | @Embeddable 12 | public class Company { 13 | private String companyName; 14 | private String city; 15 | } 16 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/java/top/wisely/learningspringdatajpa/domain/projection/PersonProjectionHelper.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdatajpa.domain.projection; 2 | 3 | import org.springframework.stereotype.Component; 4 | import top.wisely.learningspringdatajpa.domain.model.Person; 5 | @Component 6 | public class PersonProjectionHelper { 7 | 8 | public String getInfo(Person person){ 9 | return person.toString(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/java/top/wisely/learningspringdatajpa/domain/service/ListenerService.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdatajpa.domain.service; 2 | 3 | import org.springframework.stereotype.Service; 4 | 5 | @Service 6 | public class ListenerService { 7 | public void process(String msg){ 8 | System.out.println("由Spring处理:" + msg); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/java/top/wisely/learningspringdatajpa/domain/type/Gender.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdatajpa.domain.type; 2 | 3 | public enum Gender { 4 | MALE, 5 | FEMALE 6 | } 7 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/java/top/wisely/learningspringdatajpa/repository/AnotherPersonRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdatajpa.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.learningspringdatajpa.domain.model.AnotherPerson; 5 | 6 | public interface AnotherPersonRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/java/top/wisely/learningspringdatajpa/repository/EmployeeRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringdatajpa.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.learningspringdatajpa.domain.model.Employee; 5 | 6 | import java.util.List; 7 | 8 | 9 | public interface EmployeeRepository extends JpaRepository { 10 | List findByName(String name); 11 | } 12 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://localhost:3306/first_db?useSSL=false 4 | username: root 5 | password: zzzzzz 6 | driver-class-name: com.mysql.cj.jdbc.Driver 7 | initialization-mode: never 8 | continue-on-error: true 9 | jpa: 10 | show-sql: true 11 | hibernate: 12 | ddl-auto: none 13 | # flyway: 14 | # baseline-version: 1 15 | # schemas: first_db 16 | 17 | 18 | -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO another_person (name, age) VALUES ('wyf', 35); 2 | INSERT INTO another_person (name, age) VALUES ('foo', 34); 3 | INSERT INTO another_person (name, age) VALUES ('bar', 33); 4 | INSERT INTO another_person (name, age) VALUES ('www', 32); -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/resources/db/migration/V1_1__Some_Changes.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE third_person add COLUMN city varchar(255) NOT NULL; 2 | 3 | UPDATE third_person set city = 'hefei'; -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/resources/db/migration/V1__Initial_Setup.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS third_person( 2 | id bigint(20) NOT NULL AUTO_INCREMENT, 3 | name varchar(255) NOT NULL, 4 | age int(11) DEFAULT NULL, 5 | PRIMARY KEY (id) 6 | ); 7 | 8 | INSERT INTO third_person (name, age) VALUES ('wyf', 35); 9 | INSERT INTO third_person (name, age) VALUES ('foo', 34); 10 | INSERT INTO third_person (name, age) VALUES ('bar', 33); 11 | INSERT INTO third_person (name, age) VALUES ('www', 32); -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS another_person( 2 | id bigint(20) NOT NULL AUTO_INCREMENT, 3 | name varchar(255) NOT NULL, 4 | age int(11) DEFAULT NULL, 5 | PRIMARY KEY (id) 6 | ); -------------------------------------------------------------------------------- /ch06/spring-data/learning-spring-data-jpa/stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | 5 | db: 6 | image: mysql 7 | command: --default-authentication-plugin=mysql_native_password 8 | restart: always 9 | ports: 10 | - 3306:3306 11 | environment: 12 | MYSQL_DATABASE: first_db 13 | MYSQL_ROOT_PASSWORD: zzzzzz 14 | 15 | adminer: 16 | image: adminer # 全功能数据库管理工具 17 | restart: always 18 | ports: 19 | - 8081:8080 -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch07/spring-security/learning-oauth2/auth-server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'auth-server' 16 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/src/main/java/top/wisely/authserver/repository/SysAuthorityRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.authserver.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.authserver.domain.model.SysAuthority; 5 | 6 | public interface SysAuthorityRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/src/main/java/top/wisely/authserver/repository/SysRoleRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.authserver.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.authserver.domain.model.SysRole; 5 | 6 | public interface SysRoleRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/src/main/java/top/wisely/authserver/repository/SysUserRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.authserver.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.authserver.domain.model.SysUser; 5 | 6 | import java.util.Optional; 7 | 8 | public interface SysUserRepository extends JpaRepository { 9 | Optional findByUsername(String username); 10 | } 11 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/src/main/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch07/spring-security/learning-oauth2/auth-server/src/main/resources/keystore.jks -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/auth-server/src/test/java/top/wisely/authserver/AuthServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.authserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AuthServerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/client/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch07/spring-security/learning-oauth2/client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/client/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'client' 16 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/client/src/test/java/top/wisely/client/ClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.client; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ClientApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/resource-server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/resource-server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch07/spring-security/learning-oauth2/resource-server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/resource-server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/resource-server/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'resource-server' 16 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/resource-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | security: 3 | oauth2: 4 | resourceserver: 5 | jwt: 6 | public-key-location: classpath:public.txt 7 | # jwk-set-uri: http://localhost:8080/.well-known/jwks.json 8 | 9 | 10 | server: 11 | port: 8082 12 | 13 | 14 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-oauth2/resource-server/src/test/java/top/wisely/resourceserver/ResourceServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.resourceserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ResourceServerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security-in-battle/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security-in-battle/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch07/spring-security/learning-spring-security-in-battle/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security-in-battle/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security-in-battle/src/main/java/top/wisely/learningspringsecurityinbattle/repository/SysAuthorityRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringsecurityinbattle.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.learningspringsecurityinbattle.domain.model.SysAuthority; 5 | 6 | public interface SysAuthorityRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security-in-battle/src/main/java/top/wisely/learningspringsecurityinbattle/repository/SysRoleRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringsecurityinbattle.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.learningspringsecurityinbattle.domain.model.SysRole; 5 | 6 | public interface SysRoleRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security-in-battle/src/main/resources/application.yaml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://localhost:3306/first_db?useSSL=false 4 | username: root 5 | password: zzzzzz 6 | driver-class-name: com.mysql.cj.jdbc.Driver 7 | jpa: 8 | show-sql: true 9 | hibernate: 10 | ddl-auto: update 11 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security-in-battle/src/test/java/top/wisely/learningspringsecurityinbattle/LearningSpringSecurityInBattleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringsecurityinbattle; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningSpringSecurityInBattleApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch07/spring-security/learning-spring-security/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-spring-security' 16 | -------------------------------------------------------------------------------- /ch07/spring-security/learning-spring-security/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://localhost:3306/first_db?useSSL=false 4 | username: root 5 | password: zzzzzz 6 | driver-class-name: com.mysql.cj.jdbc.Driver 7 | jpa: 8 | show-sql: true 9 | hibernate: 10 | ddl-auto: update -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-nosql/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-nosql/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactive-nosql/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-nosql/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-nosql/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-reactive-nosql' 16 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-nosql/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | #spring: 2 | # data: 3 | # elasticsearch: 4 | # client: 5 | # reactive: 6 | # endpoints: localhost:9200 7 | spring: 8 | data: 9 | mongodb: 10 | host: localhost 11 | port: 27017 12 | username: wisely 13 | password: zzzzzz 14 | database: first_db -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-nosql/src/test/java/top/wisely/learningreactivenosql/LearningReactiveNosqlApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningreactivenosql; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningReactiveNosqlApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-nosql/stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | 5 | mongo: 6 | image: mongo 7 | restart: always 8 | ports: 9 | - 27017:27017 10 | environment: 11 | MONGO_INITDB_ROOT_USERNAME: root 12 | MONGO_INITDB_ROOT_PASSWORD: example -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-security/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-security/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactive-security/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-security/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-security/src/main/java/top/wisely/learningreactivesecurity/domain/model/SysAuthority.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningreactivesecurity.domain.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class SysAuthority { 11 | private String name; 12 | } 13 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-security/src/main/java/top/wisely/learningreactivesecurity/repository/PersonRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningreactivesecurity.repository; 2 | 3 | import org.springframework.data.mongodb.repository.ReactiveMongoRepository; 4 | import top.wisely.learningreactivesecurity.domain.model.Person; 5 | 6 | public interface PersonRepository extends ReactiveMongoRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-security/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | data: 3 | mongodb: 4 | host: localhost 5 | port: 27017 6 | username: wisely 7 | password: zzzzzz 8 | database: first_db -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-security/src/test/java/top/wisely/learningreactivesecurity/LearningReactiveSecurityApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningreactivesecurity; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningReactiveSecurityApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-sql/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-sql/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactive-sql/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-sql/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-sql/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-reactive-sql' 16 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-sql/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | r2dbc: 3 | url: r2dbc:postgresql://localhost:5432/first_db 4 | username: wisely 5 | password: zzzzzz -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-sql/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | create table if not exists person ( 2 | id serial primary key, 3 | name varchar(255) not null, 4 | age int4 not null 5 | ); -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-sql/src/test/java/top/wisely/learningreactivesql/LearningReactiveSqlApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningreactivesql; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningReactiveSqlApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactive-sql/stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | 5 | db: 6 | image: postgres 7 | restart: always 8 | ports: 9 | - 5432:5432 10 | environment: 11 | POSTGRES_DB: first_db 12 | POSTGRES_USER: wisely 13 | POSTGRES_PASSWORD: zzzzzz -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/fileContent/fileContent.lock -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/gc.properties -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/javaCompile/classAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/javaCompile/classAnalysis.bin -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/taskHistory/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/taskHistory/taskHistory.bin -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/4.10.3/taskHistory/taskHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/4.10.3/taskHistory/taskHistory.lock -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Jun 03 18:56:55 CST 2019 2 | gradle.version=4.10.3 3 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | } 4 | 5 | group 'top.wisely' 6 | version '1.0-SNAPSHOT' 7 | 8 | sourceCompatibility = 1.8 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | dependencies { 15 | compile 'io.projectreactor:reactor-core:3.2.9.RELEASE' 16 | testCompile group: 'junit', name: 'junit', version: '4.12' 17 | } 18 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-reactor/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-reactor/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'learning-reactor' 2 | 3 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-spring-webflux/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-spring-webflux/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch08/reactive-programming/learning-spring-webflux/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-spring-webflux/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-spring-webflux/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-spring-webflux' 16 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-spring-webflux/src/main/java/top/wisely/learningspringwebflux/config/WebFluxConfig.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringwebflux.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.reactive.config.WebFluxConfigurer; 5 | 6 | @Configuration 7 | public class WebFluxConfig implements WebFluxConfigurer { 8 | } 9 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-spring-webflux/src/main/java/top/wisely/learningspringwebflux/domain/model/Person.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringwebflux.domain.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class Person { 11 | private Long id; 12 | private String name; 13 | private Integer age; 14 | } 15 | -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-spring-webflux/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | webflux: 3 | date-format: yyyy-MM-dd 4 | static-path-pattern: /resouces/static/** -------------------------------------------------------------------------------- /ch08/reactive-programming/learning-spring-webflux/src/test/java/top/wisely/learningspringwebflux/LearningSpringWebfluxApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringwebflux; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningSpringWebfluxApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-amqp/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-amqp/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch09/spring-messaging/learning-amqp/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-amqp/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-amqp/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-amqp' 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-amqp/src/main/java/top/wisely/learningamqp/messaging/MessageEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningamqp.messaging; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class MessageEvent implements Serializable { 13 | private String id; 14 | private String name; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-amqp/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | rabbitmq: 3 | host: localhost 4 | port: 5672 5 | username: wisely 6 | password: zzzzzz 7 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-amqp/src/test/java/top/wisely/learningamqp/LearningAmqpApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningamqp; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningAmqpApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-amqp/stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | rabbitmq: 5 | image: rabbitmq:management 6 | restart: always 7 | ports: 8 | - "5672:5672" 9 | - "15672:15672" 10 | environment: 11 | RABBITMQ_DEFAULT_USER: wisely 12 | RABBITMQ_DEFAULT_PASS: zzzzzz -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch09/spring-messaging/learning-jms/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-jms' 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/src/main/java/top/wisely/learningjms/messaging/ConfirmConsumer.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningjms.messaging; 2 | 3 | import org.springframework.jms.annotation.JmsListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class ConfirmConsumer { 8 | @JmsListener(destination = "confirm-dest") 9 | public void confirmReceived(String confirm){ 10 | System.out.println(confirm); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/src/main/java/top/wisely/learningjms/messaging/MessageEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningjms.messaging; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | import java.util.Date; 9 | 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class MessageEvent implements Serializable{ 14 | private String id; 15 | private String name; 16 | } 17 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | artemis: 3 | host: localhost 4 | port: 61616 5 | user: wisely 6 | password: zzzzzz 7 | jms: 8 | pub-sub-domain: true 9 | 10 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/src/test/java/top/wisely/learningjms/LearningJmsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningjms; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningJmsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-jms/stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | artemis: 5 | image: vromero/activemq-artemis 6 | restart: always 7 | ports: 8 | - 8161:8161 9 | - 61616:61616 10 | environment: 11 | ARTEMIS_USERNAME: wisely 12 | ARTEMIS_PASSWORD: zzzzzz -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-kafka/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-kafka/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch09/spring-messaging/learning-kafka/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-kafka/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jun 12 15:58:53 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-kafka/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-kafka' 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-kafka/src/main/java/top/wisely/learningkafka/messaging/ConfirmConsumer.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningkafka.messaging; 2 | 3 | import org.springframework.kafka.annotation.KafkaListener; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class ConfirmConsumer { 8 | @KafkaListener(topics = {"confirm-topic"}) 9 | public void confirmReceived(String confirm){ 10 | System.out.println(confirm); 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-kafka/src/main/java/top/wisely/learningkafka/messaging/MessageEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningkafka.messaging; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.io.Serializable; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class MessageEvent implements Serializable { 13 | private String id; 14 | private String name; 15 | } 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-kafka/src/test/java/top/wisely/learningkafka/LearningKafkaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningkafka; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningKafkaApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-kafka/stack.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | 3 | services: 4 | zookeeper: 5 | image: wurstmeister/zookeeper 6 | restart: always 7 | 8 | kafka: 9 | image: wurstmeister/kafka 10 | restart: always 11 | ports: 12 | - "9092:9092" 13 | environment: 14 | KAFKA_ADVERTISED_HOST_NAME: localhost 15 | KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket-reactive/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket-reactive/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch09/spring-messaging/learning-websocket-reactive/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket-reactive/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket-reactive/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-websocket-reactive' 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket-reactive/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket-reactive/src/test/java/top/wisely/learningwebsocketreactive/LearningWebsocketReactiveApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningwebsocketreactive; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningWebsocketReactiveApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch09/spring-messaging/learning-websocket/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-websocket' 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket/src/main/java/top/wisely/learningwebsocket/LearningWebsocketApplication.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningwebsocket; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class LearningWebsocketApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(LearningWebsocketApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch09/spring-messaging/learning-websocket/src/test/java/top/wisely/learningwebsocket/LearningWebsocketApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningwebsocket; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningWebsocketApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-client/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch09/spring-messaging/rsocket/rsocket-client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-client/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'rsocket-client' 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-client/src/test/java/top/wisely/rsocketclient/RsocketClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.rsocketclient; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RsocketClientApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch09/spring-messaging/rsocket/rsocket-server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-server/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'rsocket-server' 16 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-server/src/main/java/top/wisely/rsocketserver/repository/PersonRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.rsocketserver.repository; 2 | 3 | import org.springframework.data.mongodb.repository.ReactiveMongoRepository; 4 | import top.wisely.rsocketserver.domain.model.Person; 5 | 6 | public interface PersonRepository extends ReactiveMongoRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | rsocket: 3 | server: 4 | address: localhost 5 | port: 9898 6 | transport: tcp 7 | data: 8 | mongodb: 9 | host: localhost 10 | port: 27017 11 | username: wisely 12 | password: zzzzzz 13 | database: first_db 14 | -------------------------------------------------------------------------------- /ch09/spring-messaging/rsocket/rsocket-server/src/test/java/top/wisely/rsocketserver/RsocketServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.rsocketserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class RsocketServerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-batch/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch10/integration-batch/learning-spring-batch/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-batch/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-batch/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'learning-spring-batch' 16 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-batch/src/main/java/top/wisely/learningspringbatch/domain/model/Person.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringbatch.domain.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class Person { 11 | private Long id; 12 | private String name; 13 | private String gender; 14 | private Integer age; 15 | } 16 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-batch/src/main/java/top/wisely/learningspringbatch/dto/CsvPerson.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringbatch.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class CsvPerson { 11 | private String name; 12 | private String gender; 13 | private Integer age; 14 | } 15 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-batch/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:mysql://localhost:3306/first_db?useSSL=false 4 | username: root 5 | password: zzzzzz 6 | driver-class-name: com.mysql.cj.jdbc.Driver 7 | batch: 8 | initialize-schema: always 9 | job: 10 | enabled: false 11 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-batch/src/main/resources/people.csv: -------------------------------------------------------------------------------- 1 | name, gender, age 2 | aaa, M, 20 3 | bbb, F, 21 4 | ccc, M, 22 5 | ddd, F, 23 6 | eee, M, 24 7 | fff, F, 25 8 | ggg, M, 26 9 | hhh, F, 27 10 | iii, M, 28 11 | jjj, F, 29 -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-batch/src/test/java/top/wisely/learningspringbatch/LearningSpringBatchApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringbatch; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningSpringBatchApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-integration/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch10/integration-batch/learning-spring-integration/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-integration/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-integration/src/main/java/top/wisely/learningspringintegration/service/SendingGateway.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringintegration.service; 2 | 3 | 4 | import org.springframework.integration.file.FileHeaders; 5 | import org.springframework.messaging.handler.annotation.Header; 6 | 7 | public interface SendingGateway { 8 | void send(@Header(FileHeaders.FILENAME) String filename, String content); 9 | } 10 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-integration/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch10/integration-batch/learning-spring-integration/src/test/java/top/wisely/learningspringintegration/LearningSpringIntegrationApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.learningspringintegration; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LearningSpringIntegrationApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/address-service/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/address-service/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/address-service/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/address-service/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'address-service' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/address-service/src/main/java/top/wisely/addressservice/event/AddressSavedEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.addressservice.event; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class AddressSavedEvent { 11 | private Long id; 12 | private String province; 13 | private String city; 14 | } 15 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/address-service/src/main/java/top/wisely/addressservice/event/PersonSavedEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.addressservice.event; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class PersonSavedEvent { 11 | private String id; 12 | private String name; 13 | private Integer age; 14 | } 15 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/address-service/src/main/java/top/wisely/addressservice/repository/AddressRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.addressservice.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.addressservice.domain.model.Address; 5 | 6 | public interface AddressRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/address-service/src/main/java/top/wisely/addressservice/repository/PersonRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.addressservice.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.addressservice.domain.model.Person; 5 | 6 | public interface PersonRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/address-service/src/test/java/top/wisely/addressservice/AddressServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.addressservice; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AddressServiceApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/auth-server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'auth-server' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/src/main/java/top/wisely/authserver/repository/SysAuthorityRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.authserver.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.authserver.domain.model.SysAuthority; 5 | 6 | public interface SysAuthorityRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/src/main/java/top/wisely/authserver/repository/SysRoleRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.authserver.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.authserver.domain.model.SysRole; 5 | 6 | public interface SysRoleRepository extends JpaRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/src/main/java/top/wisely/authserver/repository/SysUserRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.authserver.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import top.wisely.authserver.domain.model.SysUser; 5 | 6 | import java.util.Optional; 7 | 8 | public interface SysUserRepository extends JpaRepository { 9 | Optional findByUsername(String username); 10 | } 11 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: auth-server 4 | 5 | management: 6 | endpoints: 7 | web: 8 | exposure: 9 | include: shutdown 10 | endpoint: 11 | shutdown: 12 | enabled: true 13 | 14 | eureka: 15 | client: 16 | service-url: 17 | default-zone: http://localhost:8761/eureka/ -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | discovery: 5 | enabled: true 6 | service-id: config-server 7 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/src/main/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/auth-server/src/main/resources/keystore.jks -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/auth-server/src/test/java/top/wisely/authserver/AuthServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.authserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AuthServerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/config-server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'config-server' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/src/main/resources/config/discovery-client-dev.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9998 -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/src/main/resources/config/discovery-client-prod.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9999 -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/src/main/resources/config/discovery-client.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9997 -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/src/main/resources/config/feign-service.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | security: 3 | oauth2: 4 | resourceserver: 5 | jwt: 6 | public-key-location: classpath:public.txt 7 | 8 | 9 | server: 10 | port: 8089 11 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/src/main/resources/config/resource-server.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | security: 3 | oauth2: 4 | resourceserver: 5 | jwt: 6 | public-key-location: classpath:public.txt 7 | 8 | 9 | server: 10 | port: 8088 11 | 12 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/config-server/src/test/java/top/wisely/configserver/ConfigServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.configserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ConfigServerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/discovery-client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-client/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'discovery-client' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-client/src/main/java/top/wisely/discoveryclient/domain/model/Person.java: -------------------------------------------------------------------------------- 1 | package top.wisely.discoveryclient.domain.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class Person { 11 | private Long id; 12 | private String name; 13 | private Integer age; 14 | private Integer serverPort; 15 | } 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: discovery-client 4 | management: 5 | endpoints: 6 | web: 7 | exposure: 8 | include: shutdown 9 | endpoint: 10 | shutdown: 11 | enabled: true 12 | server: 13 | port: 8080 14 | eureka: 15 | client: 16 | service-url: 17 | default-zone: http://localhost:8761/eureka/ -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-client/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | discovery: 5 | enabled: true 6 | service-id: config-server 7 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-client/src/test/java/top/wisely/discoveryclient/DiscoveryClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.discoveryclient; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DiscoveryClientApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/discovery-server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-server/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'discovery-server' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8761 3 | eureka: 4 | client: 5 | register-with-eureka: false 6 | fetch-registry: false 7 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/discovery-server/src/test/java/top/wisely/discoveryserver/DiscoveryServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.discoveryserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DiscoveryServerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-client/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/feign-client/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-client/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-client/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'feign-client' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: feign-client #1 4 | management: 5 | endpoints: 6 | web: 7 | exposure: 8 | include: shutdown 9 | endpoint: 10 | shutdown: 11 | enabled: true 12 | server: 13 | port: 8082 14 | eureka: 15 | client: 16 | service-url: 17 | default-zone: http://localhost:8761/eureka/ 18 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-client/src/test/java/top/wisely/feignclient/FeignClientApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.feignclient; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class FeignClientApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-service/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/feign-service/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-service/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-service/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'feign-service' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-service/src/main/java/top/wisely/feignservice/client/ResourceClient.java: -------------------------------------------------------------------------------- 1 | package top.wisely.feignservice.client; 2 | 3 | import org.springframework.cloud.openfeign.FeignClient; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | 6 | @FeignClient("resource-server") 7 | public interface ResourceClient { 8 | 9 | @GetMapping("/remote1") 10 | public String invokeRemote1(); 11 | 12 | @GetMapping("/remote2") 13 | public String invokeRemote2(); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-service/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: feign-service 4 | 5 | management: 6 | endpoints: 7 | web: 8 | exposure: 9 | include: shutdown 10 | endpoint: 11 | shutdown: 12 | enabled: true 13 | 14 | 15 | eureka: 16 | client: 17 | service-url: 18 | default-zone: http://localhost:8761/eureka/ 19 | 20 | 21 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-service/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | discovery: 5 | enabled: true 6 | service-id: config-server 7 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/feign-service/src/test/java/top/wisely/feignservice/FeignServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.feignservice; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class FeignServiceApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/gateway/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/gateway/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/gateway/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/gateway/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'gateway' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/gateway/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: gateway 4 | 5 | management: 6 | endpoints: 7 | web: 8 | exposure: 9 | include: shutdown 10 | endpoint: 11 | shutdown: 12 | enabled: true 13 | 14 | eureka: 15 | client: 16 | service-url: 17 | default-zone: http://localhost:8761/eureka/ 18 | 19 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/gateway/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | discovery: 5 | enabled: true 6 | service-id: config-server 7 | 8 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/gateway/src/test/java/top/wisely/gateway/GatewayApplicationTests.java: -------------------------------------------------------------------------------- 1 | //package top.wisely.gateway; 2 | // 3 | //import org.junit.jupiter.api.Test; 4 | //import org.springframework.boot.test.context.SpringBootTest; 5 | // 6 | //@SpringBootTest 7 | //class GatewayApplicationTests { 8 | // 9 | // @Test 10 | // void contextLoads() { 11 | // } 12 | // 13 | //} 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/person-service/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/person-service/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/person-service/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/person-service/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'person-service' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/person-service/src/main/java/top/wisely/personservice/event/AddressSavedEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.personservice.event; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class AddressSavedEvent { 11 | private Long id; 12 | private String province; 13 | private String city; 14 | } 15 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/person-service/src/main/java/top/wisely/personservice/event/PersonSavedEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.personservice.event; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | @Data 8 | @AllArgsConstructor 9 | @NoArgsConstructor 10 | public class PersonSavedEvent { 11 | private String id; 12 | private String name; 13 | private Integer age; 14 | } 15 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/person-service/src/main/java/top/wisely/personservice/repository/AddressRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.personservice.repository; 2 | 3 | import org.springframework.data.mongodb.repository.MongoRepository; 4 | import top.wisely.personservice.domain.model.Address; 5 | 6 | public interface AddressRepository extends MongoRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/person-service/src/main/java/top/wisely/personservice/repository/PersonRepository.java: -------------------------------------------------------------------------------- 1 | package top.wisely.personservice.repository; 2 | 3 | import org.springframework.data.mongodb.repository.MongoRepository; 4 | import top.wisely.personservice.domain.model.Person; 5 | 6 | public interface PersonRepository extends MongoRepository { 7 | } 8 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/person-service/src/test/java/top/wisely/personservice/PersonServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.personservice; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class PersonServiceApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-consumer/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/reactive-stream-consumer/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-consumer/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-consumer/src/main/java/top/wisely/reactivestreamconsumer/event/MessageEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.reactivestreamconsumer.event; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class MessageEvent { 13 | private String msg; 14 | private Date time; 15 | } 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-consumer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: reactive-stream-consumer 4 | 5 | cloud: 6 | stream: 7 | kafka: 8 | binder: 9 | brokers: localhost 10 | defaultBrokerPort: 9092 11 | bindings: 12 | input: 13 | destination: msgTopic 14 | contentType: application/json 15 | group: msgInGroup 16 | server: 17 | port: 8086 18 | 19 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-consumer/src/test/java/top/wisely/reactivestreamconsumer/ReactiveStreamConsumerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.reactivestreamconsumer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ReactiveStreamConsumerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-producer/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/reactive-stream-producer/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-producer/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-producer/src/main/java/top/wisely/reactivestreamproducer/event/MessageEvent.java: -------------------------------------------------------------------------------- 1 | package top.wisely.reactivestreamproducer.event; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.Date; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | @NoArgsConstructor 12 | public class MessageEvent { 13 | private String msg; 14 | private Date time; 15 | } 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-producer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: reactive-stream-producer 4 | 5 | cloud: 6 | stream: 7 | kafka: 8 | binder: 9 | brokers: localhost 10 | defaultBrokerPort: 9092 11 | bindings: 12 | output: 13 | destination: msgTopic 14 | contentType: application/json 15 | server: 16 | port: 8085 17 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/reactive-stream-producer/src/test/java/top/wisely/reactivestreamproducer/ReactiveStreamProducerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.reactivestreamproducer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ReactiveStreamProducerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/resource-server/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | /build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | /out/ 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | 29 | ### VS Code ### 30 | .vscode/ 31 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/resource-server/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch11/microservices/spring-cloud/resource-server/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/resource-server/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/resource-server/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/snapshot' } 4 | maven { url 'https://repo.spring.io/milestone' } 5 | gradlePluginPortal() 6 | } 7 | resolutionStrategy { 8 | eachPlugin { 9 | if (requested.id.id == 'org.springframework.boot') { 10 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 11 | } 12 | } 13 | } 14 | } 15 | rootProject.name = 'resource-server' 16 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/resource-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: resource-server 4 | 5 | management: 6 | endpoints: 7 | web: 8 | exposure: 9 | include: shutdown 10 | endpoint: 11 | shutdown: 12 | enabled: true 13 | 14 | 15 | eureka: 16 | client: 17 | service-url: 18 | default-zone: http://localhost:8761/eureka/ 19 | 20 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/resource-server/src/main/resources/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | cloud: 3 | config: 4 | discovery: 5 | enabled: true 6 | service-id: config-server 7 | -------------------------------------------------------------------------------- /ch11/microservices/spring-cloud/resource-server/src/test/java/top/wisely/resourceserver/ResourceServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.resourceserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ResourceServerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch12/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch12/.DS_Store -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:8 2 | RUN mkdir /app 3 | ADD build/libs/demo-istio-service-*.jar /app/app.jar 4 | ADD runboot.sh /app/ 5 | RUN bash -c 'touch /app/app.jar' 6 | WORKDIR /app 7 | RUN chmod a+x runboot.sh 8 | EXPOSE 8080 9 | CMD /app/runboot.sh 10 | RUN echo "Asia/Shanghai" > /etc/timezone; -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch12/istio/demo-istio-service/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/runboot.sh: -------------------------------------------------------------------------------- 1 | java -Djava.security.egd=file:/dev/./urandom -jar /app/app.jar -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/milestone' } 4 | gradlePluginPortal() 5 | } 6 | resolutionStrategy { 7 | eachPlugin { 8 | if (requested.id.id == 'org.springframework.boot') { 9 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 10 | } 11 | } 12 | } 13 | } 14 | rootProject.name = 'demo-istio-service' 15 | -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/src/main/java/top/wisely/demoistioservice/DemoIstioServiceApplication.java: -------------------------------------------------------------------------------- 1 | package top.wisely.demoistioservice; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DemoIstioServiceApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DemoIstioServiceApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/src/main/java/top/wisely/demoistioservice/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package top.wisely.demoistioservice.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloController { 8 | @GetMapping("/") 9 | public String hello(){ 10 | return "Hello Spring Boot with Istio"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ch12/istio/demo-istio-service/src/test/java/top/wisely/demoistioservice/DemoIstioServiceApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.demoistioservice; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DemoIstioServiceApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /ch12/k8s/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch12/k8s/.DS_Store -------------------------------------------------------------------------------- /ch12/k8s/basic/ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1beta1 2 | kind: Ingress 3 | metadata: 4 | name: my-ingress 5 | annotations: 6 | nginx.ingress.kubernetes.io/rewrite-target: /$1 7 | nginx.ingress.kubernetes.io/ssl-redirect: "false" 8 | spec: 9 | rules: 10 | - http: 11 | paths: 12 | - path: /tomcat(.*) 13 | backend: 14 | serviceName: tomcat-service 15 | servicePort: 30000 -------------------------------------------------------------------------------- /ch12/k8s/basic/pvc.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: my-pvc 5 | spec: 6 | accessModes: 7 | - ReadWriteMany 8 | storageClassName: standard 9 | resources: 10 | requests: 11 | storage: 500Mi -------------------------------------------------------------------------------- /ch12/k8s/basic/tomcat-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: tomcat-deployment 5 | labels: 6 | app: mytomcat 7 | spec: 8 | replicas: 4 9 | selector: 10 | matchLabels: 11 | app: mytomcat 12 | template: 13 | metadata: 14 | labels: 15 | app: mytomcat 16 | spec: 17 | containers: 18 | - name: tomcat 19 | image: tomcat:8 20 | -------------------------------------------------------------------------------- /ch12/k8s/basic/tomcat-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: tomcat 5 | labels: 6 | app: mytomcat 7 | spec: 8 | containers: 9 | - name: tomcat 10 | image: tomcat:8 11 | resources: 12 | limits: 13 | memory: "128Mi" 14 | cpu: "500m" 15 | ports: 16 | - containerPort: 8080 17 | 18 | -------------------------------------------------------------------------------- /ch12/k8s/basic/tomcat-rs.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: ReplicaSet 3 | metadata: 4 | name: tomcat-rs 5 | labels: 6 | app: mytomcat 7 | spec: 8 | replicas: 3 9 | selector: 10 | matchLabels: 11 | app: mytomcat 12 | template: 13 | metadata: 14 | labels: 15 | app: mytomcat 16 | spec: 17 | containers: 18 | - name: tomcat 19 | image: tomcat:8 20 | -------------------------------------------------------------------------------- /ch12/k8s/basic/tomcat-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: tomcat-service 5 | labels: 6 | app: mytomcat 7 | spec: 8 | type: NodePort 9 | ports: 10 | - port: 30000 11 | nodePort: 30000 12 | targetPort: 8080 13 | selector: 14 | app: mytomcat -------------------------------------------------------------------------------- /ch12/k8s/devops/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/ch12/k8s/devops/.DS_Store -------------------------------------------------------------------------------- /ch12/k8s/devops/docker-registry/values.yaml: -------------------------------------------------------------------------------- 1 | persistence: 2 | enabled: true 3 | service: 4 | type: NodePort -------------------------------------------------------------------------------- /ch12/k8s/devops/jenkins/jenkins/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | ci/ 23 | -------------------------------------------------------------------------------- /ch12/k8s/devops/jenkins/jenkins/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - lachie83 3 | - viglesiasce 4 | - maorfr 5 | - torstenwalter 6 | reviewers: 7 | - lachie83 8 | - viglesiasce 9 | - maorfr 10 | - torstenwalter 11 | -------------------------------------------------------------------------------- /ch12/k8s/devops/jenkins/jenkins/ci/casc-values.yaml: -------------------------------------------------------------------------------- 1 | master: 2 | JCasC: 3 | enabled: true 4 | sidecars: 5 | configAutoReload: 6 | enabled: true 7 | -------------------------------------------------------------------------------- /ch12/k8s/devops/jenkins/jenkins/ci/default-values.yaml: -------------------------------------------------------------------------------- 1 | # this file is empty to check if defaults within values.yaml work as expected 2 | -------------------------------------------------------------------------------- /ch12/k8s/devops/jenkins/jenkins/templates/tests/test-config.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: {{ template "jenkins.fullname" . }}-tests 5 | namespace: {{ template "jenkins.namespace" . }} 6 | data: 7 | run.sh: |- 8 | @test "Testing Jenkins UI is accessible" { 9 | curl --retry 48 --retry-delay 10 {{ template "jenkins.fullname" . }}:{{ .Values.master.servicePort }}{{ default "" .Values.master.jenkinsUriPrefix }}/login 10 | } 11 | -------------------------------------------------------------------------------- /ch12/k8s/devops/jenkins/values.yaml: -------------------------------------------------------------------------------- 1 | master: 2 | serviceType: NodePort 3 | adminUser: wisely 4 | adminPassword: zzzzzz 5 | installPlugins: 6 | - kubernetes:1.17.2 7 | - workflow-job:2.33 8 | - workflow-aggregator:2.6 9 | - credentials-binding:1.19 10 | - git:3.10.1 11 | - blueocean:1.17.0 12 | #persistence: 13 | # storageClass: standard -------------------------------------------------------------------------------- /ch12/k8s/helm/postgresql/values.yaml: -------------------------------------------------------------------------------- 1 | postgresqlUsername: wisely 2 | postgresqlPassword: zzzzzz 3 | postgresqlDatabase: first_db 4 | persistence: 5 | storageClass: standard -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/5.2.1/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/5.2.1/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/5.2.1/fileContent/fileContent.lock -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/5.2.1/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/5.2.1/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/5.2.1/gc.properties -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/5.2.1/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/5.2.1/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/5.2.1/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Thu Mar 14 23:22:55 CST 2019 2 | gradle.version=5.2.1 3 | -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/buildOutputCleanup/outputFiles.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/buildOutputCleanup/outputFiles.bin -------------------------------------------------------------------------------- /tools/gradle-java/.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-java/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /tools/gradle-java/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | group = 'top.wisely' 4 | version = '0.0.1-SNAPSHOT' 5 | 6 | repositories { 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | implementation 'org.springframework:spring-web:5.1.5.RELEASE' 12 | } 13 | -------------------------------------------------------------------------------- /tools/gradle-java/src/main/java/top/wisely/Hello.java: -------------------------------------------------------------------------------- 1 | package top.wisely; 2 | 3 | public class Hello { 4 | public static void main(String[] args) { 5 | System.out.println("Hello World!!"); 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /tools/gradle-project/.gradle/5.2.1/executionHistory/executionHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-project/.gradle/5.2.1/executionHistory/executionHistory.bin -------------------------------------------------------------------------------- /tools/gradle-project/.gradle/5.2.1/executionHistory/executionHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-project/.gradle/5.2.1/executionHistory/executionHistory.lock -------------------------------------------------------------------------------- /tools/gradle-project/.gradle/5.2.1/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/gradle-project/.gradle/5.2.1/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-project/.gradle/5.2.1/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /tools/gradle-project/.gradle/5.2.1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-project/.gradle/5.2.1/gc.properties -------------------------------------------------------------------------------- /tools/gradle-project/.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/gradle-project/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /tools/gradle-project/.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Thu Mar 14 10:36:47 CST 2019 2 | gradle.version=5.2.1 3 | -------------------------------------------------------------------------------- /tools/gradle-project/build.gradle: -------------------------------------------------------------------------------- 1 | task hello { 2 | doLast { 3 | println 'Hello World!' 4 | } 5 | } 6 | task hello2 { 7 | doLast { 8 | println 'Hello Gradle!' 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /tools/intellij-spring-boot/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | .gradle 3 | build/ 4 | !gradle/wrapper/gradle-wrapper.jar 5 | !**/src/main/** 6 | !**/src/test/** 7 | 8 | ### STS ### 9 | .apt_generated 10 | .classpath 11 | .factorypath 12 | .project 13 | .settings 14 | .springBeans 15 | .sts4-cache 16 | 17 | ### IntelliJ IDEA ### 18 | .idea 19 | *.iws 20 | *.iml 21 | *.ipr 22 | out/ 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | 31 | ### VS Code ### 32 | .vscode/ 33 | -------------------------------------------------------------------------------- /tools/intellij-spring-boot/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/tools/intellij-spring-boot/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /tools/intellij-spring-boot/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /tools/intellij-spring-boot/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url 'https://repo.spring.io/milestone' } 4 | gradlePluginPortal() 5 | } 6 | resolutionStrategy { 7 | eachPlugin { 8 | if (requested.id.id == 'org.springframework.boot') { 9 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 10 | } 11 | } 12 | } 13 | } 14 | rootProject.name = 'intellij-spring-boot' 15 | -------------------------------------------------------------------------------- /tools/intellij-spring-boot/src/main/java/top/wisely/intellijspringboot/IntellijSpringBootApplication.java: -------------------------------------------------------------------------------- 1 | package top.wisely.intellijspringboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | @SpringBootApplication 6 | public class IntellijSpringBootApplication { 7 | 8 | public static void main(String[] args) { 9 | SpringApplication.run(IntellijSpringBootApplication.class, args); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /tools/intellij-spring-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tools/intellij-spring-boot/src/test/java/top/wisely/intellijspringboot/IntellijSpringBootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.wisely.intellijspringboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class IntellijSpringBootApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /开发必备工具.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wiselyman/spring-boot-book-source-code/177053b0a3d88a03a5fca4a8848b06a54c4dbb82/开发必备工具.docx --------------------------------------------------------------------------------