diff --git a/safespringboot/.idea/.gitignore b/safespringboot/.idea/.gitignore new file mode 100644 index 0000000..7dce4a0 --- /dev/null +++ b/safespringboot/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/../../../../:\java project\manyDatasource\.idea/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/safespringboot/.idea/.name b/safespringboot/.idea/.name new file mode 100644 index 0000000..efd261b --- /dev/null +++ b/safespringboot/.idea/.name @@ -0,0 +1 @@ +demo \ No newline at end of file diff --git a/safespringboot/.idea/compiler.xml b/safespringboot/.idea/compiler.xml new file mode 100644 index 0000000..b5fc47a --- /dev/null +++ b/safespringboot/.idea/compiler.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/encodings.xml b/safespringboot/.idea/encodings.xml new file mode 100644 index 0000000..1b90869 --- /dev/null +++ b/safespringboot/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/jarRepositories.xml b/safespringboot/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/safespringboot/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml b/safespringboot/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml new file mode 100644 index 0000000..44c1ba0 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_2_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml b/safespringboot/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml new file mode 100644 index 0000000..ca0f837 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__ch_qos_logback_logback_core_1_2_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_alibaba_fastjson_1_2_78.xml b/safespringboot/.idea/libraries/Maven__com_alibaba_fastjson_1_2_78.xml new file mode 100644 index 0000000..1baba97 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_alibaba_fastjson_1_2_78.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml b/safespringboot/.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml new file mode 100644 index 0000000..f714f6b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml new file mode 100644 index 0000000..c6109f4 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_9_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_9.xml b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_9.xml new file mode 100644 index 0000000..9b84e6d --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_9_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_9_3.xml b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_9_3.xml new file mode 100644 index 0000000..080c1ae --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_9_9_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_9.xml b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_9.xml new file mode 100644 index 0000000..c9af50b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jdk8_2_9_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_9.xml b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_9.xml new file mode 100644 index 0000000..9b14f05 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_datatype_jackson_datatype_jsr310_2_9_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_9.xml b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_9.xml new file mode 100644 index 0000000..87b15bd --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_fasterxml_jackson_module_jackson_module_parameter_names_2_9_9.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml b/safespringboot/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml new file mode 100644 index 0000000..f397dfc --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_google_code_findbugs_jsr305_3_0_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_google_errorprone_error_prone_annotations_2_3_4.xml b/safespringboot/.idea/libraries/Maven__com_google_errorprone_error_prone_annotations_2_3_4.xml new file mode 100644 index 0000000..28021bc --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_google_errorprone_error_prone_annotations_2_3_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_google_guava_failureaccess_1_0_1.xml b/safespringboot/.idea/libraries/Maven__com_google_guava_failureaccess_1_0_1.xml new file mode 100644 index 0000000..4fddf48 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_google_guava_failureaccess_1_0_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_google_guava_guava_29_0_jre.xml b/safespringboot/.idea/libraries/Maven__com_google_guava_guava_29_0_jre.xml new file mode 100644 index 0000000..2b2c677 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_google_guava_guava_29_0_jre.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava.xml b/safespringboot/.idea/libraries/Maven__com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava.xml new file mode 100644 index 0000000..75e9795 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_google_j2objc_j2objc_annotations_1_3.xml b/safespringboot/.idea/libraries/Maven__com_google_j2objc_j2objc_annotations_1_3.xml new file mode 100644 index 0000000..952c00b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_google_j2objc_j2objc_annotations_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml b/safespringboot/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml new file mode 100644 index 0000000..2c23f7b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_4_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml b/safespringboot/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml new file mode 100644 index 0000000..5246203 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__commons_io_commons_io_2_11_0.xml b/safespringboot/.idea/libraries/Maven__commons_io_commons_io_2_11_0.xml new file mode 100644 index 0000000..e40ed50 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__commons_io_commons_io_2_11_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__io_lettuce_lettuce_core_5_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__io_lettuce_lettuce_core_5_1_8_RELEASE.xml new file mode 100644 index 0000000..17b854f --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__io_lettuce_lettuce_core_5_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__io_netty_netty_buffer_4_1_39_Final.xml b/safespringboot/.idea/libraries/Maven__io_netty_netty_buffer_4_1_39_Final.xml new file mode 100644 index 0000000..a5ff258 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__io_netty_netty_buffer_4_1_39_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__io_netty_netty_codec_4_1_39_Final.xml b/safespringboot/.idea/libraries/Maven__io_netty_netty_codec_4_1_39_Final.xml new file mode 100644 index 0000000..fcfa7e2 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__io_netty_netty_codec_4_1_39_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__io_netty_netty_common_4_1_39_Final.xml b/safespringboot/.idea/libraries/Maven__io_netty_netty_common_4_1_39_Final.xml new file mode 100644 index 0000000..710fb3e --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__io_netty_netty_common_4_1_39_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__io_netty_netty_handler_4_1_39_Final.xml b/safespringboot/.idea/libraries/Maven__io_netty_netty_handler_4_1_39_Final.xml new file mode 100644 index 0000000..ade78d3 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__io_netty_netty_handler_4_1_39_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__io_netty_netty_resolver_4_1_39_Final.xml b/safespringboot/.idea/libraries/Maven__io_netty_netty_resolver_4_1_39_Final.xml new file mode 100644 index 0000000..dbb380a --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__io_netty_netty_resolver_4_1_39_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__io_netty_netty_transport_4_1_39_Final.xml b/safespringboot/.idea/libraries/Maven__io_netty_netty_transport_4_1_39_Final.xml new file mode 100644 index 0000000..1165d2d --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__io_netty_netty_transport_4_1_39_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__io_projectreactor_reactor_core_3_2_12_RELEASE.xml b/safespringboot/.idea/libraries/Maven__io_projectreactor_reactor_core_3_2_12_RELEASE.xml new file mode 100644 index 0000000..8d5313b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__io_projectreactor_reactor_core_3_2_12_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml b/safespringboot/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml new file mode 100644 index 0000000..99e4787 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__javax_annotation_javax_annotation_api_1_3_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml b/safespringboot/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml new file mode 100644 index 0000000..305d5fe --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__javax_validation_validation_api_2_0_1_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__junit_junit_4_12.xml b/safespringboot/.idea/libraries/Maven__junit_junit_4_12.xml new file mode 100644 index 0000000..69ca908 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__junit_junit_4_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_16.xml b/safespringboot/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_16.xml new file mode 100644 index 0000000..8ee8be8 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_16.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_16.xml b/safespringboot/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_16.xml new file mode 100644 index 0000000..0956a7d --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_16.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml b/safespringboot/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml new file mode 100644 index 0000000..a894af5 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml b/safespringboot/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml new file mode 100644 index 0000000..40ef52b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__net_minidev_json_smart_2_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml b/safespringboot/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml new file mode 100644 index 0000000..14edd40 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xml b/safespringboot/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xml new file mode 100644 index 0000000..375c261 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_24.xml b/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_24.xml new file mode 100644 index 0000000..b8006a1 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_24.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_24.xml b/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_24.xml new file mode 100644 index 0000000..85196f5 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_24.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_24.xml b/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_24.xml new file mode 100644 index 0000000..10d31c7 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_24.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_7.xml b/safespringboot/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_7.xml new file mode 100644 index 0000000..5f6fb35 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_7.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml b/safespringboot/.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml new file mode 100644 index 0000000..2ad0b2d --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_checkerframework_checker_qual_2_11_1.xml b/safespringboot/.idea/libraries/Maven__org_checkerframework_checker_qual_2_11_1.xml new file mode 100644 index 0000000..e2d686a --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_checkerframework_checker_qual_2_11_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_functionaljava_functionaljava_5_0.xml b/safespringboot/.idea/libraries/Maven__org_functionaljava_functionaljava_5_0.xml new file mode 100644 index 0000000..c200645 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_functionaljava_functionaljava_5_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/safespringboot/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..7deb049 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml b/safespringboot/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml new file mode 100644 index 0000000..240e078 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_17_Final.xml b/safespringboot/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_17_Final.xml new file mode 100644 index 0000000..7a64f22 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_17_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_3_Final.xml b/safespringboot/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_3_Final.xml new file mode 100644 index 0000000..b8e6e4d --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_3_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_mapstruct_mapstruct_1_5_3_Final.xml b/safespringboot/.idea/libraries/Maven__org_mapstruct_mapstruct_1_5_3_Final.xml new file mode 100644 index 0000000..1121704 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_mapstruct_mapstruct_1_5_3_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml b/safespringboot/.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml new file mode 100644 index 0000000..e1137b8 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml b/safespringboot/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml new file mode 100644 index 0000000..10fc9d3 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml b/safespringboot/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml new file mode 100644 index 0000000..4f737ae --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_projectlombok_lombok_1_18_22.xml b/safespringboot/.idea/libraries/Maven__org_projectlombok_lombok_1_18_22.xml new file mode 100644 index 0000000..a36d7df --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_projectlombok_lombok_1_18_22.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml b/safespringboot/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml new file mode 100644 index 0000000..c6016a3 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml b/safespringboot/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml new file mode 100644 index 0000000..9b78e42 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_28.xml b/safespringboot/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_28.xml new file mode 100644 index 0000000..94c7b37 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_28.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_28.xml b/safespringboot/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_28.xml new file mode 100644 index 0000000..83f0f61 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_28.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_8_RELEASE.xml new file mode 100644 index 0000000..73729cc --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_8_RELEASE.xml new file mode 100644 index 0000000..a97d932 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_8_RELEASE.xml new file mode 100644 index 0000000..21bb36b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_redis_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_redis_2_1_8_RELEASE.xml new file mode 100644 index 0000000..3e3c4fc --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_redis_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_8_RELEASE.xml new file mode 100644 index 0000000..400d914 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_8_RELEASE.xml new file mode 100644 index 0000000..7f2be76 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_1_8_RELEASE.xml new file mode 100644 index 0000000..9e574ef --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_8_RELEASE.xml new file mode 100644 index 0000000..3865324 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_8_RELEASE.xml new file mode 100644 index 0000000..90c099d --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_8_RELEASE.xml new file mode 100644 index 0000000..3cc6d71 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_8_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_8_RELEASE.xml new file mode 100644 index 0000000..9ac1eb3 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_8_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_1_10_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_1_10_RELEASE.xml new file mode 100644 index 0000000..995fb3b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_1_10_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_keyvalue_2_1_10_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_keyvalue_2_1_10_RELEASE.xml new file mode 100644 index 0000000..fa71c08 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_keyvalue_2_1_10_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_redis_2_1_10_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_redis_2_1_10_RELEASE.xml new file mode 100644 index 0000000..9164f49 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_data_spring_data_redis_2_1_10_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_aop_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_aop_5_1_9_RELEASE.xml new file mode 100644 index 0000000..35720c5 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_aop_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_beans_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_beans_5_1_9_RELEASE.xml new file mode 100644 index 0000000..32236a2 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_beans_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_context_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_context_5_1_9_RELEASE.xml new file mode 100644 index 0000000..04e506c --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_context_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_context_support_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_context_support_5_1_9_RELEASE.xml new file mode 100644 index 0000000..d099dae --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_context_support_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_core_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_core_5_1_9_RELEASE.xml new file mode 100644 index 0000000..cb486aa --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_core_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_expression_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_expression_5_1_9_RELEASE.xml new file mode 100644 index 0000000..38af2ce --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_expression_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_9_RELEASE.xml new file mode 100644 index 0000000..39f2653 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_jcl_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_oxm_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_oxm_5_1_9_RELEASE.xml new file mode 100644 index 0000000..03b7a89 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_oxm_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_test_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_test_5_1_9_RELEASE.xml new file mode 100644 index 0000000..ad84e76 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_test_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_tx_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_tx_5_1_9_RELEASE.xml new file mode 100644 index 0000000..bad3b0b --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_tx_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_web_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_web_5_1_9_RELEASE.xml new file mode 100644 index 0000000..533c7fe --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_web_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_9_RELEASE.xml b/safespringboot/.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_9_RELEASE.xml new file mode 100644 index 0000000..9121763 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_9_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_3.xml b/safespringboot/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_3.xml new file mode 100644 index 0000000..6faa344 --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml b/safespringboot/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml new file mode 100644 index 0000000..5351a3e --- /dev/null +++ b/safespringboot/.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/manyDatasource.iml b/safespringboot/.idea/manyDatasource.iml new file mode 100644 index 0000000..c3b4680 --- /dev/null +++ b/safespringboot/.idea/manyDatasource.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/misc.xml b/safespringboot/.idea/misc.xml new file mode 100644 index 0000000..70cffe3 --- /dev/null +++ b/safespringboot/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/safespringboot/.idea/modules.xml b/safespringboot/.idea/modules.xml new file mode 100644 index 0000000..21adc01 --- /dev/null +++ b/safespringboot/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/safespringboot/safespringboot/.gitignore b/safespringboot/safespringboot/.gitignore new file mode 100644 index 0000000..549e00a --- /dev/null +++ b/safespringboot/safespringboot/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/safespringboot/safespringboot/README.md b/safespringboot/safespringboot/README.md new file mode 100644 index 0000000..1b8a5f2 --- /dev/null +++ b/safespringboot/safespringboot/README.md @@ -0,0 +1,3 @@ +# java-demo-bilibili +B站视频对应的代码 + diff --git a/safespringboot/safespringboot/a.txt b/safespringboot/safespringboot/a.txt new file mode 100644 index 0000000..e41359e --- /dev/null +++ b/safespringboot/safespringboot/a.txt @@ -0,0 +1 @@ +{"gender":0,"name":"李四","age":30} \ No newline at end of file diff --git a/safespringboot/safespringboot/b.txt b/safespringboot/safespringboot/b.txt new file mode 100644 index 0000000..d3a78c6 --- /dev/null +++ b/safespringboot/safespringboot/b.txt @@ -0,0 +1,5 @@ +{ + "name": "张三", + "age": 20, + "gender": 1 +} diff --git a/safespringboot/safespringboot/doc/后端自测要点.md b/safespringboot/safespringboot/doc/后端自测要点.md new file mode 100644 index 0000000..cef0fdf --- /dev/null +++ b/safespringboot/safespringboot/doc/后端自测要点.md @@ -0,0 +1,5 @@ +## 后端自测三大要点 + +1. 可重复性 +2. 用例覆盖完整,重点覆盖异常场景 +3. 环境一致性 diff --git a/safespringboot/safespringboot/mvnw b/safespringboot/safespringboot/mvnw new file mode 100644 index 0000000..8a8fb22 --- /dev/null +++ b/safespringboot/safespringboot/mvnw @@ -0,0 +1,316 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`\\unset -f command; \\command -v java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/safespringboot/safespringboot/mvnw.cmd b/safespringboot/safespringboot/mvnw.cmd new file mode 100644 index 0000000..1d8ab01 --- /dev/null +++ b/safespringboot/safespringboot/mvnw.cmd @@ -0,0 +1,188 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/safespringboot/safespringboot/pom.xml b/safespringboot/safespringboot/pom.xml new file mode 100644 index 0000000..382683f --- /dev/null +++ b/safespringboot/safespringboot/pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.1.8.RELEASE + + + com.example + demo + 0.0.1-SNAPSHOT + demo + demo + + 8 + + + + org.projectlombok + lombok + 1.18.26 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + + + + com.alibaba + fastjson + 1.2.78 + + + + commons-io + commons-io + 2.11.0 + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/DemoApplication.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/DemoApplication.java new file mode 100644 index 0000000..29f47eb --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/DemoApplication.java @@ -0,0 +1,14 @@ +package com.woniu.datasourcedemo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +//@EnableAspectJAutoProxy(exposeProxy = true) +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/config/SignFilterConfiguration.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/config/SignFilterConfiguration.java new file mode 100644 index 0000000..5739146 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/config/SignFilterConfiguration.java @@ -0,0 +1,39 @@ +package com.woniu.datasourcedemo.config; + +import com.woniu.datasourcedemo.filter.SignFilter; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.Filter; +import java.util.HashMap; +import java.util.Map; + +@Configuration +public class SignFilterConfiguration { + + @Value("${sign.maxTime}") + private String signMaxTime; + + //filter中的初始化参数 + private Map initParametersMap = new HashMap<>(); + + @Bean + public FilterRegistrationBean contextFilterRegistrationBean() { + initParametersMap.put("signMaxTime", signMaxTime); + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setFilter(signFilter()); + registration.setInitParameters(initParametersMap); + registration.addUrlPatterns("/*"); + registration.setName("SignFilter"); + // 设置过滤器被调用的顺序 + registration.setOrder(1); + return registration; + } + + @Bean + public Filter signFilter() { + return new SignFilter(); + } +} \ No newline at end of file diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/controller/UserController.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/controller/UserController.java new file mode 100644 index 0000000..ce2b16b --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/controller/UserController.java @@ -0,0 +1,26 @@ +package com.woniu.datasourcedemo.controller; + +import com.woniu.datasourcedemo.model.User; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + + +@RestController +@Slf4j +public class UserController { + + + /** + * idea如何本地调试远程服务器的代码? + * @param id + * @return + */ + @GetMapping("/v1/user/{id}") + public User getById1(@PathVariable String id) { + System.out.println("woniu is good person"); + return new User("蜗牛","18"); + } + + + +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/dao/UserDao.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/dao/UserDao.java new file mode 100644 index 0000000..7880061 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/dao/UserDao.java @@ -0,0 +1,15 @@ +package com.woniu.datasourcedemo.dao; + +import com.woniu.datasourcedemo.model.User; +import org.springframework.stereotype.Repository; + + +//@Mapper +//@Repository +public interface UserDao { +// User getById(Integer id); +// +// void insertUserDs1(@Param("name") String name, @Param("age") String age); +// +// void insertUserDs2(@Param("name") String name, @Param("age") String age); +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/filter/SignFilter.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/filter/SignFilter.java new file mode 100644 index 0000000..238111e --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/filter/SignFilter.java @@ -0,0 +1,108 @@ +package com.woniu.datasourcedemo.filter; + +import com.woniu.datasourcedemo.model.RequestHeader; +import com.woniu.datasourcedemo.model.ResultData; +import com.woniu.datasourcedemo.model.ReturnCode; +import com.woniu.datasourcedemo.util.*; +import org.springframework.util.ObjectUtils; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.SortedMap; + +// SpringBoot 如何保证接口安全?高手都是这么玩的! +public class SignFilter implements Filter { + @Resource + private RedisUtil redisUtil; + + //从fitler配置中获取sign过期时间 + private Long signMaxTime; + + private static final String NONCE_KEY = "x-nonce-"; + + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + HttpServletRequest httpRequest = (HttpServletRequest) servletRequest; + HttpServletResponse httpResponse = (HttpServletResponse) servletResponse; + + System.out.println(httpRequest.getRequestURI()); + + HttpServletRequestWrapper requestWrapper = new SignRequestWrapper(httpRequest); + //构建请求头 + RequestHeader requestHeader = new RequestHeader(); + requestHeader.setNonce(httpRequest.getHeader("x-Nonce")); + requestHeader.setSign(httpRequest.getHeader("X-Sign")); + String header = httpRequest.getHeader("X-Time"); + if (StringUtils.isEmpty(header)) { + responseFail(httpResponse, ReturnCode.ILLEGAL_HEADER); + return; + } + requestHeader.setTimestamp(Long.parseLong(header)); + //验证请求头是否存在 + if (StringUtils.isEmpty(requestHeader.getSign()) || ObjectUtils.isEmpty(requestHeader.getTimestamp()) || StringUtils.isEmpty(requestHeader.getNonce())) { + responseFail(httpResponse, ReturnCode.ILLEGAL_HEADER); + return; + } + + /* + * 1.重放验证 + * 判断timestamp时间戳与当前时间是否超过60s(过期时间根据业务情况设置),如果超过了就提示签名过期。 + */ + long now = System.currentTimeMillis() / 1000; + + if (now - requestHeader.getTimestamp() > signMaxTime) { + responseFail(httpResponse, ReturnCode.REPLAY_ERROR); + return; + } + + //2. 判断nonce + boolean nonceExists = redisUtil.hasKey(NONCE_KEY + requestHeader.getNonce()); + if (nonceExists) { + //请求重复 + responseFail(httpResponse, ReturnCode.REPLAY_ERROR); + return; + } else { + redisUtil.set(NONCE_KEY + requestHeader.getNonce(), requestHeader.getNonce(), signMaxTime); + } + + + boolean accept; + SortedMap paramMap; + switch (httpRequest.getMethod()) { + case "GET": + paramMap = HttpDataUtil.getUrlParams(requestWrapper); + accept = SignUtil.verifySign(paramMap, requestHeader); + break; + case "POST": + paramMap = HttpDataUtil.getBodyParams(requestWrapper); + accept = SignUtil.verifySign(paramMap, requestHeader); + break; + default: + accept = true; + break; + } + if (accept) { + filterChain.doFilter(requestWrapper, servletResponse); + } else { + responseFail(httpResponse, ReturnCode.ARGUMENT_ERROR); + return; + } + + } + + private void responseFail(HttpServletResponse httpResponse, ReturnCode returnCode) { + ResultData resultData = ResultData.fail(returnCode.getCode(), returnCode.getMessage()); + WebUtils.writeJson(httpResponse, resultData); + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + String signTime = filterConfig.getInitParameter("signMaxTime"); + signMaxTime = Long.parseLong(signTime); + } +} \ No newline at end of file diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/RequestHeader.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/RequestHeader.java new file mode 100644 index 0000000..ce27098 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/RequestHeader.java @@ -0,0 +1,36 @@ +package com.woniu.datasourcedemo.model; + +import lombok.Builder; +import lombok.Data; + +//@Data +//@Builder +public class RequestHeader { + private String sign; + private Long timestamp; + private String nonce; + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public Long getTimestamp() { + return timestamp; + } + + public void setTimestamp(Long timestamp) { + this.timestamp = timestamp; + } + + public String getNonce() { + return nonce; + } + + public void setNonce(String nonce) { + this.nonce = nonce; + } +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/ResultData.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/ResultData.java new file mode 100644 index 0000000..51f8295 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/ResultData.java @@ -0,0 +1,56 @@ +package com.woniu.datasourcedemo.model; + + +import java.io.Serializable; + +public class ResultData implements Serializable { + + // 标识代码,2000表示成功,其它数值表示出错 + private String code; + // 返回的数据 + private T data; + // 提示信息,供报错时使用 + private String message; + + public ResultData(String code, String message) { + this.code = code; + this.message = message; + } + + public static ResultData fail(String code, String message) { + return new ResultData(code, message); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + @Override + public String toString() { + return "ResultData{" + + "code='" + code + '\'' + + ", data=" + data + + ", message='" + message + '\'' + + '}'; + } +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/ReturnCode.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/ReturnCode.java new file mode 100644 index 0000000..e3988cf --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/ReturnCode.java @@ -0,0 +1,31 @@ +package com.woniu.datasourcedemo.model; + +/** + * @className: ReturnCode + * @author: woniu + * @date: 2023/2/22 + **/ +public enum ReturnCode { + + ILLEGAL_HEADER("请求头错误","400"), + REPLAY_ERROR("重放错误","405"), + ARGUMENT_ERROR("验签失败","409") + ; + + private String message; + private String code; + + + ReturnCode(String message, String code) { + this.message = message; + this.code = code; + } + + public String getMessage() { + return message; + } + + public String getCode() { + return code; + } +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/User.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/User.java new file mode 100644 index 0000000..d0db5f6 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/model/User.java @@ -0,0 +1,56 @@ +package com.woniu.datasourcedemo.model; + +import lombok.Data; + +import java.io.Serializable; + +public class User implements Serializable { + + private String id; + + private String name; + + private String age; + + + public User() { + } + + public User( String name, String age) { + this.name = name; + this.age = age; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getAge() { + return age; + } + + public void setAge(String age) { + this.age = age; + } + + @Override + public String toString() { + return "User{" + + "id='" + id + '\'' + + ", name='" + name + '\'' + + ", age='" + age + '\'' + + '}'; + } +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/service/MainTest.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/service/MainTest.java new file mode 100644 index 0000000..38969b6 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/service/MainTest.java @@ -0,0 +1,24 @@ +package com.woniu.datasourcedemo.service; + + +import java.util.stream.LongStream; + +/** + * 代码调试神器 + * + * @author 蜗牛 + * @date 2023/01/13 + */ +public class MainTest { + + + public static void main(String[] args) { + + long[] dataResult = LongStream.of(10, 11, 52, 49, 5, 94, 105, 88) + .filter(data -> data > 10) + .map(data -> data * 2) + .distinct() + .sorted() + .toArray(); + } +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/service/UserService.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/service/UserService.java new file mode 100644 index 0000000..d19d2d1 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/service/UserService.java @@ -0,0 +1,50 @@ +package com.woniu.datasourcedemo.service; + +import com.woniu.datasourcedemo.dao.UserDao; +import com.woniu.datasourcedemo.model.User; +import org.springframework.aop.framework.AopContext; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +//@Service +public class UserService { + +// +// @Resource +// UserDao userDao; + + +// @DS("ds1") + public User getByUserId1(String userId) { +// return userDao.getById(Integer.parseInt(userId));\ + return null; + } + +// @DS("ds2") +// public User getByUserId2(String userId) { +// return userDao.getById(Integer.parseInt(userId)); +// } + + +// @DS("ds1") +// public void insertUserDs1(String name,String age) { +// userDao.insertUserDs1(name,age); +// } +// +// @DS("ds2") +// public void insertUserDs2(String name,String age) { +// userDao.insertUserDs2(name,age); +// } +// +// @DSTransactional +// public void insertUserAll(String name, String age){ +// UserService userService = (UserService) AopContext.currentProxy(); +// userService.insertUserDs1(name,age); +// userService.insertUserDs2(name,age); +// int i =1/0; +// } + + + +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/HttpDataUtil.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/HttpDataUtil.java new file mode 100644 index 0000000..bab694d --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/HttpDataUtil.java @@ -0,0 +1,56 @@ +package com.woniu.datasourcedemo.util; + + +import com.alibaba.fastjson.JSON; +import lombok.experimental.UtilityClass; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StreamUtils; +import org.springframework.util.StringUtils; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.util.SortedMap; +import java.util.TreeMap; + +@Slf4j +@UtilityClass +public class HttpDataUtil { + /** + * post请求处理:获取 Body 参数,转换为SortedMap + * + * @param request + */ + public static SortedMap getBodyParams(final HttpServletRequest request) throws IOException { + byte[] requestBody = StreamUtils.copyToByteArray(request.getInputStream()); + String body = new String(requestBody); + return JSON.parseObject(body, SortedMap.class); + } + + + /** + * get请求处理:将URL请求参数转换成SortedMap + */ + public static SortedMap getUrlParams(HttpServletRequest request) { + String param = ""; + SortedMap result = new TreeMap<>(); + + if (StringUtils.isEmpty(request.getQueryString())) { + return result; + } + + try { + param = URLDecoder.decode(request.getQueryString(), "utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + String[] params = param.split("&"); + for (String s : params) { + String[] array = s.split("="); + result.put(array[0], array[1]); + } + return result; + } +} \ No newline at end of file diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/RedisUtil.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/RedisUtil.java new file mode 100644 index 0000000..2250ff7 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/RedisUtil.java @@ -0,0 +1,70 @@ +package com.woniu.datasourcedemo.util; + + +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.concurrent.TimeUnit; + +@Component +public class RedisUtil { + @Resource + private RedisTemplate redisTemplate; + + /** + * 判断key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public boolean hasKey(String key) { + try { + return Boolean.TRUE.equals(redisTemplate.hasKey(key)); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + + /** + * 普通缓存放入并设置时间 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 + * @return true成功 false 失败 + */ + public boolean set(String key, Object value, long time) { + try { + if (time > 0) { + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); + } else { + set(key, value); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 普通缓存放入 + * + * @param key 键 + * @param value 值 + * @return true成功 false失败 + */ + public boolean set(String key, Object value) { + try { + redisTemplate.opsForValue().set(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + +} \ No newline at end of file diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/SignRequestWrapper.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/SignRequestWrapper.java new file mode 100644 index 0000000..9cd14a7 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/SignRequestWrapper.java @@ -0,0 +1,55 @@ +package com.woniu.datasourcedemo.util; + +import org.springframework.util.StreamUtils; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; + +public class SignRequestWrapper extends HttpServletRequestWrapper { + //用于将流保存下来 + private byte[] requestBody = null; + + public SignRequestWrapper(HttpServletRequest request) throws IOException { + super(request); + requestBody = StreamUtils.copyToByteArray(request.getInputStream()); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + final ByteArrayInputStream bais = new ByteArrayInputStream(requestBody); + + return new ServletInputStream() { + @Override + public boolean isFinished() { + return false; + } + + @Override + public boolean isReady() { + return false; + } + + @Override + public void setReadListener(ReadListener readListener) { + + } + + @Override + public int read() throws IOException { + return bais.read(); + } + }; + + } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(getInputStream())); + } +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/SignUtil.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/SignUtil.java new file mode 100644 index 0000000..2729370 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/SignUtil.java @@ -0,0 +1,40 @@ +package com.woniu.datasourcedemo.util; + +import com.alibaba.fastjson.JSON; +import com.woniu.datasourcedemo.model.RequestHeader; +import lombok.SneakyThrows; +import lombok.experimental.UtilityClass; +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.DigestUtils; +import org.springframework.util.StringUtils; + +import java.util.SortedMap; + +public class SignUtil { + /** + * 验证签名 + * 验证算法:把timestamp + JsonUtil.object2Json(SortedMap)合成字符串,然后MD5 + */ + @SneakyThrows + public static boolean verifySign(SortedMap map, RequestHeader requestHeader) { + String params = requestHeader.getNonce() + requestHeader.getTimestamp() + JSON.toJSONString(map); + return verifySign(params, requestHeader); + } + + /** + * 验证签名 + */ + public static boolean verifySign(String params, RequestHeader requestHeader) { +// log.debug("客户端签名: {}", requestHeader.getSign()); + System.out.println(requestHeader.getSign()); + if (StringUtils.isEmpty(params)) { + return false; + } +// log.info("客户端上传内容: {}", params); + System.out.println(params); + String paramsSign = DigestUtils.md5DigestAsHex(params.getBytes()).toUpperCase(); +// log.info("客户端上传内容加密后的签名结果: {}", paramsSign); + System.out.println(paramsSign); + return requestHeader.getSign().equals(paramsSign); + } +} diff --git a/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/WebUtils.java b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/WebUtils.java new file mode 100644 index 0000000..1165314 --- /dev/null +++ b/safespringboot/safespringboot/src/main/java/com/woniu/datasourcedemo/util/WebUtils.java @@ -0,0 +1,39 @@ +package com.woniu.datasourcedemo.util; + + +import com.alibaba.fastjson.JSON; +import com.woniu.datasourcedemo.model.ResultData; + +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; + +public class WebUtils { + + + /** + * 返回json数据 + * + * @param response + * @param object + */ + public static void writeJson(HttpServletResponse response, ResultData object) { + response.setHeader("Content-Type", "application/json;charset=UTF-8"); + response.setContentType("application/json;charset=UTF-8"); + PrintWriter out = null; + try { + String data = JSON.toJSONString(object); + out = response.getWriter(); + out.print(data); + out.flush(); + } catch (Exception e) { + + } finally { + if (out != null) { + out.close(); + } + } + } + + + +} diff --git a/safespringboot/safespringboot/src/main/resources/application.yml b/safespringboot/safespringboot/src/main/resources/application.yml new file mode 100644 index 0000000..e28200d --- /dev/null +++ b/safespringboot/safespringboot/src/main/resources/application.yml @@ -0,0 +1,29 @@ +#spring: +# datasource: +# dynamic: +# primary: ds1 #设置默认的数据源或者数据源组,默认值即为master +# strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源 +# datasource: +# ds1: +# url: jdbc:mysql://localhost:3306/ds1database +# username: root +# password: 123456 +# driver-class-name: com.mysql.cj.jdbc.Driver # 3.2.0开始支持SPI可省略此配置 +# ds2: +# url: jdbc:mysql://localhost:3306/ds2database +# username: root +# password: 123456 +# driver-class-name: com.mysql.cj.jdbc.Driver + +#mybatis: +# mapper-locations: +# classpath:mapper/*.xml +spring: + redis: + host: 192.168.56.10 + port: 6379 + password: 123456 + timeout: 6000ms # 连接超时时长(毫秒) + +sign: + maxTime: 60 diff --git a/safespringboot/safespringboot/src/main/resources/templates/test.json b/safespringboot/safespringboot/src/main/resources/templates/test.json new file mode 100644 index 0000000..d3a78c6 --- /dev/null +++ b/safespringboot/safespringboot/src/main/resources/templates/test.json @@ -0,0 +1,5 @@ +{ + "name": "张三", + "age": 20, + "gender": 1 +}