├── .gitignore ├── README.md ├── demo ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ ├── DemoApplication.java │ │ │ └── controller │ │ │ └── HelloController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── example │ └── demo │ └── DemoApplicationTests.java ├── girl-friend-spring-boot-starter ├── .idea │ ├── compiler.xml │ ├── encodings.xml │ ├── inspectionProfiles │ │ └── Project_Default.xml │ ├── libraries │ │ ├── Maven__org_springframework_boot_spring_boot_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_spring_aop_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_beans_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_context_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_core_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_expression_5_1_4_RELEASE.xml │ │ └── Maven__org_springframework_spring_jcl_5_1_4_RELEASE.xml │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── girl-friend-spring-boot-starter.iml ├── pom.xml └── src │ └── main │ ├── java │ └── site │ │ └── exception │ │ ├── GirlFriendAutoConfiguration.java │ │ ├── GirlFriendService.java │ │ ├── GirlFriendServiceImpl.java │ │ └── GirlFriendServiceProperties.java │ └── resources │ └── META-INF │ └── spring.factories ├── spring-boot-aop-web-request ├── .idea │ ├── compiler.xml │ ├── encodings.xml │ ├── inspectionProfiles │ │ └── Project_Default.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_8.xml │ │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_9_8.xml │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_8.xml │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_8.xml │ │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_8.xml │ │ ├── Maven__com_google_code_gson_gson_2_8_5.xml │ │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.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_7.xml │ │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_9_7.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_14.xml │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_14.xml │ │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_14.xml │ │ ├── Maven__org_aspectj_aspectjweaver_1_9_2.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_14_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_boot_spring_boot_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_aop_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_test_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_spring_aop_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_beans_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_context_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_core_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_expression_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_jcl_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_test_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_web_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_webmvc_5_1_4_RELEASE.xml │ │ ├── Maven__org_xmlunit_xmlunit_core_2_6_2.xml │ │ └── Maven__org_yaml_snakeyaml_1_23.xml │ ├── misc.xml │ ├── modules.xml │ └── workspace.xml ├── pom.xml ├── spring-boot-aop-web-request.iml ├── src │ ├── main │ │ ├── java │ │ │ └── site │ │ │ │ └── exception │ │ │ │ └── springbootaopwebrequest │ │ │ │ ├── SpringBootAopWebRequestApplication.java │ │ │ │ ├── aspect │ │ │ │ ├── WebLog.java │ │ │ │ └── WebLogAspect.java │ │ │ │ ├── controller │ │ │ │ └── TestController.java │ │ │ │ └── entity │ │ │ │ └── User.java │ │ └── resources │ │ │ ├── application.properties │ │ │ └── logback-spring.xml │ └── test │ │ └── java │ │ └── site │ │ └── exception │ │ └── springbootaopwebrequest │ │ └── SpringBootAopWebRequestApplicationTests.java └── target │ ├── classes │ ├── application.properties │ ├── logback-spring.xml │ └── site │ │ └── exception │ │ └── springbootaopwebrequest │ │ ├── SpringBootAopWebRequestApplication.class │ │ ├── aspect │ │ ├── WebLog.class │ │ └── WebLogAspect.class │ │ ├── controller │ │ └── TestController.class │ │ └── entity │ │ └── User.class │ └── test-classes │ └── site │ └── exception │ └── springbootaopwebrequest │ └── SpringBootAopWebRequestApplicationTests.class ├── spring-boot-aop ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootaop │ │ │ ├── SpringBootAopApplication.java │ │ │ ├── config │ │ │ └── AOPConfig.java │ │ │ ├── controller │ │ │ └── TestController.java │ │ │ └── form │ │ │ └── UserForm.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootaop │ └── SpringBootAopApplicationTests.java ├── spring-boot-date-format ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootdateformat │ │ │ ├── SpringBootDateFormatApplication.java │ │ │ ├── config │ │ │ └── MvcConfig.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ └── entity │ │ │ └── User.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootdateformat │ └── SpringBootDateFormatApplicationTests.java ├── spring-boot-excel ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootexcel │ │ │ └── SpringBootExcelApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootexcel │ ├── ExcelTests.java │ ├── PdfTests.java │ ├── WordTests.java │ ├── model │ ├── Commodity.java │ ├── User.java │ ├── WriteModel.java │ └── WriteModel2.java │ └── util │ └── DataUtil.java ├── spring-boot-freemark-excel ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootfreemarkexcel │ │ │ └── SpringBootFreemarkExcelApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootfreemarkexcel │ ├── SpringBootFreemarkExcelApplicationTests.java │ └── entity │ └── Commodity.java ├── spring-boot-hello ├── .DS_Store ├── .idea │ ├── compiler.xml │ ├── encodings.xml │ ├── inspectionProfiles │ │ └── Project_Default.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_8.xml │ │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_9_8.xml │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_8.xml │ │ ├── Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_8.xml │ │ ├── Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_8.xml │ │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.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_servlet_javax_servlet_api_4_0_1.xml │ │ ├── Maven__javax_validation_validation_api_2_0_1_Final.xml │ │ ├── Maven__javax_websocket_javax_websocket_api_1_1.xml │ │ ├── Maven__junit_junit_4_12.xml │ │ ├── Maven__net_bytebuddy_byte_buddy_1_9_7.xml │ │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_9_7.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_assertj_assertj_core_3_11_1.xml │ │ ├── Maven__org_eclipse_jetty_jetty_annotations_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_client_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_continuation_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_http_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_io_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_plus_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_security_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_server_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_servlet_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_servlets_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_util_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_webapp_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_jetty_xml_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_websocket_javax_websocket_client_impl_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_websocket_javax_websocket_server_impl_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_websocket_websocket_api_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_websocket_websocket_client_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_websocket_websocket_common_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_websocket_websocket_server_9_4_14_v20181114.xml │ │ ├── Maven__org_eclipse_jetty_websocket_websocket_servlet_9_4_14_v20181114.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_14_Final.xml │ │ ├── Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml │ │ ├── Maven__org_mockito_mockito_core_2_23_4.xml │ │ ├── Maven__org_mortbay_jasper_apache_el_8_5_35_1.xml │ │ ├── Maven__org_objenesis_objenesis_2_6.xml │ │ ├── Maven__org_ow2_asm_asm_7_0.xml │ │ ├── Maven__org_ow2_asm_asm_analysis_7_0.xml │ │ ├── Maven__org_ow2_asm_asm_commons_7_0.xml │ │ ├── Maven__org_ow2_asm_asm_tree_7_0.xml │ │ ├── Maven__org_projectlombok_lombok_1_18_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_boot_spring_boot_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_jetty_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_test_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_2_RELEASE.xml │ │ ├── Maven__org_springframework_spring_aop_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_beans_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_context_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_core_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_expression_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_jcl_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_test_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_web_5_1_4_RELEASE.xml │ │ ├── Maven__org_springframework_spring_webmvc_5_1_4_RELEASE.xml │ │ ├── Maven__org_xmlunit_xmlunit_core_2_6_2.xml │ │ └── Maven__org_yaml_snakeyaml_1_23.xml │ ├── misc.xml │ ├── modules.xml │ ├── spring-boot-hello.iml │ └── workspace.xml ├── pom.xml ├── src │ ├── .DS_Store │ ├── main │ │ ├── .DS_Store │ │ ├── java │ │ │ ├── .DS_Store │ │ │ └── site │ │ │ │ ├── .DS_Store │ │ │ │ └── exception │ │ │ │ ├── .DS_Store │ │ │ │ └── springboothello │ │ │ │ ├── SpringBootHelloApplication.java │ │ │ │ └── controller │ │ │ │ └── TestController.java │ │ └── resources │ │ │ └── application.properties │ └── test │ │ └── java │ │ └── site │ │ └── exception │ │ └── springboothello │ │ └── SpringBootHelloApplicationTests.java └── target │ ├── classes │ ├── application.properties │ └── site │ │ └── exception │ │ └── springboothello │ │ ├── SpringBootHelloApplication.class │ │ └── controller │ │ └── TestController.class │ └── test-classes │ └── site │ └── exception │ └── springboothello │ └── SpringBootHelloApplicationTests.class ├── spring-boot-interceptor ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootinterceptor │ │ │ ├── Controller │ │ │ └── TestController.java │ │ │ ├── SpringBootInterceptorApplication.java │ │ │ ├── config │ │ │ └── WebMvcConfig.java │ │ │ ├── entity │ │ │ └── User.java │ │ │ └── interceptor │ │ │ └── LoginValidationInterceptor.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootinterceptor │ └── SpringBootInterceptorApplicationTests.java ├── spring-boot-jackson ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootjackson │ │ │ ├── SpringBootJacksonApplication.java │ │ │ ├── config │ │ │ └── JacksonConfig.java │ │ │ ├── controller │ │ │ └── UserController.java │ │ │ └── entity │ │ │ └── User.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootjackson │ └── SpringBootJacksonApplicationTests.java ├── spring-boot-jetty ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootjetty │ │ │ ├── SpringBootJettyApplication.java │ │ │ └── controller │ │ │ └── TestController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootjetty │ └── SpringBootJettyApplicationTests.java ├── spring-boot-kafka ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootkafka │ │ │ ├── SpringBootKafkaApplication.java │ │ │ ├── consumer │ │ │ └── KafkaConsumer.java │ │ │ ├── model │ │ │ └── Order.java │ │ │ └── provider │ │ │ └── KafkaProvider.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── site │ └── exception │ └── springbootkafka │ └── SpringBootKafkaApplicationTests.java ├── spring-boot-log4j2 ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootlog4j2 │ │ │ └── SpringBootLog4j2Application.java │ └── resources │ │ ├── application.properties │ │ └── log4j2.xml │ └── test │ └── java │ └── site │ └── exception │ └── springbootlog4j2 │ └── SpringBootLog4j2ApplicationTests.java ├── spring-boot-mail ├── .gitignore ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootmail │ │ │ ├── SpringBootMailApplication.java │ │ │ └── service │ │ │ ├── MailService.java │ │ │ └── impl │ │ │ └── MailServiceImpl.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootmail │ └── SpringBootMailApplicationTests.java ├── spring-boot-undertow ├── pom.xml └── src │ ├── main │ ├── java │ │ └── site │ │ │ └── exception │ │ │ └── springbootundertow │ │ │ ├── SpringBootUndertowApplication.java │ │ │ └── controller │ │ │ └── TestController.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── site │ └── exception │ └── springbootundertow │ └── SpringBootUndertowApplicationTests.java └── spring-boot-webflux-hello ├── pom.xml └── src ├── main ├── java │ └── site │ │ └── exception │ │ └── springbootwebfluxhello │ │ ├── SpringBootWebfluxHelloApplication.java │ │ ├── controller │ │ └── HelloWebFluxController.java │ │ └── entity │ │ └── User.java └── resources │ └── application.properties └── test └── java └── site └── exception └── springbootwebfluxhello └── SpringBootWebfluxHelloApplicationTests.java /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | /.idea/ 3 | /.gitignore 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Spring Boot 2.x 实战学习教程 2 | 3 | :green_apple: 犬小哈的 《Spring 2.x 学习实战教程》,( A Tutorial to Spring Boot 2.x ) 带您玩转 Spring Boot 2.x 教程 !!! 4 | 5 | --- 6 | 7 |

8 | ★★★ 如果此教程有帮助到您, Star 一下吧, 您还可以访问 :fire: 《Spring 2.x 学习实战教程》 :fire: 来阅读它. 谢谢啦! ★★★ 9 |

10 | 11 | --- 12 | 13 | // 内容持续更新中哟,第一时间发布在个人网站 www.exception.site 上,请保持关注哟 ...... 14 | 15 | ## 教程目录 16 | 17 | ### 基础篇 18 | 19 | - [入门篇](https://www.exception.site/springboot/spring-boot-tutorial) 20 | 21 | ### 快速整合篇 22 | 23 | - [Spring Boot 整合邮件发送功能](https://www.exception.site/springboot/spring-boots-send-mail) 24 | - [Spring Boot 整合集成消息中间件 Kafka](https://www.exception.site/springboot/spring-boot2-kafka) 25 | - [Spring Boot 7 行代码快速生成 Excel 文件(演示代码在测试包内)](https://www.exception.site/essay/how-to-create-excel-by-seven-line-code) 26 | - [Spring Boot 如何通过 Freemark 优雅地生成那些花里胡哨的复杂样式 Excel 文件?(演示代码在测试包内)](https://www.exception.site/essay/how-to-create-complex-style-excel-with-freemark) 27 | 28 | 29 | ### 进阶篇 30 | 31 | - [Spring Boot 自定义注解,AOP 切面统一打印出入参请求日志](https://www.exception.site/springboot/spring-boot-aop-web-request) 32 | - [Spring Boot 自定义 Starter 组件](https://www.exception.site/springboot/spring-boot-custom-starter) 33 | 34 | 35 | ## 小哈的微信公众号,欢迎关注 36 | 37 | 关注即可免费无套路领取 100G 小哈整理的各种 Java 学习资料哟,祝您学习愉快! 38 | 39 | ![](https://exception-image-bucket.oss-cn-hangzhou.aliyuncs.com/155634562788477) 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | /.mvn/ 31 | /mvnw 32 | /mvnw.cmd 33 | -------------------------------------------------------------------------------- /demo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.4.RELEASE 9 | 10 | 11 | com.example 12 | demo 13 | 0.0.1-SNAPSHOT 14 | demo 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-web 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.springframework.boot 43 | spring-boot-maven-plugin 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /demo/src/main/java/com/example/demo/DemoApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class DemoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(DemoApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /demo/src/main/java/com/example/demo/controller/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.example.demo.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 犬小哈(微信公众号: 小哈学Java) 9 | * @site 个人网站: www.exception.site 10 | * @date 2019/4/14 11 | * @time 下午7:49 12 | * @discription 13 | **/ 14 | @RestController 15 | public class HelloController { 16 | 17 | @GetMapping("/hello") 18 | public String hello() { 19 | return "Hello, Spring Boot !"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /demo/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo/src/test/java/com/example/demo/DemoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.example.demo; 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 DemoApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/libraries/Maven__org_springframework_spring_aop_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/libraries/Maven__org_springframework_spring_beans_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/libraries/Maven__org_springframework_spring_context_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/libraries/Maven__org_springframework_spring_core_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/libraries/Maven__org_springframework_spring_expression_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/girl-friend-spring-boot-starter.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | org.springframework.boot 9 | spring-boot-starter-parent 10 | 2.1.2.RELEASE 11 | 12 | 13 | site.exception 14 | girl-friend-spring-boot-starter 15 | 1.0-SNAPSHOT 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-autoconfigure 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/src/main/java/site/exception/GirlFriendAutoConfiguration.java: -------------------------------------------------------------------------------- 1 | package site.exception; 2 | 3 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; 4 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 5 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | /** 10 | * @author www.exception.site(exception 教程网)) 11 | * @date 2019/1/30 12 | * @time 11:11 13 | * @discription 14 | **/ 15 | @Configuration 16 | @ConditionalOnClass(GirlFriendService.class) 17 | @EnableConfigurationProperties(GirlFriendServiceProperties.class) 18 | public class GirlFriendAutoConfiguration { 19 | 20 | @Bean 21 | @ConditionalOnMissingBean 22 | public GirlFriendService girlFriendService() { 23 | return new GirlFriendServiceImpl(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/src/main/java/site/exception/GirlFriendService.java: -------------------------------------------------------------------------------- 1 | package site.exception; 2 | 3 | /** 4 | * @author www.exception.site(exception 教程网) 5 | * @date 2019/1/30 6 | * @time 11:07 7 | * @discription 8 | **/ 9 | public interface GirlFriendService { 10 | /** 11 | * 打招呼 12 | * @return 13 | */ 14 | void say(); 15 | } 16 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/src/main/java/site/exception/GirlFriendServiceImpl.java: -------------------------------------------------------------------------------- 1 | package site.exception; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | 5 | /** 6 | * @author www.exception.site(exception 教程网) 7 | * @date 2019/1/30 8 | * @time 11:07 9 | * @discription 10 | **/ 11 | public class GirlFriendServiceImpl implements GirlFriendService { 12 | 13 | @Autowired 14 | private GirlFriendServiceProperties girlFriendServiceProperties; 15 | 16 | /** 17 | * 打招呼 18 | * 19 | */ 20 | @Override 21 | public void say() { 22 | String message = girlFriendServiceProperties.getMessage(); 23 | System.out.println("Girl Friend: " + message); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/src/main/java/site/exception/GirlFriendServiceProperties.java: -------------------------------------------------------------------------------- 1 | package site.exception; 2 | 3 | import org.springframework.boot.context.properties.ConfigurationProperties; 4 | 5 | /** 6 | * @author www.exception.site(exception 教程网) 7 | * @date 2019/1/30 8 | * @time 11:22 9 | * @discription 10 | **/ 11 | @ConfigurationProperties(prefix = "spring.girlfriend") 12 | public class GirlFriendServiceProperties { 13 | 14 | /** 默认输出 */ 15 | private String message = "Hi, good morning !"; 16 | 17 | public String getMessage() { 18 | return message; 19 | } 20 | 21 | public void setMessage(String message) { 22 | this.message = message; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /girl-friend-spring-boot-starter/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.boot.autoconfigure.EnableAutoConfiguration=site.exception.GirlFriendAutoConfiguration -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__com_google_code_gson_gson_2_8_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_14_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.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 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_aop_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_beans_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_context_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_core_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_expression_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_test_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_web_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-aop-web-request 13 | 0.0.1-SNAPSHOT 14 | spring-boot-aop-web-request 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-aop 36 | 37 | 38 | 39 | 40 | com.google.code.gson 41 | gson 42 | 2.8.5 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-maven-plugin 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/src/main/java/site/exception/springbootaopwebrequest/SpringBootAopWebRequestApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaopwebrequest; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootAopWebRequestApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootAopWebRequestApplication.class, args); 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/src/main/java/site/exception/springbootaopwebrequest/aspect/WebLog.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaopwebrequest.aspect; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * @author 犬小哈 (微信号:小哈学Java) 7 | * @site www.exception.site 8 | * @date 2019/2/12 9 | * @time 下午9:19 10 | * @discription 11 | **/ 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target({ElementType.METHOD}) 14 | @Documented 15 | public @interface WebLog { 16 | /** 17 | * 日志描述信息 18 | * 19 | * @return 20 | */ 21 | String description() default ""; 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/src/main/java/site/exception/springbootaopwebrequest/entity/User.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaopwebrequest.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | /** 7 | * @author 犬小哈 (微信号:小哈学Java) 8 | * @site www.exception.site 9 | * @date 2019/2/12 10 | * @time 下午9:19 11 | * @discription 12 | **/ 13 | public class User implements Serializable { 14 | /** 15 | * 用户名 16 | */ 17 | private String username; 18 | /** 19 | * 密码 20 | */ 21 | private String password; 22 | /** 23 | * 创建时间 24 | */ 25 | private Date createTime; 26 | 27 | public String getUsername() { 28 | return username; 29 | } 30 | 31 | public void setUsername(String username) { 32 | this.username = username; 33 | } 34 | 35 | public String getPassword() { 36 | return password; 37 | } 38 | 39 | public void setPassword(String password) { 40 | this.password = password; 41 | } 42 | 43 | public Date getCreateTime() { 44 | return createTime; 45 | } 46 | 47 | public void setCreateTime(Date createTime) { 48 | this.createTime = createTime; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=dev 2 | logging.config=classpath:logback-spring.xml -------------------------------------------------------------------------------- /spring-boot-aop-web-request/src/test/java/site/exception/springbootaopwebrequest/SpringBootAopWebRequestApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaopwebrequest; 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 SpringBootAopWebRequestApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /spring-boot-aop-web-request/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | spring.profiles.active=dev 2 | logging.config=classpath:logback-spring.xml -------------------------------------------------------------------------------- /spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/SpringBootAopWebRequestApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/SpringBootAopWebRequestApplication.class -------------------------------------------------------------------------------- /spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/aspect/WebLog.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/aspect/WebLog.class -------------------------------------------------------------------------------- /spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/aspect/WebLogAspect.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/aspect/WebLogAspect.class -------------------------------------------------------------------------------- /spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/controller/TestController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/controller/TestController.class -------------------------------------------------------------------------------- /spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/entity/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-aop-web-request/target/classes/site/exception/springbootaopwebrequest/entity/User.class -------------------------------------------------------------------------------- /spring-boot-aop-web-request/target/test-classes/site/exception/springbootaopwebrequest/SpringBootAopWebRequestApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-aop-web-request/target/test-classes/site/exception/springbootaopwebrequest/SpringBootAopWebRequestApplicationTests.class -------------------------------------------------------------------------------- /spring-boot-aop/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-aop 13 | 0.0.1-SNAPSHOT 14 | spring-boot-aop 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-aop 36 | 37 | 38 | 39 | com.alibaba 40 | fastjson 41 | 1.2.31 42 | 43 | 44 | 45 | 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-maven-plugin 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /spring-boot-aop/src/main/java/site/exception/springbootaop/SpringBootAopApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaop; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootAopApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootAopApplication.class, args); 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /spring-boot-aop/src/main/java/site/exception/springbootaop/config/AOPConfig.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaop.config; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import org.aspectj.lang.ProceedingJoinPoint; 5 | import org.aspectj.lang.annotation.Around; 6 | import org.aspectj.lang.annotation.Aspect; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | import java.util.Arrays; 10 | 11 | /** 12 | * @author www.exception.site(Exception 教程网) 13 | * @date 2019/2/6 14 | * @time 20:02 15 | * @discription 16 | **/ 17 | @Configuration 18 | @Aspect 19 | public class AOPConfig { 20 | 21 | @Around("@within(org.springframework.web.bind.annotation.RestController)") 22 | public Object simpleAop(final ProceedingJoinPoint proceedingJoinPoint) throws Throwable { 23 | Object[] args = proceedingJoinPoint.getArgs(); 24 | System.out.println("入参: " + JSONObject.toJSONString(Arrays.asList(args))); 25 | // 调用原有的方法 26 | Object object = proceedingJoinPoint.proceed(); 27 | System.out.println("返参: " + object); 28 | return object; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-aop/src/main/java/site/exception/springbootaop/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaop.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.PostMapping; 5 | import org.springframework.web.bind.annotation.RequestBody; 6 | import org.springframework.web.bind.annotation.RestController; 7 | import site.exception.springbootaop.form.UserForm; 8 | 9 | /** 10 | * @author www.exception.site(Exception 教程网) 11 | * @date 2019/2/6 12 | * @time 20:11 13 | * @discription 14 | **/ 15 | @RestController 16 | public class TestController { 17 | 18 | @GetMapping("/test") 19 | public String test(String name) { 20 | return "Hello, Aop !"; 21 | } 22 | 23 | @PostMapping("/login") 24 | public String login(@RequestBody UserForm userForm) { 25 | return "Hello, Aop2 !"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-aop/src/main/java/site/exception/springbootaop/form/UserForm.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaop.form; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author www.exception.site(Exception 教程网) 7 | * @date 2019/2/6 8 | * @time 20:17 9 | * @discription 10 | **/ 11 | public class UserForm implements Serializable { 12 | /** 13 | * 用户名 14 | */ 15 | private String username; 16 | /** 17 | * 密码 18 | */ 19 | private String password; 20 | 21 | public String getUsername() { 22 | return username; 23 | } 24 | 25 | public void setUsername(String username) { 26 | this.username = username; 27 | } 28 | 29 | public String getPassword() { 30 | return password; 31 | } 32 | 33 | public void setPassword(String password) { 34 | this.password = password; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-boot-aop/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-aop/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-boot-aop/src/test/java/site/exception/springbootaop/SpringBootAopApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootaop; 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 SpringBootAopApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /spring-boot-date-format/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-date-format 13 | 0.0.1-SNAPSHOT 14 | spring-boot-date-format 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-maven-plugin 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /spring-boot-date-format/src/main/java/site/exception/springbootdateformat/SpringBootDateFormatApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootdateformat; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootDateFormatApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootDateFormatApplication.class, args); 11 | } 12 | 13 | } 14 | 15 | -------------------------------------------------------------------------------- /spring-boot-date-format/src/main/java/site/exception/springbootdateformat/config/MvcConfig.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootdateformat.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.format.FormatterRegistry; 5 | import org.springframework.format.datetime.DateFormatter; 6 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 7 | 8 | 9 | /** 10 | * @author www.exception.site (exception 教程网) 11 | * @date 2019/2/16 12 | * @time 20:55 13 | * @discription 14 | **/ 15 | @Configuration 16 | public class MvcConfig implements WebMvcConfigurer { 17 | 18 | /** 19 | * 配置日期格式化 20 | * @param registry 21 | */ 22 | @Override 23 | public void addFormatters(FormatterRegistry registry) { 24 | registry.addFormatter(new DateFormatter("yyyy-MM-dd HH:mm:ss")); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-date-format/src/main/java/site/exception/springbootdateformat/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootdateformat.controller; 2 | 3 | import org.springframework.web.bind.annotation.PostMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import site.exception.springbootdateformat.entity.User; 6 | 7 | /** 8 | * @author www.exception.site (exception 教程网) 9 | * @date 2019/2/16 10 | * @time 21:03 11 | * @discription 12 | **/ 13 | @RestController 14 | public class UserController { 15 | 16 | /** 17 | * 定义一个创建用户的接口 18 | * @param user 19 | * @return 20 | */ 21 | @PostMapping("/user") 22 | public String createUser(User user) { 23 | // 打印创建时间 24 | System.out.println(user.getCreateTime().toString()); 25 | return "Create user success !"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-boot-date-format/src/main/java/site/exception/springbootdateformat/entity/User.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootdateformat.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | /** 7 | * @author www.exception.site (exception 教程网) 8 | * @date 2019/2/16 9 | * @time 21:00 10 | * @discription 11 | **/ 12 | public class User implements Serializable { 13 | /** 14 | * 用户名 15 | */ 16 | private String username; 17 | /** 18 | * 密码 19 | */ 20 | private String password; 21 | /** 22 | * 创建时间 23 | */ 24 | private Date createTime; 25 | 26 | public String getUsername() { 27 | return username; 28 | } 29 | 30 | public void setUsername(String username) { 31 | this.username = username; 32 | } 33 | 34 | public String getPassword() { 35 | return password; 36 | } 37 | 38 | public void setPassword(String password) { 39 | this.password = password; 40 | } 41 | 42 | public Date getCreateTime() { 43 | return createTime; 44 | } 45 | 46 | public void setCreateTime(Date createTime) { 47 | this.createTime = createTime; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /spring-boot-date-format/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-boot-date-format/src/test/java/site/exception/springbootdateformat/SpringBootDateFormatApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootdateformat; 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 SpringBootDateFormatApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /spring-boot-excel/src/main/java/site/exception/springbootexcel/SpringBootExcelApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootexcel; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootExcelApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootExcelApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-excel/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-boot-excel/src/test/java/site/exception/springbootexcel/PdfTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootexcel; 2 | 3 | import com.alibaba.excel.EasyExcelFactory; 4 | import com.alibaba.excel.ExcelWriter; 5 | import com.alibaba.excel.metadata.Sheet; 6 | import com.alibaba.excel.metadata.Table; 7 | import com.itextpdf.text.Document; 8 | import com.itextpdf.text.Paragraph; 9 | import com.itextpdf.text.pdf.PdfWriter; 10 | import org.assertj.core.util.Lists; 11 | import org.junit.Test; 12 | import org.junit.runner.RunWith; 13 | import org.springframework.boot.test.context.SpringBootTest; 14 | import org.springframework.test.context.junit4.SpringRunner; 15 | import site.exception.springbootexcel.model.WriteModel; 16 | import site.exception.springbootexcel.model.WriteModel2; 17 | import site.exception.springbootexcel.util.DataUtil; 18 | 19 | import java.io.FileOutputStream; 20 | import java.io.OutputStream; 21 | import java.time.LocalDateTime; 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | @RunWith(SpringRunner.class) 26 | @SpringBootTest 27 | public class PdfTests { 28 | 29 | private static final String PATH = "/Users/a123123/Work/tmp_files/testPDF.pdf"; 30 | 31 | 32 | @Test 33 | public void writePdfSimple() throws Exception { 34 | Document document = new Document(); 35 | PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(PATH)); 36 | document.open(); 37 | document.add(new Paragraph("hello 世界")); 38 | document.close(); 39 | writer.close(); 40 | } 41 | 42 | 43 | 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /spring-boot-excel/src/test/java/site/exception/springbootexcel/model/Commodity.java: -------------------------------------------------------------------------------- 1 | //package site.exception.springbootexcel.model; 2 | // 3 | //import lombok.AllArgsConstructor; 4 | //import lombok.Builder; 5 | //import lombok.Data; 6 | //import lombok.NoArgsConstructor; 7 | // 8 | ///** 9 | // * @author jiangbing(江冰) 10 | // * @date 2019/5/10 11 | // * @time 上午10:56 12 | // * @discription 13 | // **/ 14 | //@Data 15 | //@NoArgsConstructor 16 | //@AllArgsConstructor 17 | //@Builder 18 | //public class Commodity { 19 | // 20 | //// private String c1; 21 | //// private String c1; 22 | //// private String c1; 23 | //// private String c1; 24 | //// private String c1; 25 | //// private String c1; 26 | //// private String c1; 27 | //// private String c1; 28 | //// private String c1; 29 | //// private String c1; 30 | //// private String c1; 31 | //} 32 | -------------------------------------------------------------------------------- /spring-boot-excel/src/test/java/site/exception/springbootexcel/model/User.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootexcel.model; 2 | 3 | import com.alibaba.excel.annotation.ExcelProperty; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Builder; 6 | import lombok.Data; 7 | import lombok.NoArgsConstructor; 8 | 9 | /** 10 | * @author jiangbing(江冰) 11 | * @date 2019/5/9 12 | * @time 下午5:01 13 | * @discription 14 | **/ 15 | @Data 16 | @NoArgsConstructor 17 | @AllArgsConstructor 18 | @Builder 19 | public class User { 20 | private String name; 21 | 22 | private String password; 23 | 24 | private Integer age; 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot-excel/src/test/java/site/exception/springbootexcel/model/WriteModel.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootexcel.model; 2 | 3 | import com.alibaba.excel.annotation.ExcelProperty; 4 | import com.alibaba.excel.metadata.BaseRowModel; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | /** 11 | * @author jiangbing(江冰) 12 | * @date 2019/5/9 13 | * @time 下午2:07 14 | * @discription 写入Excel模型对象 15 | **/ 16 | @Data 17 | @NoArgsConstructor 18 | @AllArgsConstructor 19 | @Builder 20 | public class WriteModel extends BaseRowModel { 21 | 22 | @ExcelProperty(value = "姓名", index = 0) 23 | private String name; 24 | 25 | @ExcelProperty(value = "密码", index = 1) 26 | private String password; 27 | 28 | @ExcelProperty(value = "年龄", index = 2) 29 | private Integer age; 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-excel/src/test/java/site/exception/springbootexcel/model/WriteModel2.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootexcel.model; 2 | 3 | import com.alibaba.excel.annotation.ExcelProperty; 4 | import com.alibaba.excel.metadata.BaseRowModel; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Builder; 7 | import lombok.Data; 8 | import lombok.NoArgsConstructor; 9 | 10 | import java.time.LocalDateTime; 11 | 12 | /** 13 | * @author jiangbing(江冰) 14 | * @date 2019/5/9 15 | * @time 下午2:07 16 | * @discription 写入Excel模型对象 17 | **/ 18 | @Data 19 | @NoArgsConstructor 20 | @AllArgsConstructor 21 | @Builder 22 | public class WriteModel2 extends BaseRowModel { 23 | 24 | @ExcelProperty(value = "订单号", index = 0) 25 | private String orderNo; 26 | 27 | @ExcelProperty(value = "创建人", index = 1) 28 | private String name; 29 | 30 | @ExcelProperty(value = "创建时间", index = 2) 31 | private LocalDateTime createTime; 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-freemark-excel/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.5.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-freemark-excel 13 | 0.0.1-SNAPSHOT 14 | spring-boot-freemark-excel 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-freemarker 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-web 29 | 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-devtools 34 | runtime 35 | 36 | 37 | org.projectlombok 38 | lombok 39 | true 40 | 41 | 42 | org.springframework.boot 43 | spring-boot-starter-test 44 | test 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | org.springframework.boot 53 | spring-boot-maven-plugin 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /spring-boot-freemark-excel/src/main/java/site/exception/springbootfreemarkexcel/SpringBootFreemarkExcelApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootfreemarkexcel; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootFreemarkExcelApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootFreemarkExcelApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-freemark-excel/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-boot-freemark-excel/src/test/java/site/exception/springbootfreemarkexcel/entity/Commodity.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootfreemarkexcel.entity; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | 6 | import java.math.BigDecimal; 7 | import java.time.LocalDateTime; 8 | import java.util.Date; 9 | 10 | /** 11 | * @author 犬小哈 (微信公众号: 小哈学Java) 12 | * @site www.exception.site 13 | * @date 2019/5/21 14 | * @time 上午10:57 15 | * @discription 16 | **/ 17 | @Data 18 | @Builder 19 | public class Commodity { 20 | private String name; 21 | private Integer num; 22 | private int num1; 23 | private BigDecimal price; 24 | private Double price2; 25 | private Float price3; 26 | private Date createTime; 27 | private Long timestamp; 28 | } 29 | -------------------------------------------------------------------------------- /spring-boot-hello/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/.DS_Store -------------------------------------------------------------------------------- /spring-boot-hello/.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__javax_servlet_javax_servlet_api_4_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__javax_websocket_javax_websocket_api_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_annotations_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_client_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_continuation_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_http_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_io_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_plus_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_security_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_server_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_servlet_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_servlets_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_util_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_webapp_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_jetty_xml_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_websocket_javax_websocket_client_impl_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_websocket_javax_websocket_server_impl_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_websocket_websocket_api_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_websocket_websocket_client_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_websocket_websocket_common_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_websocket_websocket_server_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_eclipse_jetty_websocket_websocket_servlet_9_4_14_v20181114.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_14_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_mortbay_jasper_apache_el_8_5_35_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_ow2_asm_asm_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_ow2_asm_asm_analysis_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_ow2_asm_asm_commons_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_ow2_asm_asm_tree_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_projectlombok_lombok_1_18_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.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 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jetty_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_aop_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_beans_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_context_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_core_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_expression_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_test_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_web_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-boot-hello/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-boot-hello/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-jetty 13 | 0.0.1-SNAPSHOT 14 | spring-boot-jetty 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-tomcat 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-jetty 38 | 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | 47 | org.projectlombok 48 | lombok 49 | 50 | 51 | 52 | 53 | 54 | 55 | org.springframework.boot 56 | spring-boot-maven-plugin 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /spring-boot-hello/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/src/.DS_Store -------------------------------------------------------------------------------- /spring-boot-hello/src/main/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/src/main/.DS_Store -------------------------------------------------------------------------------- /spring-boot-hello/src/main/java/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/src/main/java/.DS_Store -------------------------------------------------------------------------------- /spring-boot-hello/src/main/java/site/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/src/main/java/site/.DS_Store -------------------------------------------------------------------------------- /spring-boot-hello/src/main/java/site/exception/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/src/main/java/site/exception/.DS_Store -------------------------------------------------------------------------------- /spring-boot-hello/src/main/java/site/exception/springboothello/SpringBootHelloApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springboothello; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootHelloApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootHelloApplication.class, args); 11 | } 12 | 13 | 14 | 15 | } 16 | 17 | -------------------------------------------------------------------------------- /spring-boot-hello/src/main/java/site/exception/springboothello/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package site.exception.springboothello.controller; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import java.util.concurrent.TimeUnit; 8 | 9 | /** 10 | * @author www.exception.site(Exception 教程网) 11 | * @date 2019/1/29 12 | * @time 13:58 13 | * @discription 14 | **/ 15 | @RestController 16 | @Slf4j 17 | public class TestController { 18 | 19 | @GetMapping("/hello") 20 | String hello() throws InterruptedException { 21 | log.info("===================== start ====================="); 22 | // 模拟一个 50 ms 的业务处理时间 23 | TimeUnit.MILLISECONDS.sleep(50); 24 | log.info("===================== end ====================="); 25 | return "Hello, Spring Boot !"; 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /spring-boot-hello/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-boot-hello/src/test/java/site/exception/springboothello/SpringBootHelloApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springboothello; 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 SpringBootHelloApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /spring-boot-hello/target/classes/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/target/classes/application.properties -------------------------------------------------------------------------------- /spring-boot-hello/target/classes/site/exception/springboothello/SpringBootHelloApplication.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/target/classes/site/exception/springboothello/SpringBootHelloApplication.class -------------------------------------------------------------------------------- /spring-boot-hello/target/classes/site/exception/springboothello/controller/TestController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/target/classes/site/exception/springboothello/controller/TestController.class -------------------------------------------------------------------------------- /spring-boot-hello/target/test-classes/site/exception/springboothello/SpringBootHelloApplicationTests.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-hello/target/test-classes/site/exception/springboothello/SpringBootHelloApplicationTests.class -------------------------------------------------------------------------------- /spring-boot-interceptor/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-interceptor 13 | 0.0.1-SNAPSHOT 14 | spring-boot-interceptor 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-maven-plugin 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /spring-boot-interceptor/src/main/java/site/exception/springbootinterceptor/Controller/TestController.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootinterceptor.Controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * @author www.exception.site (exception 教程网) 8 | * @date 2019/2/28 9 | * @time 19:21 10 | * @discription 11 | **/ 12 | @RestController 13 | public class TestController { 14 | 15 | @GetMapping("/admin/test") 16 | public String test() { 17 | System.out.println("test"); 18 | return "success"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spring-boot-interceptor/src/main/java/site/exception/springbootinterceptor/SpringBootInterceptorApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootinterceptor; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootInterceptorApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootInterceptorApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-interceptor/src/main/java/site/exception/springbootinterceptor/config/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootinterceptor.config; 2 | 3 | import org.springframework.context.annotation.Configuration; 4 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 5 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 6 | import site.exception.springbootinterceptor.interceptor.LoginValidationInterceptor; 7 | 8 | /** 9 | * @author www.exception.site (exception 教程网) 10 | * @date 2019/2/27 11 | * @time 12:17 12 | * @discription 13 | **/ 14 | @Configuration 15 | public class WebMvcConfig implements WebMvcConfigurer { 16 | 17 | /** 18 | * 配置拦截器 19 | * @param interceptorRegistry 20 | */ 21 | @Override 22 | public void addInterceptors(InterceptorRegistry interceptorRegistry) { 23 | // 拦截所有 /admin/** 的访问地址 24 | interceptorRegistry.addInterceptor(new LoginValidationInterceptor()).addPathPatterns("/admin/**"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /spring-boot-interceptor/src/main/java/site/exception/springbootinterceptor/entity/User.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootinterceptor.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author www.exception.site (exception 教程网) 7 | * @date 2019/3/1 8 | * @time 21:15 9 | * @discription 10 | **/ 11 | public class User implements Serializable { 12 | private String usernmae; 13 | private String password; 14 | 15 | public String getUsernmae() { 16 | return usernmae; 17 | } 18 | 19 | public void setUsernmae(String usernmae) { 20 | this.usernmae = usernmae; 21 | } 22 | 23 | public String getPassword() { 24 | return password; 25 | } 26 | 27 | public void setPassword(String password) { 28 | this.password = password; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-boot-interceptor/src/main/java/site/exception/springbootinterceptor/interceptor/LoginValidationInterceptor.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootinterceptor.interceptor; 2 | 3 | import org.springframework.lang.Nullable; 4 | import org.springframework.web.servlet.HandlerInterceptor; 5 | import org.springframework.web.servlet.ModelAndView; 6 | import site.exception.springbootinterceptor.entity.User; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | /** 12 | * @author www.exception.site (exception 教程网) 13 | * @date 2019/2/27 14 | * @time 12:19 15 | * @discription 登录验证拦截器 16 | **/ 17 | public class LoginValidationInterceptor implements HandlerInterceptor { 18 | 19 | @Override 20 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 21 | System.out.println("preHandle ..."); 22 | User user = (User) request.getSession().getAttribute("user"); 23 | if (user == null) { 24 | // 若未登录,重定向到登录页面 25 | response.sendRedirect("login.html"); 26 | return false; 27 | } 28 | // 若已登录,继续往下执行 29 | return true; 30 | } 31 | 32 | @Override 33 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable ModelAndView modelAndView) throws Exception { 34 | System.out.println("postHandle ..."); 35 | // controller 方法调用完毕后,执行此方法 36 | } 37 | 38 | @Override 39 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception { 40 | System.out.println("afterCompletion ..."); 41 | // 页面渲染完成后调用此方法, 一般用来清除某些资源等 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /spring-boot-interceptor/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 2 | -------------------------------------------------------------------------------- /spring-boot-interceptor/src/test/java/site/exception/springbootinterceptor/SpringBootInterceptorApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootinterceptor; 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 SpringBootInterceptorApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-jackson/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.3.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-jackson 13 | 0.0.1-SNAPSHOT 14 | spring-boot-jackson 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | 34 | 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-maven-plugin 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /spring-boot-jackson/src/main/java/site/exception/springbootjackson/SpringBootJacksonApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootjackson; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootJacksonApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootJacksonApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-jackson/src/main/java/site/exception/springbootjackson/config/JacksonConfig.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootjackson.config; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import java.text.SimpleDateFormat; 8 | 9 | /** 10 | * @author www.exception.site (exception 教程网) 11 | * @date 2019/2/17 12 | * @time 19:32 13 | * @discription 14 | **/ 15 | @Configuration 16 | public class JacksonConfig { 17 | 18 | @Bean 19 | public ObjectMapper objectMapper() { 20 | ObjectMapper objectMapper = new ObjectMapper(); 21 | objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")); 22 | return objectMapper; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot-jackson/src/main/java/site/exception/springbootjackson/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootjackson.controller; 2 | 3 | import org.springframework.web.bind.annotation.PostMapping; 4 | import org.springframework.web.bind.annotation.RequestBody; 5 | import org.springframework.web.bind.annotation.RestController; 6 | import site.exception.springbootjackson.entity.User; 7 | 8 | /** 9 | * @author www.exception.site (exception 教程网) 10 | * @date 2019/2/16 11 | * @time 21:03 12 | * @discription 13 | **/ 14 | @RestController 15 | public class UserController { 16 | 17 | /** 18 | * 定义一个创建用户的接口 19 | * @param user 20 | * @return 21 | */ 22 | @PostMapping("/user") 23 | public User createUser(@RequestBody User user) { 24 | System.out.println(user.getCreateTime().toString()); 25 | // 将 user 再以 Json 的形式返回 26 | return user; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-boot-jackson/src/main/java/site/exception/springbootjackson/entity/User.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootjackson.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | /** 7 | * @author www.exception.site (exception 教程网) 8 | * @date 2019/2/16 9 | * @time 21:00 10 | * @discription 11 | **/ 12 | public class User implements Serializable { 13 | /** 14 | * 用户名 15 | */ 16 | private String username; 17 | /** 18 | * 密码 19 | */ 20 | private String password; 21 | /** 22 | * 创建时间 23 | */ 24 | private Date createTime; 25 | 26 | public String getUsername() { 27 | return username; 28 | } 29 | 30 | public void setUsername(String username) { 31 | this.username = username; 32 | } 33 | 34 | public String getPassword() { 35 | return password; 36 | } 37 | 38 | public void setPassword(String password) { 39 | this.password = password; 40 | } 41 | 42 | public Date getCreateTime() { 43 | return createTime; 44 | } 45 | 46 | public void setCreateTime(Date createTime) { 47 | this.createTime = createTime; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /spring-boot-jackson/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-boot-jackson/src/test/java/site/exception/springbootjackson/SpringBootJacksonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootjackson; 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 SpringBootJacksonApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-jetty/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-jetty 13 | 0.0.1-SNAPSHOT 14 | spring-boot-jetty 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-tomcat 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-jetty 38 | 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-maven-plugin 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /spring-boot-jetty/src/main/java/site/exception/springbootjetty/SpringBootJettyApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootjetty; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootJettyApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootJettyApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-jetty/src/main/java/site/exception/springbootjetty/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootjetty.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * @author www.exception.site (exception 教程网) 8 | * @date 2019/2/25 9 | * @time 19:58 10 | * @discription 11 | **/ 12 | @RestController 13 | public class TestController { 14 | 15 | @GetMapping("/test") 16 | public String test() { 17 | return "success !"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spring-boot-jetty/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-boot-jetty/src/test/java/site/exception/springbootjetty/SpringBootJettyApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootjetty; 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 SpringBootJettyApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-kafka/src/main/java/site/exception/springbootkafka/SpringBootKafkaApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootkafka; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootKafkaApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootKafkaApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-kafka/src/main/java/site/exception/springbootkafka/consumer/KafkaConsumer.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootkafka.consumer; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | import org.springframework.kafka.annotation.KafkaListener; 5 | import org.springframework.stereotype.Component; 6 | 7 | /** 8 | * @author 犬小哈(公众号:小哈学Java) 9 | * @date 2019/4/12 10 | * @time 下午3:05 11 | * @discription 消息消费者 12 | **/ 13 | @Component 14 | @Slf4j 15 | public class KafkaConsumer { 16 | 17 | @KafkaListener(topics = "xiaoha", groupId = "group_id") 18 | public void consume(String message) { 19 | log.info("## consume message: {}", message); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /spring-boot-kafka/src/main/java/site/exception/springbootkafka/model/Order.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootkafka.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.time.LocalDateTime; 9 | 10 | /** 11 | * @author 犬小哈(公众号:小哈学Java) 12 | * @date 2019/4/12 13 | * @time 下午3:05 14 | * @discription 订单实体类 15 | **/ 16 | @Data 17 | @Builder 18 | @AllArgsConstructor 19 | @NoArgsConstructor 20 | public class Order { 21 | private long orderId; 22 | private String orderNum; 23 | private LocalDateTime createTime; 24 | } 25 | -------------------------------------------------------------------------------- /spring-boot-kafka/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | 2 | spring: 3 | kafka: 4 | consumer: 5 | bootstrap-servers: localhost:9092 6 | group-id: group_id 7 | auto-offset-reset: earliest 8 | key-deserializer: org.apache.kafka.common.serialization.StringDeserializer 9 | value-deserializer: org.apache.kafka.common.serialization.StringDeserializer 10 | producer: 11 | bootstrap-servers: localhost:9092 12 | key-deserializer: org.apache.kafka.common.serialization.StringSerializer 13 | value-deserializer: org.apache.kafka.common.serialization.StringSerializer 14 | -------------------------------------------------------------------------------- /spring-boot-kafka/src/test/java/site/exception/springbootkafka/SpringBootKafkaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootkafka; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.context.junit4.SpringRunner; 8 | import site.exception.springbootkafka.provider.KafkaProvider; 9 | 10 | import java.time.LocalDateTime; 11 | import java.util.UUID; 12 | import java.util.concurrent.TimeUnit; 13 | 14 | /** 15 | * @author 犬小哈(公众号:小哈学Java) 16 | * @date 2019/4/12 17 | * @time 下午3:05 18 | * @discription 19 | **/ 20 | @RunWith(SpringRunner.class) 21 | @SpringBootTest 22 | public class SpringBootKafkaApplicationTests { 23 | 24 | @Autowired 25 | private KafkaProvider kafkaProvider; 26 | 27 | @Test 28 | public void sendMessage() throws InterruptedException { 29 | // 发送 1000 个消息 30 | for (int i = 0; i < 1000; i++) { 31 | long orderId = i+1; 32 | String orderNum = UUID.randomUUID().toString(); 33 | kafkaProvider.sendMessage(orderId, orderNum, LocalDateTime.now()); 34 | } 35 | 36 | TimeUnit.MINUTES.sleep(1); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-boot-log4j2/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-log4j2 13 | 0.0.1-SNAPSHOT 14 | spring-boot-log4j2 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-logging 29 | 30 | 31 | 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-log4j2 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-starter-test 41 | test 42 | 43 | 44 | 45 | 46 | 47 | 48 | org.springframework.boot 49 | spring-boot-maven-plugin 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /spring-boot-log4j2/src/main/java/site/exception/springbootlog4j2/SpringBootLog4j2Application.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootlog4j2; 2 | 3 | import org.apache.logging.log4j.LogManager; 4 | import org.apache.logging.log4j.Logger; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @SpringBootApplication 11 | @RestController 12 | public class SpringBootLog4j2Application { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(SpringBootLog4j2Application.class, args); 16 | } 17 | 18 | private static final Logger LOG = LogManager.getLogger(SpringBootLog4j2Application.class); 19 | 20 | @GetMapping("/test") 21 | public String test() { 22 | LOG.debug("debug 级别日志 ..."); 23 | LOG.info("info 级别日志 ..."); 24 | LOG.warn("warn 级别日志 ..."); 25 | LOG.error("error 级别日志 ..."); 26 | LOG.fatal("fatal 级别日志 ..."); 27 | return "Hello Log4j2 !"; 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /spring-boot-log4j2/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-log4j2/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-boot-log4j2/src/test/java/site/exception/springbootlog4j2/SpringBootLog4j2ApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootlog4j2; 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 SpringBootLog4j2ApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | 18 | -------------------------------------------------------------------------------- /spring-boot-mail/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | .sts4-cache 13 | 14 | ### IntelliJ IDEA ### 15 | .idea 16 | *.iws 17 | *.iml 18 | *.ipr 19 | 20 | ### NetBeans ### 21 | /nbproject/private/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ 26 | /build/ 27 | 28 | ### VS Code ### 29 | .vscode/ 30 | /.mvn/ 31 | /mvnw 32 | /mvnw.cmd 33 | -------------------------------------------------------------------------------- /spring-boot-mail/src/main/java/site/exception/springbootmail/SpringBootMailApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootmail; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootMailApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootMailApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-mail/src/main/java/site/exception/springbootmail/service/MailService.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootmail.service; 2 | 3 | /** 4 | * @author 犬小哈(微信号: 小哈学Java) 5 | * @site 个人网站: www.exception.site 6 | * @date 2019/4/10 7 | * @time 下午4:19 8 | * @discription 9 | **/ 10 | public interface MailService { 11 | 12 | /** 13 | * 发送简单文本的邮件 14 | * @param to 15 | * @param subject 16 | * @param content 17 | * @return 18 | */ 19 | boolean send(String to, String subject, String content); 20 | 21 | /** 22 | * 发送 html 的邮件 23 | * @param to 24 | * @param subject 25 | * @param html 26 | * @return 27 | */ 28 | boolean sendWithHtml(String to, String subject, String html); 29 | 30 | /** 31 | * 发送带有图片的 html 的邮件 32 | * @param to 33 | * @param subject 34 | * @param html 35 | * @param cids 36 | * @param filePaths 37 | * @return 38 | */ 39 | boolean sendWithImageHtml(String to, String subject, String html, String[] cids, String[] filePaths); 40 | 41 | 42 | /** 43 | * 发送带有附件的邮件 44 | * @param to 45 | * @param subject 46 | * @param content 47 | * @param filePaths 48 | * @return 49 | */ 50 | boolean sendWithWithEnclosure(String to, String subject, String content, String[] filePaths); 51 | 52 | } 53 | -------------------------------------------------------------------------------- /spring-boot-mail/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 发送邮件的服务器,笔者这里使用的 QQ 邮件 2 | spring.mail.host=smtp.qq.com 3 | # QQ 邮箱 4 | spring.mail.username=237409996@qq.com 5 | # 授权码 6 | spring.mail.password=bxabkystcclocaac 7 | spring.mail.properties.mail.smtp.auth=true 8 | spring.mail.properties.mail.smtp.starttls.enable=true 9 | spring.mail.properties.mail.smtp.starttls.required=true 10 | 11 | -------------------------------------------------------------------------------- /spring-boot-undertow/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.2.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-undertow 13 | 0.0.1-SNAPSHOT 14 | spring-boot-undertow 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-tomcat 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-undertow 38 | 39 | 40 | 41 | org.springframework.boot 42 | spring-boot-starter-test 43 | test 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.springframework.boot 51 | spring-boot-maven-plugin 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /spring-boot-undertow/src/main/java/site/exception/springbootundertow/SpringBootUndertowApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootundertow; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootUndertowApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootUndertowApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-undertow/src/main/java/site/exception/springbootundertow/controller/TestController.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootundertow.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | /** 7 | * @author jiangbing(江冰) 8 | * @date 2019/2/22 9 | * @time 20:20 10 | * @discription 11 | **/ 12 | @RestController 13 | public class TestController { 14 | 15 | @GetMapping("/test") 16 | public String test() { 17 | return "success !"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /spring-boot-undertow/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/weiwosuoai/spring-boot-tutorial/d7c070a78676c050f0442cbe0ab615a2ae890239/spring-boot-undertow/src/main/resources/application.properties -------------------------------------------------------------------------------- /spring-boot-undertow/src/test/java/site/exception/springbootundertow/SpringBootUndertowApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootundertow; 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 SpringBootUndertowApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /spring-boot-webflux-hello/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.1.4.RELEASE 9 | 10 | 11 | site.exception 12 | spring-boot-webflux-hello 13 | 0.0.1-SNAPSHOT 14 | spring-boot-webflux-hello 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-webflux 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | io.projectreactor 34 | reactor-test 35 | test 36 | 37 | 38 | 39 | 40 | 41 | 42 | org.springframework.boot 43 | spring-boot-maven-plugin 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /spring-boot-webflux-hello/src/main/java/site/exception/springbootwebfluxhello/SpringBootWebfluxHelloApplication.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootwebfluxhello; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class SpringBootWebfluxHelloApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(SpringBootWebfluxHelloApplication.class, args); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /spring-boot-webflux-hello/src/main/java/site/exception/springbootwebfluxhello/controller/HelloWebFluxController.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootwebfluxhello.controller; 2 | 3 | import org.springframework.web.bind.annotation.GetMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | import reactor.core.publisher.Mono; 6 | import site.exception.springbootwebfluxhello.entity.User; 7 | 8 | /** 9 | * @author 犬小哈 (微信号: 小哈学Java) 10 | * @site 个人网站: www.exception.site 11 | * @date 2019/4/15 12 | * @time 下午9:12 13 | * @discription 14 | **/ 15 | @RestController 16 | public class HelloWebFluxController { 17 | 18 | @GetMapping("/hello") 19 | public String hello() { 20 | return "Hello, WebFlux !"; 21 | } 22 | 23 | @GetMapping("/user") 24 | public Mono getUser() { 25 | User user = new User(); 26 | user.setName("犬小哈"); 27 | user.setDesc("欢迎关注我的公众号: 小哈学Java"); 28 | return Mono.just(user); 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-boot-webflux-hello/src/main/java/site/exception/springbootwebfluxhello/entity/User.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootwebfluxhello.entity; 2 | 3 | /** 4 | * @author 犬小哈 (微信号: 小哈学Java) 5 | * @site 个人网站: www.exception.site 6 | * @date 2019/4/15 7 | * @time 下午9:12 8 | * @discription 9 | **/ 10 | public class User { 11 | 12 | /** 13 | * 姓名 14 | */ 15 | private String name; 16 | /** 17 | * 描述 18 | */ 19 | private String desc; 20 | 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | 29 | public String getDesc() { 30 | return desc; 31 | } 32 | 33 | public void setDesc(String desc) { 34 | this.desc = desc; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-boot-webflux-hello/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /spring-boot-webflux-hello/src/test/java/site/exception/springbootwebfluxhello/SpringBootWebfluxHelloApplicationTests.java: -------------------------------------------------------------------------------- 1 | package site.exception.springbootwebfluxhello; 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 SpringBootWebfluxHelloApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | --------------------------------------------------------------------------------