├── .idea ├── .gitignore ├── compiler.xml ├── encodings.xml ├── jarRepositories.xml ├── libraries │ ├── Maven__ch_qos_logback_logback_classic_1_2_3.xml │ ├── Maven__ch_qos_logback_logback_core_1_2_3.xml │ ├── Maven__com_alibaba_fastjson_1_2_78.xml │ ├── Maven__com_carrotsearch_hppc_0_7_1.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_dataformat_jackson_dataformat_cbor_2_9_8.xml │ ├── Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_smile_2_9_8.xml │ ├── Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_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_github_penggle_kaptcha_2_3_2.xml │ ├── Maven__com_github_spullara_mustache_java_compiler_0_9_3.xml │ ├── Maven__com_jayway_jsonpath_json_path_2_4_0.xml │ ├── Maven__com_jhlabs_filters_2_0_235_1.xml │ ├── Maven__com_sun_mail_javax_mail_1_6_2.xml │ ├── Maven__com_tdunning_t_digest_3_2.xml │ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml │ ├── Maven__com_zaxxer_HikariCP_3_2_0.xml │ ├── Maven__commons_codec_commons_codec_1_11.xml │ ├── Maven__io_lettuce_lettuce_core_5_1_6_RELEASE.xml │ ├── Maven__io_netty_netty_buffer_4_1_36_Final.xml │ ├── Maven__io_netty_netty_codec_4_1_36_Final.xml │ ├── Maven__io_netty_netty_codec_http_4_1_36_Final.xml │ ├── Maven__io_netty_netty_common_4_1_36_Final.xml │ ├── Maven__io_netty_netty_handler_4_1_36_Final.xml │ ├── Maven__io_netty_netty_resolver_4_1_36_Final.xml │ ├── Maven__io_netty_netty_transport_4_1_36_Final.xml │ ├── Maven__io_projectreactor_reactor_core_3_2_9_RELEASE.xml │ ├── Maven__javax_activation_activation_1_1.xml │ ├── Maven__javax_activation_javax_activation_api_1_2_0.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_xml_bind_jaxb_api_2_3_1.xml │ ├── Maven__joda_time_joda_time_2_10_2.xml │ ├── Maven__junit_junit_4_12.xml │ ├── Maven__mysql_mysql_connector_java_8_0_16.xml │ ├── Maven__net_bytebuddy_byte_buddy_1_9_12.xml │ ├── Maven__net_bytebuddy_byte_buddy_agent_1_9_12.xml │ ├── Maven__net_minidev_accessors_smart_1_2.xml │ ├── Maven__net_minidev_json_smart_2_3.xml │ ├── Maven__net_sf_jopt_simple_jopt_simple_5_0_2.xml │ ├── Maven__org_apache_commons_commons_lang3_3_12_0.xml │ ├── Maven__org_apache_httpcomponents_httpasyncclient_4_1_4.xml │ ├── Maven__org_apache_httpcomponents_httpclient_4_5_8.xml │ ├── Maven__org_apache_httpcomponents_httpcore_4_4_11.xml │ ├── Maven__org_apache_httpcomponents_httpcore_nio_4_4_11.xml │ ├── Maven__org_apache_kafka_kafka_clients_2_0_1.xml │ ├── Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml │ ├── Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xml │ ├── Maven__org_apache_lucene_lucene_analyzers_common_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_backward_codecs_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_core_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_grouping_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_highlighter_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_join_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_memory_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_misc_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_queries_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_queryparser_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_sandbox_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_spatial3d_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_spatial_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_spatial_extras_7_4_0.xml │ ├── Maven__org_apache_lucene_lucene_suggest_7_4_0.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_19.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_19.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_19.xml │ ├── Maven__org_aspectj_aspectjweaver_1_9_4.xml │ ├── Maven__org_assertj_assertj_core_3_11_1.xml │ ├── Maven__org_attoparser_attoparser_2_0_5_RELEASE.xml │ ├── Maven__org_elasticsearch_client_elasticsearch_rest_client_6_4_3.xml │ ├── Maven__org_elasticsearch_client_transport_6_4_3.xml │ ├── Maven__org_elasticsearch_elasticsearch_6_4_3.xml │ ├── Maven__org_elasticsearch_elasticsearch_cli_6_4_3.xml │ ├── Maven__org_elasticsearch_elasticsearch_core_6_4_3.xml │ ├── Maven__org_elasticsearch_elasticsearch_secure_sm_6_4_3.xml │ ├── Maven__org_elasticsearch_elasticsearch_x_content_6_4_3.xml │ ├── Maven__org_elasticsearch_jna_4_5_1.xml │ ├── Maven__org_elasticsearch_plugin_lang_mustache_client_6_4_3.xml │ ├── Maven__org_elasticsearch_plugin_parent_join_client_6_4_3.xml │ ├── Maven__org_elasticsearch_plugin_percolator_client_6_4_3.xml │ ├── Maven__org_elasticsearch_plugin_rank_eval_client_6_4_3.xml │ ├── Maven__org_elasticsearch_plugin_reindex_client_6_4_3.xml │ ├── Maven__org_elasticsearch_plugin_transport_netty4_client_6_4_3.xml │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ ├── Maven__org_hamcrest_hamcrest_library_1_3.xml │ ├── Maven__org_hdrhistogram_HdrHistogram_2_1_9.xml │ ├── Maven__org_hibernate_validator_hibernate_validator_6_0_16_Final.xml │ ├── Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml │ ├── Maven__org_lz4_lz4_java_1_4_1.xml │ ├── Maven__org_mockito_mockito_core_2_23_4.xml │ ├── Maven__org_mybatis_mybatis_3_5_7.xml │ ├── Maven__org_mybatis_mybatis_spring_2_0_6.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_2_0.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_2_0.xml │ ├── Maven__org_objenesis_objenesis_2_6.xml │ ├── Maven__org_ow2_asm_asm_5_0_4.xml │ ├── Maven__org_reactivestreams_reactive_streams_1_0_2.xml │ ├── Maven__org_skyscreamer_jsonassert_1_5_0.xml │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_26.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_26.xml │ ├── Maven__org_springframework_boot_spring_boot_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_aop_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_data_elasticsearch_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_data_redis_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_jdbc_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_json_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_mail_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_test_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_thymeleaf_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_web_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_test_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_5_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_commons_2_1_8_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_elasticsearch_3_1_8_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_keyvalue_2_1_8_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_redis_2_1_8_RELEASE.xml │ ├── Maven__org_springframework_kafka_spring_kafka_2_2_6_RELEASE.xml │ ├── Maven__org_springframework_retry_spring_retry_1_2_4_RELEASE.xml │ ├── Maven__org_springframework_spring_aop_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_beans_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_context_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_context_support_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_core_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_expression_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_jcl_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_jdbc_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_messaging_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_oxm_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_test_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_tx_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_web_5_1_7_RELEASE.xml │ ├── Maven__org_springframework_spring_webmvc_5_1_7_RELEASE.xml │ ├── Maven__org_thymeleaf_extras_thymeleaf_extras_java8time_3_0_4_RELEASE.xml │ ├── Maven__org_thymeleaf_thymeleaf_3_0_11_RELEASE.xml │ ├── Maven__org_thymeleaf_thymeleaf_spring5_3_0_11_RELEASE.xml │ ├── Maven__org_unbescape_unbescape_1_1_6_RELEASE.xml │ ├── Maven__org_xerial_snappy_snappy_java_1_1_7_1.xml │ ├── Maven__org_xmlunit_xmlunit_core_2_6_2.xml │ └── Maven__org_yaml_snakeyaml_1_23.xml ├── misc.xml ├── modules.xml ├── uiDesigner.xml └── workspace.xml ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── HELP.md ├── README.md ├── community.iml ├── community.sql ├── log └── community │ ├── log_error.log │ ├── log_info.log │ └── log_warn.log ├── mvnw ├── mvnw.cmd ├── pictureForExample ├── show1.jpg ├── show10.jpg ├── show2.jpg ├── show3.jpg ├── show4.jpg ├── show5.jpg ├── show6.jpg ├── show7.jpg ├── show8.jpg └── show9.jpg ├── pom.xml ├── src ├── main │ ├── java │ │ └── com │ │ │ └── zcx │ │ │ └── community │ │ │ ├── CommunityApplication.java │ │ │ ├── annotation │ │ │ └── LoginRequired.java │ │ │ ├── aspect │ │ │ ├── AlphaAspect.java │ │ │ └── ServiceLogAspect.java │ │ │ ├── config │ │ │ ├── AlphaConfig.java │ │ │ ├── KaptchaConfig.java │ │ │ ├── RedisConfig.java │ │ │ └── WebMvcConfig.java │ │ │ ├── controller │ │ │ ├── AlphaController.java │ │ │ ├── CommentController.java │ │ │ ├── DiscussPostController.java │ │ │ ├── FollowController.java │ │ │ ├── HomeController.java │ │ │ ├── IndexController.java │ │ │ ├── LikeController.java │ │ │ ├── LoginController.java │ │ │ ├── MessageController.java │ │ │ ├── SearchController.java │ │ │ ├── UserController.java │ │ │ ├── advice │ │ │ │ └── ExceptionAdvice.java │ │ │ └── interceptor │ │ │ │ ├── AlphaInterceptor.java │ │ │ │ ├── LoginRequiredInterceptor.java │ │ │ │ ├── LoginTicketInterceptor.java │ │ │ │ └── MessageInterceptor.java │ │ │ ├── dao │ │ │ ├── AlphaDao.java │ │ │ ├── CommentMapper.java │ │ │ ├── DiscussPostMapper.java │ │ │ ├── LoginTicketMapper.java │ │ │ ├── MessageMapper.java │ │ │ ├── UserMapper.java │ │ │ ├── elasticsearch │ │ │ │ └── DiscussPostRepository.java │ │ │ └── impl │ │ │ │ ├── AlphaDaoImpl.java │ │ │ │ └── AnotherAlphaDaoImpl.java │ │ │ ├── entity │ │ │ ├── Comment.java │ │ │ ├── DiscussPost.java │ │ │ ├── Event.java │ │ │ ├── LoginTicket.java │ │ │ ├── Message.java │ │ │ ├── Page.java │ │ │ └── User.java │ │ │ ├── event │ │ │ ├── EventConsumer.java │ │ │ └── EventProducer.java │ │ │ ├── service │ │ │ ├── AlphaService.java │ │ │ ├── CommentService.java │ │ │ ├── DiscussPostService.java │ │ │ ├── ElasticsearchService.java │ │ │ ├── FollowService.java │ │ │ ├── LikeService.java │ │ │ ├── MessageService.java │ │ │ └── UserService.java │ │ │ └── util │ │ │ ├── CommunityConstants.java │ │ │ ├── CommunityUtils.java │ │ │ ├── CookieUtil.java │ │ │ ├── HostHolder.java │ │ │ ├── MailClient.java │ │ │ ├── RedisKeyUtils.java │ │ │ └── SensitiveFilter.java │ └── resources │ │ ├── application.properties │ │ ├── logback-spring.xml │ │ ├── mapper │ │ ├── CommentMapper.xml │ │ ├── DiscussPostMapper.xml │ │ ├── MessageMapper.xml │ │ └── UserMapper.xml │ │ ├── sensitive-words.txt │ │ ├── static │ │ ├── css │ │ │ ├── discuss-detail.css │ │ │ ├── global.css │ │ │ ├── letter.css │ │ │ └── login.css │ │ ├── html │ │ │ ├── ajax-demo.html │ │ │ └── student.html │ │ ├── img │ │ │ ├── 404.png │ │ │ ├── captcha.png │ │ │ └── error.png │ │ └── js │ │ │ ├── discuss.js │ │ │ ├── global.js │ │ │ ├── index.js │ │ │ ├── letter.js │ │ │ ├── profile.js │ │ │ └── register.js │ │ └── templates │ │ ├── demo │ │ └── view.html │ │ ├── error │ │ ├── 404.html │ │ └── 500.html │ │ ├── index.html │ │ ├── mail │ │ ├── activation.html │ │ ├── demo.html │ │ └── forget.html │ │ └── site │ │ ├── admin │ │ └── data.html │ │ ├── discuss-detail.html │ │ ├── followee.html │ │ ├── follower.html │ │ ├── forget.html │ │ ├── letter-detail.html │ │ ├── letter.html │ │ ├── login.html │ │ ├── my-post.html │ │ ├── my-reply.html │ │ ├── notice-detail.html │ │ ├── notice.html │ │ ├── operate-result.html │ │ ├── profile.html │ │ ├── register.html │ │ ├── search.html │ │ └── setting.html └── test │ └── java │ └── com │ └── zcx │ └── community │ ├── BlockingQueueTests.java │ ├── CommonTests.java │ ├── CommunityApplicationTests.java │ ├── ElasticsearchTests.java │ ├── KafkaTests.java │ ├── LoggerTests.java │ ├── MailTests.java │ ├── MapperTests.java │ ├── RedisTests.java │ ├── SensitiveTests.java │ └── TransactionTests.java └── upload ├── e4948202ce3542cab4c3223fdca3870e.jpg └── f4b0d3b5103242e69d8c64df28ba7263.jpg /.idea/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/.idea/.gitignore -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_fastjson_1_2_78.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_carrotsearch_hppc_0_7_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_classmate_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_cbor_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_smile_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_dataformat_jackson_dataformat_yaml_2_9_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_penggle_kaptcha_2_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_spullara_mustache_java_compiler_0_9_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jhlabs_filters_2_0_235_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_sun_mail_javax_mail_1_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_tdunning_t_digest_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_zaxxer_HikariCP_3_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_codec_commons_codec_1_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_lettuce_lettuce_core_5_1_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_netty_netty_buffer_4_1_36_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_netty_netty_codec_4_1_36_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_netty_netty_codec_http_4_1_36_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_netty_netty_common_4_1_36_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_netty_netty_handler_4_1_36_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_netty_netty_resolver_4_1_36_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_netty_netty_transport_4_1_36_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_projectreactor_reactor_core_3_2_9_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_activation_activation_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_activation_javax_activation_api_1_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_xml_bind_jaxb_api_2_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__joda_time_joda_time_2_10_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__mysql_mysql_connector_java_8_0_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_9_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_agent_1_9_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_minidev_accessors_smart_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_minidev_json_smart_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_sf_jopt_simple_jopt_simple_5_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_lang3_3_12_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpasyncclient_4_1_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_5_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_4_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpcore_nio_4_4_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_kafka_kafka_clients_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_11_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_logging_log4j_log4j_to_slf4j_2_11_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_analyzers_common_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_backward_codecs_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_core_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_grouping_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_highlighter_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_join_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_memory_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_misc_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_queries_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_queryparser_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_sandbox_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_spatial3d_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_spatial_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_spatial_extras_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_lucene_lucene_suggest_7_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_9_0_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_9_0_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_9_0_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_aspectj_aspectjweaver_1_9_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_assertj_assertj_core_3_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_attoparser_attoparser_2_0_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_client_elasticsearch_rest_client_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_client_transport_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_elasticsearch_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_elasticsearch_cli_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_elasticsearch_core_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_elasticsearch_secure_sm_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_elasticsearch_x_content_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_jna_4_5_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_plugin_lang_mustache_client_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_plugin_parent_join_client_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_plugin_percolator_client_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_plugin_rank_eval_client_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_plugin_reindex_client_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_elasticsearch_plugin_transport_netty4_client_6_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hdrhistogram_HdrHistogram_2_1_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_validator_hibernate_validator_6_0_16_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_lz4_lz4_java_1_4_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mockito_mockito_core_2_23_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_3_5_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_spring_2_0_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_2_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_2_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_objenesis_objenesis_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ow2_asm_asm_5_0_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_reactivestreams_reactive_streams_1_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_skyscreamer_jsonassert_1_5_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_26.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_aop_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_elasticsearch_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_data_redis_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_jdbc_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_json_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_mail_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_thymeleaf_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_test_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_2_1_5_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_commons_2_1_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_elasticsearch_3_1_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_keyvalue_2_1_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_redis_2_1_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_kafka_spring_kafka_2_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_retry_spring_retry_1_2_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_aop_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_support_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jcl_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jdbc_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_messaging_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_oxm_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_test_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_tx_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_5_1_7_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_extras_thymeleaf_extras_java8time_3_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_thymeleaf_3_0_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_thymeleaf_thymeleaf_spring5_3_0_11_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_unbescape_unbescape_1_1_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_xerial_snappy_snappy_java_1_1_7_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_6_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_yaml_snakeyaml_1_23.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /HELP.md: -------------------------------------------------------------------------------- 1 | # Getting Started 2 | 3 | ### Reference Documentation 4 | For further reference, please consider the following sections: 5 | 6 | * [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) 7 | * [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.4.11/maven-plugin/reference/html/) 8 | * [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.4.11/maven-plugin/reference/html/#build-image) 9 | * [Spring Web](https://docs.spring.io/spring-boot/docs/2.5.5/reference/htmlsingle/#boot-features-developing-web-applications) 10 | * [Thymeleaf](https://docs.spring.io/spring-boot/docs/2.5.5/reference/htmlsingle/#boot-features-spring-mvc-template-engines) 11 | * [Spring Boot DevTools](https://docs.spring.io/spring-boot/docs/2.5.5/reference/htmlsingle/#using-boot-devtools) 12 | 13 | ### Guides 14 | The following guides illustrate how to use some features concretely: 15 | 16 | * [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) 17 | * [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) 18 | * [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) 19 | * [Handling Form Submission](https://spring.io/guides/gs/handling-form-submission/) 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > **写在前面的话:该项目是牛客职导的Java高薪面试项目。有Redis、Zookeeper、Kafka、ElasticSearch等中间件的使用。配置较多,不能直接部署运行,需要参照原教学视频全部配置正确后才能启动运行。** 2 | ## 以牛客为原型的社区开发 3 | *** 4 | > **启动前请认真修改application.properties中的相关配置信息以及logback-spring.xml中的日志文件夹的路径** 5 | 1. **本项目涉及各种中间件的使用,部署启动成本高,不适合“拿来即用”。** 6 | 2. **本项目主要面向Java后端开发者,前端以模板引擎Thymeleaf为主。** 7 | 3. **本项目使用第三方smtp服务器来发送邮件。** 8 | 4. **本项目使用非关系型数据库Redis来缓存频繁修改的数据。** 9 | 5. **本项目使用aop来记录用户的操作日志。** 10 | 6. **本项目使用Zookeeper注册中心和Kafka消息队列来发送和接收系统通知信息。** 11 | 7. **本项目使用分布式搜索引擎ElasticSearch来存储帖子信息,并对帖子信息进行分词搜索。** 12 | 8. **本项目涉及了SpringBoot各种高级开发技巧的使用。** 13 | 9. **本项目使用“前缀树”算法来过滤敏感词。** 14 | 10. **项目的配套课程有40个小时之多,而且老师着重于关键功能模块的代码教学。这意味着只跟着老师敲完课程里的代码的话,项目的总体结构就会显得十分的不完整和不连贯,可以说是漏洞百出。当然如果你仅仅是来学习关键功能模块设计和实现的话这都可以忽略。由于个人强迫症的原因,总想把一个项目写的尽善尽美,因此我已经竭尽所能完善项目的所有基本功能,特别是老师没讲到而现实又需要的。** 15 | > **注:基于个人实际需求只完成了前六章的所有内容。** 16 | *** 17 | > **[牛客网在线课程](https://www.nowcoder.com/courses/cover/live/246)** 18 | *** 19 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show1.jpg) 20 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show2.jpg) 21 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show3.jpg) 22 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show4.jpg) 23 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show5.jpg) 24 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show6.jpg) 25 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show7.jpg) 26 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show8.jpg) 27 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show9.jpg) 28 | ![示例图片](https://github.com/DragonLog/community/blob/main/pictureForExample/show10.jpg) -------------------------------------------------------------------------------- /log/community/log_error.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/log/community/log_error.log -------------------------------------------------------------------------------- /log/community/log_warn.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/log/community/log_warn.log -------------------------------------------------------------------------------- /pictureForExample/show1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show1.jpg -------------------------------------------------------------------------------- /pictureForExample/show10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show10.jpg -------------------------------------------------------------------------------- /pictureForExample/show2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show2.jpg -------------------------------------------------------------------------------- /pictureForExample/show3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show3.jpg -------------------------------------------------------------------------------- /pictureForExample/show4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show4.jpg -------------------------------------------------------------------------------- /pictureForExample/show5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show5.jpg -------------------------------------------------------------------------------- /pictureForExample/show6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show6.jpg -------------------------------------------------------------------------------- /pictureForExample/show7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show7.jpg -------------------------------------------------------------------------------- /pictureForExample/show8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show8.jpg -------------------------------------------------------------------------------- /pictureForExample/show9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/pictureForExample/show9.jpg -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/CommunityApplication.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | import javax.annotation.PostConstruct; 7 | 8 | @SpringBootApplication 9 | public class CommunityApplication { 10 | 11 | @PostConstruct 12 | public void init() { 13 | System.setProperty("es.set.netty.runtime.available.processors", "false"); 14 | } 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(CommunityApplication.class, args); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/annotation/LoginRequired.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | public @interface LoginRequired { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/aspect/AlphaAspect.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.aspect; 2 | 3 | import org.aspectj.lang.ProceedingJoinPoint; 4 | import org.aspectj.lang.annotation.*; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | @Aspect 9 | public class AlphaAspect { 10 | 11 | @Pointcut("execution(* com.zcx.community.service.*.*(..))") 12 | public void pointcut() { 13 | } 14 | 15 | @Before("pointcut()") 16 | public void before() { 17 | System.out.println("before"); 18 | } 19 | 20 | @After("pointcut()") 21 | public void after() { 22 | System.out.println("after"); 23 | } 24 | 25 | @AfterReturning("pointcut()") 26 | public void afterReturning() { 27 | System.out.println("afterReturning"); 28 | } 29 | 30 | @AfterThrowing("pointcut()") 31 | public void afterThrowing() { 32 | System.out.println("afterThrowing"); 33 | } 34 | 35 | @Around("pointcut()") 36 | public Object around(ProceedingJoinPoint joinPoint) throws Throwable { 37 | System.out.println("around before"); 38 | Object object = joinPoint.proceed(); 39 | System.out.println("around after"); 40 | return object; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/aspect/ServiceLogAspect.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.aspect; 2 | 3 | import org.aspectj.lang.JoinPoint; 4 | import org.aspectj.lang.annotation.Aspect; 5 | import org.aspectj.lang.annotation.Before; 6 | import org.aspectj.lang.annotation.Pointcut; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | import org.springframework.stereotype.Component; 10 | import org.springframework.web.context.request.RequestContextHolder; 11 | import org.springframework.web.context.request.ServletRequestAttributes; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import java.text.SimpleDateFormat; 15 | import java.util.Date; 16 | 17 | @Component 18 | @Aspect 19 | public class ServiceLogAspect { 20 | 21 | private static final Logger logger = LoggerFactory.getLogger(ServiceLogAspect.class); 22 | 23 | @Pointcut("execution(* com.zcx.community.service.*.*(..))") 24 | public void pointcut() { 25 | } 26 | 27 | @Before("pointcut()") 28 | public void before(JoinPoint joinPoint) { 29 | ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); 30 | if (attributes == null) { 31 | return; 32 | } 33 | HttpServletRequest request = attributes.getRequest(); 34 | String ip = request.getRemoteHost(); 35 | String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); 36 | final String target = joinPoint.getSignature().getDeclaringTypeName() + "." + joinPoint.getSignature().getName(); 37 | logger.info(String.format("用户[%s],在[%s],访问了[%s].", ip, now, target)); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/config/AlphaConfig.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | import java.text.SimpleDateFormat; 7 | 8 | @Configuration 9 | public class AlphaConfig { 10 | 11 | @Bean 12 | public SimpleDateFormat simpleDateFormat() { 13 | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/config/KaptchaConfig.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.config; 2 | 3 | import com.google.code.kaptcha.Producer; 4 | import com.google.code.kaptcha.impl.DefaultKaptcha; 5 | import com.google.code.kaptcha.util.Config; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | 9 | import java.util.Properties; 10 | 11 | @Configuration 12 | public class KaptchaConfig { 13 | 14 | @Bean 15 | public Producer kaptchaProducer() { 16 | Properties properties = new Properties(); 17 | properties.setProperty("kaptcha.image.width", "100"); 18 | properties.setProperty("kaptcha.image.height", "40"); 19 | properties.setProperty("kaptcha.textproducer.font.size", "32"); 20 | properties.setProperty("kaptcha.textproducer.font.color", "0,0,0"); 21 | properties.setProperty("kaptcha.textproducer.char.string", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"); 22 | properties.setProperty("kaptcha.textproducer.char.length", "4"); 23 | properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise"); 24 | DefaultKaptcha kaptcha = new DefaultKaptcha(); 25 | Config config = new Config(properties); 26 | kaptcha.setConfig(config); 27 | return kaptcha; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.data.redis.connection.RedisConnectionFactory; 6 | import org.springframework.data.redis.core.RedisTemplate; 7 | import org.springframework.data.redis.serializer.RedisSerializer; 8 | 9 | @Configuration 10 | public class RedisConfig { 11 | 12 | @Bean 13 | public RedisTemplate redisTemplate(RedisConnectionFactory redisConnectionFactory) { 14 | RedisTemplate redisTemplate = new RedisTemplate<>(); 15 | redisTemplate.setConnectionFactory(redisConnectionFactory); 16 | redisTemplate.setKeySerializer(RedisSerializer.string()); 17 | redisTemplate.setValueSerializer(RedisSerializer.json()); 18 | redisTemplate.setHashKeySerializer(RedisSerializer.string()); 19 | redisTemplate.setHashValueSerializer(RedisSerializer.json()); 20 | redisTemplate.afterPropertiesSet(); 21 | return redisTemplate; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/config/WebMvcConfig.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.config; 2 | 3 | import com.zcx.community.controller.interceptor.AlphaInterceptor; 4 | import com.zcx.community.controller.interceptor.LoginRequiredInterceptor; 5 | import com.zcx.community.controller.interceptor.LoginTicketInterceptor; 6 | import com.zcx.community.controller.interceptor.MessageInterceptor; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 10 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; 11 | 12 | @Configuration 13 | public class WebMvcConfig implements WebMvcConfigurer { 14 | 15 | @Autowired 16 | private AlphaInterceptor alphaInterceptor; 17 | 18 | @Autowired 19 | private LoginTicketInterceptor loginTicketInterceptor; 20 | 21 | @Autowired 22 | private LoginRequiredInterceptor loginRequiredInterceptor; 23 | 24 | @Autowired 25 | private MessageInterceptor messageInterceptor; 26 | 27 | @Override 28 | public void addInterceptors(InterceptorRegistry registry) { 29 | registry.addInterceptor(alphaInterceptor) 30 | .excludePathPatterns("/**/*.css", "/**/*.js", "/**/*.png", "/**/*.jpg", "/**/*.jpeg", "/**/*.html") 31 | .addPathPatterns("/register", "/login"); 32 | 33 | registry.addInterceptor(loginTicketInterceptor) 34 | .excludePathPatterns("/**/*.css", "/**/*.js", "/**/*.png", "/**/*.jpg", "/**/*.jpeg", "/**/*.html"); 35 | 36 | registry.addInterceptor(loginRequiredInterceptor) 37 | .excludePathPatterns("/**/*.css", "/**/*.js", "/**/*.png", "/**/*.jpg", "/**/*.jpeg", "/**/*.html"); 38 | 39 | registry.addInterceptor(messageInterceptor) 40 | .excludePathPatterns("/**/*.css", "/**/*.js", "/**/*.png", "/**/*.jpg", "/**/*.jpeg", "/**/*.html"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller; 2 | 3 | import com.zcx.community.entity.DiscussPost; 4 | import com.zcx.community.entity.Page; 5 | import com.zcx.community.service.DiscussPostService; 6 | import com.zcx.community.service.LikeService; 7 | import com.zcx.community.service.UserService; 8 | import com.zcx.community.util.CommunityConstants; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.Model; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | 14 | 15 | import java.util.*; 16 | 17 | @Controller 18 | public class HomeController implements CommunityConstants { 19 | 20 | @Autowired 21 | private DiscussPostService discussPostService; 22 | 23 | @Autowired 24 | private UserService userService; 25 | 26 | @Autowired 27 | private LikeService likeService; 28 | 29 | @GetMapping(value = "/index") 30 | public String getIndexPage(Model model, Page page) { 31 | page.setLimit(5); 32 | page.setRows(discussPostService.findDiscussPostRows(0)); 33 | page.setPath("/index"); 34 | List list = discussPostService.findDiscussPosts(0, page.getOffset(), page.getLimit()); 35 | List> discussPosts = new ArrayList<>(); 36 | if (list != null) { 37 | for (DiscussPost post: list) { 38 | Map map = new HashMap<>(); 39 | map.put("post", post); 40 | map.put("user", userService.findUserById(post.getUserId())); 41 | long likeCount = likeService.findEntityLikeCount(ENTITY_TYPE_POST, post.getId()); 42 | map.put("likeCount", likeCount); 43 | discussPosts.add(map); 44 | } 45 | } 46 | model.addAttribute("discussPosts", discussPosts); 47 | return "/index"; 48 | } 49 | 50 | @GetMapping("/error") 51 | public String getErrorPage() { 52 | return "/error/500"; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/IndexController.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | @Controller 8 | @RequestMapping("/") 9 | public class IndexController { 10 | 11 | @GetMapping 12 | public String index() { 13 | return "forward:/index"; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/LikeController.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller; 2 | 3 | import com.zcx.community.entity.Event; 4 | import com.zcx.community.entity.User; 5 | import com.zcx.community.event.EventProducer; 6 | import com.zcx.community.service.LikeService; 7 | import com.zcx.community.util.CommunityConstants; 8 | import com.zcx.community.util.CommunityUtils; 9 | import com.zcx.community.util.HostHolder; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.PostMapping; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | 15 | import java.util.HashMap; 16 | import java.util.Map; 17 | 18 | @Controller 19 | public class LikeController implements CommunityConstants { 20 | 21 | @Autowired 22 | private EventProducer eventProducer; 23 | 24 | @Autowired 25 | private LikeService likeService; 26 | 27 | @Autowired 28 | private HostHolder hostHolder; 29 | 30 | @PostMapping("/like") 31 | @ResponseBody 32 | public String like(int entityType, int entityId, int entityUserId, int postId) { 33 | User user = hostHolder.getUser(); 34 | if (user == null) { 35 | return CommunityUtils.getJSONString(-1, "没有登录", null); 36 | } 37 | likeService.like(user.getId(), entityType, entityId, entityUserId); 38 | long likeCount = likeService.findEntityLikeCount(entityType, entityId); 39 | int likeStatus = likeService.findEntityLikeStatus(user.getId(), entityType, entityId); 40 | Map map = new HashMap<>(); 41 | map.put("likeCount", likeCount); 42 | map.put("likeStatus", likeStatus); 43 | 44 | if (likeStatus == 1 && user.getId() != entityUserId) { 45 | Event event = new Event() 46 | .setTopic(TOPIC_LIKE) 47 | .setUserId(hostHolder.getUser().getId()) 48 | .setEntityType(entityType) 49 | .setEntityId(entityId) 50 | .setEntityUserId(entityUserId) 51 | .setData("postId", postId); 52 | eventProducer.fireEvent(event); 53 | } 54 | return CommunityUtils.getJSONString(0, null, map); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/SearchController.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller; 2 | 3 | import com.zcx.community.entity.DiscussPost; 4 | import com.zcx.community.entity.Page; 5 | import com.zcx.community.service.ElasticsearchService; 6 | import com.zcx.community.service.LikeService; 7 | import com.zcx.community.service.UserService; 8 | import com.zcx.community.util.CommunityConstants; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.Model; 12 | import org.springframework.web.bind.annotation.GetMapping; 13 | 14 | import java.util.ArrayList; 15 | import java.util.HashMap; 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | @Controller 20 | public class SearchController implements CommunityConstants { 21 | 22 | @Autowired 23 | private ElasticsearchService elasticsearchService; 24 | 25 | @Autowired 26 | private UserService userService; 27 | 28 | @Autowired 29 | private LikeService likeService; 30 | 31 | @GetMapping("/search") 32 | public String search(String keyword, Page page, Model model) { 33 | page.setLimit(5); 34 | org.springframework.data.domain.Page searchResult = elasticsearchService.searchDiscussPost(keyword, page.getCurrent() - 1, page.getLimit()); 35 | List> discussPosts = new ArrayList<>(); 36 | if (searchResult != null) { 37 | for (DiscussPost post : searchResult) { 38 | Map map = new HashMap<>(); 39 | map.put("post", post); 40 | map.put("user", userService.findUserById(post.getUserId())); 41 | map.put("likeCount", likeService.findEntityLikeCount(ENTITY_TYPE_POST, post.getId())); 42 | discussPosts.add(map); 43 | } 44 | } 45 | model.addAttribute("discussPosts", discussPosts); 46 | model.addAttribute("keyword", keyword); 47 | page.setPath("/search?keyword=" + keyword); 48 | page.setRows(searchResult == null ? 0 : (int) searchResult.getTotalElements()); 49 | return "/site/search"; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/advice/ExceptionAdvice.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller.advice; 2 | 3 | import com.zcx.community.util.CommunityUtils; 4 | import org.slf4j.Logger; 5 | import org.slf4j.LoggerFactory; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.ControllerAdvice; 8 | import org.springframework.web.bind.annotation.ExceptionHandler; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.io.IOException; 13 | import java.io.PrintWriter; 14 | 15 | @ControllerAdvice(annotations = Controller.class) 16 | public class ExceptionAdvice { 17 | 18 | private static final Logger logger = LoggerFactory.getLogger(ExceptionAdvice.class); 19 | 20 | @ExceptionHandler({Exception.class}) 21 | public void handleException(Exception e, HttpServletRequest request, HttpServletResponse response) throws IOException { 22 | logger.error("服务器发生异常:" + e.getMessage()); 23 | for (StackTraceElement stackTraceElement : e.getStackTrace()) { 24 | logger.error(stackTraceElement.toString()); 25 | } 26 | String xRequestedWith = request.getHeader("x-requested-with"); 27 | if ("XMLHttpRequest".equals(xRequestedWith)) { 28 | response.setContentType("application/plain;charset=utf-8"); 29 | PrintWriter writer = response.getWriter(); 30 | writer.write(CommunityUtils.getJSONString(-1, "服务器异常")); 31 | } else { 32 | response.sendRedirect(request.getContextPath() + "/error"); 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/interceptor/AlphaInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller.interceptor; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.stereotype.Component; 6 | import org.springframework.web.servlet.HandlerInterceptor; 7 | import org.springframework.web.servlet.ModelAndView; 8 | 9 | import javax.servlet.http.HttpServletRequest; 10 | import javax.servlet.http.HttpServletResponse; 11 | 12 | @Component 13 | public class AlphaInterceptor implements HandlerInterceptor { 14 | 15 | private static final Logger logger = LoggerFactory.getLogger(AlphaInterceptor.class); 16 | 17 | @Override 18 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 19 | logger.debug("preHandle: " + handler.toString()); 20 | return true; 21 | } 22 | 23 | @Override 24 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 25 | logger.debug("postHandle: " + handler.toString()); 26 | } 27 | 28 | @Override 29 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 30 | logger.debug("afterCompletion: " + handler.toString()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/interceptor/LoginRequiredInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller.interceptor; 2 | 3 | import com.zcx.community.annotation.LoginRequired; 4 | import com.zcx.community.util.HostHolder; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Component; 7 | import org.springframework.web.method.HandlerMethod; 8 | import org.springframework.web.servlet.HandlerInterceptor; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | import java.lang.reflect.Method; 13 | 14 | @Component 15 | public class LoginRequiredInterceptor implements HandlerInterceptor { 16 | 17 | @Autowired 18 | private HostHolder hostHolder; 19 | 20 | @Override 21 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 22 | if (handler instanceof HandlerMethod) { 23 | HandlerMethod handlerMethod = (HandlerMethod) handler; 24 | Method method = handlerMethod.getMethod(); 25 | LoginRequired loginRequired = method.getAnnotation(LoginRequired.class); 26 | if (loginRequired != null && hostHolder.getUser() == null) { 27 | response.sendRedirect(request.getContextPath() + "/login"); 28 | return false; 29 | } 30 | } 31 | return true; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/interceptor/LoginTicketInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller.interceptor; 2 | 3 | import com.zcx.community.entity.LoginTicket; 4 | import com.zcx.community.entity.User; 5 | import com.zcx.community.service.UserService; 6 | import com.zcx.community.util.CookieUtil; 7 | import com.zcx.community.util.HostHolder; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Component; 10 | import org.springframework.web.servlet.HandlerInterceptor; 11 | import org.springframework.web.servlet.ModelAndView; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | import javax.servlet.http.HttpServletResponse; 15 | import java.util.Date; 16 | 17 | @Component 18 | public class LoginTicketInterceptor implements HandlerInterceptor { 19 | 20 | @Autowired 21 | private UserService userService; 22 | 23 | @Autowired 24 | private HostHolder hostHolder; 25 | 26 | @Override 27 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 28 | String ticket = CookieUtil.getValue(request, "ticket"); 29 | if (ticket != null) { 30 | LoginTicket loginTicket = userService.findLoginTicket(ticket); 31 | if (loginTicket != null && loginTicket.getStatus() == 0 && loginTicket.getExpired().after(new Date())) { 32 | User user = userService.findUserById(loginTicket.getUserId()); 33 | hostHolder.setUser(user); 34 | } 35 | } 36 | return true; 37 | } 38 | 39 | @Override 40 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 41 | User user = hostHolder.getUser(); 42 | if (user != null && modelAndView != null) { 43 | modelAndView.addObject("loginUser", user); 44 | } 45 | } 46 | 47 | @Override 48 | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { 49 | hostHolder.clear(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/controller/interceptor/MessageInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.controller.interceptor; 2 | 3 | import com.zcx.community.entity.User; 4 | import com.zcx.community.service.MessageService; 5 | import com.zcx.community.util.HostHolder; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.web.servlet.HandlerInterceptor; 9 | import org.springframework.web.servlet.ModelAndView; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | 14 | @Component 15 | public class MessageInterceptor implements HandlerInterceptor { 16 | 17 | @Autowired 18 | private HostHolder hostHolder; 19 | 20 | @Autowired 21 | private MessageService messageService; 22 | 23 | @Override 24 | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { 25 | User user = hostHolder.getUser(); 26 | if (user != null && modelAndView != null) { 27 | int letterUnreadCount = messageService.findLetterUnreadCount(user.getId(), null); 28 | int noticeUnreadCount = messageService.findNoticeUnreadCount(user.getId(), null); 29 | modelAndView.addObject("allUnreadCount", letterUnreadCount + noticeUnreadCount); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/AlphaDao.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao; 2 | 3 | public interface AlphaDao { 4 | 5 | String select(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/CommentMapper.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao; 2 | 3 | import com.zcx.community.entity.Comment; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface CommentMapper { 11 | 12 | List selectCommentsByEntity(@Param("entityType") int entityType, @Param("entityId") int entityId, @Param("offset") int offset, @Param("limit") int limit); 13 | 14 | int selectCountByEntity(@Param("entityType") int entityType, @Param("entityId") int entityId); 15 | 16 | List selectCommentsByUserId(@Param("entityType") int entityType, @Param("userId") int userId, @Param("offset") int offset, @Param("limit") int limit); 17 | 18 | int selectCountByUserId(@Param("entityType") int entityType, @Param("userId") int userId); 19 | 20 | int insertComment(Comment comment); 21 | 22 | int deleteCommentById(@Param("id") int id); 23 | 24 | Comment selectCommentById(@Param("id") int id); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/DiscussPostMapper.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao; 2 | 3 | import com.zcx.community.entity.DiscussPost; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface DiscussPostMapper { 11 | 12 | List selectDiscussPosts(@Param("userId") int userId, @Param("offset") int offset, @Param("limit") int limit); 13 | 14 | int selectDiscussPostRows(@Param("userId") int userId); 15 | 16 | int insertDiscussPost(DiscussPost discussPost); 17 | 18 | DiscussPost selectDiscussPostById(@Param("id") int id); 19 | 20 | int updateCommentCount(@Param("id") int id, @Param("commentCount") int commentCount); 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/LoginTicketMapper.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao; 2 | 3 | import com.zcx.community.entity.LoginTicket; 4 | import org.apache.ibatis.annotations.*; 5 | 6 | 7 | @Mapper 8 | @Deprecated 9 | public interface LoginTicketMapper { 10 | 11 | @Insert({ 12 | "insert into login_ticket (user_id, ticket, status, expired) ", 13 | "values(#{userId}, #{ticket}, #{status}, #{expired})" 14 | }) 15 | @Options(keyProperty = "id") 16 | int insertLoginTicket(LoginTicket loginTicket); 17 | 18 | @Select({ 19 | "select id, user_id, ticket, status, expired ", 20 | "from login_ticket where ticket = #{ticket}" 21 | }) 22 | LoginTicket selectByTicket(@Param("ticket") String ticket); 23 | 24 | @Update({ 25 | "update login_ticket set status = #{status} where ticket = #{ticket}" 26 | }) 27 | int updateStatus(@Param("ticket") String ticket, @Param("status") int status); 28 | 29 | //将除本次登录以外的历史登录凭证都置为无效 30 | //作用:永远只能使用一个浏览器登录账号进行操作 31 | //事实证明功能冗余,多个浏览器可以登录同一个账号进行操作 32 | @Update({ 33 | "update login_ticket set status = 1 where user_id = #{userId} and ticket != #{ticket}" 34 | }) 35 | int updatePreviousLoginTicket(@Param("ticket") String ticket, @Param("userId") int userId); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/MessageMapper.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao; 2 | 3 | import com.zcx.community.entity.Message; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface MessageMapper { 11 | 12 | List selectConversations(@Param("userId") int userId, @Param("offset") int offset, @Param("limit") int limit); 13 | 14 | int selectConversationCount(@Param("userId") int userId); 15 | 16 | List selectLetters(@Param("conversationId") String conversationId, @Param("offset") int offset, @Param("limit") int limit); 17 | 18 | int selectLetterCount(@Param("conversationId") String conversationId); 19 | 20 | int selectLetterUnreadCount(@Param("userId") int userId, @Param("conversationId") String conversationId); 21 | 22 | int insertMessage(Message message); 23 | 24 | int updateStatus(@Param("ids") List ids, @Param("status") int status); 25 | 26 | int deleteLetterById(@Param("id") int id); 27 | 28 | Message selectLatestNotice(@Param("userId") int userId, @Param("topic") String topic); 29 | 30 | int selectNoticeCount(@Param("userId") int userId, @Param("topic") String topic); 31 | 32 | int selectNoticeUnreadCount(@Param("userId") int userId, @Param("topic") String topic); 33 | 34 | List selectNotices(@Param("userId") int userId, @Param("topic") String topic, @Param("offset") int offset, @Param("limit") int limit); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao; 2 | 3 | import com.zcx.community.entity.User; 4 | import org.apache.ibatis.annotations.Mapper; 5 | import org.apache.ibatis.annotations.Param; 6 | 7 | @Mapper 8 | public interface UserMapper { 9 | 10 | User selectById(@Param("id") int id); 11 | 12 | User selectByName(@Param("username") String username); 13 | 14 | User selectByEmail(@Param("email") String email); 15 | 16 | int insertUser(User user); 17 | 18 | int updateStatus(@Param("id") int id, @Param("status") int status); 19 | 20 | int updateHeader(@Param("id") int id, @Param("headerUrl") String headerUrl); 21 | 22 | int updatePassword(@Param("id") int id, @Param("password") String password); 23 | 24 | int deleteById(@Param("id") int id); 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/elasticsearch/DiscussPostRepository.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao.elasticsearch; 2 | 3 | import com.zcx.community.entity.DiscussPost; 4 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | @Repository 8 | public interface DiscussPostRepository extends ElasticsearchRepository { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/impl/AlphaDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao.impl; 2 | 3 | import com.zcx.community.dao.AlphaDao; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository 7 | public class AlphaDaoImpl implements AlphaDao { 8 | @Override 9 | public String select() { 10 | return "访问数据库"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/dao/impl/AnotherAlphaDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.dao.impl; 2 | 3 | import com.zcx.community.dao.AlphaDao; 4 | import org.springframework.context.annotation.Primary; 5 | import org.springframework.stereotype.Repository; 6 | 7 | //@Repository("AnotherAlphaDaoImpl") 8 | @Repository 9 | //@Primary 10 | public class AnotherAlphaDaoImpl implements AlphaDao { 11 | @Override 12 | public String select() { 13 | return "另一个方法访问数据库"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/entity/Comment.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class Comment { 6 | 7 | private int id; 8 | private int userId; 9 | private int entityType; 10 | private int entityId; 11 | private int targetId; 12 | private String content; 13 | private int status; 14 | private Date createTime; 15 | 16 | public Comment() { 17 | } 18 | 19 | public Comment(int id, int userId, int entityType, int entityId, int targetId, String content, int status, Date createTime) { 20 | this.id = id; 21 | this.userId = userId; 22 | this.entityType = entityType; 23 | this.entityId = entityId; 24 | this.targetId = targetId; 25 | this.content = content; 26 | this.status = status; 27 | this.createTime = createTime; 28 | } 29 | 30 | public int getId() { 31 | return id; 32 | } 33 | 34 | public void setId(int id) { 35 | this.id = id; 36 | } 37 | 38 | public int getUserId() { 39 | return userId; 40 | } 41 | 42 | public void setUserId(int userId) { 43 | this.userId = userId; 44 | } 45 | 46 | public int getEntityType() { 47 | return entityType; 48 | } 49 | 50 | public void setEntityType(int entityType) { 51 | this.entityType = entityType; 52 | } 53 | 54 | public int getEntityId() { 55 | return entityId; 56 | } 57 | 58 | public void setEntityId(int entityId) { 59 | this.entityId = entityId; 60 | } 61 | 62 | public int getTargetId() { 63 | return targetId; 64 | } 65 | 66 | public void setTargetId(int targetId) { 67 | this.targetId = targetId; 68 | } 69 | 70 | public String getContent() { 71 | return content; 72 | } 73 | 74 | public void setContent(String content) { 75 | this.content = content; 76 | } 77 | 78 | public int getStatus() { 79 | return status; 80 | } 81 | 82 | public void setStatus(int status) { 83 | this.status = status; 84 | } 85 | 86 | public Date getCreateTime() { 87 | return createTime; 88 | } 89 | 90 | public void setCreateTime(Date createTime) { 91 | this.createTime = createTime; 92 | } 93 | 94 | @Override 95 | public String toString() { 96 | return "Comment{" + 97 | "id=" + id + 98 | ", userId=" + userId + 99 | ", entityType=" + entityType + 100 | ", entityId=" + entityId + 101 | ", targetId=" + targetId + 102 | ", content='" + content + '\'' + 103 | ", status=" + status + 104 | ", createTime=" + createTime + 105 | '}'; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/entity/Event.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.entity; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class Event { 7 | 8 | private String topic; 9 | private int userId; 10 | private int entityType; 11 | private int entityId; 12 | private int entityUserId; 13 | private Map data = new HashMap<>(); 14 | 15 | public Event() { 16 | } 17 | 18 | public Event(String topic, int userId, int entityType, int entityId, int entityUserId, Map data) { 19 | this.topic = topic; 20 | this.userId = userId; 21 | this.entityType = entityType; 22 | this.entityId = entityId; 23 | this.entityUserId = entityUserId; 24 | this.data = data; 25 | } 26 | 27 | public String getTopic() { 28 | return topic; 29 | } 30 | 31 | public int getUserId() { 32 | return userId; 33 | } 34 | 35 | public int getEntityType() { 36 | return entityType; 37 | } 38 | 39 | public int getEntityId() { 40 | return entityId; 41 | } 42 | 43 | public int getEntityUserId() { 44 | return entityUserId; 45 | } 46 | 47 | public Map getData() { 48 | return data; 49 | } 50 | 51 | public Event setTopic(String topic) { 52 | this.topic = topic; 53 | return this; 54 | } 55 | 56 | public Event setUserId(int userId) { 57 | this.userId = userId; 58 | return this; 59 | } 60 | 61 | public Event setEntityType(int entityType) { 62 | this.entityType = entityType; 63 | return this; 64 | } 65 | 66 | public Event setEntityId(int entityId) { 67 | this.entityId = entityId; 68 | return this; 69 | } 70 | 71 | public Event setEntityUserId(int entityUserId) { 72 | this.entityUserId = entityUserId; 73 | return this; 74 | } 75 | 76 | public Event setData(String key, Object value) { 77 | this.data.put(key, value); 78 | return this; 79 | } 80 | 81 | @Override 82 | public String toString() { 83 | return "Event{" + 84 | "topic='" + topic + '\'' + 85 | ", userId=" + userId + 86 | ", entityType=" + entityType + 87 | ", entityId=" + entityId + 88 | ", entityUserId=" + entityUserId + 89 | ", data=" + data + 90 | '}'; 91 | } 92 | 93 | 94 | } 95 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/entity/LoginTicket.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class LoginTicket { 6 | 7 | private int id; 8 | private int userId; 9 | private String ticket; 10 | private int status; 11 | private Date expired; 12 | 13 | public LoginTicket() { 14 | } 15 | 16 | public LoginTicket(int id, int userId, String ticket, int status, Date expired) { 17 | this.id = id; 18 | this.userId = userId; 19 | this.ticket = ticket; 20 | this.status = status; 21 | this.expired = expired; 22 | } 23 | 24 | public int getId() { 25 | return id; 26 | } 27 | 28 | public void setId(int id) { 29 | this.id = id; 30 | } 31 | 32 | public int getUserId() { 33 | return userId; 34 | } 35 | 36 | public void setUserId(int userId) { 37 | this.userId = userId; 38 | } 39 | 40 | public String getTicket() { 41 | return ticket; 42 | } 43 | 44 | public void setTicket(String ticket) { 45 | this.ticket = ticket; 46 | } 47 | 48 | public int getStatus() { 49 | return status; 50 | } 51 | 52 | public void setStatus(int status) { 53 | this.status = status; 54 | } 55 | 56 | public Date getExpired() { 57 | return expired; 58 | } 59 | 60 | public void setExpired(Date expired) { 61 | this.expired = expired; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return "LoginTicket{" + 67 | "id=" + id + 68 | ", userId=" + userId + 69 | ", ticket='" + ticket + '\'' + 70 | ", status=" + status + 71 | ", expired=" + expired + 72 | '}'; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/entity/Message.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class Message { 6 | 7 | private int id; 8 | private int fromId; 9 | private int toId; 10 | private String conversationId; 11 | private String content; 12 | private int status; 13 | private Date createTime; 14 | 15 | public Message() { 16 | } 17 | 18 | public Message(int id, int fromId, int toId, String conversationId, String content, int status, Date createTime) { 19 | this.id = id; 20 | this.fromId = fromId; 21 | this.toId = toId; 22 | this.conversationId = conversationId; 23 | this.content = content; 24 | this.status = status; 25 | this.createTime = createTime; 26 | } 27 | 28 | public int getId() { 29 | return id; 30 | } 31 | 32 | public void setId(int id) { 33 | this.id = id; 34 | } 35 | 36 | public int getFromId() { 37 | return fromId; 38 | } 39 | 40 | public void setFromId(int fromId) { 41 | this.fromId = fromId; 42 | } 43 | 44 | public int getToId() { 45 | return toId; 46 | } 47 | 48 | public void setToId(int toId) { 49 | this.toId = toId; 50 | } 51 | 52 | public String getConversationId() { 53 | return conversationId; 54 | } 55 | 56 | public void setConversationId(String conversationId) { 57 | this.conversationId = conversationId; 58 | } 59 | 60 | public String getContent() { 61 | return content; 62 | } 63 | 64 | public void setContent(String content) { 65 | this.content = content; 66 | } 67 | 68 | public int getStatus() { 69 | return status; 70 | } 71 | 72 | public void setStatus(int status) { 73 | this.status = status; 74 | } 75 | 76 | public Date getCreateTime() { 77 | return createTime; 78 | } 79 | 80 | public void setCreateTime(Date createTime) { 81 | this.createTime = createTime; 82 | } 83 | 84 | @Override 85 | public String toString() { 86 | return "Message{" + 87 | "id=" + id + 88 | ", fromId=" + fromId + 89 | ", toId=" + toId + 90 | ", conversationId='" + conversationId + '\'' + 91 | ", content='" + content + '\'' + 92 | ", status=" + status + 93 | ", createTime=" + createTime + 94 | '}'; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/entity/Page.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.entity; 2 | 3 | public class Page { 4 | 5 | private int current = 1; 6 | private int limit = 10; 7 | private int rows; 8 | private String path; 9 | 10 | public Page() { 11 | } 12 | 13 | public Page(int current, int limit, int rows, String path) { 14 | this.current = current; 15 | this.limit = limit; 16 | this.rows = rows; 17 | this.path = path; 18 | } 19 | 20 | public int getCurrent() { 21 | return current; 22 | } 23 | 24 | public void setCurrent(int current) { 25 | if (current >= 1) { 26 | this.current = current; 27 | } 28 | } 29 | 30 | public int getLimit() { 31 | return limit; 32 | } 33 | 34 | public void setLimit(int limit) { 35 | if (limit >= 1 && limit <= 100) { 36 | this.limit = limit; 37 | } 38 | } 39 | 40 | public int getRows() { 41 | return rows; 42 | } 43 | 44 | public void setRows(int rows) { 45 | if (rows >= 0) { 46 | this.rows = rows; 47 | } 48 | } 49 | 50 | public String getPath() { 51 | return path; 52 | } 53 | 54 | public void setPath(String path) { 55 | this.path = path; 56 | } 57 | 58 | public int getOffset() { 59 | return (current - 1) * limit; 60 | } 61 | 62 | public int getTotal() { 63 | if (rows % limit == 0) { 64 | return rows / limit; 65 | } else { 66 | return rows / limit + 1; 67 | } 68 | } 69 | 70 | public int getFrom() { 71 | int from = current - 2; 72 | return from < 1 ? 1 : from; 73 | } 74 | 75 | public int getTo() { 76 | int to = current + 2; 77 | return to > getTotal() ? getTotal() : to; 78 | } 79 | 80 | @Override 81 | public String toString() { 82 | return "Page{" + 83 | "current=" + current + 84 | ", limit=" + limit + 85 | ", rows=" + rows + 86 | ", path='" + path + '\'' + 87 | '}'; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/event/EventProducer.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.event; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import com.zcx.community.entity.Event; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.kafka.core.KafkaTemplate; 7 | import org.springframework.stereotype.Component; 8 | 9 | @Component 10 | public class EventProducer { 11 | 12 | @Autowired 13 | private KafkaTemplate kafkaTemplate; 14 | 15 | public void fireEvent(Event event) { 16 | kafkaTemplate.send(event.getTopic(), JSONObject.toJSONString(event)); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/service/DiscussPostService.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.service; 2 | 3 | import com.zcx.community.dao.DiscussPostMapper; 4 | import com.zcx.community.entity.DiscussPost; 5 | import com.zcx.community.util.SensitiveFilter; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.web.util.HtmlUtils; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | public class DiscussPostService { 14 | 15 | @Autowired 16 | private SensitiveFilter sensitiveFilter; 17 | 18 | @Autowired 19 | private DiscussPostMapper discussPostMapper; 20 | 21 | public List findDiscussPosts(int userId, int offset, int limit) { 22 | return discussPostMapper.selectDiscussPosts(userId, offset, limit); 23 | } 24 | 25 | public int findDiscussPostRows(int userId) { 26 | return discussPostMapper.selectDiscussPostRows(userId); 27 | } 28 | 29 | public int addDiscussPost(DiscussPost discussPost) { 30 | if (discussPost == null) { 31 | throw new IllegalArgumentException("参数不能为空"); 32 | } 33 | discussPost.setTitle(HtmlUtils.htmlEscape(discussPost.getTitle())); 34 | discussPost.setContent(HtmlUtils.htmlEscape(discussPost.getContent())); 35 | discussPost.setTitle(sensitiveFilter.filter(discussPost.getTitle())); 36 | discussPost.setContent(sensitiveFilter.filter(discussPost.getContent())); 37 | return discussPostMapper.insertDiscussPost(discussPost); 38 | } 39 | 40 | public DiscussPost findDiscussPostById(int id) { 41 | return discussPostMapper.selectDiscussPostById(id); 42 | } 43 | 44 | public int updateCommentCount(int id, int commentCount) { 45 | return discussPostMapper.updateCommentCount(id, commentCount); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/service/LikeService.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.service; 2 | 3 | import com.zcx.community.util.RedisKeyUtils; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.dao.DataAccessException; 6 | import org.springframework.data.redis.core.RedisOperations; 7 | import org.springframework.data.redis.core.RedisTemplate; 8 | import org.springframework.data.redis.core.SessionCallback; 9 | import org.springframework.stereotype.Service; 10 | 11 | @Service 12 | public class LikeService { 13 | 14 | @Autowired 15 | private RedisTemplate redisTemplate; 16 | 17 | public void like(int userId, int entityType, int entityId, int entityUserId) { 18 | redisTemplate.execute(new SessionCallback() { 19 | @Override 20 | public Object execute(RedisOperations operations) throws DataAccessException { 21 | String entityLikeKey = RedisKeyUtils.getEntityLikeKey(entityType, entityId); 22 | String userLikeKey = RedisKeyUtils.getUserLikeKey(entityUserId); 23 | boolean isMember = operations.opsForSet().isMember(entityLikeKey, userId); 24 | operations.multi(); 25 | if (isMember) { 26 | operations.opsForSet().remove(entityLikeKey, userId); 27 | operations.opsForValue().decrement(userLikeKey); 28 | } else { 29 | operations.opsForSet().add(entityLikeKey, userId); 30 | operations.opsForValue().increment(userLikeKey); 31 | } 32 | return operations.exec(); 33 | } 34 | }); 35 | } 36 | 37 | public long findEntityLikeCount(int entityType, int entityId) { 38 | String entityLikeKey = RedisKeyUtils.getEntityLikeKey(entityType, entityId); 39 | return redisTemplate.opsForSet().size(entityLikeKey); 40 | } 41 | 42 | public int findEntityLikeStatus(int userId, int entityType, int entityId) { 43 | String entityLikeKey = RedisKeyUtils.getEntityLikeKey(entityType, entityId); 44 | return redisTemplate.opsForSet().isMember(entityLikeKey, userId) ? 1 : 0; 45 | } 46 | 47 | public int findUserLikeCount(int userId) { 48 | String userLikeKey = RedisKeyUtils.getUserLikeKey(userId); 49 | Integer count = (Integer) redisTemplate.opsForValue().get(userLikeKey); 50 | return count == null ? 0 : count.intValue(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/service/MessageService.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.service; 2 | 3 | import com.zcx.community.dao.MessageMapper; 4 | import com.zcx.community.entity.Message; 5 | import com.zcx.community.util.SensitiveFilter; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.web.util.HtmlUtils; 9 | 10 | import java.util.List; 11 | 12 | @Service 13 | public class MessageService { 14 | 15 | @Autowired 16 | private MessageMapper messageMapper; 17 | 18 | @Autowired 19 | private SensitiveFilter sensitiveFilter; 20 | 21 | public List findConversations(int userId, int offset, int limit) { 22 | return messageMapper.selectConversations(userId, offset, limit); 23 | } 24 | 25 | public int findConversationCount(int userId) { 26 | return messageMapper.selectConversationCount(userId); 27 | } 28 | 29 | public List findLetters(String conversationId, int offset, int limit) { 30 | return messageMapper.selectLetters(conversationId, offset, limit); 31 | } 32 | 33 | public int findLetterCount(String conversationId) { 34 | return messageMapper.selectLetterCount(conversationId); 35 | } 36 | 37 | public int findLetterUnreadCount(int userId, String conversationId) { 38 | return messageMapper.selectLetterUnreadCount(userId, conversationId); 39 | } 40 | 41 | public int addMessage(Message message) { 42 | message.setContent(HtmlUtils.htmlEscape(message.getContent())); 43 | message.setContent(sensitiveFilter.filter(message.getContent())); 44 | return messageMapper.insertMessage(message); 45 | } 46 | 47 | public int readMessage(List ids) { 48 | return messageMapper.updateStatus(ids, 1); 49 | } 50 | 51 | public int removeLetterById(int id) { 52 | return messageMapper.deleteLetterById(id); 53 | } 54 | 55 | public Message findLatestNotice(int userId, String topic) { 56 | return messageMapper.selectLatestNotice(userId, topic); 57 | } 58 | 59 | public int findNoticeCount(int userId, String topic) { 60 | return messageMapper.selectNoticeCount(userId, topic); 61 | } 62 | 63 | public int findNoticeUnreadCount(int userId, String topic) { 64 | return messageMapper.selectNoticeUnreadCount(userId, topic); 65 | } 66 | 67 | public List findNotices(int userId, String topic, int offset, int limit) { 68 | return messageMapper.selectNotices(userId, topic, offset, limit); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/util/CommunityConstants.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.util; 2 | 3 | public interface CommunityConstants { 4 | 5 | int ACTIVATION_SUCCESS = 0; 6 | int ACTIVATION_REPEAT = 1; 7 | int ACTIVATION_FAILURE = 2; 8 | int ACTIVATION_TIMEOUT = 3; 9 | int DEFAULT_EXPIRED_SECONDS = 3600 * 12; 10 | int REMEMBER_EXPIRED_SECONDS = 3600 * 24 * 100; 11 | int ENTITY_TYPE_POST = 1; 12 | int ENTITY_TYPE_COMMENT = 2; 13 | int ENTITY_TYPE_USER = 3; 14 | String TOPIC_COMMENT = "comment"; 15 | String TOPIC_LIKE = "like"; 16 | String TOPIC_FOLLOW = "follow"; 17 | String TOPIC_PUBLISH = "publish"; 18 | int SYSTEM_USER_ID = 1; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/util/CommunityUtils.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.util; 2 | 3 | import com.alibaba.fastjson.JSONObject; 4 | import org.apache.commons.lang3.StringUtils; 5 | import org.springframework.util.DigestUtils; 6 | 7 | import java.util.Map; 8 | import java.util.UUID; 9 | 10 | public class CommunityUtils { 11 | 12 | public static String generateUUID() { 13 | return UUID.randomUUID().toString().replace("-", ""); 14 | } 15 | 16 | public static String md5(String key) { 17 | if (StringUtils.isBlank(key)) { 18 | return null; 19 | } 20 | return DigestUtils.md5DigestAsHex(key.getBytes()); 21 | } 22 | 23 | public static String getJSONString(int code, String msg, Map map) { 24 | JSONObject jsonObject = new JSONObject(); 25 | jsonObject.put("code", code); 26 | jsonObject.put("msg", msg); 27 | if (map != null) { 28 | for (String key : map.keySet()) { 29 | jsonObject.put(key, map.get(key)); 30 | } 31 | } 32 | return jsonObject.toJSONString(); 33 | } 34 | 35 | public static String getJSONString(int code, String msg) { 36 | return getJSONString(code, msg, null); 37 | } 38 | 39 | public static String getJSONString(int code) { 40 | return getJSONString(code, null, null); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/util/CookieUtil.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.util; 2 | 3 | import javax.servlet.http.Cookie; 4 | import javax.servlet.http.HttpServletRequest; 5 | 6 | public class CookieUtil { 7 | 8 | public static String getValue(HttpServletRequest request, String name) { 9 | if (request == null || name == null) { 10 | throw new IllegalArgumentException("参数为空"); 11 | } 12 | Cookie[] cookies = request.getCookies(); 13 | if (cookies != null) { 14 | for (Cookie cookie : cookies) { 15 | if (cookie.getName().equals(name)) { 16 | return cookie.getValue(); 17 | } 18 | } 19 | } 20 | return null; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/util/HostHolder.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.util; 2 | 3 | import com.zcx.community.entity.User; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class HostHolder { 8 | 9 | private ThreadLocal users = new ThreadLocal<>(); 10 | 11 | public void setUser(User user) { 12 | users.set(user); 13 | } 14 | 15 | public User getUser() { 16 | return users.get(); 17 | } 18 | 19 | public void clear() { 20 | users.remove(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/util/MailClient.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.util; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.mail.javamail.JavaMailSender; 8 | import org.springframework.mail.javamail.MimeMessageHelper; 9 | import org.springframework.stereotype.Component; 10 | 11 | import javax.mail.internet.MimeMessage; 12 | 13 | @Component 14 | public class MailClient { 15 | 16 | private static final Logger logger = LoggerFactory.getLogger(MailClient.class); 17 | 18 | @Autowired 19 | private JavaMailSender javaMailSender; 20 | 21 | @Value("${spring.mail.username}") 22 | private String from; 23 | 24 | public void sendMail(String to, String subject, String content) { 25 | MimeMessage mimeMailMessage = javaMailSender.createMimeMessage(); 26 | MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMailMessage); 27 | try { 28 | mimeMessageHelper.setFrom(from); 29 | mimeMessageHelper.setTo(to); 30 | mimeMessageHelper.setSubject(subject); 31 | mimeMessageHelper.setText(content, true); 32 | javaMailSender.send(mimeMessageHelper.getMimeMessage()); 33 | } catch (Exception e) { 34 | throw new RuntimeException("发送邮件失败,服务器发生异常", e); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/zcx/community/util/RedisKeyUtils.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community.util; 2 | 3 | public class RedisKeyUtils { 4 | 5 | private static final String SPLIT = ":"; 6 | private static final String PREFIX_ENTITY_LIKE = "like:entity"; 7 | private static final String PREFIX_USER_LIKE = "like:user"; 8 | private static final String PREFIX_FOLLOWEE = "followee"; 9 | private static final String PREFIX_FOLLOWER = "follower"; 10 | private static final String PREFIX_KAPTCHA = "kaptcha"; 11 | private static final String PREFIX_TICKET = "ticket"; 12 | private static final String PREFIX_USER = "user"; 13 | 14 | public static String getEntityLikeKey(int entityType, int entityId) { 15 | return PREFIX_ENTITY_LIKE + SPLIT + entityId + SPLIT + entityId; 16 | } 17 | 18 | public static String getUserLikeKey(int userId) { 19 | return PREFIX_USER_LIKE + SPLIT + userId; 20 | } 21 | 22 | public static String getFolloweeKey(int userId, int entityType) { 23 | return PREFIX_FOLLOWEE + SPLIT + userId + SPLIT + entityType; 24 | } 25 | 26 | public static String getFollowerKey(int entityType, int entityId) { 27 | return PREFIX_FOLLOWER + SPLIT + entityType + SPLIT + entityId; 28 | } 29 | 30 | public static String getKaptchaKey(String owner) { 31 | return PREFIX_KAPTCHA + SPLIT + owner; 32 | } 33 | 34 | public static String getTicketKey(String ticket) { 35 | return PREFIX_TICKET + SPLIT + ticket; 36 | } 37 | 38 | public static String getUserKey(int userId){ 39 | return PREFIX_USER + SPLIT + userId; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #Tomcat配置 2 | server.port=8080 3 | server.servlet.context-path=/community 4 | 5 | #Thymeleaf配置 6 | spring.thymeleaf.cache=false 7 | 8 | #数据源配置 9 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 10 | spring.datasource.url=jdbc:mysql://192.168.212.128/community?characterEncoding=utf-8&serverTimezone=UTC 11 | spring.datasource.username=root 12 | spring.datasource.password= 13 | 14 | #mybatis配置 15 | mybatis.mapper-locations=classpath:mapper/*.xml 16 | mybatis.type-aliases-package=com.zcx.community.entity 17 | mybatis.configuration.use-generated-keys=true 18 | mybatis.configuration.map-underscore-to-camel-case=true 19 | #mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl 20 | 21 | #logging.level.com.zcx.community=debug 22 | #logging.file.name=D:/course/community/log/community.log 23 | 24 | #邮件服务配置 25 | spring.mail.host=smtp.qq.com 26 | spring.mail.port=465 27 | spring.mail.username=1364052596@qq.com 28 | spring.mail.password= 29 | spring.mail.protocol=smtps 30 | spring.mail.properties.mail.smtp.ssl.enable=true 31 | 32 | #常量 33 | community.path.domain=http://localhost:8080 34 | community.path.upload=C:/Users/World/Desktop/community/upload 35 | 36 | #redis配置 37 | spring.redis.database=0 38 | spring.redis.host=192.168.212.128 39 | spring.redis.port=6379 40 | 41 | #kafka配置 42 | spring.kafka.bootstrap-servers=192.168.212.128:9092 43 | spring.kafka.consumer.group-id=community-consumer-group 44 | spring.kafka.consumer.enable-auto-commit=true 45 | spring.kafka.consumer.auto-commit-interval=3000 46 | 47 | #elasticsearch配置 48 | spring.data.elasticsearch.cluster-name=nowcoder 49 | spring.data.elasticsearch.cluster-nodes=192.168.212.128:9300 -------------------------------------------------------------------------------- /src/main/resources/mapper/CommentMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | id, user_id, entity_type, entity_id, target_id, content, status, create_time 8 | 9 | 10 | 11 | user_id, entity_type, entity_id, target_id, content, status, create_time 12 | 13 | 14 | 23 | 24 | 33 | 34 | 41 | 42 | 49 | 50 | 51 | insert into comment() 52 | values(#{userId}, #{entityType}, #{entityId}, #{targetId}, #{content}, #{status}, #{createTime}) 53 | 54 | 55 | 56 | update comment 57 | set status = 1 58 | where id = #{id} 59 | 60 | 61 | 66 | 67 | -------------------------------------------------------------------------------- /src/main/resources/mapper/DiscussPostMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | id, user_id, title, content, type, status, create_time, comment_count, score 8 | 9 | 10 | 11 | user_id, title, content, type, status, create_time, comment_count, score 12 | 13 | 14 | 25 | 26 | 34 | 35 | 36 | insert into discuss_post () 37 | values (#{userId}, #{title}, #{content}, #{type}, #{status}, #{createTime}, #{commentCount}, #{score}) 38 | 39 | 40 | 45 | 46 | 47 | update discuss_post set comment_count = #{commentCount} 48 | where id = #{id} 49 | 50 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | username, password, salt, email, type, status, activation_code, header_url, create_time 8 | 9 | 10 | 11 | id, username, password, salt, email, type, status, activation_code, header_url, create_time 12 | 13 | 14 | 20 | 21 | 27 | 28 | 34 | 35 | 36 | insert into user () 37 | values (#{username}, #{password}, #{salt}, #{email}, #{type}, #{status}, #{activationCode}, #{headerUrl}, #{createTime}) 38 | 39 | 40 | 41 | update user set status = #{status} where id = #{id} 42 | 43 | 44 | 45 | update user set header_url = #{headerUrl} where id = #{id} 46 | 47 | 48 | 49 | update user set password = #{password} where id = #{id} 50 | 51 | 52 | 53 | delete from user where id = #{id} 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/main/resources/static/css/discuss-detail.css: -------------------------------------------------------------------------------- 1 | .content { 2 | font-size: 16px; 3 | line-height: 2em; 4 | } 5 | 6 | .replyform textarea { 7 | width: 100%; 8 | height: 200px; 9 | } 10 | 11 | .floor { 12 | background: #dcdadc; 13 | padding: 4px 12px; 14 | border-radius: 3px; 15 | font-size: 14px; 16 | } 17 | 18 | .input-size { 19 | width: 100%; 20 | height: 35px; 21 | } -------------------------------------------------------------------------------- /src/main/resources/static/css/global.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100%; 3 | } 4 | 5 | body { 6 | background: #eee; 7 | font-family: arial, STHeiti, 'Microsoft YaHei', \5b8b\4f53; 8 | font-size: 14px; 9 | height: 100%; 10 | } 11 | 12 | .nk-container { 13 | position: relative; 14 | height: auto; 15 | min-height: 100%; 16 | } 17 | 18 | .container { 19 | width: 960px; 20 | padding: 0; 21 | } 22 | 23 | header .navbar-brand { 24 | background: url('http://static.nowcoder.com/images/res/logo/logo-v3.png') no-repeat; 25 | background-size: 147px 42px; 26 | width: 147px; 27 | height: 42px; 28 | margin: 5px 15px 5px 0; 29 | } 30 | 31 | header .navbar { 32 | padding: 5px 0; 33 | font-size: 16px; 34 | } 35 | 36 | header .badge { 37 | position: absolute; 38 | top: -3px; 39 | left: 33px; 40 | } 41 | 42 | footer { 43 | padding: 20px 0; 44 | font-size: 12px; 45 | position: absolute; 46 | bottom: 0; 47 | width: 100%; 48 | } 49 | 50 | footer .qrcode { 51 | text-align: center; 52 | } 53 | 54 | footer .detail-info{ 55 | border-left: 1px solid #888; 56 | } 57 | 58 | footer .company-info li { 59 | padding-left: 16px; 60 | margin: 4px 0; 61 | } 62 | 63 | .main { 64 | padding: 20px 0; 65 | padding-bottom: 200px; 66 | } 67 | 68 | .main .container { 69 | background: #fff; 70 | padding: 20px; 71 | } 72 | 73 | i { 74 | font-style: normal; 75 | } 76 | 77 | u { 78 | text-decoration: none; 79 | } 80 | 81 | b { 82 | font-weight: normal; 83 | } 84 | 85 | a { 86 | color: #000; 87 | } 88 | 89 | a:hover { 90 | text-decoration: none; 91 | } 92 | 93 | .font-size-12 { 94 | font-size: 12px; 95 | } 96 | .font-size-14 { 97 | font-size: 14px; 98 | } 99 | .font-size-16 { 100 | font-size: 16px; 101 | } 102 | .font-size-18 { 103 | font-size: 18px; 104 | } 105 | .font-size-20 { 106 | font-size: 20px; 107 | } 108 | .font-size-22 { 109 | font-size: 20px; 110 | } 111 | .font-size-24 { 112 | font-size: 20px; 113 | } 114 | 115 | .hidden { 116 | display: none; 117 | } 118 | 119 | .rt-0 { 120 | right: 0; 121 | top: 0; 122 | } 123 | 124 | .square { 125 | display: inline-block; 126 | width: 7px; 127 | height: 7px; 128 | background: #ff6547; 129 | margin-bottom: 2px; 130 | margin-right: 3px; 131 | } 132 | 133 | .bg-gray { 134 | background: #eff0f2; 135 | } 136 | 137 | .user-header { 138 | width: 50px; 139 | height: 50px; 140 | } 141 | 142 | em { 143 | font-style: normal; 144 | color: red; 145 | } 146 | -------------------------------------------------------------------------------- /src/main/resources/static/css/letter.css: -------------------------------------------------------------------------------- 1 | .main .nav .badge { 2 | position: absolute; 3 | top: -3px; 4 | left: 68px; 5 | } 6 | 7 | .main .media .badge { 8 | position: absolute; 9 | top: 12px; 10 | left: -3px; 11 | } 12 | 13 | .toast { 14 | max-width: 100%; 15 | width: 80%; 16 | } -------------------------------------------------------------------------------- /src/main/resources/static/css/login.css: -------------------------------------------------------------------------------- 1 | .main .container { 2 | width: 720px; 3 | } 4 | -------------------------------------------------------------------------------- /src/main/resources/static/html/ajax-demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AJAX 6 | 7 | 8 |

9 | 10 |

11 | 12 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/resources/static/html/student.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 增加学生 6 | 7 | 8 | 9 |
10 |

11 | 姓名: 12 |

13 |

14 | 年龄: 15 |

16 |

17 | 18 |

19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /src/main/resources/static/img/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/src/main/resources/static/img/404.png -------------------------------------------------------------------------------- /src/main/resources/static/img/captcha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/src/main/resources/static/img/captcha.png -------------------------------------------------------------------------------- /src/main/resources/static/img/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/src/main/resources/static/img/error.png -------------------------------------------------------------------------------- /src/main/resources/static/js/discuss.js: -------------------------------------------------------------------------------- 1 | function like(btn, entityType, entityId, entityUserId, postId) { 2 | 3 | $.post( 4 | CONTEXT_PATH + "/like", 5 | { 6 | "entityType":entityType, 7 | "entityId":entityId, 8 | "entityUserId":entityUserId, 9 | "postId":postId 10 | }, 11 | function (data) { 12 | data = $.parseJSON(data); 13 | if (data.code == 0) { 14 | $(btn).children("i").text(data.likeCount); 15 | $(btn).children("b").text(data.likeStatus==1?'已赞':'赞'); 16 | } else { 17 | alert(data.msg); 18 | } 19 | } 20 | ); 21 | 22 | } 23 | 24 | function removeComment(discussPostId, commentId) { 25 | $.post( 26 | CONTEXT_PATH + "/comment/remove/" + discussPostId + "/" + commentId, 27 | function (data) { 28 | data = $.parseJSON(data); 29 | if (data.code == 0) { 30 | location.reload(); 31 | } else { 32 | alert(data.msg); 33 | } 34 | } 35 | ); 36 | } -------------------------------------------------------------------------------- /src/main/resources/static/js/global.js: -------------------------------------------------------------------------------- 1 | var CONTEXT_PATH = "/community" 2 | 3 | window.alert = function(message) { 4 | if(!$(".alert-box").length) { 5 | $("body").append( 6 | '' 24 | ); 25 | } 26 | 27 | var h = $(".alert-box").height(); 28 | var y = h / 2 - 100; 29 | if(h > 600) y -= 100; 30 | $(".alert-box .modal-dialog").css("margin", (y < 0 ? 0 : y) + "px auto"); 31 | 32 | $(".alert-box .modal-body p").text(message); 33 | $(".alert-box").modal("show"); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/static/js/index.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $("#publishBtn").click(publish); 3 | }); 4 | 5 | function publish() { 6 | $("#publishModal").modal("hide"); 7 | 8 | var title = $("#recipient-name").val(); 9 | var content = $("#message-text").val(); 10 | 11 | $.post( 12 | CONTEXT_PATH + "/discuss/add", 13 | { 14 | "title":title, 15 | "content":content 16 | }, 17 | function (data) { 18 | data = $.parseJSON(data); 19 | $("#hintBody").text(data.msg); 20 | $("#hintModal").modal("show"); 21 | setTimeout(function(){ 22 | $("#hintModal").modal("hide"); 23 | if (data.code == 0) { 24 | window.location.reload(); 25 | } else { 26 | alert(data.msg) 27 | } 28 | }, 2000); 29 | } 30 | ); 31 | } -------------------------------------------------------------------------------- /src/main/resources/static/js/letter.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $("#sendBtn").click(send_letter); 3 | $(".close").click(delete_msg); 4 | }); 5 | 6 | function send_letter() { 7 | $("#sendModal").modal("hide"); 8 | 9 | var toName = $("#recipient-name").val(); 10 | var content = $("#message-text").val(); 11 | $.post( 12 | CONTEXT_PATH + "/letter/send", 13 | { 14 | "toName":toName, 15 | "content":content 16 | }, 17 | function (data) { 18 | data = $.parseJSON(data); 19 | if (data.code == 0) { 20 | $("#hintBody").text("发送成功!") 21 | } else { 22 | $("#hintBody").text(data.msg) 23 | } 24 | $("#hintModal").modal("show"); 25 | setTimeout(function() { 26 | $("#hintModal").modal("hide"); 27 | location.reload(); 28 | }, 2000); 29 | } 30 | ); 31 | 32 | $("#hintModal").modal("show"); 33 | setTimeout(function(){ 34 | $("#hintModal").modal("hide"); 35 | }, 2000); 36 | } 37 | 38 | function delete_msg(letterId) { 39 | $.ajax({ 40 | url: CONTEXT_PATH + "/letter/remove/" + letterId, 41 | type: "put", 42 | success: function (data) { 43 | data = $.parseJSON(data); 44 | if (data.code == 0) { 45 | location.reload(); 46 | } else { 47 | alert(data.msg); 48 | } 49 | } 50 | }); 51 | $(this).parents(".media").remove(); 52 | } -------------------------------------------------------------------------------- /src/main/resources/static/js/profile.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $(".follow-btn").click(follow); 3 | }); 4 | 5 | function follow() { 6 | var btn = this; 7 | if($(btn).hasClass("btn-info")) { 8 | // 关注TA 9 | $.post( 10 | CONTEXT_PATH + "/follow", 11 | { 12 | "entityType":3, 13 | "entityId":$(btn).prev().val() 14 | }, 15 | function(data) { 16 | data = $.parseJSON(data); 17 | if (data.code == 0) { 18 | window.location.reload(); 19 | } else { 20 | alert(data.msg); 21 | } 22 | } 23 | ); 24 | // $(btn).text("已关注").removeClass("btn-info").addClass("btn-secondary"); 25 | } else { 26 | $.post( 27 | CONTEXT_PATH + "/unfollow", 28 | { 29 | "entityType":3, 30 | "entityId":$(btn).prev().val() 31 | }, 32 | function(data) { 33 | data = $.parseJSON(data); 34 | if (data.code == 0) { 35 | window.location.reload(); 36 | } else { 37 | alert(data.msg); 38 | } 39 | } 40 | ); 41 | // 取消关注 42 | // $(btn).text("关注TA").removeClass("btn-secondary").addClass("btn-info"); 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/resources/static/js/register.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | $("form").submit(check_data); 3 | $("input").focus(clear_error); 4 | }); 5 | 6 | function check_data() { 7 | var pwd1 = $("#password").val(); 8 | var pwd2 = $("#confirm-password").val(); 9 | if(pwd1 != pwd2) { 10 | $("#confirm-password").addClass("is-invalid"); 11 | return false; 12 | } 13 | return true; 14 | } 15 | 16 | function clear_error() { 17 | $(this).removeClass("is-invalid"); 18 | } -------------------------------------------------------------------------------- /src/main/resources/templates/demo/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Teacher 6 | 7 | 8 | 9 |

10 |

11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/templates/mail/activation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 牛客网-激活账号 7 | 8 | 9 |
10 |

11 | , 您好! 12 |

13 |

14 | 您正在注册牛客网, 这是一封激活邮件, 请在1分钟内点击 15 | 此链接, 16 | 激活您的牛客账号! 17 |

18 |
19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/templates/mail/demo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 邮件示例 6 | 7 | 8 |

欢迎你!!

9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/templates/mail/forget.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 牛客网-忘记密码 7 | 8 | 9 |
10 |

11 | , 您好! 12 |

13 |

14 | 您正在找回牛客账号的密码, 本次操作的验证码为 , 15 | 有效时间5分钟, 请您及时进行操作! 16 |

17 |
18 | 19 | -------------------------------------------------------------------------------- /src/test/java/com/zcx/community/BlockingQueueTests.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import org.junit.runner.RunWith; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | import org.springframework.test.context.junit4.SpringRunner; 6 | 7 | import java.util.Random; 8 | import java.util.concurrent.ArrayBlockingQueue; 9 | import java.util.concurrent.BlockingQueue; 10 | 11 | @SpringBootTest 12 | @RunWith(SpringRunner.class) 13 | public class BlockingQueueTests { 14 | 15 | public static void main(String[] args) { 16 | BlockingQueue queue = new ArrayBlockingQueue(10); 17 | new Thread(new Producer(queue)).start(); 18 | 19 | new Thread(new Consumer(queue)).start(); 20 | new Thread(new Consumer(queue)).start(); 21 | new Thread(new Consumer(queue)).start(); 22 | } 23 | 24 | } 25 | 26 | class Producer implements Runnable { 27 | 28 | private BlockingQueue queue; 29 | 30 | public Producer(BlockingQueue queue) { 31 | this.queue = queue; 32 | } 33 | 34 | @Override 35 | public void run() { 36 | try { 37 | for (int i = 0; i < 100; i ++) { 38 | Thread.sleep(20); 39 | queue.put(i); 40 | System.out.println(Thread.currentThread().getName() + "生产:" + queue.size()); 41 | } 42 | } catch (Exception ex) { 43 | ex.printStackTrace(); 44 | } 45 | } 46 | } 47 | 48 | class Consumer implements Runnable { 49 | 50 | 51 | private BlockingQueue queue; 52 | 53 | public Consumer(BlockingQueue queue) { 54 | this.queue = queue; 55 | } 56 | 57 | @Override 58 | public void run() { 59 | try { 60 | while (true) { 61 | Thread.sleep(new Random().nextInt(1000)); 62 | queue.take(); 63 | System.out.println(Thread.currentThread().getName() + "消费:" + queue.size()); 64 | } 65 | } catch (Exception ex) { 66 | ex.printStackTrace(); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /src/test/java/com/zcx/community/CommonTests.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import org.apache.commons.lang3.StringUtils; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | import org.springframework.test.context.junit4.SpringRunner; 8 | 9 | @SpringBootTest 10 | @RunWith(SpringRunner.class) 11 | public class CommonTests { 12 | 13 | @Test 14 | public void test01() { 15 | System.out.println(StringUtils.isBlank(null)); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/com/zcx/community/CommunityApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import com.zcx.community.dao.AlphaDao; 4 | import com.zcx.community.service.AlphaService; 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.beans.factory.annotation.Qualifier; 9 | import org.springframework.boot.test.context.SpringBootTest; 10 | import org.springframework.context.ApplicationContext; 11 | import org.springframework.test.context.junit4.SpringRunner; 12 | 13 | import java.text.SimpleDateFormat; 14 | import java.util.Date; 15 | 16 | @SpringBootTest 17 | @RunWith(SpringRunner.class) 18 | class CommunityApplicationTests { 19 | 20 | @Autowired 21 | private SimpleDateFormat simpleDateFormat; 22 | 23 | @Autowired 24 | private ApplicationContext applicationContext; 25 | 26 | @Autowired 27 | private AlphaService alphaService; 28 | 29 | @Autowired 30 | @Qualifier("alphaDaoImpl") 31 | private AlphaDao alphaDao; 32 | 33 | @Test 34 | void contextLoads() { 35 | // System.out.println(applicationContext); 36 | // System.out.println(alphaDao.select()); 37 | // System.out.println(alphaService); 38 | System.out.println(simpleDateFormat.format(new Date())); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/com/zcx/community/KafkaTests.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import org.apache.kafka.clients.consumer.ConsumerRecord; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.kafka.annotation.KafkaListener; 9 | import org.springframework.kafka.core.KafkaTemplate; 10 | import org.springframework.stereotype.Component; 11 | import org.springframework.test.context.junit4.SpringRunner; 12 | 13 | @SpringBootTest 14 | @RunWith(SpringRunner.class) 15 | public class KafkaTests { 16 | 17 | @Autowired 18 | private KafkaProducer kafkaProducer; 19 | 20 | 21 | @Test 22 | public void testKafka() { 23 | kafkaProducer.sendMessage("test", "你好,世界!"); 24 | kafkaProducer.sendMessage("test", "我操了!"); 25 | try { 26 | Thread.sleep(1000 * 10); 27 | } catch (InterruptedException e) { 28 | e.printStackTrace(); 29 | } 30 | } 31 | 32 | } 33 | @Component 34 | class KafkaProducer { 35 | @Autowired 36 | private KafkaTemplate kafkaTemplate; 37 | 38 | public void sendMessage(String topic, String content) { 39 | kafkaTemplate.send(topic, content); 40 | } 41 | } 42 | @Component 43 | class KafkaConsumer { 44 | @KafkaListener(topics = {"test"}) 45 | public void handleMessage(ConsumerRecord record) { 46 | System.out.println(record.value()); 47 | } 48 | } -------------------------------------------------------------------------------- /src/test/java/com/zcx/community/LoggerTests.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | 10 | @SpringBootTest 11 | @RunWith(SpringRunner.class) 12 | public class LoggerTests { 13 | 14 | private static final Logger logger = LoggerFactory.getLogger(LoggerTests.class); 15 | 16 | @Test 17 | public void testLogger() { 18 | System.out.println(logger.getName()); 19 | logger.debug("debug log"); 20 | logger.info("info log"); 21 | logger.warn("warn log"); 22 | logger.error("error log"); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/com/zcx/community/MailTests.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import com.zcx.community.util.MailClient; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | import org.thymeleaf.TemplateEngine; 10 | import org.thymeleaf.context.Context; 11 | 12 | @SpringBootTest 13 | @RunWith(SpringRunner.class) 14 | public class MailTests { 15 | 16 | @Autowired 17 | private MailClient mailClient; 18 | 19 | @Autowired 20 | private TemplateEngine templateEngine; 21 | 22 | @Test 23 | public void testTextMail() { 24 | mailClient.sendMail("1364052596@qq.com", "TEST", "Welcome."); 25 | } 26 | 27 | @Test 28 | public void testHtmlMail() { 29 | Context context = new Context(); 30 | context.setVariable("username", "ym"); 31 | String content = templateEngine.process("/mail/demo", context); 32 | mailClient.sendMail("1364052596@qq.com", "HTML", content); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/zcx/community/SensitiveTests.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import com.zcx.community.util.SensitiveFilter; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | 10 | @SpringBootTest 11 | @RunWith(SpringRunner.class) 12 | public class SensitiveTests { 13 | 14 | @Autowired 15 | private SensitiveFilter sensitiveFilter; 16 | 17 | @Test 18 | public void testSensitiveFilter() { 19 | String text = "做原子弹"; 20 | text = sensitiveFilter.filter(text); 21 | System.out.println(text); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/com/zcx/community/TransactionTests.java: -------------------------------------------------------------------------------- 1 | package com.zcx.community; 2 | 3 | import com.zcx.community.service.AlphaService; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.boot.test.context.SpringBootTest; 8 | import org.springframework.test.context.junit4.SpringRunner; 9 | 10 | @SpringBootTest 11 | @RunWith(SpringRunner.class) 12 | public class TransactionTests { 13 | 14 | @Autowired 15 | private AlphaService alphaService; 16 | 17 | @Test 18 | public void testSave01() { 19 | Object obj = alphaService.save01(); 20 | System.out.println(obj); 21 | } 22 | 23 | @Test 24 | public void testSave02() { 25 | Object obj = alphaService.save02(); 26 | System.out.println(obj); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /upload/e4948202ce3542cab4c3223fdca3870e.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/upload/e4948202ce3542cab4c3223fdca3870e.jpg -------------------------------------------------------------------------------- /upload/f4b0d3b5103242e69d8c64df28ba7263.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DragonLog/community/a836216b10b5dcf4740c23d33a77ca5cb0ae273d/upload/f4b0d3b5103242e69d8c64df28ba7263.jpg --------------------------------------------------------------------------------