├── .gitattributes ├── .gitignore ├── .nojekyll ├── 404.md ├── LICENSE ├── README.md ├── _coverpage.md ├── docs ├── MyBatisPlus.md ├── PowerMockRunnerAndMockito.md ├── advanced │ ├── Apache-BeanUtils-VS-SpringBean-Utils.md │ ├── Performance-of-Java-Mapping-Frameworks.md │ ├── SpringBoot-ScheduleTasks.md │ ├── springboot-async.md │ ├── springboot-dubbo.md │ ├── springboot-handle-exception-plus.md │ ├── springboot-handle-exception.md │ └── springboot-oss.md ├── basis │ ├── @PostConstruct与@PreDestroy.md │ ├── RestControllerVSController.md │ ├── read-config-properties.md │ ├── springboot-filter.md │ ├── springboot-interceptor.md │ ├── springboot-jpa-lianbiao.md │ ├── springboot-jpa.md │ ├── springboot-mybatis-mutipledatasource.md │ ├── springboot-mybatis.md │ ├── sringboot-restful-web-service.md │ └── swagger.md ├── projects │ ├── SpringCloud刷题系统.md │ ├── kkFileView-SpringBoot在线文件预览系统.md │ └── 一个基于SpringBoot的在线考试系统.md ├── spring-bean-validation.md └── start │ ├── springboot-hello-world.md │ └── springboot-introduction.md ├── index.html ├── media └── zhao-chen-hvuLPoMM19I-unsplash.jpg └── source-code ├── advanced ├── async-method-springboot │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── github │ │ │ │ └── javaguide │ │ │ │ └── asyncmethodspringboot │ │ │ │ ├── AsyncMethodSpringbootApplication.java │ │ │ │ ├── config │ │ │ │ └── AsyncConfig.java │ │ │ │ ├── controller │ │ │ │ └── AsyncController.java │ │ │ │ └── service │ │ │ │ └── AsyncService.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── github │ │ └── javaguide │ │ └── asyncmethodspringboot │ │ └── service │ │ └── AsyncServiceTest.java ├── bean-validation-demo │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── beanvalidationdemo │ │ │ │ ├── BeanValidationDemoApplication.java │ │ │ │ ├── constants │ │ │ │ └── Constants.java │ │ │ │ ├── controller │ │ │ │ ├── HelloWorldController.java │ │ │ │ └── PersonController.java │ │ │ │ ├── entity │ │ │ │ ├── Person.java │ │ │ │ └── PersonRequest.java │ │ │ │ ├── exception │ │ │ │ └── GlobalExceptionHandler.java │ │ │ │ ├── service │ │ │ │ ├── AddPersonGroup.java │ │ │ │ ├── DeletePersonGroup.java │ │ │ │ └── PersonService.java │ │ │ │ └── validation │ │ │ │ ├── PhoneNumber.java │ │ │ │ ├── PhoneNumberValidator.java │ │ │ │ ├── Region.java │ │ │ │ └── RegionValidator.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── example │ │ └── beanvalidationdemo │ │ ├── PersonControllerTest.java │ │ └── PersonServiceTest.java ├── springboot-dubbo │ ├── .idea │ │ ├── compiler.xml │ │ ├── encodings.xml │ │ ├── libraries │ │ │ ├── Maven__ch_qos_logback_logback_classic_1_2_3.xml │ │ │ ├── Maven__ch_qos_logback_logback_core_1_2_3.xml │ │ │ ├── Maven__com_101tec_zkclient_0_10.xml │ │ │ ├── Maven__com_alibaba_dubbo_2_6_0.xml │ │ │ ├── Maven__com_alibaba_spring_boot_dubbo_spring_boot_starter_2_0_0.xml │ │ │ ├── Maven__com_fasterxml_classmate_1_4_0.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_9_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_9_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_7.xml │ │ │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.xml │ │ │ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml │ │ │ ├── Maven__io_micrometer_micrometer_core_1_1_0.xml │ │ │ ├── Maven__io_netty_netty_3_7_0_Final.xml │ │ │ ├── Maven__javax_annotation_javax_annotation_api_1_3_2.xml │ │ │ ├── Maven__javax_validation_validation_api_2_0_1_Final.xml │ │ │ ├── Maven__jline_jline_0_9_94.xml │ │ │ ├── Maven__junit_junit_4_12.xml │ │ │ ├── Maven__log4j_log4j_1_2_16.xml │ │ │ ├── Maven__net_bytebuddy_byte_buddy_1_9_3.xml │ │ │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_9_3.xml │ │ │ ├── Maven__net_minidev_accessors_smart_1_2.xml │ │ │ ├── Maven__net_minidev_json_smart_2_3.xml │ │ │ ├── Maven__org_apache_logging_log4j_log4j_api_2_11_1.xml │ │ │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_1.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_12.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_12.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_12.xml │ │ │ ├── Maven__org_apache_zookeeper_zookeeper_3_4_8.xml │ │ │ ├── Maven__org_assertj_assertj_core_3_11_1.xml │ │ │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ │ │ ├── Maven__org_hamcrest_hamcrest_library_1_3.xml │ │ │ ├── Maven__org_hdrhistogram_HdrHistogram_2_1_9.xml │ │ │ ├── Maven__org_hibernate_validator_hibernate_validator_6_0_13_Final.xml │ │ │ ├── Maven__org_javassist_javassist_3_20_0_GA.xml │ │ │ ├── Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml │ │ │ ├── Maven__org_jboss_netty_netty_3_2_5_Final.xml │ │ │ ├── Maven__org_latencyutils_LatencyUtils_2_0_3.xml │ │ │ ├── Maven__org_mockito_mockito_core_2_23_0.xml │ │ │ ├── Maven__org_objenesis_objenesis_2_6.xml │ │ │ ├── Maven__org_ow2_asm_asm_5_0_4.xml │ │ │ ├── Maven__org_skyscreamer_jsonassert_1_5_0.xml │ │ │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_25.xml │ │ │ ├── Maven__org_slf4j_slf4j_api_1_7_25.xml │ │ │ ├── Maven__org_slf4j_slf4j_log4j12_1_7_25.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_actuator_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_actuator_autoconfigure_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_actuator_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_test_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_0_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_aop_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_beans_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_context_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_core_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_expression_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_jcl_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_test_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_web_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_webmvc_5_1_2_RELEASE.xml │ │ │ ├── Maven__org_xmlunit_xmlunit_core_2_6_2.xml │ │ │ └── Maven__org_yaml_snakeyaml_1_23.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ ├── vcs.xml │ │ └── workspace.xml │ ├── dubbo-consumer │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── top │ │ │ │ │ └── snailclimb │ │ │ │ │ └── dubboconsumer │ │ │ │ │ ├── DubboConsumerApplication.java │ │ │ │ │ └── HelloController.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── top │ │ │ └── snailclimb │ │ │ └── dubboconsumer │ │ │ └── DubboConsumerApplicationTests.java │ ├── dubbo-interface │ │ ├── dubbo-interface.iml │ │ ├── pom.xml │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── top │ │ │ │ └── snailclimb │ │ │ │ └── service │ │ │ │ └── HelloService.java │ │ └── target │ │ │ ├── maven-archiver │ │ │ └── pom.properties │ │ │ └── maven-status │ │ │ └── maven-compiler-plugin │ │ │ ├── compile │ │ │ └── default-compile │ │ │ │ ├── createdFiles.lst │ │ │ │ └── inputFiles.lst │ │ │ └── testCompile │ │ │ └── default-testCompile │ │ │ └── inputFiles.lst │ └── dubbo-provider │ │ ├── .gitignore │ │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── snailclimb │ │ │ │ ├── DubboProviderApplication.java │ │ │ │ └── service │ │ │ │ └── impl │ │ │ │ └── HelloServiceImpl.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── top │ │ └── snailclimb │ │ └── dubboprovider │ │ └── DubboProviderApplicationTests.java ├── springboot-rabbitmq │ ├── .idea │ │ ├── compiler.xml │ │ ├── encodings.xml │ │ ├── libraries │ │ │ ├── Maven__ch_qos_logback_logback_classic_1_2_3.xml │ │ │ ├── Maven__ch_qos_logback_logback_core_1_2_3.xml │ │ │ ├── Maven__com_fasterxml_classmate_1_4_0.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_9_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_9_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_7.xml │ │ │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_7.xml │ │ │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.xml │ │ │ ├── Maven__com_rabbitmq_amqp_client_5_4_3.xml │ │ │ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml │ │ │ ├── Maven__javax_annotation_javax_annotation_api_1_3_2.xml │ │ │ ├── Maven__javax_validation_validation_api_2_0_1_Final.xml │ │ │ ├── Maven__junit_junit_4_12.xml │ │ │ ├── Maven__net_bytebuddy_byte_buddy_1_9_5.xml │ │ │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_9_5.xml │ │ │ ├── Maven__net_minidev_accessors_smart_1_2.xml │ │ │ ├── Maven__net_minidev_json_smart_2_3.xml │ │ │ ├── Maven__org_apache_logging_log4j_log4j_api_2_11_1.xml │ │ │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_1.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_13.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_13.xml │ │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_13.xml │ │ │ ├── Maven__org_assertj_assertj_core_3_11_1.xml │ │ │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ │ │ ├── Maven__org_hamcrest_hamcrest_library_1_3.xml │ │ │ ├── Maven__org_hibernate_validator_hibernate_validator_6_0_13_Final.xml │ │ │ ├── Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml │ │ │ ├── Maven__org_mockito_mockito_core_2_23_4.xml │ │ │ ├── Maven__org_objenesis_objenesis_2_6.xml │ │ │ ├── Maven__org_ow2_asm_asm_5_0_4.xml │ │ │ ├── Maven__org_skyscreamer_jsonassert_1_5_0.xml │ │ │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_25.xml │ │ │ ├── Maven__org_slf4j_slf4j_api_1_7_25.xml │ │ │ ├── Maven__org_springframework_amqp_spring_amqp_2_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_amqp_spring_rabbit_2_1_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_amqp_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_test_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_1_RELEASE.xml │ │ │ ├── Maven__org_springframework_retry_spring_retry_1_2_2_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_aop_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_beans_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_context_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_core_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_expression_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_jcl_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_messaging_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_test_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_tx_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_web_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_springframework_spring_webmvc_5_1_3_RELEASE.xml │ │ │ ├── Maven__org_xmlunit_xmlunit_core_2_6_2.xml │ │ │ └── Maven__org_yaml_snakeyaml_1_23.xml │ │ ├── misc.xml │ │ ├── modules.xml │ │ ├── vcs.xml │ │ └── workspace.xml │ └── producer │ │ ├── .gitignore │ │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── snailclimb │ │ │ │ └── producer │ │ │ │ └── ProducerApplication.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── top │ │ └── snailclimb │ │ └── producer │ │ └── ProducerApplicationTests.java └── springboot-schedule-task │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── github │ │ │ └── javaguide │ │ │ └── springbootscheduletask │ │ │ ├── AsyncScheduledTasks.java │ │ │ ├── SpringbootScheduleTaskApplication.java │ │ │ └── config │ │ │ └── SchedulerConfig.java │ └── resources │ │ ├── application.properties │ │ └── templates │ │ └── hello │ │ └── hello.html │ └── test │ └── java │ └── github │ └── javaguide │ └── springbootscheduletask │ └── SpringbootScheduleTaskApplicationTests.java ├── basis ├── jpa-demo │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── github │ │ │ │ └── snailclimb │ │ │ │ └── jpademo │ │ │ │ ├── JpaDemoApplication.java │ │ │ │ ├── model │ │ │ │ ├── dto │ │ │ │ │ └── UserDTO.java │ │ │ │ └── po │ │ │ │ │ ├── Company.java │ │ │ │ │ ├── Person.java │ │ │ │ │ └── School.java │ │ │ │ └── repository │ │ │ │ └── PersonRepository.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ ├── java │ │ └── github │ │ │ └── snailclimb │ │ │ └── jpademo │ │ │ └── repository │ │ │ ├── PersonRepositoryTest.java │ │ │ └── PersonRepositoryTest2.java │ │ └── resources │ │ └── init.sql ├── life-cycle-annotation │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── cn │ │ │ │ └── javaguide │ │ │ │ ├── LifeCycleAnnotationApplication.java │ │ │ │ └── config │ │ │ │ ├── MyConfiguration.java │ │ │ │ └── MyConfiguration2.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── cn │ │ └── javaguide │ │ └── lifecycleannotation │ │ └── LifeCycleAnnotationApplicationTests.java ├── read-config-properties │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── config │ │ └── application.yml │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── cn │ │ │ │ └── javaguide │ │ │ │ └── readconfigproperties │ │ │ │ ├── LibraryProperties.java │ │ │ │ ├── ProfileProperties.java │ │ │ │ ├── ReadConfigPropertiesApplication.java │ │ │ │ └── WebSite.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── config │ │ │ └── application.yml │ │ │ └── website.properties │ │ └── test │ │ └── java │ │ └── cn │ │ └── javaguide │ │ └── readconfigproperties │ │ └── ReadConfigPropertiesApplicationTests.java ├── springboot-filter-interceptor │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── MavenWrapperDownloader.java │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── github │ │ │ │ └── javaguide │ │ │ │ └── springbootfilter │ │ │ │ ├── SpringbootFilterApplication.java │ │ │ │ ├── config │ │ │ │ ├── MyFilterConfig.java │ │ │ │ └── WebConfig.java │ │ │ │ ├── filter │ │ │ │ ├── MyFilter.java │ │ │ │ ├── MyFilter2.java │ │ │ │ └── MyFilterWithAnnotation.java │ │ │ │ ├── interceptor │ │ │ │ ├── AdminInterceptor.java │ │ │ │ ├── LogInterceptor.java │ │ │ │ └── OldLoginInterceptor.java │ │ │ │ └── web │ │ │ │ ├── InterceptorTestController.java │ │ │ │ └── MyController.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── templates │ │ │ ├── login.html │ │ │ └── test.html │ │ └── test │ │ └── java │ │ └── github │ │ └── javaguide │ │ └── springbootfilter │ │ └── SpringbootFilterApplicationTests.java ├── springboot-handle-exception-improved │ ├── .gitignore │ ├── .idea │ │ ├── .name │ │ ├── checkstyle-idea.xml │ │ ├── inspectionProfiles │ │ │ └── Project_Default.xml │ │ ├── misc.xml │ │ ├── modules │ │ │ └── webApp.main.iml │ │ └── vcs.xml │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── twuc │ │ │ │ └── webApp │ │ │ │ ├── WebAppApplication.java │ │ │ │ ├── entity │ │ │ │ └── Person.java │ │ │ │ ├── exception │ │ │ │ ├── BaseException.java │ │ │ │ ├── ErrorCode.java │ │ │ │ ├── ErrorReponse.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ └── web │ │ │ │ └── ExceptionController.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── twuc │ │ └── webApp │ │ └── web │ │ └── ExceptionTest.java ├── springboot-handle-exception │ ├── .gitignore │ ├── .idea │ │ ├── .name │ │ ├── checkstyle-idea.xml │ │ ├── inspectionProfiles │ │ │ └── Project_Default.xml │ │ ├── misc.xml │ │ └── vcs.xml │ ├── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── twuc │ │ │ │ └── webApp │ │ │ │ ├── WebAppApplication.java │ │ │ │ ├── exception │ │ │ │ ├── ErrorResponse.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ ├── ResourceNotFoundException.java │ │ │ │ └── ResourseNotFoundException2.java │ │ │ │ └── web │ │ │ │ ├── ExceptionController.java │ │ │ │ └── ResponseStatusExceptionController.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── twuc │ │ └── webApp │ │ └── web │ │ └── ExceptionTest.java └── springboot-mybatis │ ├── springboot-mybatis-annotation │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── snailclimb │ │ │ │ ├── MainApplication.java │ │ │ │ ├── bean │ │ │ │ └── User.java │ │ │ │ ├── controller │ │ │ │ └── UserController.java │ │ │ │ ├── dao │ │ │ │ └── UserDao.java │ │ │ │ └── service │ │ │ │ └── UserService.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── top │ │ └── snailclimb │ │ └── snailclimb │ │ └── springbootmybatis │ │ └── SpringbootMybatisApplicationTests.java │ ├── springboot-mybatis-mutipleDatasource │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── top │ │ │ │ └── snailclimb │ │ │ │ ├── MainApplication.java │ │ │ │ ├── bean │ │ │ │ ├── Money.java │ │ │ │ └── User.java │ │ │ │ ├── config │ │ │ │ ├── DataSource1Config.java │ │ │ │ └── DataSource2Config.java │ │ │ │ ├── controller │ │ │ │ ├── MoneyController.java │ │ │ │ └── UserController.java │ │ │ │ ├── db1 │ │ │ │ ├── dao │ │ │ │ │ └── UserDao.java │ │ │ │ └── service │ │ │ │ │ └── UserService.java │ │ │ │ └── db2 │ │ │ │ ├── dao │ │ │ │ └── MoneyDao.java │ │ │ │ └── service │ │ │ │ └── MoneyService.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── top │ │ └── snailclimb │ │ └── snailclimb │ │ └── springbootmybatis │ │ └── SpringbootMybatisApplicationTests.java │ └── springboot-mybatis-xml │ ├── .gitignore │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── top │ │ │ └── snailclimb │ │ │ ├── MainApplication.java │ │ │ ├── bean │ │ │ └── User.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── dao │ │ │ └── UserDao.java │ │ │ └── service │ │ │ └── UserService.java │ └── resources │ │ ├── application.properties │ │ └── mapper │ │ └── UserMapper.xml │ └── test │ └── java │ └── top │ └── snailclimb │ └── snailclimb │ └── springbootmybatis │ └── SpringbootMybatisApplicationTests.java ├── bean-validation-demo ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── beanvalidationdemo │ │ │ ├── BeanValidationDemoApplication.java │ │ │ ├── constants │ │ │ └── Constants.java │ │ │ ├── controller │ │ │ ├── HelloWorldController.java │ │ │ └── PersonController.java │ │ │ ├── entity │ │ │ ├── Person.java │ │ │ └── PersonRequest.java │ │ │ ├── exception │ │ │ └── GlobalExceptionHandler.java │ │ │ ├── service │ │ │ ├── AddPersonGroup.java │ │ │ ├── DeletePersonGroup.java │ │ │ └── PersonService.java │ │ │ └── validation │ │ │ ├── PhoneNumber.java │ │ │ ├── PhoneNumberValidator.java │ │ │ ├── Region.java │ │ │ └── RegionValidator.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── beanvalidationdemo │ ├── PersonControllerTest.java │ └── PersonServiceTest.java ├── hello-world ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── helloworld │ │ │ ├── HelloWorldApplication.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ ├── dto │ │ │ └── UserDto.java │ │ │ └── entity │ │ │ └── User.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ ├── dto2entity │ └── BeanUtilsTest.java │ └── helloworld │ └── HelloWorldApplicationTests.java └── springboot-data-desensitization ├── .gitignore ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── github │ │ └── springbootdatadesensitization │ │ ├── SpringbootDataDesensitizationApplication.java │ │ ├── desensitize │ │ ├── JsonDesensitizationSerializer.java │ │ ├── annotation │ │ │ └── JsonDesensitization.java │ │ ├── desensitizer │ │ │ ├── AbstractDesensitizer.java │ │ │ ├── Desensitizer.java │ │ │ ├── DesensitizerFactory.java │ │ │ └── impl │ │ │ │ ├── AddressDesensitizer.java │ │ │ │ ├── BankCardDesensitizer.java │ │ │ │ ├── BirthdayDesensitizer.java │ │ │ │ ├── DefaultDesensitizer.java │ │ │ │ ├── EmailDesensitizer.java │ │ │ │ ├── IdCardDesensitizer.java │ │ │ │ ├── LandlineDesensitizer.java │ │ │ │ ├── MobileDesensitizer.java │ │ │ │ └── PasswordDesensitizer.java │ │ ├── enums │ │ │ └── DesensitizationType.java │ │ └── exception │ │ │ └── DesensitizationException.java │ │ └── entity │ │ └── User.java └── resources │ └── application.properties └── test └── java └── com └── github └── springbootdatadesensitization └── desensitize └── JsonDesensitizationSerializerTest.java /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | -------------------------------------------------------------------------------- /.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/.nojekyll -------------------------------------------------------------------------------- /404.md: -------------------------------------------------------------------------------- 1 | ### 联系我 2 | 3 | 添加我的微信备注“Github”,回复关键字 **“加群”** 即可入群。 4 | 5 | ![个人微信](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-7/wechat3.jpeg) 6 | 7 | ### 公众号 8 | 9 | 如果大家想要实时关注我更新的文章以及分享的干货的话,可以关注我的公众号。 10 | 11 | **《Java面试突击》:** 由本文档衍生的专为面试而生的《Java面试突击》V2.0 PDF 版本[公众号](#公众号)后台回复 **"Java面试突击"** 即可免费领取! 12 | 13 | **Java工程师必备学习资源:** 一些Java工程师常用学习资源公众号后台回复关键字 **“1”** 即可免费无套路获取。 14 | 15 | ![我的公众号](https://my-blog-to-use.oss-cn-beijing.aliyuncs.com/2019-6/167598cd2e17b8ec.png) -------------------------------------------------------------------------------- /_coverpage.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | 5 |

6 | 7 |

Spring Boot 学习/面试指南

8 | 9 | [常用资源](https://shimo.im/docs/MuiACIg1HlYfVxrj/) 10 | [GitHub](https://github.com/Snailclimb/springboot-guide) 11 | [开始阅读](#重要知识点) 12 | 13 | ![](./media/zhao-chen-hvuLPoMM19I-unsplash.jpg) -------------------------------------------------------------------------------- /media/zhao-chen-hvuLPoMM19I-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/media/zhao-chen-hvuLPoMM19I-unsplash.jpg -------------------------------------------------------------------------------- /source-code/advanced/async-method-springboot/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/advanced/async-method-springboot/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/async-method-springboot/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/advanced/async-method-springboot/.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 | -------------------------------------------------------------------------------- /source-code/advanced/async-method-springboot/src/main/java/github/javaguide/asyncmethodspringboot/AsyncMethodSpringbootApplication.java: -------------------------------------------------------------------------------- 1 | package github.javaguide.asyncmethodspringboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class AsyncMethodSpringbootApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(AsyncMethodSpringbootApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/advanced/async-method-springboot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/bean-validation-demo/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/.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 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/BeanValidationDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BeanValidationDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BeanValidationDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/constants/Constants.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.constants; 2 | 3 | public final class Constants { 4 | public static final String sexs = "((^Man$|^Woman$|^UGM$))"; 5 | } 6 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/controller/HelloWorldController.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | * @author shuang.kou 9 | * 验证基本环境搭建是否正确 10 | */ 11 | @RestController 12 | @RequestMapping("/api") 13 | public class HelloWorldController { 14 | 15 | @GetMapping("/hello") 16 | public String hello() { 17 | return "Hello"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/entity/Person.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.entity; 2 | 3 | import com.example.beanvalidationdemo.service.AddPersonGroup; 4 | import com.example.beanvalidationdemo.service.DeletePersonGroup; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | import javax.validation.constraints.Null; 9 | 10 | @Data 11 | public class Person { 12 | 13 | // 当验证组为 DeletePersonGroup 的时候 group 字段不能为空 14 | @NotNull(groups = DeletePersonGroup.class) 15 | // 当验证组为 AddPersonGroup 的时候 group 字段需要为空 16 | @Null(groups = AddPersonGroup.class) 17 | private String group; 18 | } 19 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/service/AddPersonGroup.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.service; 2 | 3 | public interface AddPersonGroup { 4 | } 5 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/service/DeletePersonGroup.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.service; 2 | 3 | public interface DeletePersonGroup { 4 | } 5 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/validation/PhoneNumber.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.validation; 2 | 3 | import javax.validation.Constraint; 4 | import java.lang.annotation.Documented; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.Target; 7 | 8 | import static java.lang.annotation.ElementType.FIELD; 9 | import static java.lang.annotation.ElementType.PARAMETER; 10 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 11 | 12 | @Documented 13 | @Constraint(validatedBy = PhoneNumberValidator.class) 14 | @Target({FIELD, PARAMETER}) 15 | @Retention(RUNTIME) 16 | public @interface PhoneNumber { 17 | String message() default "Invalid phone number"; 18 | 19 | Class[] groups() default {}; 20 | 21 | Class[] payload() default {}; 22 | } 23 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/validation/Region.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.validation; 2 | 3 | import javax.validation.Constraint; 4 | import javax.validation.Payload; 5 | import java.lang.annotation.Documented; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.Target; 8 | 9 | import static java.lang.annotation.ElementType.FIELD; 10 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 11 | 12 | /** 13 | * @author shuang.kou 14 | */ 15 | @Target({FIELD}) 16 | @Retention(RUNTIME) 17 | @Constraint(validatedBy = RegionValidator.class) 18 | @Documented 19 | public @interface Region { 20 | 21 | String message() default "Region 值不在可选范围内"; 22 | 23 | Class[] groups() default {}; 24 | 25 | Class[] payload() default {}; 26 | } 27 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/validation/RegionValidator.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.validation; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | import java.util.HashSet; 6 | 7 | public class RegionValidator implements ConstraintValidator { 8 | 9 | @Override 10 | public boolean isValid(String value, ConstraintValidatorContext context) { 11 | HashSet regions = new HashSet<>(); 12 | regions.add("China"); 13 | regions.add("China-Taiwan"); 14 | regions.add("China-HongKong"); 15 | return regions.contains(value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source-code/advanced/bean-validation-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/bean-validation-demo/src/main/resources/application.properties -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_101tec_zkclient_0_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_alibaba_dubbo_2_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_alibaba_spring_boot_dubbo_spring_boot_starter_2_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__io_micrometer_micrometer_core_1_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__io_netty_netty_3_7_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__jline_jline_0_9_94.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__log4j_log4j_1_2_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_apache_zookeeper_zookeeper_3_4_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_13_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_javassist_javassist_3_20_0_GA.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_jboss_netty_netty_3_2_5_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_latencyutils_LatencyUtils_2_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_mockito_mockito_core_2_23_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_actuator_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_actuator_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_aop_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_beans_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_context_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_core_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_expression_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_test_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_web_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-consumer/.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 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-consumer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/springboot-dubbo/dubbo-consumer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-consumer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-consumer/src/main/java/top/snailclimb/dubboconsumer/DubboConsumerApplication.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.dubboconsumer; 2 | 3 | import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | @EnableDubboConfiguration 9 | public class DubboConsumerApplication { 10 | 11 | public static void main(String[] args) { 12 | 13 | SpringApplication.run(DubboConsumerApplication.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-consumer/src/main/java/top/snailclimb/dubboconsumer/HelloController.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.dubboconsumer; 2 | 3 | import com.alibaba.dubbo.config.annotation.Reference; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import top.snailclimb.service.HelloService; 7 | 8 | @RestController 9 | public class HelloController { 10 | @Reference 11 | private HelloService helloService; 12 | 13 | @RequestMapping("/hello") 14 | public String hello() { 15 | String hello = helloService.sayHello("world"); 16 | System.out.println(helloService.sayHello("SnailClimb")); 17 | return hello; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-consumer/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/springboot-dubbo/dubbo-consumer/src/main/resources/application.properties -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-consumer/src/test/java/top/snailclimb/dubboconsumer/DubboConsumerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.dubboconsumer; 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 DubboConsumerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-interface/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | top.snailclimb 8 | dubbo-interface 9 | 1.0-SNAPSHOT 10 | 11 | 12 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-interface/src/main/java/top/snailclimb/service/HelloService.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.service; 2 | 3 | public interface HelloService { 4 | 5 | public String sayHello(String name); 6 | } 7 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-interface/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven 2 | #Tue Nov 27 10:32:58 CST 2018 3 | version=1.0-SNAPSHOT 4 | groupId=top.snailclimb 5 | artifactId=dubbo-interface 6 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-interface/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | top\snailclimb\service\HelloService.class 2 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-interface/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | F:\workplace\Spring Boot\springboot-dubbo\dubbo-interface\src\main\java\top\snailclimb\service\HelloService.java 2 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-interface/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/springboot-dubbo/dubbo-interface/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-provider/.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 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-provider/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/springboot-dubbo/dubbo-provider/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-provider/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-provider/src/main/java/top/snailclimb/DubboProviderApplication.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb; 2 | 3 | import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | // 开启dubbo的自动配置 9 | @EnableDubboConfiguration 10 | public class DubboProviderApplication { 11 | public static void main(String[] args) { 12 | SpringApplication.run(DubboProviderApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-provider/src/main/java/top/snailclimb/service/impl/HelloServiceImpl.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.service.impl; 2 | 3 | import com.alibaba.dubbo.config.annotation.Service; 4 | import org.springframework.stereotype.Component; 5 | import top.snailclimb.service.HelloService; 6 | 7 | @Component 8 | @Service 9 | public class HelloServiceImpl implements HelloService { 10 | @Override 11 | public String sayHello(String name) { 12 | return "Hello " + name; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-provider/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/springboot-dubbo/dubbo-provider/src/main/resources/application.properties -------------------------------------------------------------------------------- /source-code/advanced/springboot-dubbo/dubbo-provider/src/test/java/top/snailclimb/dubboprovider/DubboProviderApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.dubboprovider; 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 DubboProviderApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_rabbitmq_amqp_client_5_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_13_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_amqp_spring_amqp_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_amqp_spring_rabbit_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_amqp_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_retry_spring_retry_1_2_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_aop_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_beans_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_context_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_core_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_expression_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_messaging_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_test_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_tx_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_web_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/producer/.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 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/producer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/springboot-rabbitmq/producer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/producer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/producer/src/main/java/top/snailclimb/producer/ProducerApplication.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.producer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class ProducerApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(ProducerApplication.class, args); 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/producer/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/springboot-rabbitmq/producer/src/main/resources/application.properties -------------------------------------------------------------------------------- /source-code/advanced/springboot-rabbitmq/producer/src/test/java/top/snailclimb/producer/ProducerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.producer; 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 ProducerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-schedule-task/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-schedule-task/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/advanced/springboot-schedule-task/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/advanced/springboot-schedule-task/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.2/apache-maven-3.6.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-schedule-task/src/main/java/github/javaguide/springbootscheduletask/SpringbootScheduleTaskApplication.java: -------------------------------------------------------------------------------- 1 | package github.javaguide.springbootscheduletask; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.scheduling.annotation.EnableScheduling; 6 | 7 | @SpringBootApplication 8 | @EnableScheduling 9 | public class SpringbootScheduleTaskApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringbootScheduleTaskApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-schedule-task/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-schedule-task/src/main/resources/templates/hello/hello.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Getting Started: Serving Web Content 10 | 11 | 12 | 13 |

14 |

15 | 16 | 17 | -------------------------------------------------------------------------------- /source-code/advanced/springboot-schedule-task/src/test/java/github/javaguide/springbootscheduletask/SpringbootScheduleTaskApplicationTests.java: -------------------------------------------------------------------------------- 1 | package github.javaguide.springbootscheduletask; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootScheduleTaskApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/jpa-demo/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/.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 | -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/src/main/java/github/snailclimb/jpademo/JpaDemoApplication.java: -------------------------------------------------------------------------------- 1 | package github.snailclimb.jpademo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class JpaDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(JpaDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/src/main/java/github/snailclimb/jpademo/model/dto/UserDTO.java: -------------------------------------------------------------------------------- 1 | package github.snailclimb.jpademo.model.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | @Data 9 | @NoArgsConstructor 10 | @Builder(toBuilder = true) 11 | @AllArgsConstructor 12 | public class UserDTO { 13 | private String name; 14 | private int age; 15 | private String companyName; 16 | private String schoolName; 17 | } 18 | -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/src/main/java/github/snailclimb/jpademo/model/po/Company.java: -------------------------------------------------------------------------------- 1 | package github.snailclimb.jpademo.model.po; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import javax.persistence.Column; 8 | import javax.persistence.Entity; 9 | import javax.persistence.GeneratedValue; 10 | import javax.persistence.GenerationType; 11 | import javax.persistence.Id; 12 | 13 | @Entity 14 | @Data 15 | @NoArgsConstructor 16 | public class Company { 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.IDENTITY) 19 | private Long id; 20 | @Column(unique = true) 21 | private String companyName; 22 | private String description; 23 | 24 | public Company(String name, String description) { 25 | this.companyName = name; 26 | this.description = description; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/src/main/java/github/snailclimb/jpademo/model/po/School.java: -------------------------------------------------------------------------------- 1 | package github.snailclimb.jpademo.model.po; 2 | 3 | 4 | import lombok.AllArgsConstructor; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import javax.persistence.Column; 9 | import javax.persistence.Entity; 10 | import javax.persistence.GeneratedValue; 11 | import javax.persistence.GenerationType; 12 | import javax.persistence.Id; 13 | 14 | @Entity 15 | @Data 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | public class School { 19 | @Id 20 | @GeneratedValue(strategy = GenerationType.IDENTITY) 21 | private Long id; 22 | @Column(unique = true) 23 | private String name; 24 | private String description; 25 | } 26 | -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 数据库url地址 2 | spring.datasource.url=jdbc:h2:mem:jpa-demo 3 | spring.datasource.username=root 4 | spring.datasource.password=123456 5 | spring.datasource.platform=h2 6 | spring.datasource.driverClassName =org.h2.Driver 7 | 8 | spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true 9 | # 打印出 sql 语句 10 | spring.jpa.show-sql=true 11 | #常用的有四种: 12 | # 1.create:每次重新启动项目都会重新创新表结构,会导致数据丢失 13 | # 2.create-drop:每次启动项目创建表结构,关闭项目删除表结构 14 | # 3.update:每次启动项目会更新表结构 15 | # 4. validate:验证表结构,不对数据库进行任何更改 16 | spring.jpa.hibernate.ddl-auto=update 17 | spring.jpa.open-in-view=false 18 | server.port=8080 19 | #H2控制台 20 | spring.h2.console.enabled=true 21 | -------------------------------------------------------------------------------- /source-code/basis/jpa-demo/src/test/resources/init.sql: -------------------------------------------------------------------------------- 1 | insert into person (name, age,company_id,school_id) values ("person1",18,1,1) 2 | insert into person (name, age,company_id,school_id) values ("person2",18,1,1) 3 | insert into person (name, age,company_id,school_id) values ("person3",15,1,1) 4 | insert into person (name, age,company_id,school_id) values ("person4",18,2,2) 5 | insert into person (name, age,company_id,school_id) values ("person5",16,2,2) 6 | insert into person (name, age,company_id,school_id) values ("person6",19,2,2) 7 | 8 | 9 | insert into company (company_name, description) values ("tw","tw is good") 10 | insert into company (company_name, description) values ("baidu","baidu is good") 11 | 12 | insert into school (name, description) values ("zhongnandaxue","zhongnandaxue is good") 13 | insert into school (name, description) values ("hubeidaxue","hubeidaxue is good") 14 | 15 | -------------------------------------------------------------------------------- /source-code/basis/life-cycle-annotation/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/basis/life-cycle-annotation/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/life-cycle-annotation/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/life-cycle-annotation/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /source-code/basis/life-cycle-annotation/src/main/java/cn/javaguide/LifeCycleAnnotationApplication.java: -------------------------------------------------------------------------------- 1 | package cn.javaguide; 2 | 3 | import cn.javaguide.config.MyConfiguration; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | public class LifeCycleAnnotationApplication { 9 | 10 | public static void main(String[] args) { 11 | MyConfiguration myConfiguration = new MyConfiguration(); 12 | MyConfiguration myConfiguration2 = new MyConfiguration(); 13 | SpringApplication.run(LifeCycleAnnotationApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source-code/basis/life-cycle-annotation/src/main/java/cn/javaguide/config/MyConfiguration.java: -------------------------------------------------------------------------------- 1 | package cn.javaguide.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | 5 | import javax.annotation.PostConstruct; 6 | import javax.annotation.PreDestroy; 7 | 8 | @Configuration 9 | public class MyConfiguration { 10 | public MyConfiguration() { 11 | System.out.println("构造方法被调用"); 12 | } 13 | 14 | @PostConstruct 15 | private void init() { 16 | System.out.println("PostConstruct注解方法被调用"); 17 | } 18 | 19 | @PreDestroy 20 | private void shutdown() { 21 | System.out.println("PreDestroy注解方法被调用"); 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /source-code/basis/life-cycle-annotation/src/main/java/cn/javaguide/config/MyConfiguration2.java: -------------------------------------------------------------------------------- 1 | package cn.javaguide.config; 2 | 3 | import org.springframework.beans.factory.DisposableBean; 4 | import org.springframework.beans.factory.InitializingBean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class MyConfiguration2 implements InitializingBean, DisposableBean { 9 | public MyConfiguration2() { 10 | System.out.println("构造方法被调用"); 11 | } 12 | 13 | @Override 14 | public void afterPropertiesSet() { 15 | System.out.println("afterPropertiesSet方法被调用"); 16 | } 17 | 18 | @Override 19 | public void destroy() { 20 | System.out.println("destroy方法被调用"); 21 | } 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /source-code/basis/life-cycle-annotation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8888 2 | -------------------------------------------------------------------------------- /source-code/basis/life-cycle-annotation/src/test/java/cn/javaguide/lifecycleannotation/LifeCycleAnnotationApplicationTests.java: -------------------------------------------------------------------------------- 1 | package cn.javaguide.lifecycleannotation; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LifeCycleAnnotationApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/read-config-properties/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8083 3 | # 优先级1 4 | wuhan2020: 【优先级1】2020年初武汉爆发了新型冠状病毒,疫情严重,但是,我相信一切都会过去!武汉加油!中国加油! 5 | 6 | my-profile: 7 | name: Guide哥 8 | email: koushuangbwcx@163.com 9 | 10 | library: 11 | location: 湖北武汉加油中国加油 12 | books: 13 | - name: 天才基本法 14 | description: 二十二岁的林朝夕在父亲确诊阿尔茨海默病这天,得知自己暗恋多年的校园男神裴之即将出国深造的消息——对方考取的学校,恰是父亲当年为她放弃的那所。 15 | - name: 时间的秩序 16 | description: 为什么我们记得过去,而非未来?时间“流逝”意味着什么?是我们存在于时间之内,还是时间存在于我们之中?卡洛·罗韦利用诗意的文字,邀请我们思考这一亘古难题——时间的本质。 17 | - name: 了不起的我 18 | description: 如何养成一个新习惯?如何让心智变得更成熟?如何拥有高质量的关系? 如何走出人生的艰难时刻? 19 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/src/main/java/cn/javaguide/readconfigproperties/LibraryProperties.java: -------------------------------------------------------------------------------- 1 | package cn.javaguide.readconfigproperties; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import lombok.ToString; 6 | import org.springframework.boot.context.properties.ConfigurationProperties; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.context.annotation.PropertySource; 9 | import org.springframework.stereotype.Component; 10 | 11 | import java.util.List; 12 | 13 | @Component 14 | @ConfigurationProperties(prefix = "library") 15 | @Setter 16 | @Getter 17 | @ToString 18 | class LibraryProperties { 19 | private String location; 20 | private List books; 21 | 22 | @Setter 23 | @Getter 24 | @ToString 25 | static class Book { 26 | String name; 27 | String description; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/src/main/java/cn/javaguide/readconfigproperties/ProfileProperties.java: -------------------------------------------------------------------------------- 1 | package cn.javaguide.readconfigproperties; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import lombok.ToString; 6 | import org.springframework.boot.context.properties.ConfigurationProperties; 7 | import org.springframework.validation.annotation.Validated; 8 | 9 | import javax.validation.constraints.Email; 10 | import javax.validation.constraints.NotEmpty; 11 | 12 | /** 13 | * @author shuang.kou 14 | */ 15 | @Getter 16 | @Setter 17 | @ToString 18 | @ConfigurationProperties("my-profile") 19 | @Validated 20 | public class ProfileProperties { 21 | @NotEmpty 22 | private String name; 23 | 24 | @Email 25 | @NotEmpty 26 | private String email; 27 | 28 | private Boolean handsome = Boolean.TRUE; 29 | } 30 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/src/main/java/cn/javaguide/readconfigproperties/WebSite.java: -------------------------------------------------------------------------------- 1 | package cn.javaguide.readconfigproperties; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.springframework.beans.factory.annotation.Value; 6 | import org.springframework.context.annotation.PropertySource; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | @PropertySource("classpath:website.properties") 11 | @Getter 12 | @Setter 13 | class WebSite { 14 | @Value("${url}") 15 | private String url; 16 | } 17 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | 2 | # 优先级3 3 | wuhan2020: 【优先级3】武汉加油!中国加油! 4 | 5 | my-profile: 6 | name: Guide哥 7 | email: koushuangbwcx@163.com 8 | 9 | library: 10 | location: 湖北武汉加油中国加油 11 | books: 12 | - name: 天才基本法 13 | description: 二十二岁的林朝夕在父亲确诊阿尔茨海默病这天,得知自己暗恋多年的校园男神裴之即将出国深造的消息——对方考取的学校,恰是父亲当年为她放弃的那所。 14 | - name: 时间的秩序 15 | description: 为什么我们记得过去,而非未来?时间“流逝”意味着什么?是我们存在于时间之内,还是时间存在于我们之中?卡洛·罗韦利用诗意的文字,邀请我们思考这一亘古难题——时间的本质。 16 | - name: 了不起的我 17 | description: 如何养成一个新习惯?如何让心智变得更成熟?如何拥有高质量的关系? 如何走出人生的艰难时刻? 18 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | # 优先级2 2 | wuhan2020: 【优先级2】2020年初武汉爆发了新型冠状病毒,疫情严重,但是,我相信一切都会过去!武汉加油!中国加油! 3 | 4 | my-profile: 5 | name: Guide哥 6 | email: koushuangbwcx@163.com 7 | 8 | library: 9 | location: 湖北武汉加油中国加油 10 | books: 11 | - name: 天才基本法 12 | description: 二十二岁的林朝夕在父亲确诊阿尔茨海默病这天,得知自己暗恋多年的校园男神裴之即将出国深造的消息——对方考取的学校,恰是父亲当年为她放弃的那所。 13 | - name: 时间的秩序 14 | description: 为什么我们记得过去,而非未来?时间“流逝”意味着什么?是我们存在于时间之内,还是时间存在于我们之中?卡洛·罗韦利用诗意的文字,邀请我们思考这一亘古难题——时间的本质。 15 | - name: 了不起的我 16 | description: 如何养成一个新习惯?如何让心智变得更成熟?如何拥有高质量的关系? 如何走出人生的艰难时刻? 17 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/src/main/resources/website.properties: -------------------------------------------------------------------------------- 1 | url=https://javaguide.cn/ 2 | 3 | -------------------------------------------------------------------------------- /source-code/basis/read-config-properties/src/test/java/cn/javaguide/readconfigproperties/ReadConfigPropertiesApplicationTests.java: -------------------------------------------------------------------------------- 1 | package cn.javaguide.readconfigproperties; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ReadConfigPropertiesApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/springboot-filter-interceptor/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/.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 | -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/src/main/java/github/javaguide/springbootfilter/SpringbootFilterApplication.java: -------------------------------------------------------------------------------- 1 | package github.javaguide.springbootfilter; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.boot.web.servlet.ServletComponentScan; 6 | 7 | @SpringBootApplication 8 | @ServletComponentScan 9 | public class SpringbootFilterApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(SpringbootFilterApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/src/main/java/github/javaguide/springbootfilter/web/MyController.java: -------------------------------------------------------------------------------- 1 | package github.javaguide.springbootfilter.web; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | @RequestMapping("/api") 9 | public class MyController { 10 | 11 | @GetMapping("/hello") 12 | public String getHello() throws InterruptedException { 13 | Thread.sleep(1000); 14 | return "Hello"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/springboot-filter-interceptor/src/main/resources/application.properties -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/src/main/resources/templates/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Spring Boot Mvc Interceptor example 6 | 7 | 8 | 9 |

10 | Home 11 |    |    12 | /admin/oldLogin (OLD URL) 13 |
14 | 15 |

This is Login Page

16 | 17 | Testing OldLoginInterceptor & AdminInterceptor 18 |

19 | See more info in the Console. 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/src/main/resources/templates/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Spring Boot Mvc Interceptor example 7 | 8 | 9 | 10 |
11 | Home 12 |    |    13 | /admin/oldLogin (OLD URL) 14 |
15 | 16 |

Spring Boot Mvc Interceptor

17 | 18 | Testing LogInterceptor 19 |

20 | 21 | See Log in Console.. 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /source-code/basis/springboot-filter-interceptor/src/test/java/github/javaguide/springbootfilter/SpringbootFilterApplicationTests.java: -------------------------------------------------------------------------------- 1 | package github.javaguide.springbootfilter; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootFilterApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/.idea/.name: -------------------------------------------------------------------------------- 1 | webApp -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/.idea/checkstyle-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/.idea/modules/webApp.main.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/springboot-handle-exception-improved/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/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 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | } 5 | } 6 | rootProject.name = 'webApp' 7 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/src/main/java/com/twuc/webApp/WebAppApplication.java: -------------------------------------------------------------------------------- 1 | package com.twuc.webApp; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebAppApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(WebAppApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/src/main/java/com/twuc/webApp/entity/Person.java: -------------------------------------------------------------------------------- 1 | package com.twuc.webApp.entity; 2 | 3 | public class Person { 4 | private Long id; 5 | private String name; 6 | 7 | public Person(Long id, String name) { 8 | this.id = id; 9 | this.name = name; 10 | } 11 | 12 | public Long getId() { 13 | return id; 14 | } 15 | 16 | public void setId(Long id) { 17 | this.id = id; 18 | } 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/src/main/java/com/twuc/webApp/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.twuc.webApp.exception; 2 | 3 | import java.util.Map; 4 | 5 | public class ResourceNotFoundException extends BaseException { 6 | 7 | public ResourceNotFoundException(Map data) { 8 | super(ErrorCode.RESOURCE_NOT_FOUND, data); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/src/main/java/com/twuc/webApp/web/ExceptionController.java: -------------------------------------------------------------------------------- 1 | package com.twuc.webApp.web; 2 | 3 | import com.google.common.collect.ImmutableMap; 4 | import com.twuc.webApp.entity.Person; 5 | import com.twuc.webApp.exception.ResourceNotFoundException; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @RestController 11 | @RequestMapping("/api") 12 | public class ExceptionController { 13 | 14 | @GetMapping("/resourceNotFound") 15 | public void throwException() { 16 | Person p=new Person(1L,"SnailClimb"); 17 | throw new ResourceNotFoundException(ImmutableMap.of("person id:", p.getId())); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception-improved/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | server.port=8333 3 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/.idea/.name: -------------------------------------------------------------------------------- 1 | webApp -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/.idea/checkstyle-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'org.springframework.boot' version '2.1.3.RELEASE' 3 | id 'java' 4 | } 5 | 6 | apply plugin: 'io.spring.dependency-management' 7 | 8 | group = 'com.twuc' 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 | exclude group:'junit', module: 'junit' 20 | } 21 | testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2' 22 | testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.4.1' 23 | } 24 | 25 | test { 26 | useJUnitPlatform() 27 | testLogging { 28 | events 'passed', 'skipped', 'failed' 29 | } 30 | } -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/springboot-handle-exception/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/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 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | } 5 | } 6 | rootProject.name = 'webApp' 7 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/src/main/java/com/twuc/webApp/WebAppApplication.java: -------------------------------------------------------------------------------- 1 | package com.twuc.webApp; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class WebAppApplication { 8 | public static void main(String[] args) { 9 | SpringApplication.run(WebAppApplication.class, args); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/src/main/java/com/twuc/webApp/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.twuc.webApp.exception; 2 | 3 | /** 4 | * @author shuang.kou 5 | * 自定义异常类型 6 | */ 7 | public class ResourceNotFoundException extends RuntimeException { 8 | private String message; 9 | 10 | public ResourceNotFoundException() { 11 | super(); 12 | } 13 | 14 | public ResourceNotFoundException(String message) { 15 | super(message); 16 | this.message = message; 17 | } 18 | 19 | @Override 20 | public String getMessage() { 21 | return message; 22 | } 23 | 24 | public void setMessage(String message) { 25 | this.message = message; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/src/main/java/com/twuc/webApp/exception/ResourseNotFoundException2.java: -------------------------------------------------------------------------------- 1 | package com.twuc.webApp.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(code = HttpStatus.NOT_FOUND) 7 | public class ResourseNotFoundException2 extends RuntimeException { 8 | 9 | public ResourseNotFoundException2() { 10 | } 11 | 12 | public ResourseNotFoundException2(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/src/main/java/com/twuc/webApp/web/ExceptionController.java: -------------------------------------------------------------------------------- 1 | package com.twuc.webApp.web; 2 | 3 | import com.twuc.webApp.exception.ResourceNotFoundException; 4 | import com.twuc.webApp.exception.ResourseNotFoundException2; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | import org.springframework.web.bind.annotation.RestController; 8 | 9 | @RestController 10 | @RequestMapping("/api") 11 | public class ExceptionController { 12 | 13 | @GetMapping("/illegalArgumentException") 14 | public void throwException() { 15 | throw new IllegalArgumentException(); 16 | } 17 | 18 | @GetMapping("/resourceNotFoundException") 19 | public void throwException2() { 20 | throw new ResourceNotFoundException(); 21 | } 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /source-code/basis/springboot-handle-exception/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | server.port=8333 -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-annotation/.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 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/springboot-mybatis/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-annotation/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-annotation/src/main/java/top/snailclimb/MainApplication.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | //此注解表示SpringBoot启动类 8 | @SpringBootApplication 9 | // 此注解表示动态扫描DAO接口所在包,实际上不加下面这条语句也可以找到 10 | @MapperScan("top.snailclimb.dao") 11 | public class MainApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(MainApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-annotation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8335 2 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/erp?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 6 | 7 | 8 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-annotation/src/test/java/top/snailclimb/snailclimb/springbootmybatis/SpringbootMybatisApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.snailclimb.springbootmybatis; 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 SpringbootMybatisApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/.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 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/java/top/snailclimb/MainApplication.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; 7 | 8 | //此注解表示SpringBoot启动类 9 | @SpringBootApplication 10 | public class MainApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(MainApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/java/top/snailclimb/controller/MoneyController.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import top.snailclimb.bean.Money; 7 | import top.snailclimb.db2.service.MoneyService; 8 | 9 | @RestController 10 | @RequestMapping("/money") 11 | public class MoneyController { 12 | @Autowired 13 | private MoneyService moneyService; 14 | 15 | @RequestMapping("/query") 16 | public Money testQuery() { 17 | return moneyService.selectMoneyById(1); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/java/top/snailclimb/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import top.snailclimb.bean.User; 7 | import top.snailclimb.db1.service.UserService; 8 | 9 | @RestController 10 | @RequestMapping("/user") 11 | public class UserController { 12 | @Autowired 13 | private UserService userService; 14 | 15 | @RequestMapping("/query") 16 | public User testQuery() { 17 | return userService.selectUserByName("Daisy"); 18 | } 19 | 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/java/top/snailclimb/db1/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.db1.dao; 2 | 3 | 4 | import org.apache.ibatis.annotations.*; 5 | import org.springframework.beans.factory.annotation.Qualifier; 6 | import top.snailclimb.bean.User; 7 | 8 | import java.util.List; 9 | 10 | 11 | 12 | @Qualifier("db1SqlSessionTemplate") 13 | public interface UserDao { 14 | /** 15 | * 通过名字查询用户信息 16 | */ 17 | @Select("SELECT * FROM user WHERE name = #{name}") 18 | User findUserByName(String name); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/java/top/snailclimb/db1/service/UserService.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.db1.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import top.snailclimb.bean.User; 6 | import top.snailclimb.db1.dao.UserDao; 7 | 8 | @Service 9 | public class UserService { 10 | @Autowired 11 | private UserDao userDao; 12 | 13 | /** 14 | * 根据名字查找用户 15 | */ 16 | public User selectUserByName(String name) { 17 | return userDao.findUserByName(name); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/java/top/snailclimb/db2/dao/MoneyDao.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.db2.dao; 2 | 3 | import org.apache.ibatis.annotations.Mapper; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.apache.ibatis.annotations.Select; 6 | import org.springframework.beans.factory.annotation.Qualifier; 7 | import top.snailclimb.bean.Money; 8 | 9 | 10 | @Qualifier("db2SqlSessionTemplate") 11 | public interface MoneyDao { 12 | 13 | /** 14 | * 通过id 查看工资详情 15 | */ 16 | @Select("SELECT * FROM money WHERE id = #{id}") 17 | Money findMoneyById(@Param("id") int id); 18 | } 19 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/java/top/snailclimb/db2/service/MoneyService.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.db2.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import top.snailclimb.bean.Money; 6 | import top.snailclimb.bean.User; 7 | import top.snailclimb.db1.dao.UserDao; 8 | import top.snailclimb.db2.dao.MoneyDao; 9 | 10 | @Service 11 | public class MoneyService { 12 | @Autowired 13 | private MoneyDao moneyDao; 14 | 15 | /** 16 | * 根据名字查找用户 17 | */ 18 | public Money selectMoneyById(int id) { 19 | return moneyDao.findMoneyById(id); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/main/resources/application.properties -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-mutipleDatasource/src/test/java/top/snailclimb/snailclimb/springbootmybatis/SpringbootMybatisApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.snailclimb.springbootmybatis; 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 SpringbootMybatisApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/.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 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/basis/springboot-mybatis/springboot-mybatis-xml/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip 2 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/src/main/java/top/snailclimb/MainApplication.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | //此注解表示SpringBoot启动类 8 | @SpringBootApplication 9 | // 此注解表示动态扫描DAO接口所在包,实际上不加下面这条语句也可以找到 10 | //@MapperScan("top.snailclimb.dao") 11 | public class MainApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(MainApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/src/main/java/top/snailclimb/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import top.snailclimb.bean.User; 7 | import top.snailclimb.service.UserService; 8 | 9 | import java.util.List; 10 | 11 | @RestController 12 | @RequestMapping("/user") 13 | public class UserController { 14 | @Autowired 15 | private UserService userService; 16 | 17 | @RequestMapping("/query") 18 | public User testQuery() { 19 | return userService.selectUserByName("Daisy" 20 | ); 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/src/main/java/top/snailclimb/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.dao; 2 | 3 | 4 | import org.apache.ibatis.annotations.*; 5 | import top.snailclimb.bean.User; 6 | 7 | import java.util.List; 8 | 9 | 10 | @Mapper 11 | public interface UserDao { 12 | /** 13 | * 通过名字查询用户信息 14 | */ 15 | User findUserByName(String name); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/src/main/java/top/snailclimb/service/UserService.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | import top.snailclimb.bean.User; 6 | import top.snailclimb.dao.UserDao; 7 | 8 | @Service 9 | public class UserService { 10 | @Autowired 11 | private UserDao userDao; 12 | 13 | /** 14 | * 根据名字查找用户 15 | */ 16 | public User selectUserByName(String name) { 17 | return userDao.findUserByName(name); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8334 2 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/erp?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 3 | spring.datasource.username=root 4 | spring.datasource.password=root 5 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 6 | 7 | mybatis.mapper-locations=classpath:mapper/*.xml -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /source-code/basis/springboot-mybatis/springboot-mybatis-xml/src/test/java/top/snailclimb/snailclimb/springbootmybatis/SpringbootMybatisApplicationTests.java: -------------------------------------------------------------------------------- 1 | package top.snailclimb.snailclimb.springbootmybatis; 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 SpringbootMybatisApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/bean-validation-demo/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/bean-validation-demo/.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 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/BeanValidationDemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class BeanValidationDemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(BeanValidationDemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/constants/Constants.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.constants; 2 | 3 | public final class Constants { 4 | public static final String sexs = "((^Man$|^Woman$|^UGM$))"; 5 | } 6 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/controller/HelloWorldController.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | /** 8 | * @author shuang.kou 9 | * 验证基本环境搭建是否正确 10 | */ 11 | @RestController 12 | @RequestMapping("/api") 13 | public class HelloWorldController { 14 | 15 | @GetMapping("/hello") 16 | public String hello() { 17 | return "Hello"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/entity/Person.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.entity; 2 | 3 | import com.example.beanvalidationdemo.service.AddPersonGroup; 4 | import com.example.beanvalidationdemo.service.DeletePersonGroup; 5 | import lombok.Data; 6 | 7 | import javax.validation.constraints.NotNull; 8 | import javax.validation.constraints.Null; 9 | 10 | @Data 11 | public class Person { 12 | 13 | // 当验证组为 DeletePersonGroup 的时候 group 字段不能为空 14 | @NotNull(groups = DeletePersonGroup.class) 15 | // 当验证组为 AddPersonGroup 的时候 group 字段需要为空 16 | @Null(groups = AddPersonGroup.class) 17 | private String group; 18 | } 19 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/service/AddPersonGroup.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.service; 2 | 3 | public interface AddPersonGroup { 4 | } 5 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/service/DeletePersonGroup.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.service; 2 | 3 | public interface DeletePersonGroup { 4 | } 5 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/validation/PhoneNumber.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.validation; 2 | 3 | import javax.validation.Constraint; 4 | import java.lang.annotation.Documented; 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.Target; 7 | 8 | import static java.lang.annotation.ElementType.FIELD; 9 | import static java.lang.annotation.ElementType.PARAMETER; 10 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 11 | 12 | @Documented 13 | @Constraint(validatedBy = PhoneNumberValidator.class) 14 | @Target({FIELD, PARAMETER}) 15 | @Retention(RUNTIME) 16 | public @interface PhoneNumber { 17 | String message() default "Invalid phone number"; 18 | 19 | Class[] groups() default {}; 20 | 21 | Class[] payload() default {}; 22 | } 23 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/validation/PhoneNumberValidator.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.validation; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | 6 | public class PhoneNumberValidator implements ConstraintValidator { 7 | 8 | @Override 9 | public boolean isValid(String phoneField, ConstraintValidatorContext context) { 10 | if (phoneField == null) { 11 | // can be null 12 | return true; 13 | } 14 | // 大陆手机号码11位数,匹配格式:前三位固定格式+后8位任意数 15 | // ^ 匹配输入字符串开始的位置 16 | // \d 匹配一个或多个数字,其中 \ 要转义,所以是 \\d 17 | // $ 匹配输入字符串结尾的位置 18 | String regExp = "^[1]((3[0-9])|(4[5-9])|(5[0-3,5-9])|([6][5,6])|(7[0-9])|(8[0-9])|(9[1,8,9]))\\d{8}$"; 19 | return phoneField.matches(regExp); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/validation/Region.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.validation; 2 | 3 | import javax.validation.Constraint; 4 | import javax.validation.Payload; 5 | import java.lang.annotation.Documented; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.Target; 8 | 9 | import static java.lang.annotation.ElementType.FIELD; 10 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 11 | 12 | /** 13 | * @author shuang.kou 14 | */ 15 | @Target({FIELD}) 16 | @Retention(RUNTIME) 17 | @Constraint(validatedBy = RegionValidator.class) 18 | @Documented 19 | public @interface Region { 20 | 21 | String message() default "Region 值不在可选范围内"; 22 | 23 | Class[] groups() default {}; 24 | 25 | Class[] payload() default {}; 26 | } 27 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/java/com/example/beanvalidationdemo/validation/RegionValidator.java: -------------------------------------------------------------------------------- 1 | package com.example.beanvalidationdemo.validation; 2 | 3 | import javax.validation.ConstraintValidator; 4 | import javax.validation.ConstraintValidatorContext; 5 | import java.util.HashSet; 6 | 7 | public class RegionValidator implements ConstraintValidator { 8 | 9 | @Override 10 | public boolean isValid(String value, ConstraintValidatorContext context) { 11 | HashSet regions = new HashSet<>(); 12 | regions.add("China"); 13 | regions.add("China-Taiwan"); 14 | regions.add("China-HongKong"); 15 | return regions.contains(value); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source-code/bean-validation-demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/bean-validation-demo/src/main/resources/application.properties -------------------------------------------------------------------------------- /source-code/hello-world/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /source-code/hello-world/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/hello-world/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/hello-world/.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 | -------------------------------------------------------------------------------- /source-code/hello-world/src/main/java/com/example/helloworld/HelloWorldApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.helloworld; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * @author shuang.kou 8 | */ 9 | @SpringBootApplication 10 | public class HelloWorldApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(HelloWorldApplication.class, args); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /source-code/hello-world/src/main/java/com/example/helloworld/dto/UserDto.java: -------------------------------------------------------------------------------- 1 | package com.example.helloworld.dto; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import lombok.ToString; 6 | 7 | @Getter 8 | @Setter 9 | @ToString 10 | public class UserDto { 11 | String name; 12 | String email; 13 | } 14 | -------------------------------------------------------------------------------- /source-code/hello-world/src/main/java/com/example/helloworld/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.example.helloworld.entity; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class User { 9 | Long id; 10 | String name; 11 | String email; 12 | String password; 13 | } 14 | -------------------------------------------------------------------------------- /source-code/hello-world/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8333 2 | -------------------------------------------------------------------------------- /source-code/hello-world/src/test/java/com/example/helloworld/HelloWorldApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.helloworld; 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 HelloWorldApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodingDocs/springboot-guide/76c018d7d898d61d9ce07a975c0056a36a5f9358/source-code/springboot-data-desensitization/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/SpringbootDataDesensitizationApplication.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringbootDataDesensitizationApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringbootDataDesensitizationApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/Desensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer; 2 | 3 | /** 4 | * 微信搜 JavaGuide 回复"面试突击"即可免费领取个人原创的 Java 面试手册 5 | * 6 | * @author Guide哥 7 | * @date 2021/05/10 20:36 8 | **/ 9 | public interface Desensitizer { 10 | String desensitize(String origin); 11 | } 12 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/AddressDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 地址脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:15 10 | **/ 11 | public class AddressDesensitizer extends AbstractDesensitizer { 12 | public AddressDesensitizer() { 13 | super(3, 3); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/BankCardDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 银行卡号脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:28 10 | **/ 11 | public class BankCardDesensitizer extends AbstractDesensitizer { 12 | public BankCardDesensitizer() { 13 | super(3, 3); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/BirthdayDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 密码脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:28 10 | **/ 11 | public class BirthdayDesensitizer extends AbstractDesensitizer { 12 | public BirthdayDesensitizer() { 13 | super(4, 0); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/DefaultDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 密码脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:28 10 | **/ 11 | public class DefaultDesensitizer extends AbstractDesensitizer { 12 | public DefaultDesensitizer() { 13 | super(0, 0); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/EmailDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 邮箱脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:28 10 | **/ 11 | public class EmailDesensitizer extends AbstractDesensitizer { 12 | public EmailDesensitizer() { 13 | super(0); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/IdCardDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 身份证号脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:28 10 | **/ 11 | public class IdCardDesensitizer extends AbstractDesensitizer { 12 | public IdCardDesensitizer() { 13 | super(3, 4); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/LandlineDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 座机号脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:28 10 | **/ 11 | public class LandlineDesensitizer extends AbstractDesensitizer { 12 | public LandlineDesensitizer() { 13 | super(2, 2); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/MobileDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 手机号脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:28 10 | **/ 11 | public class MobileDesensitizer extends AbstractDesensitizer { 12 | public MobileDesensitizer() { 13 | super(3, 4); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/desensitizer/impl/PasswordDesensitizer.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.desensitizer.impl; 2 | 3 | import com.github.springbootdatadesensitization.desensitize.desensitizer.AbstractDesensitizer; 4 | 5 | /** 6 | * 密码脱敏 7 | * 8 | * @author Guide哥 9 | * @date 2021/05/10 20:28 10 | **/ 11 | public class PasswordDesensitizer extends AbstractDesensitizer { 12 | public PasswordDesensitizer() { 13 | super(0, 0); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/enums/DesensitizationType.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.enums; 2 | 3 | /** 4 | * 微信搜 JavaGuide 回复"面试突击"即可免费领取个人原创的 Java 面试手册 5 | * 6 | * @author Guide哥 7 | * @date 2021/05/10 20:36 8 | **/ 9 | public enum DesensitizationType { 10 | 11 | DEFAULT, 12 | /** 13 | * 座机号 14 | */ 15 | LANDLINE, 16 | /** 17 | * 手机 18 | */ 19 | MOBILE, 20 | /** 21 | * 邮箱 22 | */ 23 | EMAIL, 24 | 25 | /** 26 | * 生日🎂 27 | */ 28 | BIRTHDAY, 29 | /** 30 | * 密码 31 | */ 32 | PASSWORD, 33 | /** 34 | * 身份证 35 | */ 36 | ID_CARD, 37 | /** 38 | * 银行卡 39 | */ 40 | BANK_CARD, 41 | /** 42 | * 地址 43 | */ 44 | ADDRESS, 45 | 46 | } 47 | -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/java/com/github/springbootdatadesensitization/desensitize/exception/DesensitizationException.java: -------------------------------------------------------------------------------- 1 | package com.github.springbootdatadesensitization.desensitize.exception; 2 | 3 | import lombok.Getter; 4 | 5 | /** 6 | * @author shuang.kou 7 | * @date 2017/12/19 14:25 8 | */ 9 | @Getter 10 | public class DesensitizationException extends RuntimeException { 11 | public DesensitizationException(String message) { 12 | super(message); 13 | } 14 | } -------------------------------------------------------------------------------- /source-code/springboot-data-desensitization/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------