├── .idea ├── MyBatisCodeHelperDatasource.xml ├── artifacts │ └── shop_jar.xml ├── compiler.xml ├── encodings.xml ├── inspectionProfiles │ └── Project_Default.xml ├── libraries │ ├── Maven__aopalliance_aopalliance_1_0.xml │ ├── Maven__ch_qos_logback_logback_classic_1_1_11.xml │ ├── Maven__ch_qos_logback_logback_core_1_1_11.xml │ ├── Maven__cn_rongcloud_im_server_sdk_java_3_0_1.xml │ ├── Maven__com_alibaba_druid_1_1_6.xml │ ├── Maven__com_alibaba_fastjson_1_2_4.xml │ ├── Maven__com_aliyun_aliyun_java_sdk_core_3_4_0.xml │ ├── Maven__com_aliyun_aliyun_java_sdk_ecs_4_2_0.xml │ ├── Maven__com_aliyun_aliyun_java_sdk_ram_3_0_0.xml │ ├── Maven__com_aliyun_aliyun_java_sdk_sts_3_0_0.xml │ ├── Maven__com_aliyun_oss_aliyun_sdk_oss_3_1_0.xml │ ├── Maven__com_fasterxml_classmate_1_3_3.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_8_9.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_8_9.xml │ ├── Maven__com_flipkart_zjsonpatch_zjsonpatch_0_2_1.xml │ ├── Maven__com_github_caspar_chen_swagger_ui_layer_0_0_3.xml │ ├── Maven__com_github_jknack_handlebars_4_0_6.xml │ ├── Maven__com_github_jsqlparser_jsqlparser_1_0.xml │ ├── Maven__com_github_pagehelper_pagehelper_5_1_4.xml │ ├── Maven__com_github_pagehelper_pagehelper_spring_boot_autoconfigure_1_2_5.xml │ ├── Maven__com_github_pagehelper_pagehelper_spring_boot_starter_1_2_5.xml │ ├── Maven__com_github_tomakehurst_wiremock_2_5_1.xml │ ├── Maven__com_google_code_gson_gson_2_8_0.xml │ ├── Maven__com_google_guava_guava_20_0.xml │ ├── Maven__com_jayway_jsonpath_json_path_2_2_0.xml │ ├── Maven__com_sun_jersey_jersey_core_1_19_1.xml │ ├── Maven__com_sun_jersey_jersey_json_1_9.xml │ ├── Maven__com_sun_xml_bind_jaxb_impl_2_2_3_1.xml │ ├── Maven__com_thoughtworks_xstream_xstream_1_4_10.xml │ ├── Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml │ ├── Maven__commons_beanutils_commons_beanutils_1_9_3.xml │ ├── Maven__commons_codec_commons_codec_1_10.xml │ ├── Maven__commons_collections_commons_collections_3_2_2.xml │ ├── Maven__commons_io_commons_io_2_5.xml │ ├── Maven__commons_lang_commons_lang_2_6.xml │ ├── Maven__commons_net_commons_net_3_1.xml │ ├── Maven__io_jsonwebtoken_jjwt_0_7_0.xml │ ├── Maven__io_springfox_springfox_core_2_8_0.xml │ ├── Maven__io_springfox_springfox_schema_2_8_0.xml │ ├── Maven__io_springfox_springfox_spi_2_8_0.xml │ ├── Maven__io_springfox_springfox_spring_web_2_8_0.xml │ ├── Maven__io_springfox_springfox_swagger2_2_8_0.xml │ ├── Maven__io_springfox_springfox_swagger_common_2_8_0.xml │ ├── Maven__io_springfox_springfox_swagger_ui_2_8_0.xml │ ├── Maven__io_swagger_swagger_annotations_1_5_14.xml │ ├── Maven__io_swagger_swagger_models_1_5_14.xml │ ├── Maven__javax_activation_activation_1_1_1.xml │ ├── Maven__javax_inject_javax_inject_1.xml │ ├── Maven__javax_validation_validation_api_1_1_0_Final.xml │ ├── Maven__javax_ws_rs_jsr311_api_1_1_1.xml │ ├── Maven__javax_xml_bind_jaxb_api_2_2_2.xml │ ├── Maven__javax_xml_stream_stax_api_1_0_2.xml │ ├── Maven__junit_junit_4_12.xml │ ├── Maven__mysql_mysql_connector_java_5_1_43.xml │ ├── Maven__net_bytebuddy_byte_buddy_1_7_9.xml │ ├── Maven__net_minidev_accessors_smart_1_1.xml │ ├── Maven__net_minidev_json_smart_2_2_1.xml │ ├── Maven__org_antlr_antlr4_runtime_4_5_1_1.xml │ ├── Maven__org_apache_commons_commons_collections4_4_0.xml │ ├── Maven__org_apache_commons_commons_lang3_3_5.xml │ ├── Maven__org_apache_commons_commons_pool2_2_4_2.xml │ ├── Maven__org_apache_httpcomponents_httpclient_4_5_3.xml │ ├── Maven__org_apache_httpcomponents_httpcore_4_4_6.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_16.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_16.xml │ ├── Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_16.xml │ ├── Maven__org_apache_tomcat_tomcat_jdbc_8_5_16.xml │ ├── Maven__org_apache_tomcat_tomcat_juli_8_5_16.xml │ ├── Maven__org_aspectj_aspectjweaver_1_8_10.xml │ ├── Maven__org_assertj_assertj_core_2_6_0.xml │ ├── Maven__org_bouncycastle_bcpkix_jdk15on_1_56.xml │ ├── Maven__org_bouncycastle_bcprov_jdk15on_1_56.xml │ ├── Maven__org_codehaus_jackson_jackson_core_asl_1_9_13.xml │ ├── Maven__org_codehaus_jackson_jackson_jaxrs_1_8_3.xml │ ├── Maven__org_codehaus_jackson_jackson_mapper_asl_1_9_13.xml │ ├── Maven__org_codehaus_jackson_jackson_xc_1_8_3.xml │ ├── Maven__org_codehaus_jettison_jettison_1_2.xml │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ ├── Maven__org_hamcrest_hamcrest_library_1_3.xml │ ├── Maven__org_hibernate_hibernate_validator_5_3_5_Final.xml │ ├── Maven__org_javassist_javassist_3_21_0_GA.xml │ ├── Maven__org_jboss_logging_jboss_logging_3_3_1_Final.xml │ ├── Maven__org_jdom_jdom_1_1.xml │ ├── Maven__org_json_json_20140107.xml │ ├── Maven__org_mapstruct_mapstruct_1_2_0_Final.xml │ ├── Maven__org_mockito_mockito_core_1_10_19.xml │ ├── Maven__org_mybatis_mybatis_3_4_5.xml │ ├── Maven__org_mybatis_mybatis_spring_1_3_1.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_autoconfigure_1_3_1.xml │ ├── Maven__org_mybatis_spring_boot_mybatis_spring_boot_starter_1_3_1.xml │ ├── Maven__org_objenesis_objenesis_2_5_1.xml │ ├── Maven__org_ow2_asm_asm_5_0_3.xml │ ├── Maven__org_projectlombok_lombok_1_16_18.xml │ ├── Maven__org_reflections_reflections_0_9_11.xml │ ├── Maven__org_skyscreamer_jsonassert_1_4_0.xml │ ├── Maven__org_slf4j_jcl_over_slf4j_1_7_25.xml │ ├── Maven__org_slf4j_jul_to_slf4j_1_7_25.xml │ ├── Maven__org_slf4j_log4j_over_slf4j_1_7_25.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_25.xml │ ├── Maven__org_springframework_boot_spring_boot_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_actuator_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_autoconfigure_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_configuration_processor_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_actuator_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_aop_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_data_redis_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_jdbc_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_logging_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_security_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_test_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_tomcat_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_starter_web_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_test_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_boot_spring_boot_test_autoconfigure_1_5_6_RELEASE.xml │ ├── Maven__org_springframework_cloud_spring_cloud_commons_1_2_3_RELEASE.xml │ ├── Maven__org_springframework_cloud_spring_cloud_context_1_2_3_RELEASE.xml │ ├── Maven__org_springframework_cloud_spring_cloud_security_1_2_1_RELEASE.xml │ ├── Maven__org_springframework_cloud_spring_cloud_starter_1_2_3_RELEASE.xml │ ├── Maven__org_springframework_cloud_spring_cloud_starter_oauth2_1_2_1_RELEASE.xml │ ├── Maven__org_springframework_cloud_spring_cloud_starter_security_1_2_1_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_commons_1_13_6_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_keyvalue_1_2_6_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_redis_1_8_6_RELEASE.xml │ ├── Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml │ ├── Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml │ ├── Maven__org_springframework_security_oauth_spring_security_oauth2_2_0_14_RELEASE.xml │ ├── Maven__org_springframework_security_spring_security_config_4_2_3_RELEASE.xml │ ├── Maven__org_springframework_security_spring_security_core_4_2_3_RELEASE.xml │ ├── Maven__org_springframework_security_spring_security_crypto_4_2_3_RELEASE.xml │ ├── Maven__org_springframework_security_spring_security_jwt_1_0_8_RELEASE.xml │ ├── Maven__org_springframework_security_spring_security_rsa_1_0_3_RELEASE.xml │ ├── Maven__org_springframework_security_spring_security_web_4_2_3_RELEASE.xml │ ├── Maven__org_springframework_social_spring_social_config_1_1_4_RELEASE.xml │ ├── Maven__org_springframework_social_spring_social_core_1_1_4_RELEASE.xml │ ├── Maven__org_springframework_social_spring_social_security_1_1_4_RELEASE.xml │ ├── Maven__org_springframework_social_spring_social_web_1_1_4_RELEASE.xml │ ├── Maven__org_springframework_spring_aop_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_beans_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_context_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_context_support_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_core_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_expression_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_jdbc_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_oxm_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_test_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_tx_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_web_4_3_10_RELEASE.xml │ ├── Maven__org_springframework_spring_webmvc_4_3_10_RELEASE.xml │ ├── Maven__org_xmlunit_xmlunit_core_2_3_0.xml │ ├── Maven__org_xmlunit_xmlunit_legacy_2_3_0.xml │ ├── Maven__org_yaml_snakeyaml_1_17.xml │ ├── Maven__redis_clients_jedis_2_9_0.xml │ ├── Maven__stax_stax_api_1_0_1.xml │ ├── Maven__xmlpull_xmlpull_1_1_3_1.xml │ └── Maven__xpp3_xpp3_min_1_1_4c.xml ├── misc.xml ├── modules.xml └── uiDesigner.xml ├── README.md ├── app ├── app.iml ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── zq │ │ └── app │ │ ├── app │ │ ├── AppSecurityController.java │ │ ├── authentication │ │ │ ├── ZqAuthenctiationFailureHandler.java │ │ │ ├── ZqAuthenticationSuccessHandler.java │ │ │ └── openid │ │ │ │ ├── OpenIdAuthenticationConfig.java │ │ │ │ ├── OpenIdAuthenticationFilter.java │ │ │ │ ├── OpenIdAuthenticationProvider.java │ │ │ │ └── OpenIdAuthenticationToken.java │ │ ├── exceptions │ │ │ ├── AppSecretException.java │ │ │ └── ProductTokenException.java │ │ ├── social │ │ │ ├── AppSignUpUtils.java │ │ │ └── SpringSocialConfigurerPostProcessor.java │ │ └── validate │ │ │ └── core │ │ │ └── RedisValidateCodeRepository.java │ │ └── server │ │ ├── DefaultUserDetails.java │ │ ├── TokenJwtEnhancer.java │ │ ├── TokenStoreConfig.java │ │ ├── ZqAuthorizationServerConfig.java │ │ └── ZqResourceServerConfig.java │ └── main.iml ├── core ├── core.iml ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── zq │ └── core │ ├── SecurityCoreConfig.java │ ├── authentication │ ├── AuthenticationBeanConfig.java │ ├── DefaultSocialUserDetailsService.java │ ├── DefaultUserDetailsService.java │ ├── FormAuthenticationConfig.java │ └── mobile │ │ ├── SmsCodeAuthenticationFilter.java │ │ ├── SmsCodeAuthenticationProvider.java │ │ ├── SmsCodeAuthenticationSecurityConfig.java │ │ └── SmsCodeAuthenticationToken.java │ ├── authorize │ ├── AuthorizeConfigManager.java │ ├── AuthorizeConfigProvider.java │ ├── ZqAuthorizeConfigManager.java │ └── ZqAuthorizeConfigProvider.java │ ├── properties │ ├── SecurityConstants.java │ ├── SecurityProperties.java │ ├── browsers │ │ ├── BrowserProperties.java │ │ ├── LoginResponseType.java │ │ └── SessionProperties.java │ ├── oauth2 │ │ ├── OAuth2ClientProperties.java │ │ └── Oauth2Properties.java │ ├── social │ │ ├── QQProperties.java │ │ ├── SocialProperties.java │ │ └── WeXinProperties.java │ └── validate │ │ ├── ImageCodeProperties.java │ │ ├── SmsCodeProperties.java │ │ └── ValidateCodeProperties.java │ ├── restful │ ├── ResponseCode.java │ └── ServerResponse.java │ ├── social │ ├── SocialConfig.java │ ├── SocialController.java │ ├── qq │ │ ├── api │ │ │ ├── QQ.java │ │ │ ├── QQImpl.java │ │ │ └── QQUserInfo.java │ │ ├── config │ │ │ └── QQAutoConfig.java │ │ └── connect │ │ │ ├── QQAdapter.java │ │ │ ├── QQConnectionFactory.java │ │ │ ├── QQOauth2Template.java │ │ │ └── QQServiceProvider.java │ ├── support │ │ ├── SocialAuthenticationFilterPostProcessor.java │ │ ├── SocialUserInfo.java │ │ └── ZqSpringSocialConfigurer.java │ ├── view │ │ ├── ImoocConnectView.java │ │ └── ImoocConnectionStatusView.java │ └── wexin │ │ ├── api │ │ ├── WeXin.java │ │ ├── WeXinImpl.java │ │ └── WeXinUserInfo.java │ │ ├── config │ │ └── WeXinAutoConfig.java │ │ └── connect │ │ ├── WeXinAccessGrant.java │ │ ├── WeXinAdapter.java │ │ ├── WeXinConnectionFactory.java │ │ ├── WeXinOAuth2Template.java │ │ └── WeXinServiceProvider.java │ └── validate │ └── code │ ├── ValidateCodeBeanConfig.java │ ├── ValidateCodeController.java │ ├── ValidateCodeFilter.java │ ├── ValidateCodeSecurityConfig.java │ ├── common │ ├── AbstractValidateCodeProcessor.java │ ├── ValidateCode.java │ ├── ValidateCodeException.java │ ├── ValidateCodeGenerator.java │ ├── ValidateCodeProcessor.java │ ├── ValidateCodeProcessorHolder.java │ ├── ValidateCodeRepository.java │ └── ValidateCodeType.java │ ├── image │ ├── ImageCode.java │ ├── ImageCodeGenerator.java │ └── ImageCodeProcessor.java │ └── sms │ ├── DefaultSmsCodeSender.java │ ├── SmsCodeGenerator.java │ ├── SmsCodeProcessor.java │ └── SmsCodeSender.java ├── example ├── .gitignore ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── zq │ │ │ ├── ExampleApplication.java │ │ │ └── shop │ │ │ ├── authtication │ │ │ └── ExampleAuthticaitionConfigProvider.java │ │ │ ├── configs │ │ │ └── ExampleSocialUserDetailsService.java │ │ │ ├── exception │ │ │ ├── ExampleExceptionHandler.java │ │ │ └── FinalExceptionHandler.java │ │ │ ├── swagger │ │ │ └── SwaggerConfig.java │ │ │ ├── utils │ │ │ ├── BigDecimalUtil.java │ │ │ ├── FTPUtil.java │ │ │ └── MD5Util.java │ │ │ └── web │ │ │ ├── bean │ │ │ ├── Address.java │ │ │ ├── Cart.java │ │ │ ├── Moments.java │ │ │ ├── MomentsComment.java │ │ │ ├── Order.java │ │ │ ├── OrderItem.java │ │ │ ├── OrderSettlements.java │ │ │ ├── Product.java │ │ │ ├── ProductCategory.java │ │ │ ├── RongIMToken.java │ │ │ ├── Sequence.java │ │ │ ├── Shipping.java │ │ │ ├── ShopUser.java │ │ │ ├── Star.java │ │ │ └── UserFriends.java │ │ │ ├── common │ │ │ └── Const.java │ │ │ ├── controller │ │ │ ├── ManageUser │ │ │ │ ├── OrderManageController.java │ │ │ │ ├── ProductCategoryManageController.java │ │ │ │ ├── ProductManageController.java │ │ │ │ └── UserManageController.java │ │ │ └── NormalUser │ │ │ │ ├── CartController.java │ │ │ │ ├── MomentsController.java │ │ │ │ ├── OrderController.java │ │ │ │ ├── ProductController.java │ │ │ │ ├── RongIMController.java │ │ │ │ ├── ShippingController.java │ │ │ │ ├── UserController.java │ │ │ │ └── UserFriendsController.java │ │ │ ├── mappers │ │ │ ├── AddressMapper.java │ │ │ ├── CartMapper.java │ │ │ ├── IDMapper.java │ │ │ ├── MomentsCommentMapper.java │ │ │ ├── MomentsMapper.java │ │ │ ├── OrderItemMapper.java │ │ │ ├── OrderMapper.java │ │ │ ├── OrderSettlementsMapper.java │ │ │ ├── ProductCategoryMapper.java │ │ │ ├── ProductMapper.java │ │ │ ├── RongIMTokenMapper.java │ │ │ ├── SequenceMapper.java │ │ │ ├── ShippingMapper.java │ │ │ ├── ShopUserMapper.java │ │ │ ├── StarMapper.java │ │ │ └── UserFriendsMapper.java │ │ │ ├── service │ │ │ ├── ICartService.java │ │ │ ├── IFileService.java │ │ │ ├── IMomentsCommentService.java │ │ │ ├── IMomentsService.java │ │ │ ├── IOrderService.java │ │ │ ├── IProductCategoryService.java │ │ │ ├── IProductService.java │ │ │ ├── IRongIMService.java │ │ │ ├── IShippingService.java │ │ │ ├── IShopUserService.java │ │ │ ├── IUserFriendsService.java │ │ │ └── impl │ │ │ │ ├── CartServiceImpl.java │ │ │ │ ├── FileServiceImpl.java │ │ │ │ ├── MomentsCommentServiceImpl.java │ │ │ │ ├── MomentsServiceImpl.java │ │ │ │ ├── OrderServiceImpl.java │ │ │ │ ├── ProductCategoryServiceImpl.java │ │ │ │ ├── ProductServiceImpl.java │ │ │ │ ├── RongIMServiceImpl.java │ │ │ │ ├── ShippingServiceImpl.java │ │ │ │ ├── ShopUserServiceImpl.java │ │ │ │ └── UserFriendsServiceImpl.java │ │ │ └── vo │ │ │ ├── CartShopVo.java │ │ │ ├── CartVo.java │ │ │ ├── CategoryVo.java │ │ │ ├── MomentCommentVo.java │ │ │ ├── MomentVo.java │ │ │ ├── MomentsListVo.java │ │ │ ├── OrderItemVo.java │ │ │ ├── OrderSettlementsVo.java │ │ │ ├── OrderShopVo.java │ │ │ ├── OrderVo.java │ │ │ ├── ProductVo.java │ │ │ └── RecommendVo.java │ └── resources │ │ ├── application-dev.yml │ │ ├── application-prod.yml │ │ ├── application.yml │ │ └── mappers │ │ ├── AddressMapper.xml │ │ ├── CartMapper.xml │ │ ├── IDMapper.xml │ │ ├── MomentsCommentMapper.xml │ │ ├── MomentsMapper.xml │ │ ├── OrderItemMapper.xml │ │ ├── OrderMapper.xml │ │ ├── OrderSettlementsMapper.xml │ │ ├── ProductCategoryMapper.xml │ │ ├── ProductMapper.xml │ │ ├── RongIMTokenMapper.xml │ │ ├── SequenceMapper.xml │ │ ├── ShippingMapper.xml │ │ ├── ShopUserMapper.xml │ │ ├── StarMapper.xml │ │ └── UserFriendsMapper.xml │ └── test │ └── java │ └── com │ └── zq │ └── ExampleApplicationTests.java ├── pom.xml └── shop.iml /.idea/MyBatisCodeHelperDatasource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 31 | 32 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ch_qos_logback_logback_classic_1_1_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ch_qos_logback_logback_core_1_1_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__cn_rongcloud_im_server_sdk_java_3_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_druid_1_1_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_fastjson_1_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_aliyun_aliyun_java_sdk_core_3_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_aliyun_aliyun_java_sdk_ecs_4_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_aliyun_aliyun_java_sdk_ram_3_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_aliyun_aliyun_java_sdk_sts_3_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_aliyun_oss_aliyun_sdk_oss_3_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_classmate_1_3_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_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_8_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_flipkart_zjsonpatch_zjsonpatch_0_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_caspar_chen_swagger_ui_layer_0_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jknack_handlebars_4_0_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_jsqlparser_jsqlparser_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_pagehelper_pagehelper_5_1_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_pagehelper_pagehelper_spring_boot_autoconfigure_1_2_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_pagehelper_pagehelper_spring_boot_starter_1_2_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_github_tomakehurst_wiremock_2_5_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_code_gson_gson_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_guava_guava_20_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_2_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_sun_jersey_jersey_core_1_19_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_sun_jersey_jersey_json_1_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_sun_xml_bind_jaxb_impl_2_2_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_thoughtworks_xstream_xstream_1_4_10.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__commons_beanutils_commons_beanutils_1_9_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_codec_commons_codec_1_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_collections_commons_collections_3_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_io_commons_io_2_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_lang_commons_lang_2_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_net_commons_net_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_jsonwebtoken_jjwt_0_7_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_core_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_schema_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_spi_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_spring_web_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_swagger2_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_swagger_common_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_springfox_springfox_swagger_ui_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_swagger_swagger_annotations_1_5_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_swagger_swagger_models_1_5_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_activation_activation_1_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_inject_javax_inject_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_validation_validation_api_1_1_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_ws_rs_jsr311_api_1_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_xml_bind_jaxb_api_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_xml_stream_stax_api_1_0_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_5_1_43.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_7_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_minidev_accessors_smart_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_minidev_json_smart_2_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_antlr_antlr4_runtime_4_5_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_collections4_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_lang3_3_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_pool2_2_4_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpclient_4_5_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_httpcore_4_4_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_tomcat_jdbc_8_5_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_tomcat_tomcat_juli_8_5_16.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_aspectj_aspectjweaver_1_8_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_assertj_assertj_core_2_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_bouncycastle_bcpkix_jdk15on_1_56.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15on_1_56.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_jackson_jackson_core_asl_1_9_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_jackson_jackson_jaxrs_1_8_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_jackson_jackson_mapper_asl_1_9_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_jackson_jackson_xc_1_8_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_jettison_jettison_1_2.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_hibernate_hibernate_validator_5_3_5_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_javassist_javassist_3_21_0_GA.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jdom_jdom_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_json_json_20140107.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mapstruct_mapstruct_1_2_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_3_4_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_mybatis_mybatis_spring_1_3_1.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_1_3_1.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_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_objenesis_objenesis_2_5_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_ow2_asm_asm_5_0_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_projectlombok_lombok_1_16_18.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_reflections_reflections_0_9_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_skyscreamer_jsonassert_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_log4j_over_slf4j_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_actuator_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_configuration_processor_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_actuator_1_5_6_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_1_5_6_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_1_5_6_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_1_5_6_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_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_security_1_5_6_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_1_5_6_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_1_5_6_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_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_boot_spring_boot_test_1_5_6_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_1_5_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_cloud_spring_cloud_commons_1_2_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_cloud_spring_cloud_context_1_2_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_cloud_spring_cloud_security_1_2_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_cloud_spring_cloud_starter_1_2_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_cloud_spring_cloud_starter_oauth2_1_2_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_cloud_spring_cloud_starter_security_1_2_1_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_commons_1_13_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_keyvalue_1_2_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_redis_1_8_6_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_oauth_spring_security_oauth2_2_0_14_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_config_4_2_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_core_4_2_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_crypto_4_2_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_jwt_1_0_8_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_rsa_1_0_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_web_4_2_3_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_social_spring_social_config_1_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_social_spring_social_core_1_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_social_spring_social_security_1_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_social_spring_social_web_1_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_aop_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_support_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jdbc_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_oxm_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_test_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_tx_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_4_3_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_xmlunit_xmlunit_core_2_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_xmlunit_xmlunit_legacy_2_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_yaml_snakeyaml_1_17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__redis_clients_jedis_2_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__stax_stax_api_1_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__xmlpull_xmlpull_1_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__xpp3_xpp3_min_1_1_4c.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## shop-back-java 2 | 3 | #[`shop-front-android`](https://github.com/zhangqian666/shop-front-android)对应的java后端 4 | 5 | **关于一个商城的 后台包括模块** 6 | 7 | 1. 多种登录方式 : 8 | 1. 账号密码模式。 9 | 2. openid模式(第三方) 10 | 3. 密码模式 11 | 12 | 2. springsecurity 安全认证 13 | 14 | 3. 商城业务模块 15 | 1. 购物车 16 | 2. 订单模块 17 | 3. 商品,分类管理模块 18 | 4. 用户管理 19 | 5. 收货地址管理 20 | 6. 朋友圈管理 21 | 7. log管理 22 | 4. ftp服务器 redis服务器 等 23 | -------------------------------------------------------------------------------- /app/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | main 7 | com.zq.shop 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | jar 12 | app 13 | 14 | 15 | 16 | com.zq.shop 17 | core 18 | ${zq.security.version} 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/zq/app/app/exceptions/AppSecretException.java: -------------------------------------------------------------------------------- 1 | package com.zq.app.app.exceptions; 2 | 3 | /** 4 | * @Author 张迁-zhangqian 5 | * @Data 2018/4/10 下午1:00 6 | * @Package com.zq.app.app.social 7 | **/ 8 | 9 | 10 | public class AppSecretException extends RuntimeException { 11 | public AppSecretException(String msg) { 12 | super(msg); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/zq/app/app/exceptions/ProductTokenException.java: -------------------------------------------------------------------------------- 1 | package com.zq.app.app.exceptions; 2 | 3 | 4 | import org.springframework.security.core.AuthenticationException; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/10 下午9:25 9 | * @Package com.zq.app.app.exceptions 10 | **/ 11 | 12 | 13 | public class ProductTokenException extends AuthenticationException { 14 | public ProductTokenException(String message) { 15 | super(message); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/zq/app/app/social/SpringSocialConfigurerPostProcessor.java: -------------------------------------------------------------------------------- 1 | package com.zq.app.app.social; 2 | 3 | import com.zq.core.properties.SecurityConstants; 4 | import com.zq.core.social.support.ZqSpringSocialConfigurer; 5 | import org.apache.commons.lang.StringUtils; 6 | import org.springframework.beans.BeansException; 7 | import org.springframework.beans.factory.config.BeanPostProcessor; 8 | import org.springframework.stereotype.Component; 9 | 10 | /** 11 | * 用code进行社交登录 获取accesstoken后 去本地验证 如果验证不通过跳转的地址 12 | * 13 | * @Author 张迁-zhangqian 14 | * @Data 2018/4/10 下午1:27 15 | * @Package com.zq.app.app.social 16 | **/ 17 | 18 | @Component 19 | public class SpringSocialConfigurerPostProcessor implements BeanPostProcessor { 20 | @Override 21 | public Object postProcessBeforeInitialization(Object o, String s) throws BeansException { 22 | return o; 23 | } 24 | 25 | @Override 26 | public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { 27 | 28 | if (StringUtils.equals(beanName, "zqSocialSecurityConfig")) { 29 | ZqSpringSocialConfigurer config = (ZqSpringSocialConfigurer) bean; 30 | config.signupUrl(SecurityConstants.DEFAULT_SOCIAL_USER_INFO_URL); 31 | return config; 32 | } 33 | return bean; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/zq/app/server/DefaultUserDetails.java: -------------------------------------------------------------------------------- 1 | package com.zq.app.server; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.springframework.security.core.GrantedAuthority; 6 | import org.springframework.social.security.SocialUserDetails; 7 | 8 | import java.util.Collection; 9 | 10 | /** 11 | * @Author 张迁-zhangqian 12 | * @Data 2018/5/2 下午4:41 13 | * @Package com.zq.shop.web.common 14 | **/ 15 | 16 | @Getter 17 | @Setter 18 | public class DefaultUserDetails implements SocialUserDetails { 19 | 20 | private Integer uid; 21 | private String username; 22 | private String password; 23 | 24 | public DefaultUserDetails(Integer uid, String username, String password) { 25 | this.uid = uid; 26 | this.username = username; 27 | this.password = password; 28 | } 29 | 30 | @Override 31 | public Collection getAuthorities() { 32 | return null; 33 | } 34 | 35 | @Override 36 | public boolean isAccountNonExpired() { 37 | return true; 38 | } 39 | 40 | @Override 41 | public boolean isAccountNonLocked() { 42 | return true; 43 | } 44 | 45 | @Override 46 | public boolean isCredentialsNonExpired() { 47 | return true; 48 | } 49 | 50 | @Override 51 | public boolean isEnabled() { 52 | return true; 53 | } 54 | 55 | @Override 56 | public String getUserId() { 57 | return getUid().toString(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/zq/app/server/TokenJwtEnhancer.java: -------------------------------------------------------------------------------- 1 | package com.zq.app.server; 2 | 3 | import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken; 4 | import org.springframework.security.oauth2.common.OAuth2AccessToken; 5 | import org.springframework.security.oauth2.provider.OAuth2Authentication; 6 | import org.springframework.security.oauth2.provider.token.TokenEnhancer; 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | /** 12 | * @Author 张迁-zhangqian 13 | * @Data 2018/4/10 上午10:43 14 | * @Package com.zq.app.server 15 | **/ 16 | 17 | 18 | public class TokenJwtEnhancer implements TokenEnhancer { 19 | @Override 20 | public OAuth2AccessToken enhance(OAuth2AccessToken oAuth2AccessToken, OAuth2Authentication oAuth2Authentication) { 21 | Map info = new HashMap<>(); 22 | 23 | ((DefaultOAuth2AccessToken) oAuth2AccessToken).setAdditionalInformation(info); 24 | return oAuth2AccessToken; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/main.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/SecurityCoreConfig.java: -------------------------------------------------------------------------------- 1 | package com.zq.core; 2 | 3 | 4 | import com.zq.core.properties.SecurityProperties; 5 | import org.springframework.boot.context.properties.EnableConfigurationProperties; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | @EnableConfigurationProperties(SecurityProperties.class) 10 | public class SecurityCoreConfig { 11 | } 12 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/authentication/AuthenticationBeanConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.zq.core.authentication; 5 | 6 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.Configuration; 9 | import org.springframework.security.core.userdetails.UserDetailsService; 10 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 11 | import org.springframework.security.crypto.password.PasswordEncoder; 12 | import org.springframework.social.security.SocialUserDetailsService; 13 | 14 | /** 15 | * 16 | * 认证相关的扩展点配置。配置在这里的bean,业务系统都可以通过声明同类型或同名的bean来覆盖安全 17 | * 模块默认的配置。 18 | * 19 | * @author zhailiang 20 | * 21 | */ 22 | @Configuration 23 | public class AuthenticationBeanConfig { 24 | 25 | /** 26 | * 默认密码处理器 27 | * @return 28 | */ 29 | @Bean 30 | @ConditionalOnMissingBean(PasswordEncoder.class) 31 | public PasswordEncoder passwordEncoder() { 32 | return new BCryptPasswordEncoder(); 33 | } 34 | 35 | /** 36 | * 默认认证器 37 | * 38 | * @return 39 | */ 40 | @Bean 41 | @ConditionalOnMissingBean(UserDetailsService.class) 42 | public UserDetailsService userDetailsService() { 43 | return new DefaultUserDetailsService(); 44 | } 45 | 46 | /** 47 | * 默认认证器 48 | * 49 | * @return 50 | */ 51 | @Bean 52 | @ConditionalOnMissingBean(SocialUserDetailsService.class) 53 | public SocialUserDetailsService socialUserDetailsService() { 54 | return new DefaultSocialUserDetailsService(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/authentication/DefaultSocialUserDetailsService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.zq.core.authentication; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 9 | import org.springframework.social.security.SocialUserDetails; 10 | import org.springframework.social.security.SocialUserDetailsService; 11 | 12 | /** 13 | * 默认的SocialUserDetailsService实现 14 | * 15 | * 不做任何处理,只在控制台打印一句日志,然后抛出异常,提醒业务系统自己配置SocialUserDetailsService。 16 | * 17 | * @author zhailiang 18 | * 19 | */ 20 | public class DefaultSocialUserDetailsService implements SocialUserDetailsService { 21 | 22 | private Logger logger = LoggerFactory.getLogger(getClass()); 23 | 24 | @Override 25 | public SocialUserDetails loadUserByUserId(String userId) throws UsernameNotFoundException { 26 | logger.warn("请配置 SocialUserDetailsService 接口的实现."); 27 | throw new UsernameNotFoundException(userId); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/authentication/DefaultUserDetailsService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.zq.core.authentication; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.security.core.userdetails.UserDetails; 9 | import org.springframework.security.core.userdetails.UserDetailsService; 10 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 11 | 12 | /** 13 | * 14 | * 默认的 UserDetailsService 实现 15 | * 16 | * 不做任何处理,只在控制台打印一句日志,然后抛出异常,提醒业务系统自己配置 UserDetailsService。 17 | * 18 | * @author zhailiang 19 | * 20 | */ 21 | public class DefaultUserDetailsService implements UserDetailsService { 22 | 23 | private Logger logger = LoggerFactory.getLogger(getClass()); 24 | 25 | /* 26 | * (non-Javadoc) 27 | * 28 | * @see org.springframework.security.core.userdetails.UserDetailsService# 29 | * loadUserByUsername(java.lang.String) 30 | */ 31 | @Override 32 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 33 | logger.warn("请配置 UserDetailsService 接口的实现."); 34 | throw new UsernameNotFoundException(username); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/authentication/FormAuthenticationConfig.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.authentication; 2 | 3 | import com.zq.core.properties.SecurityConstants; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 6 | import org.springframework.security.web.authentication.AuthenticationFailureHandler; 7 | import org.springframework.security.web.authentication.AuthenticationSuccessHandler; 8 | import org.springframework.stereotype.Component; 9 | 10 | /** 11 | * @Author 张迁-zhangqian 12 | * @Data 2018/4/8 下午2:59 13 | * @Package com.zq.core.authentication 14 | **/ 15 | 16 | 17 | @Component 18 | public class FormAuthenticationConfig { 19 | 20 | @Autowired 21 | private AuthenticationFailureHandler zqAuthenticationFailureHandler; 22 | 23 | @Autowired 24 | private AuthenticationSuccessHandler zqAuthenticationSuccessHandler; 25 | 26 | public void configure(HttpSecurity httpSecurity) throws Exception { 27 | httpSecurity.formLogin() 28 | .loginPage(SecurityConstants.DEFAULT_UNAUTHENTICATION_URL) 29 | .loginProcessingUrl(SecurityConstants.DEFAULT_SIGN_IN_PROCESSING_URL_FORM) 30 | .successHandler(zqAuthenticationSuccessHandler) 31 | .failureHandler(zqAuthenticationFailureHandler); 32 | 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/authentication/mobile/SmsCodeAuthenticationToken.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.authentication.mobile; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.springframework.security.authentication.AbstractAuthenticationToken; 6 | import org.springframework.security.core.GrantedAuthority; 7 | 8 | import java.util.Collection; 9 | 10 | /** 11 | * @Author 张迁-zhangqian 12 | * @Data 2018/4/8 下午2:42 13 | * @Package com.zq.core.authentication.mobile 14 | **/ 15 | 16 | @Setter 17 | @Getter 18 | public class SmsCodeAuthenticationToken extends AbstractAuthenticationToken { 19 | 20 | 21 | private Object principal; 22 | 23 | public SmsCodeAuthenticationToken(String mobile) { 24 | super(null); 25 | this.principal = mobile; 26 | setAuthenticated(false); 27 | } 28 | 29 | public SmsCodeAuthenticationToken(Object principal, Collection authorities) { 30 | super(authorities); 31 | this.principal = principal; 32 | super.setAuthenticated(true); 33 | } 34 | 35 | 36 | @Override 37 | public Object getCredentials() { 38 | return null; 39 | } 40 | 41 | public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException { 42 | if (isAuthenticated) { 43 | throw new IllegalArgumentException( 44 | "Cannot set this token to trusted - use constructor which takes a GrantedAuthority list instead"); 45 | } 46 | 47 | super.setAuthenticated(false); 48 | } 49 | 50 | @Override 51 | public void eraseCredentials() { 52 | super.eraseCredentials(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/authorize/AuthorizeConfigManager.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.authorize; 2 | 3 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 4 | import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; 5 | 6 | /** 7 | * 授权信息管理器 8 | *

9 | * 用于收集系统中所有 AuthorizeConfigProvider 并加载其配置 10 | * 11 | * @Author 张迁-zhangqian 12 | * @Data 2018/4/9 下午2:00 13 | * @Package com.zq.core.authorize 14 | **/ 15 | 16 | 17 | public interface AuthorizeConfigManager { 18 | 19 | void config(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry config); 20 | } 21 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/authorize/AuthorizeConfigProvider.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.authorize; 2 | 3 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 4 | import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; 5 | 6 | /** 7 | * 授权配置提供器,各个模块和业务系统可以通过实现此接口向系统添加授权配置。 8 | * 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/4/9 下午2:00 11 | * @Package com.zq.core.authorize 12 | **/ 13 | 14 | 15 | public interface AuthorizeConfigProvider { 16 | 17 | /** 18 | * @param config 19 | * @return 返回的boolean表示配置中是否有针对anyRequest的配置。在整个授权配置中, 20 | * 应该有且仅有一个针对anyRequest的配置,如果所有的实现都没有针对anyRequest的配置, 21 | * 系统会自动增加一个anyRequest().authenticated()的配置。如果有多个针对anyRequest 22 | * 的配置,则会抛出异常。 23 | */ 24 | boolean config(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry config); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/SecurityProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties; 2 | 3 | import com.zq.core.properties.browsers.BrowserProperties; 4 | import com.zq.core.properties.oauth2.Oauth2Properties; 5 | import com.zq.core.properties.social.SocialProperties; 6 | import com.zq.core.properties.validate.ValidateCodeProperties; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | import org.springframework.boot.context.properties.ConfigurationProperties; 10 | 11 | /** 12 | * @Author 张迁-zhangqian 13 | * @Data 2018/4/4 下午4:33 14 | * @Package com.zq.core.properties 15 | **/ 16 | 17 | @Getter 18 | @Setter 19 | @ConfigurationProperties(prefix = "zq.security") 20 | public class SecurityProperties { 21 | /** 22 | * 浏览器环境配置 23 | */ 24 | private BrowserProperties browserProperties = new BrowserProperties(); 25 | 26 | private Oauth2Properties oauth2Properties = new Oauth2Properties(); 27 | 28 | private SocialProperties socialProperties = new SocialProperties(); 29 | 30 | private ValidateCodeProperties validateCodeProperties = new ValidateCodeProperties(); 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/browsers/BrowserProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.browsers; 2 | 3 | import com.zq.core.properties.SecurityConstants; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | /** 8 | * @Author 张迁-zhangqian 9 | * @Data 2018/4/4 下午4:36 10 | * @Package com.zq.core.properties.browsers 11 | **/ 12 | 13 | 14 | @Getter 15 | @Setter 16 | public class BrowserProperties { 17 | 18 | /** 19 | * session管理配置项 20 | */ 21 | private SessionProperties session = new SessionProperties(); 22 | /** 23 | * 登录页面,当引发登录行为的url以html结尾时,会跳到这里配置的url上 24 | */ 25 | private String signInPage = SecurityConstants.DEFAULT_SIGN_IN_PAGE_URL; 26 | /** 27 | * '记住我'功能的有效时间,默认1小时 28 | */ 29 | private int rememberMeSeconds = 3600; 30 | /** 31 | * 退出成功时跳转的url,如果配置了,则跳到指定的url,如果没配置,则返回json数据。 32 | */ 33 | private String signOutUrl; 34 | /** 35 | * 社交登录,如果需要用户注册,跳转的页面 36 | */ 37 | private String signUpUrl = "/zq-signUp.html"; 38 | /** 39 | * 登录响应的方式,默认是json 40 | */ 41 | private LoginResponseType signInResponseType = LoginResponseType.JSON; 42 | /** 43 | * 登录成功后跳转的地址,如果设置了此属性,则登录成功后总是会跳到这个地址上。 44 | * 45 | * 只在signInResponseType为REDIRECT时生效 46 | */ 47 | private String signInSuccessUrl; 48 | } 49 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/browsers/LoginResponseType.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.browsers; 2 | 3 | /** 4 | * @Author 张迁-zhangqian 5 | * @Data 2018/4/8 上午10:15 6 | * @Package com.zq.core.properties.browsers 7 | **/ 8 | 9 | 10 | public enum LoginResponseType { 11 | JSON, 12 | REDIRECT 13 | 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/browsers/SessionProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.browsers; 2 | 3 | import com.zq.core.properties.SecurityConstants; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | /** 8 | * @Author 张迁-zhangqian 9 | * @Data 2018/4/8 上午10:15 10 | * @Package com.zq.core.properties.browsers 11 | **/ 12 | 13 | 14 | @Getter 15 | @Setter 16 | public class SessionProperties { 17 | /** 18 | * 同一个用户在系统中的最大session数,默认1 19 | */ 20 | private int maximumSessions = 1; 21 | /** 22 | * 达到最大session时是否阻止新的登录请求,默认为false,不阻止,新的登录会将老的登录失效掉 23 | */ 24 | private boolean maxSessionsPreventsLogin; 25 | /** 26 | * session失效时跳转的地址 27 | */ 28 | private String sessionInvalidUrl = SecurityConstants.DEFAULT_SESSION_INVALID_URL; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/oauth2/OAuth2ClientProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.oauth2; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/9 下午7:02 9 | * @Package com.zq.core.properties.oauth2 10 | **/ 11 | 12 | @Setter 13 | @Getter 14 | public class OAuth2ClientProperties { 15 | /** 16 | * 第三方应用appId 17 | */ 18 | private String clientId; 19 | /** 20 | * 第三方应用appSecret 21 | */ 22 | private String clientSecret; 23 | /** 24 | * 针对此应用发出的token的有效时间 25 | */ 26 | private int accessTokenValidateSeconds = 7200; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/oauth2/Oauth2Properties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.oauth2; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/4 下午4:30 9 | * @Package com.zq.core.properties.oauth2 10 | **/ 11 | 12 | @Setter 13 | @Getter 14 | public class Oauth2Properties { 15 | 16 | /** 17 | * 使用jwt时为token签名的秘钥 18 | */ 19 | private String jwtSigningKey = "imooc"; 20 | /** 21 | * 客户端配置 22 | */ 23 | private OAuth2ClientProperties[] clients = {}; 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/social/QQProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.social; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.springframework.boot.autoconfigure.social.SocialProperties; 6 | 7 | /** 8 | * @Author 张迁-zhangqian 9 | * @Data 2018/4/8 下午8:01 10 | * @Package com.zq.core.properties.social 11 | **/ 12 | 13 | @Setter 14 | @Getter 15 | public class QQProperties extends SocialProperties{ 16 | /** 17 | * 第三方id,用来决定发起第三方登录的url,默认是 qq。 18 | */ 19 | private String providerId = "qq"; 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/social/SocialProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.social; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/4 下午4:31 9 | * @Package com.zq.core.properties.social 10 | **/ 11 | 12 | @Getter 13 | @Setter 14 | public class SocialProperties { 15 | 16 | /** 17 | * 社交登录功能拦截的url 18 | */ 19 | private String filterProcessesUrl = "/auth"; 20 | 21 | private QQProperties qq = new QQProperties(); 22 | 23 | private WeXinProperties wexin = new WeXinProperties(); 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/social/WeXinProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.social; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.springframework.boot.autoconfigure.social.SocialProperties; 6 | 7 | /** 8 | * @Author 张迁-zhangqian 9 | * @Data 2018/4/8 下午8:01 10 | * @Package com.zq.core.properties.social 11 | **/ 12 | 13 | 14 | @Setter 15 | @Getter 16 | public class WeXinProperties extends SocialProperties{ 17 | private String providerId = "wexin"; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/validate/ImageCodeProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.validate; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/8 下午1:06 9 | * @Package com.zq.core.properties.validate 10 | **/ 11 | 12 | @Getter 13 | @Setter 14 | public class ImageCodeProperties { 15 | 16 | private int width = 67; 17 | private int height = 23; 18 | private int expireIn =60; 19 | private int length; 20 | 21 | 22 | private String url; 23 | 24 | public ImageCodeProperties() { 25 | setLength(4); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/validate/SmsCodeProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.validate; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/8 下午1:06 9 | * @Package com.zq.core.properties.validate 10 | **/ 11 | 12 | 13 | @Setter 14 | @Getter 15 | public class SmsCodeProperties { 16 | 17 | private int length = 4; 18 | private int expireIn = 60; 19 | 20 | private String url; 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/properties/validate/ValidateCodeProperties.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.properties.validate; 2 | 3 | /** 4 | * @Author 张迁-zhangqian 5 | * @Data 2018/4/4 下午4:32 6 | * @Package com.zq.core.properties.validate 7 | **/ 8 | 9 | import lombok.Getter; 10 | import lombok.Setter; 11 | 12 | /** 13 | * 验证码配置 14 | */ 15 | @Setter 16 | @Getter 17 | public class ValidateCodeProperties { 18 | 19 | 20 | /** 21 | * 图片验证码配置 22 | */ 23 | private ImageCodeProperties image = new ImageCodeProperties(); 24 | /** 25 | * 短信验证码配置 26 | */ 27 | private SmsCodeProperties sms = new SmsCodeProperties(); 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/restful/ResponseCode.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.restful; 2 | 3 | /** 4 | * Created by geely 5 | */ 6 | public enum ResponseCode { 7 | 8 | SUCCESS(0,"SUCCESS"), 9 | ERROR(1,"ERROR"), 10 | NEED_LOGIN(10,"NEED_LOGIN"), 11 | ILLEGAL_ARGUMENT(2,"ILLEGAL_ARGUMENT"); 12 | 13 | private final int code; 14 | private final String desc; 15 | 16 | 17 | ResponseCode(int code,String desc){ 18 | this.code = code; 19 | this.desc = desc; 20 | } 21 | 22 | public int getCode(){ 23 | return code; 24 | } 25 | public String getDesc(){ 26 | return desc; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/SocialController.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social; 2 | 3 | import com.zq.core.social.support.SocialUserInfo; 4 | import org.springframework.social.connect.Connection; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/9 上午10:04 9 | * @Package com.zq.core.social 10 | **/ 11 | 12 | 13 | public abstract class SocialController { 14 | 15 | /** 16 | * 根据connect内容构建 SocialUserInfo 17 | * @param connection 18 | * @return 19 | */ 20 | protected SocialUserInfo buildSocialUserInfo(Connection connection){ 21 | 22 | SocialUserInfo userInfo = new SocialUserInfo(); 23 | userInfo.setProviderId(connection.getKey().getProviderId()); 24 | userInfo.setProviderUserId(connection.getKey().getProviderUserId()); 25 | userInfo.setNickname(connection.getDisplayName()); 26 | userInfo.setHeadimg(connection.getImageUrl()); 27 | return userInfo; 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/qq/api/QQ.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.qq.api; 2 | 3 | /** 4 | * @Author 张迁-zhangqian 5 | * @Data 2018/4/8 下午6:14 6 | * @Package com.zq.core.social.qq.api 7 | **/ 8 | 9 | 10 | public interface QQ { 11 | QQUserInfo getUserInfo(); 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/qq/config/QQAutoConfig.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.qq.config; 2 | 3 | import com.zq.core.properties.SecurityProperties; 4 | import com.zq.core.properties.social.QQProperties; 5 | import com.zq.core.social.qq.connect.QQConnectionFactory; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; 9 | import org.springframework.boot.autoconfigure.social.SocialAutoConfigurerAdapter; 10 | import org.springframework.context.annotation.Configuration; 11 | import org.springframework.social.connect.ConnectionFactory; 12 | 13 | /** 14 | * @Author 张迁-zhangqian 15 | * @Data 2018/4/8 下午7:40 16 | * @Package com.zq.core.social.qq.config 17 | **/ 18 | 19 | @Slf4j 20 | @Configuration 21 | @ConditionalOnProperty(prefix = "zq.security.social-properties.qq", name = "appId") 22 | public class QQAutoConfig extends SocialAutoConfigurerAdapter { 23 | 24 | 25 | @Autowired 26 | private SecurityProperties securityProperties; 27 | 28 | @Override 29 | protected ConnectionFactory createConnectionFactory() { 30 | log.info("创建QQConnectFactory成功"); 31 | QQProperties qq = securityProperties.getSocialProperties().getQq(); 32 | return new QQConnectionFactory(qq.getProviderId(), qq.getAppId(), qq.getAppSecret()); 33 | 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/qq/connect/QQAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.qq.connect; 2 | 3 | import com.zq.core.social.qq.api.QQ; 4 | import com.zq.core.social.qq.api.QQUserInfo; 5 | import org.springframework.social.connect.ApiAdapter; 6 | import org.springframework.social.connect.ConnectionValues; 7 | import org.springframework.social.connect.UserProfile; 8 | 9 | /** 10 | * @Author 张迁-zhangqian 11 | * @Data 2018/4/8 下午7:50 12 | * @Package com.zq.core.social.qq.connect 13 | **/ 14 | 15 | 16 | public class QQAdapter implements ApiAdapter { 17 | @Override 18 | public boolean test(QQ qq) { 19 | qq.getUserInfo(); 20 | return true; 21 | } 22 | 23 | @Override 24 | public void setConnectionValues(QQ api, ConnectionValues connectionValues) { 25 | QQUserInfo userInfo = api.getUserInfo(); 26 | 27 | connectionValues.setDisplayName(userInfo.getNickname()); 28 | connectionValues.setImageUrl(userInfo.getFigureurl_qq_1()); 29 | connectionValues.setProfileUrl(null); 30 | connectionValues.setProviderUserId(userInfo.getOpenId()); 31 | } 32 | 33 | @Override 34 | public UserProfile fetchUserProfile(QQ qq) { 35 | return null; 36 | } 37 | 38 | @Override 39 | public void updateStatus(QQ qq, String s) { 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/qq/connect/QQConnectionFactory.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.qq.connect; 2 | 3 | import com.zq.core.social.qq.api.QQ; 4 | import org.springframework.social.connect.ApiAdapter; 5 | import org.springframework.social.connect.support.OAuth2ConnectionFactory; 6 | import org.springframework.social.oauth2.OAuth2ServiceProvider; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/4/8 下午7:52 11 | * @Package com.zq.core.social.qq.connect 12 | **/ 13 | 14 | 15 | public class QQConnectionFactory extends OAuth2ConnectionFactory { 16 | public QQConnectionFactory(String providerId, String appid, String appSecret) { 17 | super(providerId, new QQServiceProvider(appid, appSecret), new QQAdapter()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/qq/connect/QQServiceProvider.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.qq.connect; 2 | 3 | import com.zq.core.social.qq.api.QQ; 4 | import com.zq.core.social.qq.api.QQImpl; 5 | import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider; 6 | 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/4/8 下午7:41 11 | * @Package com.zq.core.social.qq.connect 12 | **/ 13 | 14 | 15 | public class QQServiceProvider extends AbstractOAuth2ServiceProvider { 16 | 17 | private String appId; 18 | 19 | private static final String URL_AUTHORIZE = "https://graph.qq.com/oauth2.0/authorize"; 20 | 21 | private static final String URL_ACCESS_TOKEN = "https://graph.qq.com/oauth2.0/token"; 22 | 23 | public QQServiceProvider(String appId, String appSecret) { 24 | super(new QQOauth2Template(appId, appSecret, URL_AUTHORIZE, URL_ACCESS_TOKEN)); 25 | this.appId = appId; 26 | } 27 | 28 | 29 | @Override 30 | public QQ getApi(String accessToken) { 31 | return new QQImpl(accessToken, appId); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/support/SocialAuthenticationFilterPostProcessor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.zq.core.social.support; 5 | 6 | import org.springframework.social.security.SocialAuthenticationFilter; 7 | 8 | /** 9 | * SocialAuthenticationFilter后处理器,用于在不同环境下个性化社交登录的配置 10 | * 11 | * @author zhailiang 12 | */ 13 | public interface SocialAuthenticationFilterPostProcessor { 14 | 15 | /** 16 | * @param socialAuthenticationFilter 17 | */ 18 | void process(SocialAuthenticationFilter socialAuthenticationFilter); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/support/SocialUserInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.zq.core.social.support; 5 | 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | /** 10 | * @author zhailiang 11 | */ 12 | @Setter 13 | @Getter 14 | public class SocialUserInfo { 15 | 16 | private String providerId; 17 | 18 | private String providerUserId; 19 | 20 | private String nickname; 21 | 22 | private String headimg; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/support/ZqSpringSocialConfigurer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.zq.core.social.support; 5 | 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | import org.springframework.social.security.SocialAuthenticationFilter; 9 | import org.springframework.social.security.SpringSocialConfigurer; 10 | 11 | /** 12 | * 继承默认的社交登录配置,加入自定义的后处理逻辑 13 | * 14 | * @author zhailiang 15 | * 16 | */ 17 | @Getter 18 | @Setter 19 | public class ZqSpringSocialConfigurer extends SpringSocialConfigurer { 20 | 21 | private String filterProcessesUrl; 22 | 23 | private SocialAuthenticationFilterPostProcessor socialAuthenticationFilterPostProcessor; 24 | 25 | public ZqSpringSocialConfigurer(String filterProcessesUrl) { 26 | this.filterProcessesUrl = filterProcessesUrl; 27 | } 28 | 29 | /* (non-Javadoc) 30 | * @see org.springframework.security.config.annotation.SecurityConfigurerAdapter#postProcess(java.lang.Object) 31 | */ 32 | @SuppressWarnings("unchecked") 33 | @Override 34 | protected T postProcess(T object) { 35 | SocialAuthenticationFilter filter = (SocialAuthenticationFilter) super.postProcess(object); 36 | filter.setFilterProcessesUrl(filterProcessesUrl); 37 | if (socialAuthenticationFilterPostProcessor != null) { 38 | socialAuthenticationFilterPostProcessor.process(filter); 39 | } 40 | return (T) filter; 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/view/ImoocConnectView.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.zq.core.social.view; 5 | 6 | import org.springframework.web.servlet.view.AbstractView; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | import java.util.Map; 11 | 12 | /** 13 | * 绑定结果视图 14 | * @author zhailiang 15 | * 16 | */ 17 | public class ImoocConnectView extends AbstractView { 18 | 19 | /* 20 | * (non-Javadoc) 21 | * 22 | * @see 23 | * org.springframework.web.servlet.view.AbstractView#renderMergedOutputModel 24 | * (java.util.Map, javax.servlet.http.HttpServletRequest, 25 | * javax.servlet.http.HttpServletResponse) 26 | */ 27 | @Override 28 | protected void renderMergedOutputModel(Map model, HttpServletRequest request, 29 | HttpServletResponse response) throws Exception { 30 | 31 | response.setContentType("text/html;charset=UTF-8"); 32 | if (model.get("connections") == null) { 33 | response.getWriter().write("

解绑成功

"); 34 | } else { 35 | response.getWriter().write("

绑定成功

"); 36 | } 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/wexin/api/WeXin.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.wexin.api; 2 | 3 | /** 4 | * @Author 张迁-zhangqian 5 | * @Data 2018/4/9 下午12:49 6 | * @Package com.zq.core.social.wexin.api 7 | **/ 8 | 9 | 10 | public interface WeXin { 11 | 12 | 13 | WeXinUserInfo getWexinUserInfo(String appId); 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/wexin/api/WeXinUserInfo.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.wexin.api; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/9 下午12:47 9 | * @Package com.zq.core.social.wexin.api 10 | **/ 11 | 12 | @Getter 13 | @Setter 14 | public class WeXinUserInfo { 15 | /** 16 | * 普通用户的标识,对当前开发者帐号唯一 17 | */ 18 | private String openid; 19 | /** 20 | * 普通用户昵称 21 | */ 22 | private String nickname; 23 | /** 24 | * 语言 25 | */ 26 | private String language; 27 | /** 28 | * 普通用户性别,1为男性,2为女性 29 | */ 30 | private String sex; 31 | /** 32 | * 普通用户个人资料填写的省份 33 | */ 34 | private String province; 35 | /** 36 | * 普通用户个人资料填写的城市 37 | */ 38 | private String city; 39 | /** 40 | * 国家,如中国为CN 41 | */ 42 | private String country; 43 | /** 44 | * 用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空 45 | */ 46 | private String headimgurl; 47 | /** 48 | * 用户特权信息,json数组,如微信沃卡用户为(chinaunicom) 49 | */ 50 | private String[] privilege; 51 | /** 52 | * 用户统一标识。针对一个微信开放平台帐号下的应用,同一用户的unionid是唯一的。 53 | */ 54 | private String unionid; 55 | } 56 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/wexin/connect/WeXinAccessGrant.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.wexin.connect; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import org.springframework.social.oauth2.AccessGrant; 6 | 7 | /** 8 | * @Author 张迁-zhangqian 9 | * @Data 2018/4/9 下午12:59 10 | * @Package com.zq.core.social.wexin.connect 11 | **/ 12 | 13 | @Setter 14 | @Getter 15 | public class WeXinAccessGrant extends AccessGrant { 16 | private String openId; 17 | 18 | public WeXinAccessGrant(String accessToken, String scope, String refreshToken, Long expiresIn) { 19 | super(accessToken, scope, refreshToken, expiresIn); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/wexin/connect/WeXinAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.wexin.connect; 2 | 3 | import com.zq.core.social.wexin.api.WeXin; 4 | import com.zq.core.social.wexin.api.WeXinUserInfo; 5 | import org.springframework.social.connect.ApiAdapter; 6 | import org.springframework.social.connect.ConnectionValues; 7 | import org.springframework.social.connect.UserProfile; 8 | 9 | /** 10 | * 微信 api适配器,将微信 api的数据模型转为spring social的标准模型。 11 | * 12 | * @Author 张迁-zhangqian 13 | * @Data 2018/4/9 下午1:05 14 | * @Package com.zq.core.social.wexin.connect 15 | **/ 16 | 17 | 18 | public class WeXinAdapter implements ApiAdapter { 19 | private String openId; 20 | 21 | public WeXinAdapter(String openId) { 22 | this.openId = openId; 23 | } 24 | 25 | @Override 26 | public boolean test(WeXin weXin) { 27 | weXin.getWexinUserInfo(openId); 28 | return true; 29 | } 30 | 31 | @Override 32 | public void setConnectionValues(WeXin weXin, ConnectionValues connectionValues) { 33 | WeXinUserInfo wexinUserInfo = weXin.getWexinUserInfo(openId); 34 | connectionValues.setProviderUserId(wexinUserInfo.getOpenid()); 35 | connectionValues.setDisplayName(wexinUserInfo.getNickname()); 36 | connectionValues.setImageUrl(wexinUserInfo.getHeadimgurl()); 37 | } 38 | 39 | @Override 40 | public UserProfile fetchUserProfile(WeXin weXin) { 41 | return null; 42 | } 43 | 44 | @Override 45 | public void updateStatus(WeXin weXin, String s) { 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/social/wexin/connect/WeXinServiceProvider.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.social.wexin.connect; 2 | 3 | import com.zq.core.social.wexin.api.WeXin; 4 | import com.zq.core.social.wexin.api.WeXinImpl; 5 | import org.springframework.social.oauth2.AbstractOAuth2ServiceProvider; 6 | import org.springframework.social.oauth2.OAuth2Operations; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/4/9 下午1:02 11 | * @Package com.zq.core.social.wexin.connect 12 | **/ 13 | 14 | 15 | public class WeXinServiceProvider extends AbstractOAuth2ServiceProvider { 16 | 17 | /** 18 | * 微信获取授权码的url 19 | */ 20 | private static final String URL_AUTHORIZE = "https://open.weixin.qq.com/connect/qrconnect"; 21 | /** 22 | * 微信获取accessToken的url 23 | */ 24 | private static final String URL_ACCESS_TOKEN = "https://api.weixin.qq.com/sns/oauth2/access_token"; 25 | 26 | 27 | public WeXinServiceProvider(String appId, String appSecret) { 28 | super(new WeXinOAuth2Template(appId, appSecret, URL_AUTHORIZE, URL_ACCESS_TOKEN)); 29 | } 30 | 31 | @Override 32 | public WeXin getApi(String accessToken) { 33 | return new WeXinImpl(accessToken); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/ValidateCodeBeanConfig.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code; 2 | 3 | import com.zq.core.properties.SecurityProperties; 4 | import com.zq.core.validate.code.common.ValidateCodeGenerator; 5 | import com.zq.core.validate.code.image.ImageCodeGenerator; 6 | import com.zq.core.validate.code.sms.DefaultSmsCodeSender; 7 | import com.zq.core.validate.code.sms.SmsCodeSender; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; 10 | import org.springframework.context.annotation.Bean; 11 | import org.springframework.context.annotation.Configuration; 12 | 13 | /** 14 | * @Author 张迁-zhangqian 15 | * @Data 2018/4/8 下午2:03 16 | * @Package com.zq.core.validate.code 17 | **/ 18 | 19 | 20 | @Configuration 21 | public class ValidateCodeBeanConfig { 22 | 23 | @Autowired 24 | private SecurityProperties securityProperties; 25 | 26 | /** 27 | * 图片验证码图片生成器 28 | * @return 29 | */ 30 | @Bean 31 | @ConditionalOnMissingBean(name = "imageValidateCodeGenerator") 32 | public ValidateCodeGenerator imageValidateCodeGenerator() { 33 | ImageCodeGenerator codeGenerator = new ImageCodeGenerator(); 34 | codeGenerator.setSecurityProperties(securityProperties); 35 | return codeGenerator; 36 | } 37 | 38 | /** 39 | * 短信验证码发送器 40 | * @return 41 | */ 42 | @Bean 43 | @ConditionalOnMissingBean(SmsCodeSender.class) 44 | public SmsCodeSender smsCodeSender() { 45 | return new DefaultSmsCodeSender(); 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/ValidateCodeController.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code; 2 | 3 | import com.zq.core.properties.SecurityConstants; 4 | import com.zq.core.restful.ServerResponse; 5 | import com.zq.core.validate.code.common.ValidateCodeProcessorHolder; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.web.bind.annotation.GetMapping; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RestController; 10 | import org.springframework.web.context.request.ServletWebRequest; 11 | 12 | import javax.servlet.http.HttpServletRequest; 13 | import javax.servlet.http.HttpServletResponse; 14 | 15 | /** 16 | * @Author 张迁-zhangqian 17 | * @Data 2018/4/8 下午3:30 18 | * @Package com.zq.core.validate.code 19 | **/ 20 | 21 | 22 | @RestController 23 | public class ValidateCodeController { 24 | 25 | @Autowired 26 | private ValidateCodeProcessorHolder validateCodeProcessorHolder; 27 | 28 | 29 | /** 30 | * 创建验证码,根据验证码类型不同,调用不同的 {@link com.zq.core.validate.code.common.ValidateCodeProcessor}接口实现 31 | * 32 | * @param type 33 | * @param request 34 | * @param response 35 | * @throws Exception 36 | */ 37 | @GetMapping(SecurityConstants.DEFAULT_VALIDATE_CODE_URL_PREFIX + "/{type}") 38 | public ServerResponse createCode(@PathVariable String type, HttpServletRequest request, HttpServletResponse response) throws Exception { 39 | return validateCodeProcessorHolder.findValidateCodeProcessor(type) 40 | .create(new ServletWebRequest(request, response)); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/ValidateCodeSecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.config.annotation.SecurityConfigurerAdapter; 6 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 7 | import org.springframework.security.web.DefaultSecurityFilterChain; 8 | import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter; 9 | import org.springframework.stereotype.Component; 10 | 11 | import javax.servlet.Filter; 12 | 13 | /** 14 | * @Author 张迁-zhangqian 15 | * @Data 2018/4/8 下午2:00 16 | * @Package com.zq.core.validate.code 17 | **/ 18 | 19 | @Configuration("validateCodeSecurityConfig") 20 | public class ValidateCodeSecurityConfig extends SecurityConfigurerAdapter { 21 | 22 | 23 | @Autowired 24 | private Filter validateCodeFilter; 25 | 26 | @Override 27 | public void configure(HttpSecurity builder) throws Exception { 28 | builder.addFilterBefore(validateCodeFilter, AbstractPreAuthenticatedProcessingFilter.class); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/common/ValidateCode.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.common; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.io.Serializable; 7 | import java.time.LocalDateTime; 8 | 9 | /** 10 | * @Author 张迁-zhangqian 11 | * @Data 2018/4/8 上午11:59 12 | * @Package com.zq.core.validate.code 13 | **/ 14 | 15 | @Getter 16 | @Setter 17 | public class ValidateCode implements Serializable { 18 | 19 | 20 | private String code; 21 | private LocalDateTime expireTime; 22 | 23 | public ValidateCode(String code, int expireIn) { 24 | this.code = code; 25 | this.expireTime = LocalDateTime.now().plusSeconds(expireIn); 26 | } 27 | 28 | public ValidateCode(String code, LocalDateTime expireTime) { 29 | this.code = code; 30 | this.expireTime = expireTime; 31 | } 32 | 33 | public boolean isExpried() { 34 | return LocalDateTime.now().isAfter(expireTime); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/common/ValidateCodeException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.zq.core.validate.code.common; 5 | 6 | import org.springframework.security.core.AuthenticationException; 7 | 8 | /** 9 | * @author zhailiang 10 | * 11 | */ 12 | public class ValidateCodeException extends AuthenticationException { 13 | 14 | /** 15 | * 16 | */ 17 | private static final long serialVersionUID = -7285211528095468156L; 18 | 19 | public ValidateCodeException(String msg) { 20 | super(msg); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/common/ValidateCodeGenerator.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.common; 2 | 3 | import org.springframework.web.context.request.ServletWebRequest; 4 | 5 | /** 6 | * @Author 张迁-zhangqian 7 | * @Data 2018/4/8 下午1:02 8 | * @Package com.zq.core.validate.code.common 9 | **/ 10 | 11 | 12 | public interface ValidateCodeGenerator { 13 | 14 | /** 15 | * 生成验证码 16 | * 17 | * @param servletWebRequest 18 | * @return 19 | */ 20 | ValidateCode generate(ServletWebRequest servletWebRequest); 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/common/ValidateCodeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.common; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import org.springframework.web.context.request.ServletWebRequest; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/8 上午11:52 9 | * @Package com.zq.core.validate.code 10 | **/ 11 | 12 | 13 | public interface ValidateCodeProcessor { 14 | 15 | /** 16 | * 创建校验码 17 | * 18 | * @param servletWebRequest 19 | * @throws Exception 20 | */ 21 | ServerResponse create(ServletWebRequest servletWebRequest) throws Exception; 22 | 23 | /** 24 | * 验证校验码 25 | * 26 | * @param servletWebRequest 27 | */ 28 | 29 | void validate(ServletWebRequest servletWebRequest); 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/common/ValidateCodeProcessorHolder.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.common; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Component; 5 | import org.springframework.web.context.request.ServletWebRequest; 6 | 7 | import java.util.Map; 8 | 9 | /** 10 | * @Author 张迁-zhangqian 11 | * @Data 2018/4/8 下午1:49 12 | * @Package com.zq.core.validate.code.common 13 | **/ 14 | 15 | @Component 16 | public class ValidateCodeProcessorHolder { 17 | 18 | @Autowired 19 | private Map validateCodeProcessors; 20 | 21 | /** 22 | * @param type 23 | * @return 24 | */ 25 | public ValidateCodeProcessor findValidateCodeProcessor(ValidateCodeType type) { 26 | return findValidateCodeProcessor(type.toString().toLowerCase()); 27 | } 28 | 29 | /** 30 | * @param type 31 | * @return 32 | */ 33 | public ValidateCodeProcessor findValidateCodeProcessor(String type) { 34 | String name = type.toLowerCase() + ValidateCodeProcessor.class.getSimpleName(); 35 | ValidateCodeProcessor processor = validateCodeProcessors.get(name); 36 | if (processor == null) { 37 | throw new ValidateCodeException("验证码处理器" + name + "不存在"); 38 | } 39 | return processor; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/common/ValidateCodeRepository.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.common; 2 | 3 | import org.springframework.web.context.request.ServletWebRequest; 4 | 5 | /** 6 | * @Author 张迁-zhangqian 7 | * @Data 2018/4/8 下午1:30 8 | * @Package com.zq.core.validate.code.common 9 | **/ 10 | 11 | /** 12 | * 校验码存取器 13 | */ 14 | public interface ValidateCodeRepository { 15 | /** 16 | * 保存验证码 17 | * 18 | * @param request 19 | * @param code 20 | * @param validateCodeType 21 | */ 22 | void save(ServletWebRequest request, ValidateCode code, ValidateCodeType validateCodeType); 23 | 24 | /** 25 | * 获取验证码 26 | * 27 | * @param request 28 | * @param validateCodeType 29 | * @return 30 | */ 31 | ValidateCode get(ServletWebRequest request, ValidateCodeType validateCodeType); 32 | 33 | /** 34 | * 移除验证码 35 | * 36 | * @param request 37 | * @param codeType 38 | */ 39 | void remove(ServletWebRequest request, ValidateCodeType codeType); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/common/ValidateCodeType.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.common; 2 | 3 | /** 4 | * @Author 张迁-zhangqian 5 | * @Data 2018/4/8 下午1:25 6 | * @Package com.zq.core.validate.code.common 7 | **/ 8 | 9 | import com.zq.core.properties.SecurityConstants; 10 | 11 | /** 12 | * 校验码类型 13 | */ 14 | public enum ValidateCodeType { 15 | 16 | 17 | 18 | /** 19 | * 短信验证码 20 | */ 21 | SMS { 22 | @Override 23 | public String getParamNameOnValidate() { 24 | return SecurityConstants.DEFAULT_PARAMETER_NAME_CODE_SMS; 25 | } 26 | }, 27 | /** 28 | * 图片验证码 29 | */ 30 | IMAGE { 31 | @Override 32 | public String getParamNameOnValidate() { 33 | return SecurityConstants.DEFAULT_PARAMETER_NAME_CODE_IMAGE; 34 | } 35 | }; 36 | 37 | /** 38 | * 校验时从请求中获取的参数的名字 39 | * @return 40 | */ 41 | public abstract String getParamNameOnValidate(); 42 | } 43 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/image/ImageCode.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.image; 2 | 3 | import com.zq.core.validate.code.common.ValidateCode; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import java.awt.image.BufferedImage; 8 | import java.time.LocalDateTime; 9 | 10 | /** 11 | * @Author 张迁-zhangqian 12 | * @Data 2018/4/8 下午1:15 13 | * @Package com.zq.core.validate.code.image 14 | **/ 15 | 16 | 17 | /** 18 | * 图片验证码 19 | */ 20 | @Getter 21 | @Setter 22 | public class ImageCode extends ValidateCode { 23 | 24 | private BufferedImage bufferedImage; 25 | 26 | public ImageCode(BufferedImage bufferedImage, String code, int expireIn) { 27 | super(code, expireIn); 28 | this.bufferedImage = bufferedImage; 29 | } 30 | 31 | public ImageCode(String code, LocalDateTime expireTime, BufferedImage bufferedImage) { 32 | super(code, expireTime); 33 | this.bufferedImage = bufferedImage; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/image/ImageCodeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.image; 2 | 3 | 4 | import com.zq.core.restful.ServerResponse; 5 | import com.zq.core.validate.code.common.AbstractValidateCodeProcessor; 6 | import com.zq.core.validate.code.common.ValidateCode; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.web.context.request.ServletWebRequest; 9 | 10 | import javax.imageio.ImageIO; 11 | 12 | /** 13 | * @Author 张迁-zhangqian 14 | * @Data 2018/4/8 下午1:21 15 | * @Package com.zq.core.validate.code.image 16 | **/ 17 | 18 | 19 | @Component("imageValidateCodeProcessor") 20 | public class ImageCodeProcessor extends AbstractValidateCodeProcessor { 21 | 22 | 23 | @Override 24 | protected ServerResponse send(ServletWebRequest request, ImageCode imageCode) throws Exception { 25 | ImageIO.write(imageCode.getBufferedImage(),"JPEG",request.getResponse().getOutputStream()); 26 | return ServerResponse.createBySuccess("生成图片成功"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/sms/DefaultSmsCodeSender.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.sms; 2 | 3 | import lombok.extern.slf4j.Slf4j; 4 | 5 | /** 6 | * @Author 张迁-zhangqian 7 | * @Data 2018/4/8 下午1:47 8 | * @Package com.zq.core.validate.code.sms 9 | **/ 10 | 11 | @Slf4j 12 | public class DefaultSmsCodeSender implements SmsCodeSender { 13 | @Override 14 | public void send(String mobile, String code) { 15 | 16 | log.info("用第三方短信给" + mobile + "发送短信验证码:" + code); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/sms/SmsCodeGenerator.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.sms; 2 | 3 | import com.zq.core.properties.SecurityProperties; 4 | import com.zq.core.validate.code.common.ValidateCode; 5 | import com.zq.core.validate.code.common.ValidateCodeGenerator; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | import org.apache.commons.lang.RandomStringUtils; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Component; 11 | import org.springframework.web.context.request.ServletWebRequest; 12 | 13 | /** 14 | * @Author 张迁-zhangqian 15 | * @Data 2018/4/8 下午1:39 16 | * @Package com.zq.core.validate.code.sms 17 | **/ 18 | 19 | @Getter 20 | @Setter 21 | @Component("smsValidateCodeGenerator") 22 | public class SmsCodeGenerator implements ValidateCodeGenerator { 23 | @Autowired 24 | private SecurityProperties securityProperties; 25 | 26 | @Override 27 | public ValidateCode generate(ServletWebRequest servletWebRequest) { 28 | 29 | String code = RandomStringUtils.randomNumeric(securityProperties.getValidateCodeProperties().getSms().getLength()); 30 | return new ValidateCode(code, securityProperties.getValidateCodeProperties().getSms().getExpireIn()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/sms/SmsCodeProcessor.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.sms; 2 | 3 | import com.zq.core.properties.SecurityConstants; 4 | import com.zq.core.restful.ServerResponse; 5 | import com.zq.core.validate.code.common.AbstractValidateCodeProcessor; 6 | import com.zq.core.validate.code.common.ValidateCode; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Component; 10 | import org.springframework.web.bind.ServletRequestUtils; 11 | import org.springframework.web.context.request.ServletWebRequest; 12 | 13 | /** 14 | * @Author 张迁-zhangqian 15 | * @Data 2018/4/8 下午1:42 16 | * @Package com.zq.core.validate.code.sms 17 | **/ 18 | 19 | @Component("smsValidateCodeProcessor") 20 | public class SmsCodeProcessor extends AbstractValidateCodeProcessor { 21 | 22 | @Autowired 23 | private SmsCodeSender smsCodeSender; 24 | 25 | @Override 26 | protected ServerResponse send(ServletWebRequest request, ValidateCode validateCode) throws Exception { 27 | String paramName = SecurityConstants.DEFAULT_PARAMETER_NAME_MOBILE; 28 | String mobile = ServletRequestUtils.getRequiredStringParameter(request.getRequest(), paramName); 29 | 30 | smsCodeSender.send(mobile, validateCode.getCode()); 31 | 32 | return ServerResponse.createBySuccess("发送短信成功 mobile:" + mobile + " code:" + validateCode.getCode()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/com/zq/core/validate/code/sms/SmsCodeSender.java: -------------------------------------------------------------------------------- 1 | package com.zq.core.validate.code.sms; 2 | 3 | /** 4 | * @Author 张迁-zhangqian 5 | * @Data 2018/4/8 下午1:45 6 | * @Package com.zq.core.validate.code.sms 7 | **/ 8 | 9 | 10 | public interface SmsCodeSender { 11 | void send(String mobile, String code); 12 | } 13 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | .sts4-cache 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | /nbproject/private/ 21 | /build/ 22 | /nbbuild/ 23 | /dist/ 24 | /nbdist/ 25 | /.nb-gradle/ -------------------------------------------------------------------------------- /example/src/main/java/com/zq/ExampleApplication.java: -------------------------------------------------------------------------------- 1 | package com.zq; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.transaction.annotation.EnableTransactionManagement; 7 | 8 | @SpringBootApplication 9 | @EnableTransactionManagement//开启事务 10 | @MapperScan(value = "com.zq.shop.web.mappers")//mybatis扫描mapper接口 11 | public class ExampleApplication { 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(ExampleApplication.class, args); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/authtication/ExampleAuthticaitionConfigProvider.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.authtication; 2 | 3 | import com.zq.core.authorize.AuthorizeConfigProvider; 4 | import org.springframework.http.HttpMethod; 5 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 6 | import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer; 7 | import org.springframework.stereotype.Component; 8 | 9 | /** 10 | * @Author 张迁-zhangqian 11 | * @Data 2018/4/10 下午7:28 12 | * @Package com.zq.shop.authtication 13 | **/ 14 | 15 | @Component 16 | public class ExampleAuthticaitionConfigProvider implements AuthorizeConfigProvider { 17 | @Override 18 | public boolean config(ExpressionUrlAuthorizationConfigurer.ExpressionInterceptUrlRegistry config) { 19 | 20 | config.antMatchers(HttpMethod.POST, "/user/register") 21 | .permitAll() 22 | .antMatchers(HttpMethod.GET, "/fonts/**") 23 | .permitAll() 24 | .antMatchers(HttpMethod.GET, "/v2/api-docs" 25 | , "/swagger-resources/configuration/ui" 26 | , "/swagger-resources" 27 | , "/swagger-resources/configuration/security" 28 | , "/swagger-ui.html" 29 | , "/docs.html") 30 | .permitAll(); 31 | 32 | return false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/exception/ExampleExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.exception; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import org.springframework.http.HttpStatus; 5 | import org.springframework.web.bind.annotation.ControllerAdvice; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | import org.springframework.web.bind.annotation.*; 8 | import org.springframework.web.servlet.NoHandlerFoundException; 9 | 10 | 11 | /** 12 | * @Author 张迁-zhangqian 13 | * @Data 2018/4/10 下午9:40 14 | * @Package com.zq.shop.exception 15 | **/ 16 | @ResponseBody 17 | @ControllerAdvice 18 | public class ExampleExceptionHandler { 19 | 20 | 21 | @ExceptionHandler(value = Exception.class) 22 | public ServerResponse errorHandler(Exception e) { 23 | e.printStackTrace(); 24 | int code; 25 | if (e instanceof NoHandlerFoundException) { 26 | code = HttpStatus.BAD_REQUEST.value(); 27 | } else { 28 | code = 500; 29 | } 30 | return ServerResponse.createByErrorCodeMessage(code, 31 | 32 | e.getClass().getSimpleName() + ";\n" + 33 | "local : " + e.getLocalizedMessage() + ";\n" + 34 | "string : " + e.toString() + ";\n" + 35 | "message : " + e.getMessage()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/exception/FinalExceptionHandler.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.exception; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import org.springframework.boot.autoconfigure.web.ErrorController; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | /** 11 | * @Author 张迁-zhangqian 12 | * @Data 2018/4/10 下午10:01 13 | * @Package com.zq.shop.exception 14 | **/ 15 | @Deprecated 16 | //@RestController 17 | public class FinalExceptionHandler implements ErrorController { 18 | @Override 19 | public String getErrorPath() { 20 | return "/error"; 21 | } 22 | 23 | @RequestMapping("/error") 24 | public ServerResponse finalError(HttpServletResponse response, HttpServletRequest request) { 25 | return ServerResponse.createByErrorCodeMessage(500, "服务器错误"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/utils/BigDecimalUtil.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.utils; 2 | 3 | import java.math.BigDecimal; 4 | 5 | /** 6 | * Created by geely 7 | */ 8 | public class BigDecimalUtil { 9 | 10 | public static BigDecimal add(double v1, double v2) { 11 | BigDecimal b1 = new BigDecimal(Double.toString(v1)); 12 | BigDecimal b2 = new BigDecimal(Double.toString(v2)); 13 | return b1.add(b2); 14 | } 15 | 16 | public static BigDecimal sub(double v1, double v2) { 17 | BigDecimal b1 = new BigDecimal(Double.toString(v1)); 18 | BigDecimal b2 = new BigDecimal(Double.toString(v2)); 19 | return b1.subtract(b2); 20 | } 21 | 22 | 23 | public static BigDecimal mul(double v1, double v2) { 24 | BigDecimal b1 = new BigDecimal(Double.toString(v1)); 25 | BigDecimal b2 = new BigDecimal(Double.toString(v2)); 26 | return b1.multiply(b2); 27 | } 28 | 29 | public static BigDecimal div(double v1, double v2) { 30 | BigDecimal b1 = new BigDecimal(Double.toString(v1)); 31 | BigDecimal b2 = new BigDecimal(Double.toString(v2)); 32 | return b1.divide(b2, 2, BigDecimal.ROUND_HALF_UP);//四舍五入,保留2位小数 33 | 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/controller/ManageUser/OrderManageController.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.controller.ManageUser; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import com.zq.shop.web.service.IOrderService; 5 | import io.swagger.annotations.Api; 6 | import io.swagger.annotations.ApiOperation; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.web.bind.annotation.PostMapping; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RestController; 11 | 12 | /** 13 | * @Author 张迁-zhangqian 14 | * @Data 2018/4/23 下午2:42 15 | * @Package com.zq.shop.web.controller.ManageUser 16 | **/ 17 | 18 | @Api(tags = "管理员:订单管理") 19 | @RestController 20 | @RequestMapping("/manage/order") 21 | public class OrderManageController { 22 | 23 | @Autowired 24 | private IOrderService iOrderService; 25 | 26 | @ApiOperation("列表") 27 | @PostMapping("/list") 28 | public ServerResponse manageList() { 29 | return iOrderService.manageList(0, 0); 30 | } 31 | 32 | @ApiOperation("订单详情") 33 | @PostMapping("/details") 34 | public ServerResponse manageDetails(Long orderNo) { 35 | return iOrderService.manageDetail(orderNo); 36 | } 37 | 38 | @ApiOperation("发送货物") 39 | @PostMapping("/send_goods") 40 | public ServerResponse manageSendGoods(Long orderNo) { 41 | return iOrderService.manageSendGoods(orderNo); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/controller/NormalUser/RongIMController.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.controller.NormalUser; 2 | 3 | import com.zq.app.server.DefaultUserDetails; 4 | import com.zq.core.restful.ServerResponse; 5 | import com.zq.shop.web.service.IRongIMService; 6 | import io.swagger.annotations.Api; 7 | import io.swagger.annotations.ApiOperation; 8 | import lombok.extern.slf4j.Slf4j; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.security.core.annotation.AuthenticationPrincipal; 11 | import org.springframework.web.bind.annotation.GetMapping; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | /** 16 | * @Author 张迁-zhangqian 17 | * @Data 2018/5/30 上午11:49 18 | * @Package com.zq.shop.web.controller.NormalUser 19 | **/ 20 | 21 | @Slf4j 22 | @Api(tags = "融云接口管理") 23 | @RestController 24 | @RequestMapping("/rongim") 25 | public class RongIMController { 26 | 27 | @Autowired 28 | IRongIMService iRongIMService; 29 | 30 | @ApiOperation("获取token") 31 | @GetMapping("/token") 32 | public ServerResponse getUser(@AuthenticationPrincipal DefaultUserDetails defaultUserDetails) { 33 | return iRongIMService.getToken(defaultUserDetails.getUid()); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/mappers/AddressMapper.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.mappers; 2 | 3 | import com.zq.shop.web.bean.Address; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | public interface AddressMapper { 9 | /** 10 | * This method was generated by MyBatis Generator. 11 | * This method corresponds to the database table zq_address 12 | * 13 | * @mbg.generated 14 | */ 15 | int insert(Address record); 16 | 17 | /** 18 | * This method was generated by MyBatis Generator. 19 | * This method corresponds to the database table zq_address 20 | * 21 | * @mbg.generated 22 | */ 23 | int insertSelective(Address record); 24 | 25 | List
findByLevelAndShengOrDi(@Param("level") String level, @Param("sheng") String sheng, @Param("di") String di); 26 | 27 | 28 | } -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/mappers/IDMapper.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.mappers; 2 | 3 | import org.apache.ibatis.annotations.Param; 4 | 5 | /** 6 | * @Author 张迁-zhangqian 7 | * @Data 2018/4/26 下午3:54 8 | * @Package com.zq.shop.web.mappers 9 | **/ 10 | 11 | 12 | public interface IDMapper { 13 | /** 14 | * @param typeId 15 | * @return 16 | */ 17 | Integer findId(@Param("type_id") String typeId); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/ICartService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | 5 | /** 6 | * @Author 张迁-zhangqian 7 | * @Data 2018/4/22 下午5:42 8 | * @Package com.zq.shop.web.service 9 | **/ 10 | 11 | 12 | public interface ICartService { 13 | ServerResponse add(Integer userId, Integer productId, Integer count); 14 | 15 | ServerResponse delete(Integer userId, String productIds); 16 | 17 | ServerResponse updateCount(Integer userId, Integer productId, Integer count); 18 | 19 | ServerResponse list(Integer userId); 20 | 21 | ServerResponse selectOrUnSelect(Integer userId, Integer productId, Integer checked); 22 | } 23 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IFileService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import org.springframework.web.multipart.MultipartFile; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/4/21 下午7:05 11 | * @Package com.zq.shop.web.service 12 | **/ 13 | 14 | 15 | public interface IFileService { 16 | ServerResponse uploadFile(MultipartFile file, String path); 17 | 18 | ServerResponse> uploadFiles(List files, String path); 19 | } 20 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IMomentsCommentService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import com.zq.shop.web.bean.MomentsComment; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/23 下午4:19 9 | * @Package com.zq.shop.web.service 10 | **/ 11 | 12 | 13 | public interface IMomentsCommentService { 14 | ServerResponse create(MomentsComment momentsComment); 15 | 16 | ServerResponse findComment(Integer momentsId); 17 | } 18 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IMomentsService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import com.zq.shop.web.bean.Moments; 5 | import com.zq.shop.web.vo.MomentVo; 6 | import com.zq.shop.web.vo.MomentsListVo; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @Author 张迁-zhangqian 12 | * @Data 2018/4/23 下午4:08 13 | * @Package com.zq.shop.web.service 14 | **/ 15 | 16 | 17 | public interface IMomentsService { 18 | ServerResponse create(Moments moments, Integer uid); 19 | 20 | ServerResponse details(Integer momentId, Integer uid); 21 | 22 | ServerResponse> list(Integer uid, Integer searchUid); 23 | 24 | ServerResponse star(Integer momentId, Integer uid); 25 | } 26 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IOrderService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import com.zq.shop.web.vo.OrderVo; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/4/22 下午7:59 11 | * @Package com.zq.shop.web.service 12 | **/ 13 | 14 | 15 | public interface IOrderService { 16 | ServerResponse createOrder(Integer userId, Integer shippingId, String productIds); 17 | 18 | ServerResponse cancel(Integer userId, Long orderNo); 19 | 20 | ServerResponse getOrderDetail(Integer userId, Long orderNo); 21 | 22 | ServerResponse> getOrderList(Integer userId, Integer status, int pageNum, int pageSize); 23 | 24 | ServerResponse getOrderCheckedProductList(Integer uid, int i, int i1); 25 | 26 | //manage 27 | ServerResponse> manageList(int pageNum, int pageSize); 28 | 29 | ServerResponse manageDetail(Long orderNo); 30 | 31 | ServerResponse manageSendGoods(Long orderNo); 32 | 33 | ServerResponse preCreateOrder(Integer uid, String productIds); 34 | } 35 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IProductCategoryService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import com.zq.shop.web.vo.CategoryVo; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/4/22 下午2:45 11 | * @Package com.zq.shop.web.service 12 | **/ 13 | 14 | 15 | public interface IProductCategoryService { 16 | ServerResponse> selectCategoryAndChildrenById(Integer id); 17 | 18 | ServerResponse> getChildrenParallelCategory(Integer categoryId); 19 | 20 | ServerResponse addCategory(String categoryName, Integer parentId); 21 | 22 | ServerResponse updateCategoryName(Integer categoryId, String categoryName); 23 | 24 | ServerResponse updateCategoryStatus(Integer categoryId, Boolean status); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IProductService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import com.zq.shop.web.bean.Product; 5 | import com.zq.shop.web.vo.ProductVo; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @Author 张迁-zhangqian 11 | * @Data 2018/4/22 下午2:05 12 | * @Package com.zq.shop.web.service 13 | **/ 14 | 15 | 16 | public interface IProductService { 17 | ServerResponse> getProductListByKeywordCategory(String keyword, Integer categoryId, int pagenum, int pagesize, String orderby); 18 | 19 | ServerResponse details(Integer productId); 20 | 21 | ServerResponse saveOrUpdateProduct(Product product, Integer userId); 22 | 23 | ServerResponse setSaleStatus(Integer productId, Integer status); 24 | 25 | 26 | ServerResponse> getProductList(Integer uid, int pageNum, int pageSize); 27 | 28 | ServerResponse> searchProduct(String productName, Integer productId, int pageNum, int pageSize); 29 | 30 | ServerResponse getProductListByUser(Integer userId, int i, int i1); 31 | } 32 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IRongIMService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | 5 | /** 6 | * @Author 张迁-zhangqian 7 | * @Data 2018/5/31 下午2:19 8 | * @Package com.zq.shop.web.service 9 | **/ 10 | 11 | 12 | public interface IRongIMService { 13 | 14 | ServerResponse getToken(Integer userId); 15 | } 16 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IShippingService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import com.zq.shop.web.bean.Address; 5 | import com.zq.shop.web.bean.Shipping; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @Author 张迁-zhangqian 11 | * @Data 2018/4/22 下午8:01 12 | * @Package com.zq.shop.web.service 13 | **/ 14 | 15 | 16 | public interface IShippingService { 17 | ServerResponse add(Integer userId, Shipping shipping); 18 | 19 | ServerResponse del(Integer userId, Integer shippingId); 20 | 21 | ServerResponse update(Integer userId, Shipping shipping); 22 | 23 | ServerResponse select(Integer userId, Integer shippingId); 24 | 25 | ServerResponse> list(Integer userId, int pageNum, int pageSize); 26 | 27 | ServerResponse> address(Integer uid, String shengcode, String dicode, Integer level); 28 | } 29 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IShopUserService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | import com.zq.shop.web.bean.ShopUser; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/4/21 下午2:34 9 | * @Package com.zq.shop.web.service 10 | **/ 11 | 12 | 13 | public interface IShopUserService { 14 | ServerResponse register(ShopUser shopUser); 15 | 16 | ServerResponse getUserInfo(String username); 17 | 18 | ServerResponse getUserInfo(Integer userId); 19 | 20 | ServerResponse updateUserImage(String uploadFile, Integer userId); 21 | 22 | ServerResponse updateUserPassword(String password, Integer userId); 23 | 24 | ServerResponse updateInfo(ShopUser username, Integer uid); 25 | 26 | ServerResponse manageList(Integer uid); 27 | 28 | ServerResponse manageUpdateRole(Integer uid, Integer userId, Integer role); 29 | } -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/service/IUserFriendsService.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.service; 2 | 3 | import com.zq.core.restful.ServerResponse; 4 | 5 | /** 6 | * @Author 张迁-zhangqian 7 | * @Data 2018/4/24 下午2:50 8 | * @Package com.zq.shop.web.service 9 | **/ 10 | 11 | 12 | public interface IUserFriendsService { 13 | 14 | ServerResponse list(Integer userId); 15 | 16 | ServerResponse create(Integer userId, Integer followId); 17 | 18 | ServerResponse delete(Integer userId, Integer followId); 19 | } 20 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/CartShopVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/6/12 下午4:22 11 | * @Package com.zq.shop.web.vo 12 | **/ 13 | 14 | 15 | @Getter 16 | @Setter 17 | public class CartShopVo { 18 | private Integer userId; 19 | private String username; 20 | private List cartVos; 21 | } 22 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/CartVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/6/9 下午6:00 9 | * @Package com.zq.shop.web.vo 10 | **/ 11 | 12 | 13 | @Getter 14 | @Setter 15 | public class CartVo { 16 | private Integer userId; 17 | private Integer productId; 18 | private Integer quantity; 19 | private Integer checked; 20 | private ProductVo productVo; 21 | } 22 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/CategoryVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/5/13 下午12:52 11 | * @Package com.zq.shop.web.vo 12 | **/ 13 | 14 | @Setter 15 | @Getter 16 | public class CategoryVo { 17 | private Integer id; 18 | private Integer parentId; 19 | private String name; 20 | private String image; 21 | private Boolean status; 22 | private Integer sortOrder; 23 | private List itemList; 24 | } 25 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/MomentCommentVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | /** 7 | * @Author 张迁-zhangqian 8 | * @Data 2018/5/14 上午10:58 9 | * @Package com.zq.shop.web.vo 10 | **/ 11 | 12 | @Setter 13 | @Getter 14 | public class MomentCommentVo { 15 | private Integer id; 16 | private Integer userId; 17 | private String username; 18 | private String userImage; 19 | private Integer status; 20 | private Integer followId; 21 | private Integer replyUserId; 22 | private String replyUserName; 23 | private Integer momentsId; 24 | private String content; 25 | private String images; 26 | } 27 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/MomentVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.Date; 7 | import java.util.List; 8 | 9 | /** 10 | * @Author 张迁-zhangqian 11 | * @Data 2018/5/14 上午10:53 12 | * @Package com.zq.shop.web.vo 13 | **/ 14 | 15 | @Setter 16 | @Getter 17 | public class MomentVo { 18 | private Integer id; 19 | private Integer userId; 20 | private String username; 21 | private String userImage; 22 | private Integer category; 23 | private Integer status; 24 | private Integer type; 25 | private String title; 26 | private String subtitle; 27 | private String details; 28 | private String mainImage; 29 | private String subImages; 30 | private Date lastSeeTime; 31 | private Integer star; 32 | private Integer starEnable; 33 | private Integer seeTimes; 34 | private List momentCommentVoList; 35 | } 36 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/MomentsListVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/5/2 下午3:28 11 | * @Package com.zq.shop.web.vo 12 | **/ 13 | 14 | @Getter 15 | @Setter 16 | public class MomentsListVo { 17 | private MomentVo momentVo; 18 | private List momentCommentVos; 19 | } 20 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/OrderItemVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.math.BigDecimal; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/6/19 下午10:41 11 | * @Package com.zq.shop.web.vo 12 | **/ 13 | 14 | @Getter 15 | @Setter 16 | public class OrderItemVo { 17 | private Long orderNo; 18 | private Integer userId; 19 | private Integer productId; 20 | private String productName; 21 | private String productImage; 22 | private BigDecimal currentUnitPrice; 23 | private Integer quantity; 24 | private BigDecimal totalPrice; 25 | private ProductVo productVo; 26 | } 27 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/OrderSettlementsVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/6/21 下午12:48 11 | * @Package com.zq.shop.web.vo 12 | **/ 13 | 14 | @Getter 15 | @Setter 16 | public class OrderSettlementsVo { 17 | private Integer id; 18 | private Integer settlementno; 19 | private Integer settlementtype; 20 | private Integer shopid; 21 | private Long settlementmoney; 22 | private Long ordermoney; 23 | private Integer isfinish; 24 | private Long totalcommission; 25 | private List orderVos; 26 | } 27 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/OrderShopVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/6/19 下午11:05 11 | * @Package com.zq.shop.web.vo 12 | **/ 13 | 14 | @Setter 15 | @Getter 16 | public class OrderShopVo { 17 | private Integer shopId; 18 | private Integer shopSn; 19 | private Integer userId; 20 | private String shopName; 21 | private String shopImg; 22 | private String shopTel; 23 | private List orderItemVos; 24 | } 25 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/OrderVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import com.zq.shop.web.bean.Shipping; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | import java.math.BigDecimal; 8 | import java.util.Date; 9 | 10 | /** 11 | * @Author 张迁-zhangqian 12 | * @Data 2018/4/22 下午8:41 13 | * @Package com.zq.shop.web 14 | **/ 15 | 16 | @Getter 17 | @Setter 18 | public class OrderVo { 19 | private Long orderNo; 20 | private Integer userId; 21 | private Integer shippingId; 22 | private BigDecimal payment; 23 | private Integer paymentType; 24 | private Integer settlementId; 25 | private Integer postage; 26 | private Integer status; 27 | private Date paymentTime; 28 | private Date sendTime; 29 | private Date endTime; 30 | private Date closeTime; 31 | private OrderShopVo orderShopVo; 32 | private Shipping shipping; 33 | } 34 | -------------------------------------------------------------------------------- /example/src/main/java/com/zq/shop/web/vo/RecommendVo.java: -------------------------------------------------------------------------------- 1 | package com.zq.shop.web.vo; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @Author 张迁-zhangqian 10 | * @Data 2018/5/11 上午10:39 11 | * @Package com.zq.shop.web.vo 12 | **/ 13 | @Getter 14 | @Setter 15 | public class RecommendVo { 16 | private List recommendProducts; 17 | private List recommendImages; 18 | } 19 | -------------------------------------------------------------------------------- /example/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | profiles: 3 | active: prod -------------------------------------------------------------------------------- /example/src/main/resources/mappers/IDMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /example/src/test/java/com/zq/ExampleApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.zq; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class ExampleApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /shop.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------