├── redis缓存.md ├── src └── main │ ├── webapp │ ├── index.jsp │ └── WEB-INF │ │ ├── lib │ │ ├── taobao-sdk-java-auto_1489127792844-20170313.jar │ │ └── taobao-sdk-java-auto_1489127792844-20170313-source.jar │ │ ├── views │ │ ├── test.html │ │ ├── test.jsp │ │ └── emailBinding.jsp │ │ └── web.xml │ ├── resources │ ├── database.properties │ └── META-INF │ │ ├── spring │ │ ├── spring-jedis.xml │ │ └── spring-jpa.xml │ │ ├── persistence.xml │ │ ├── springmvc │ │ └── spring-mvc.xml │ │ └── log4j.properties │ └── java │ └── com │ └── ima │ ├── utils │ ├── JsonUtils.java │ ├── MySQL5DialectUTF8.java │ ├── AuthUtil.java │ ├── JavaWebToken.java │ └── CreateIMAccount.java │ ├── enmu │ └── Gender.java │ ├── dao │ ├── JedisClient.java │ └── JedisClientSingle.java │ ├── repository │ ├── AiDouChangeRepository.java │ └── UserRepository.java │ ├── dto │ └── DTO.java │ ├── test │ └── JedisTest.java │ ├── service │ ├── AiDouService.java │ └── UserService.java │ ├── model │ ├── IDouChange.java │ └── User.java │ └── controller │ └── UserController.java ├── target ├── springdatajpa │ ├── index.jsp │ ├── META-INF │ │ └── MANIFEST.MF │ └── WEB-INF │ │ ├── lib │ │ ├── asm-3.3.1.jar │ │ ├── jstl-1.2.jar │ │ ├── antlr-2.7.7.jar │ │ ├── cglib-2.2.2.jar │ │ ├── dom4j-1.6.1.jar │ │ ├── druid-1.0.0.jar │ │ ├── jedis-2.7.3.jar │ │ ├── jjwt-0.6.0.jar │ │ ├── log4j-1.2.17.jar │ │ ├── commons-io-2.4.jar │ │ ├── fastjson-1.2.5.jar │ │ ├── aopalliance-1.0.jar │ │ ├── aspectjrt-1.6.10.jar │ │ ├── classmate-0.8.0.jar │ │ ├── commons-codec-1.9.jar │ │ ├── commons-exec-1.2.jar │ │ ├── commons-pool2-2.3.jar │ │ ├── slf4j-api-1.7.7.jar │ │ ├── commons-lang3-3.3.2.jar │ │ ├── ehcache-core-2.4.3.jar │ │ ├── jackson-core-2.1.0.jar │ │ ├── javassist-3.15.0-GA.jar │ │ ├── commons-digester3-3.2.jar │ │ ├── commons-logging-1.1.3.jar │ │ ├── jackson-databind-2.1.0.jar │ │ ├── jboss-logging-3.1.0.GA.jar │ │ ├── jcl-over-slf4j-1.6.6.jar │ │ ├── slf4j-log4j12-1.7.12.jar │ │ ├── commons-beanutils-1.9.1.jar │ │ ├── commons-fileupload-1.3.1.jar │ │ ├── spring-aop-4.0.4.RELEASE.jar │ │ ├── spring-tx-4.0.4.RELEASE.jar │ │ ├── spring-web-4.0.4.RELEASE.jar │ │ ├── commons-collections-3.2.1.jar │ │ ├── hibernate-core-4.2.6.Final.jar │ │ ├── jackson-annotations-2.1.0.jar │ │ ├── mysql-connector-java-5.1.35.jar │ │ ├── spring-beans-4.0.4.RELEASE.jar │ │ ├── spring-core-4.0.4.RELEASE.jar │ │ ├── spring-jdbc-3.2.10.RELEASE.jar │ │ ├── spring-orm-3.2.10.RELEASE.jar │ │ ├── spring-test-4.0.4.RELEASE.jar │ │ ├── spring-webmvc-4.0.4.RELEASE.jar │ │ ├── validation-api-1.1.0.Final.jar │ │ ├── hibernate-ehcache-4.2.6.Final.jar │ │ ├── spring-context-4.0.4.RELEASE.jar │ │ ├── spring-data-jpa-1.6.2.RELEASE.jar │ │ ├── hibernate-validator-5.0.1.Final.jar │ │ ├── spring-expression-4.0.4.RELEASE.jar │ │ ├── hibernate-jpa-2.0-api-1.0.1.Final.jar │ │ ├── spring-data-commons-1.8.2.RELEASE.jar │ │ ├── hibernate-entitymanager-4.2.6.Final.jar │ │ ├── spring-context-support-4.0.4.RELEASE.jar │ │ ├── hibernate-commons-annotations-4.0.2.Final.jar │ │ ├── jboss-transaction-api_1.1_spec-1.0.1.Final.jar │ │ ├── taobao-sdk-java-auto_1489127792844-20170313.jar │ │ └── taobao-sdk-java-auto_1489127792844-20170313-source.jar │ │ ├── classes │ │ ├── com │ │ │ └── ima │ │ │ │ ├── dto │ │ │ │ └── DTO.class │ │ │ │ ├── model │ │ │ │ ├── User.class │ │ │ │ └── IDouChange.class │ │ │ │ ├── enmu │ │ │ │ └── Gender.class │ │ │ │ ├── dao │ │ │ │ ├── JedisClient.class │ │ │ │ └── JedisClientSingle.class │ │ │ │ ├── test │ │ │ │ └── JedisTest.class │ │ │ │ ├── utils │ │ │ │ ├── AuthUtil.class │ │ │ │ ├── JsonUtils.class │ │ │ │ ├── JavaWebToken.class │ │ │ │ ├── CreateIMAccount.class │ │ │ │ └── MySQL5DialectUTF8.class │ │ │ │ ├── service │ │ │ │ ├── AiDouService.class │ │ │ │ └── UserService.class │ │ │ │ ├── controller │ │ │ │ └── UserController.class │ │ │ │ └── repository │ │ │ │ ├── UserRepository.class │ │ │ │ └── AiDouChangeRepository.class │ │ ├── database.properties │ │ └── META-INF │ │ │ ├── spring │ │ │ ├── spring-jedis.xml │ │ │ └── spring-jpa.xml │ │ │ ├── persistence.xml │ │ │ ├── springmvc │ │ │ └── spring-mvc.xml │ │ │ └── log4j.properties │ │ ├── views │ │ ├── test.html │ │ ├── test.jsp │ │ └── emailBinding.jsp │ │ └── web.xml └── classes │ ├── com │ └── ima │ │ ├── dto │ │ └── DTO.class │ │ ├── model │ │ ├── User.class │ │ └── IDouChange.class │ │ ├── enmu │ │ └── Gender.class │ │ ├── dao │ │ ├── JedisClient.class │ │ └── JedisClientSingle.class │ │ ├── test │ │ └── JedisTest.class │ │ ├── utils │ │ ├── AuthUtil.class │ │ ├── JsonUtils.class │ │ ├── JavaWebToken.class │ │ ├── CreateIMAccount.class │ │ └── MySQL5DialectUTF8.class │ │ ├── service │ │ ├── AiDouService.class │ │ └── UserService.class │ │ ├── controller │ │ └── UserController.class │ │ └── repository │ │ ├── UserRepository.class │ │ └── AiDouChangeRepository.class │ ├── database.properties │ └── META-INF │ ├── spring │ ├── spring-jedis.xml │ └── spring-jpa.xml │ ├── persistence.xml │ ├── springmvc │ └── spring-mvc.xml │ └── log4j.properties ├── .idea ├── copyright │ └── profiles_settings.xml ├── vcs.xml ├── encodings.xml ├── modules.xml ├── artifacts │ ├── SpringdataJpaDemo_war.xml │ └── SpringdataJpaDemo_war_exploded.xml ├── libraries │ ├── Maven__asm_asm_3_3_1.xml │ ├── Maven__junit_junit_4_12.xml │ ├── Maven__antlr_antlr_2_7_7.xml │ ├── Maven__cglib_cglib_2_2_2.xml │ ├── Maven__dom4j_dom4j_1_6_1.xml │ ├── Maven__log4j_log4j_1_2_17.xml │ ├── Maven__javax_servlet_jstl_1_2.xml │ ├── Maven__com_alibaba_druid_1_0_0.xml │ ├── Maven__io_jsonwebtoken_jjwt_0_6_0.xml │ ├── Maven__redis_clients_jedis_2_7_3.xml │ ├── Maven__commons_io_commons_io_2_4.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_7.xml │ ├── Maven__com_alibaba_fastjson_1_2_5.xml │ ├── Maven__aopalliance_aopalliance_1_0.xml │ ├── Maven__javax_servlet_jsp_jsp_api_2_2.xml │ ├── Maven__com_fasterxml_classmate_0_8_0.xml │ ├── Maven__org_aspectj_aspectjrt_1_6_10.xml │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ ├── Maven__commons_codec_commons_codec_1_9.xml │ ├── Maven__org_slf4j_jcl_over_slf4j_1_6_6.xml │ ├── Maven__org_slf4j_slf4j_log4j12_1_7_12.xml │ ├── Maven__net_sf_ehcache_ehcache_core_2_4_3.xml │ ├── Maven__org_apache_commons_commons_exec_1_2.xml │ ├── Maven__org_hamcrest_hamcrest_library_1_3.xml │ ├── Maven__org_javassist_javassist_3_15_0_GA.xml │ ├── Maven__org_apache_commons_commons_pool2_2_3.xml │ ├── Maven__mysql_mysql_connector_java_5_1_35.xml │ ├── Maven__commons_logging_commons_logging_1_1_3.xml │ ├── Maven__org_apache_commons_commons_lang3_3_3_2.xml │ ├── Maven__javax_servlet_servlet_api_3_0_alpha_1.xml │ ├── Maven__org_apache_commons_commons_digester3_3_2.xml │ ├── Maven__org_jboss_logging_jboss_logging_3_1_0_GA.xml │ ├── Maven__commons_beanutils_commons_beanutils_1_9_1.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_1_0.xml │ ├── Maven__org_hibernate_hibernate_core_4_2_6_Final.xml │ ├── Maven__org_springframework_spring_tx_4_0_4_RELEASE.xml │ ├── Maven__commons_fileupload_commons_fileupload_1_3_1.xml │ ├── Maven__javax_validation_validation_api_1_1_0_Final.xml │ ├── Maven__org_springframework_spring_aop_4_0_4_RELEASE.xml │ ├── Maven__org_springframework_spring_web_4_0_4_RELEASE.xml │ ├── Maven__commons_collections_commons_collections_3_2_1.xml │ ├── Maven__org_springframework_spring_core_4_0_4_RELEASE.xml │ ├── Maven__org_springframework_spring_orm_3_2_10_RELEASE.xml │ ├── Maven__org_springframework_spring_test_4_0_4_RELEASE.xml │ ├── Maven__org_hibernate_hibernate_ehcache_4_2_6_Final.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_1_0.xml │ ├── Maven__org_springframework_spring_beans_4_0_4_RELEASE.xml │ ├── Maven__org_springframework_spring_jdbc_3_2_10_RELEASE.xml │ ├── Maven__org_springframework_spring_webmvc_4_0_4_RELEASE.xml │ ├── Maven__org_hibernate_hibernate_validator_5_0_1_Final.xml │ ├── Maven__org_springframework_spring_context_4_0_4_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_1_0.xml │ ├── Maven__org_hibernate_hibernate_entitymanager_4_2_6_Final.xml │ ├── Maven__org_springframework_spring_expression_4_0_4_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_jpa_1_6_2_RELEASE.xml │ ├── Maven__org_springframework_data_spring_data_commons_1_8_2_RELEASE.xml │ ├── Maven__org_springframework_spring_context_support_4_0_4_RELEASE.xml │ ├── Maven__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_1_Final.xml │ ├── Maven__org_hibernate_common_hibernate_commons_annotations_4_0_2_Final.xml │ └── Maven__org_jboss_spec_javax_transaction_jboss_transaction_api_1_1_spec_1_0_1_Final.xml ├── misc.xml ├── compiler.xml └── uiDesigner.xml ├── README.md ├── springdatajpa.sql ├── SpringdataJpaDemo.iml └── pom.xml /redis缓存.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/redis缓存.md -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /target/springdatajpa/index.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Hello World!

4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /target/classes/com/ima/dto/DTO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/dto/DTO.class -------------------------------------------------------------------------------- /target/classes/com/ima/model/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/model/User.class -------------------------------------------------------------------------------- /target/classes/com/ima/enmu/Gender.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/enmu/Gender.class -------------------------------------------------------------------------------- /target/classes/com/ima/dao/JedisClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/dao/JedisClient.class -------------------------------------------------------------------------------- /target/classes/com/ima/test/JedisTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/test/JedisTest.class -------------------------------------------------------------------------------- /target/classes/com/ima/utils/AuthUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/utils/AuthUtil.class -------------------------------------------------------------------------------- /target/classes/com/ima/utils/JsonUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/utils/JsonUtils.class -------------------------------------------------------------------------------- /target/springdatajpa/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: asus 3 | Created-By: IntelliJ IDEA 4 | Build-Jdk: 1.8.0_25 5 | 6 | -------------------------------------------------------------------------------- /target/classes/com/ima/model/IDouChange.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/model/IDouChange.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/asm-3.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/asm-3.3.1.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jstl-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jstl-1.2.jar -------------------------------------------------------------------------------- /target/classes/com/ima/service/AiDouService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/service/AiDouService.class -------------------------------------------------------------------------------- /target/classes/com/ima/service/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/service/UserService.class -------------------------------------------------------------------------------- /target/classes/com/ima/utils/JavaWebToken.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/utils/JavaWebToken.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/antlr-2.7.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/antlr-2.7.7.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/cglib-2.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/cglib-2.2.2.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/dom4j-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/dom4j-1.6.1.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/druid-1.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/druid-1.0.0.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jedis-2.7.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jedis-2.7.3.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jjwt-0.6.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jjwt-0.6.0.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/log4j-1.2.17.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/log4j-1.2.17.jar -------------------------------------------------------------------------------- /target/classes/com/ima/dao/JedisClientSingle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/dao/JedisClientSingle.class -------------------------------------------------------------------------------- /target/classes/com/ima/utils/CreateIMAccount.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/utils/CreateIMAccount.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-io-2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-io-2.4.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/fastjson-1.2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/fastjson-1.2.5.jar -------------------------------------------------------------------------------- /target/classes/com/ima/controller/UserController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/controller/UserController.class -------------------------------------------------------------------------------- /target/classes/com/ima/repository/UserRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/repository/UserRepository.class -------------------------------------------------------------------------------- /target/classes/com/ima/utils/MySQL5DialectUTF8.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/utils/MySQL5DialectUTF8.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/aspectjrt-1.6.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/aspectjrt-1.6.10.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/classmate-0.8.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/classmate-0.8.0.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-codec-1.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-codec-1.9.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-exec-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-exec-1.2.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-pool2-2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-pool2-2.3.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/slf4j-api-1.7.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/slf4j-api-1.7.7.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-lang3-3.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-lang3-3.3.2.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/ehcache-core-2.4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/ehcache-core-2.4.3.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jackson-core-2.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jackson-core-2.1.0.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/javassist-3.15.0-GA.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/javassist-3.15.0-GA.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/dto/DTO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/dto/DTO.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-digester3-3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-digester3-3.2.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-logging-1.1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-logging-1.1.3.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jackson-databind-2.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jackson-databind-2.1.0.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jboss-logging-3.1.0.GA.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jboss-logging-3.1.0.GA.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jcl-over-slf4j-1.6.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jcl-over-slf4j-1.6.6.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/slf4j-log4j12-1.7.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/slf4j-log4j12-1.7.12.jar -------------------------------------------------------------------------------- /target/classes/com/ima/repository/AiDouChangeRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/classes/com/ima/repository/AiDouChangeRepository.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/model/User.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/model/User.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-beanutils-1.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-beanutils-1.9.1.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-fileupload-1.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-fileupload-1.3.1.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-aop-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-aop-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-tx-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-tx-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-web-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-web-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/enmu/Gender.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/enmu/Gender.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/commons-collections-3.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/commons-collections-3.2.1.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/hibernate-core-4.2.6.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/hibernate-core-4.2.6.Final.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jackson-annotations-2.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jackson-annotations-2.1.0.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/mysql-connector-java-5.1.35.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/mysql-connector-java-5.1.35.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-beans-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-beans-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-core-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-core-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-jdbc-3.2.10.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-jdbc-3.2.10.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-orm-3.2.10.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-orm-3.2.10.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-test-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-test-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-webmvc-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-webmvc-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/validation-api-1.1.0.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/validation-api-1.1.0.Final.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/dao/JedisClient.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/dao/JedisClient.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/test/JedisTest.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/test/JedisTest.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/utils/AuthUtil.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/utils/AuthUtil.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/utils/JsonUtils.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/utils/JsonUtils.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/hibernate-ehcache-4.2.6.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/hibernate-ehcache-4.2.6.Final.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-context-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-context-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-data-jpa-1.6.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-data-jpa-1.6.2.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/model/IDouChange.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/model/IDouChange.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/utils/JavaWebToken.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/utils/JavaWebToken.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/hibernate-validator-5.0.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/hibernate-validator-5.0.1.Final.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-expression-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-expression-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/service/AiDouService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/service/AiDouService.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/service/UserService.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/service/UserService.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-data-commons-1.8.2.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-data-commons-1.8.2.RELEASE.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/dao/JedisClientSingle.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/dao/JedisClientSingle.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/utils/CreateIMAccount.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/utils/CreateIMAccount.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/utils/MySQL5DialectUTF8.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/utils/MySQL5DialectUTF8.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/hibernate-entitymanager-4.2.6.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/hibernate-entitymanager-4.2.6.Final.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/spring-context-support-4.0.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/spring-context-support-4.0.4.RELEASE.jar -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/taobao-sdk-java-auto_1489127792844-20170313.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/src/main/webapp/WEB-INF/lib/taobao-sdk-java-auto_1489127792844-20170313.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/controller/UserController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/controller/UserController.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/repository/UserRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/repository/UserRepository.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/hibernate-commons-annotations-4.0.2.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/hibernate-commons-annotations-4.0.2.Final.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/jboss-transaction-api_1.1_spec-1.0.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/jboss-transaction-api_1.1_spec-1.0.1.Final.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/taobao-sdk-java-auto_1489127792844-20170313.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/taobao-sdk-java-auto_1489127792844-20170313.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/taobao-sdk-java-auto_1489127792844-20170313-source.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/src/main/webapp/WEB-INF/lib/taobao-sdk-java-auto_1489127792844-20170313-source.jar -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/com/ima/repository/AiDouChangeRepository.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/classes/com/ima/repository/AiDouChangeRepository.class -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/lib/taobao-sdk-java-auto_1489127792844-20170313-source.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FuZhucheng/SpringDataJPA/HEAD/target/springdatajpa/WEB-INF/lib/taobao-sdk-java-auto_1489127792844-20170313-source.jar -------------------------------------------------------------------------------- /target/classes/database.properties: -------------------------------------------------------------------------------- 1 | database.url=jdbc:mysql://127.0.0.1:3306/aidou?useUnicode=true&characterEncoding=utf8 2 | database.username=root 3 | database.password=751197996 4 | #服务器用以下密码 5 | database.driverClassName=com.mysql.jdbc.Driver -------------------------------------------------------------------------------- /src/main/resources/database.properties: -------------------------------------------------------------------------------- 1 | database.url=jdbc:mysql://127.0.0.1:3306/aidou?useUnicode=true&characterEncoding=utf8 2 | database.username=root 3 | database.password=751197996 4 | #服务器用以下密码 5 | database.driverClassName=com.mysql.jdbc.Driver -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/database.properties: -------------------------------------------------------------------------------- 1 | database.url=jdbc:mysql://127.0.0.1:3306/aidou?useUnicode=true&characterEncoding=utf8 2 | database.username=root 3 | database.password=751197996 4 | #服务器用以下密码 5 | database.driverClassName=com.mysql.jdbc.Driver -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/artifacts/SpringdataJpaDemo_war.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/target 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/java/com/ima/utils/JsonUtils.java: -------------------------------------------------------------------------------- 1 | package com.ima.utils; 2 | 3 | import com.alibaba.fastjson.JSONArray; 4 | 5 | /** 6 | * Created by ${符柱成} on 2017/3/28. 7 | */ 8 | public class JsonUtils { 9 | 10 | public static String objectToJson(Object data) { 11 | String json = JSONArray.toJSONString(data); 12 | return json; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/ima/enmu/Gender.java: -------------------------------------------------------------------------------- 1 | package com.ima.enmu; 2 | 3 | /** 4 | * Created by 符柱成 on 17-3-7. 5 | */ 6 | public enum Gender { 7 | male("男"), 8 | female("女"); 9 | 10 | private String name; 11 | private Gender(String name){ 12 | this.name = name; 13 | } 14 | 15 | public String getName(){ 16 | return this.name; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/ima/utils/MySQL5DialectUTF8.java: -------------------------------------------------------------------------------- 1 | package com.ima.utils; 2 | 3 | import org.hibernate.dialect.MySQL5InnoDBDialect; 4 | 5 | /** 6 | * Created by ${符柱成} on 2017/3/21. 7 | */ 8 | public class MySQL5DialectUTF8 extends MySQL5InnoDBDialect { 9 | 10 | @Override 11 | public String getTableTypeString() { 12 | return " ENGINE=InnoDB DEFAULT CHARSET=utf8"; 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 授权跳转中... 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/views/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 授权跳转中... 6 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/test.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 授权跳转中... 6 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/views/test.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 授权跳转中... 6 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__asm_asm_3_3_1.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__antlr_antlr_2_7_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__cglib_cglib_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__log4j_log4j_1_2_17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_servlet_jstl_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_druid_1_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_jsonwebtoken_jjwt_0_6_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__redis_clients_jedis_2_7_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_io_commons_io_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_alibaba_fastjson_1_2_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_servlet_jsp_jsp_api_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/ima/dao/JedisClient.java: -------------------------------------------------------------------------------- 1 | package com.ima.dao; 2 | 3 | /** 4 | * Created by ${符柱成} on 2017/3/28. 5 | */ 6 | public interface JedisClient { 7 | 8 | public String get(String key); 9 | public String set(String key,String value); 10 | public String hget(String hkey, String key); 11 | public long hset(String hkey, String key, String value); 12 | public long incr(String key); 13 | public long expire(String key, int second); 14 | public long ttl(String key); 15 | public long del(String key); 16 | public long hdel(String hkey,String key); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_classmate_0_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_aspectj_aspectjrt_1_6_10.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__commons_codec_commons_codec_1_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_6_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_log4j12_1_7_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_sf_ehcache_ehcache_core_2_4_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_exec_1_2.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_javassist_javassist_3_15_0_GA.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_pool2_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__mysql_mysql_connector_java_5_1_35.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_logging_commons_logging_1_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_lang3_3_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_servlet_servlet_api_3_0_alpha_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_digester3_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_1_0_GA.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_beanutils_commons_beanutils_1_9_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/ima/repository/AiDouChangeRepository.java: -------------------------------------------------------------------------------- 1 | package com.ima.repository; 2 | 3 | import com.ima.model.IDouChange; 4 | import com.ima.model.User; 5 | import org.springframework.data.domain.Sort; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | import org.springframework.stereotype.Repository; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Created by ${符柱成} on 2017/3/14. 13 | */ 14 | @Repository 15 | public interface AiDouChangeRepository extends JpaRepository { 16 | 17 | 18 | //降序查记录列表 19 | List findFirst10ByUser(User user, Sort sort); 20 | 21 | List findById(Long id); 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_core_4_2_6_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_tx_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/emailBinding.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | ~ Copyright (c) 2012-2015 zjc@ppfix.cn 3 | ~ May you do good and not evil. 4 | ~ May you find forgiveness for yourself and forgive others. 5 | ~ May you share freely,never taking more than you give. 6 | ~ Please do not del these words when you share or copy this file 7 | --%> 8 | 9 | <%-- 10 | Created by IntelliJ IDEA. 11 | Date: 2016/1/14 12 | Time: 10:33 13 | To change this template use File | Settings | File Templates. 14 | --%> 15 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 16 | 17 | 18 | Title 19 | 20 | 21 | message:${msg}; 22 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/views/emailBinding.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | ~ Copyright (c) 2012-2015 zjc@ppfix.cn 3 | ~ May you do good and not evil. 4 | ~ May you find forgiveness for yourself and forgive others. 5 | ~ May you share freely,never taking more than you give. 6 | ~ Please do not del these words when you share or copy this file 7 | --%> 8 | 9 | <%-- 10 | Created by IntelliJ IDEA. 11 | Date: 2016/1/14 12 | Time: 10:33 13 | To change this template use File | Settings | File Templates. 14 | --%> 15 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 16 | 17 | 18 | Title 19 | 20 | 21 | message:${msg}; 22 | 23 | 24 | -------------------------------------------------------------------------------- /.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__org_springframework_spring_aop_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_collections_commons_collections_3_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_orm_3_2_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_test_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_ehcache_4_2_6_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jdbc_3_2_10_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_validator_5_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /target/classes/META-INF/spring/spring-jedis.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring/spring-jedis.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_entitymanager_4_2_6_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/META-INF/spring/spring-jedis.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_jpa_1_6_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/ima/dto/DTO.java: -------------------------------------------------------------------------------- 1 | package com.ima.dto; 2 | 3 | /** 4 | * Created by 符柱成 on 17-3-11. 5 | */ 6 | public class DTO { 7 | //状态码,1代表成功,-1代表异常 8 | public String code = "1"; 9 | //成功或者异常信息 10 | public String msg = "success"; 11 | //数据体 12 | public Object data; 13 | 14 | public String getCode() { 15 | return code; 16 | } 17 | 18 | public void setCode(String code) { 19 | this.code = code; 20 | } 21 | 22 | public String getMsg() { 23 | return msg; 24 | } 25 | 26 | public void setMsg(String msg) { 27 | this.msg = msg; 28 | } 29 | 30 | public Object getData() { 31 | return data; 32 | } 33 | 34 | public void setData(Object data) { 35 | this.data = data; 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/com/ima/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.ima.repository; 2 | 3 | import com.ima.model.User; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.data.jpa.repository.Modifying; 6 | import org.springframework.data.jpa.repository.Query; 7 | import org.springframework.stereotype.Repository; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | /** 11 | * Created by 符柱成 on 17-3-11. 12 | */ 13 | @Repository 14 | public interface UserRepository extends JpaRepository { 15 | User getByAccount(String account); 16 | 17 | @Modifying 18 | @Transactional 19 | @Query("UPDATE User user SET user.name = ?1 WHERE user.id = ?2") 20 | void updateName(String name, Long id); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_data_spring_data_commons_1_8_2_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_support_4_0_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_4_0_2_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jboss_spec_javax_transaction_jboss_transaction_api_1_1_spec_1_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## J2EE项目系列(三)--Spring Data JPA+Spring+SpringMVC+Maven快速开发 3 | #### DEMO使用姿势:IntelliJ IDEA工具,直接open此工程,对应环境jdk1.7,tomcat7.0。打开即可体验。 4 | #### 另外:云旺IM的体验需要你自己去注册app拿到appkey以及secret,在该工具类中填写好,即可体验。 5 | ## 简介:本系列将会把我最近那个安卓项目的一些好东西抽出来分享给大家。并附带一系列的博客解析。 6 | ### (一)[J2EE项目系列(三)--Spring Data JPA+Spring+SpringMVC+Maven快速开发(1)项目架构](http://blog.csdn.net/Jack__Frost/article/details/61205857) 7 | ### (二)[J2EE项目系列(三)--Spring Data JPA+Spring+SpringMVC+Maven快速开发(2)多个第三方服务端接入之云旺IM](http://blog.csdn.net/Jack__Frost/article/details/62443796) 8 | ### (三)[Java-解决实现JPA的hibernate自动建表的编码问题](http://blog.csdn.net/Jack__Frost/article/details/64487024) 9 | ### (四)[WEB后台--基于Token的WEB后台登录认证机制(并讲解其他认证机制以及cookie和session机制)](http://blog.csdn.net/jack__frost/article/details/64964208) 10 | ### (五)加入了一个单机版redis缓存。大致步骤见工程中的《redis缓存.md》。 11 | *** 12 | ### 更多内容,可以访问[JackFrost的博客](http://blog.csdn.net/jack__frost?viewmode=contents) 13 | ### 联系方式:jackfrost@fuzhufuzhu.com 14 | -------------------------------------------------------------------------------- /src/main/java/com/ima/test/JedisTest.java: -------------------------------------------------------------------------------- 1 | package com.ima.test; 2 | 3 | //import redis.clients.jedis.Jedis; 4 | //import redis.clients.jedis.JedisPool; 5 | 6 | /** 7 | * Created by ${符柱成} on 2017/3/29. 8 | */ 9 | public class JedisTest { 10 | //单机版 11 | // @Test 12 | // public void testJedisSingle() throws Exception{ 13 | // //创建一个jedis对象 14 | // Jedis jedis = new Jedis("127.0.0.1",6379); 15 | // jedis.set("test", "hello jedis"); 16 | // String string = jedis.get("test"); 17 | // System.out.println(string); 18 | // jedis.close(); 19 | // } 20 | // //使用连接池 21 | // @Test 22 | // public void testJedisPool() throws Exception{ 23 | // //创建一个链接池对象 24 | // //系统中应该是单例的 25 | // JedisPool jedisPool = new JedisPool("127.0.0.1",6379); 26 | // //从连接池中获得一个连接 27 | // Jedis jedis = jedisPool.getResource(); 28 | // String result = jedis.get("test"); 29 | // System.out.println(result); 30 | // //jedis必须关闭 31 | // jedis.close(); 32 | // //系统关闭时关闭连接池 33 | // jedisPool.close(); 34 | // } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/ima/service/AiDouService.java: -------------------------------------------------------------------------------- 1 | package com.ima.service; 2 | 3 | import com.ima.model.IDouChange; 4 | import com.ima.model.User; 5 | import com.ima.repository.AiDouChangeRepository; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Created by ${符柱成} on 2017/3/21. 13 | */ 14 | @Service 15 | public class AiDouService { 16 | @Autowired 17 | private AiDouChangeRepository aiDouChangeRepository; 18 | public void save(IDouChange iDouChange){ 19 | aiDouChangeRepository.save(iDouChange); 20 | } 21 | //注册给100 22 | public void registerCount(User user ){ 23 | IDouChange iDouChange = new IDouChange(); 24 | int registerCount = 300; 25 | String type = "注册成功"; 26 | iDouChange.setChangeType(type); 27 | iDouChange.setiDouCount(registerCount); 28 | iDouChange.setUser(user); 29 | aiDouChangeRepository.save(iDouChange); 30 | } 31 | public List getHistory(Long id){ 32 | List iDouChangeList = aiDouChangeRepository.findById(id); 33 | return iDouChangeList; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/ima/utils/AuthUtil.java: -------------------------------------------------------------------------------- 1 | package com.ima.utils; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import static com.ima.utils.JavaWebToken.verifyJavaWebToken; 8 | 9 | /** 10 | * Created by 符柱成 on 17-3-12. 11 | */ 12 | public class AuthUtil { 13 | private static Map getClientLoginInfo(HttpServletRequest request) throws Exception { 14 | Map r = new HashMap<>(); 15 | String sessionId = request.getHeader("sessionId"); 16 | if (sessionId != null) { 17 | r = decodeSession(sessionId); 18 | return r; 19 | } 20 | throw new Exception("session解析错误"); 21 | } 22 | 23 | public static Long getUserId(HttpServletRequest request) throws Exception { 24 | return Long.valueOf((Integer)getClientLoginInfo(request).get("userId")); 25 | 26 | } 27 | 28 | /** 29 | * session解密 30 | */ 31 | public static Map decodeSession(String sessionId) { 32 | try { 33 | return verifyJavaWebToken(sessionId); 34 | } catch (Exception e) { 35 | System.err.println(""); 36 | return null; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/java/com/ima/model/IDouChange.java: -------------------------------------------------------------------------------- 1 | package com.ima.model; 2 | 3 | import javax.persistence.*; 4 | import java.util.Date; 5 | 6 | /** 7 | * 积分变化实体类 8 | * Created by 符柱成 on 17-3-11. 9 | */ 10 | @Entity 11 | @Table(name = "i_dou_change") 12 | public class IDouChange { 13 | private Long id; 14 | //积分变化的类型,拉黑或者在线或者充值 15 | private String changeType; 16 | private Date createTime; 17 | //积分变化数 18 | private Integer iDouCount; 19 | //积分变化者 20 | private User user; 21 | 22 | 23 | public IDouChange() { 24 | } 25 | 26 | @Id 27 | @GeneratedValue 28 | public Long getId() { 29 | return id; 30 | } 31 | 32 | public void setId(Long id) { 33 | this.id = id; 34 | } 35 | 36 | 37 | @Column(name = "change_type") 38 | public String getChangeType() { 39 | return changeType; 40 | } 41 | 42 | public void setChangeType(String changeType) { 43 | this.changeType = changeType; 44 | } 45 | 46 | @Temporal(TemporalType.TIMESTAMP) 47 | @Column(name = "create_time",nullable=true,columnDefinition="timestamp default current_timestamp") 48 | public Date getCreateTime() { 49 | return createTime; 50 | } 51 | 52 | public void setCreateTime(Date createTime) { 53 | this.createTime = createTime; 54 | } 55 | 56 | @Column(name = "i_dou_count") 57 | public Integer getiDouCount() { 58 | return iDouCount; 59 | } 60 | 61 | public void setiDouCount(Integer iDouCount) { 62 | this.iDouCount = iDouCount; 63 | } 64 | 65 | @JoinColumn(name="user_id") 66 | @ManyToOne(fetch= FetchType.LAZY) 67 | public User getUser() { 68 | return user; 69 | } 70 | 71 | public void setUser(User user) { 72 | this.user = user; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/ima/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.ima.service; 2 | 3 | import com.ima.model.User; 4 | import com.ima.repository.UserRepository; 5 | import com.ima.utils.CreateIMAccount; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | /** 10 | * Created by ${符柱成} on 2017/3/9. 11 | */ 12 | @Service 13 | public class UserService { 14 | @Autowired 15 | private UserRepository userRepository; 16 | 17 | public void save(User user){ 18 | userRepository.save(user); 19 | } 20 | 21 | public User login(String account) { 22 | User user = userRepository.getByAccount(account); 23 | System.out.println("userId :" + user); 24 | return user; 25 | } 26 | //注册 27 | public User register(String account, String name, String sex) { 28 | boolean flag; 29 | User user = new User(); 30 | if (account == null) { 31 | return null; 32 | } else { 33 | //判存在 34 | if (userRepository.getByAccount(account) != null) { 35 | return null; 36 | } else { 37 | user.setAccount(account); 38 | user.setName(name); 39 | user.setSex(sex); 40 | //注册成功加爱豆 41 | user.setiDouCount((long)300); 42 | user.setChargeMoney((long)0); 43 | userRepository.save(user); 44 | //注册云旺,想体验的就自己打开这个咯 45 | // CreateIMAccount.createIMAccount(account); 46 | return user; 47 | } 48 | } 49 | } 50 | //更新昵称 51 | public boolean updateName(Long userId, String name) { 52 | boolean flag = false; 53 | if (userId != null && name != null) { 54 | userRepository.updateName(name, userId); 55 | flag = true; 56 | } 57 | return flag; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/ima/utils/JavaWebToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * * Copyright (c) 2012-2015 zjc@ppfix.cn 4 | * * May you do good and not evil. 5 | * * May you find forgiveness for yourself and forgive others. 6 | * * May you share freely,never taking more than you give. 7 | * * Please do not del these words when you share or copy this file 8 | * 9 | */ 10 | 11 | package com.ima.utils; 12 | 13 | 14 | import io.jsonwebtoken.Jwts; 15 | import io.jsonwebtoken.SignatureAlgorithm; 16 | import org.apache.log4j.Logger; 17 | 18 | import javax.crypto.spec.SecretKeySpec; 19 | import javax.xml.bind.DatatypeConverter; 20 | import java.security.Key; 21 | import java.util.Map; 22 | 23 | /** 24 | * @author 符柱成 25 | */ 26 | 27 | public class JavaWebToken { 28 | 29 | private static Logger log = Logger.getLogger(JavaWebToken.class); 30 | 31 | private static Key getKeyInstance() { 32 | // return MacProvider.generateKey(); 33 | //We will sign our JavaWebToken with our ApiKey secret 34 | SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256; 35 | byte[] apiKeySecretBytes = DatatypeConverter.parseBase64Binary("AiDou"); 36 | Key signingKey = new SecretKeySpec(apiKeySecretBytes, signatureAlgorithm.getJcaName()); 37 | return signingKey; 38 | } 39 | 40 | public static String createJavaWebToken(Map claims) { 41 | return Jwts.builder().setClaims(claims).signWith(SignatureAlgorithm.HS256, getKeyInstance()).compact(); 42 | } 43 | 44 | public static Map verifyJavaWebToken(String jwt) { 45 | try { 46 | 47 | Map jwtClaims = 48 | Jwts.parser().setSigningKey(getKeyInstance()).parseClaimsJws(jwt).getBody(); 49 | return jwtClaims; 50 | } catch (Exception e) { 51 | log.error("json web token verify failed"); 52 | return null; 53 | } 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/ima/utils/CreateIMAccount.java: -------------------------------------------------------------------------------- 1 | package com.ima.utils; 2 | 3 | import com.taobao.api.ApiException; 4 | import com.taobao.api.DefaultTaobaoClient; 5 | import com.taobao.api.TaobaoClient; 6 | import com.taobao.api.domain.Userinfos; 7 | import com.taobao.api.request.OpenimUsersAddRequest; 8 | import com.taobao.api.response.OpenimUsersAddResponse; 9 | import org.springframework.util.DigestUtils; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | /** 15 | * Created by ${符柱成} on 2017/3/13. 16 | */ 17 | public class CreateIMAccount { 18 | //淘宝IM默认的接口 19 | private static final String url ="http://gw.api.taobao.com/router/rest"; 20 | //淘宝阿里云旺IM中,你创建的应用的key。appkey跟secret。 21 | private static final String appkey=""; 22 | private static final String secret=""; 23 | //这个是自定义的加密规则 24 | private static final String passwordHead = ""; 25 | 26 | public static void createIMAccount(String account) { 27 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); 28 | OpenimUsersAddRequest req = new OpenimUsersAddRequest(); 29 | List list = new ArrayList(); 30 | /* 31 | MD5加密 32 | */ 33 | String userIMAccount = DigestUtils.md5DigestAsHex(account.getBytes()); 34 | String userPassword = DigestUtils.md5DigestAsHex(passwordHead.concat(userIMAccount).getBytes()); 35 | //对应云旺的用户信息 36 | Userinfos userinfos = new Userinfos(); 37 | list.add(userinfos); 38 | userinfos.setUserid(userIMAccount); 39 | userinfos.setPassword(userPassword); 40 | 41 | req.setUserinfos(list); 42 | OpenimUsersAddResponse response = null; 43 | try { 44 | response = client.execute(req); 45 | } catch (ApiException e) { 46 | e.printStackTrace(); 47 | System.out.println("IM注册异常"); 48 | } 49 | System.out.println("response Body"+response.getBody()); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /target/classes/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | ENABLE_SELECTIVE 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | ENABLE_SELECTIVE 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | ENABLE_SELECTIVE 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/com/ima/dao/JedisClientSingle.java: -------------------------------------------------------------------------------- 1 | package com.ima.dao; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.Bean; 5 | import redis.clients.jedis.Jedis; 6 | import redis.clients.jedis.JedisPool; 7 | 8 | /** 9 | * Created by ${符柱成} on 2017/3/28. 10 | */ 11 | public class JedisClientSingle implements JedisClient { 12 | 13 | // @Autowired 14 | // private JedisPool jedisPool; 15 | @Bean 16 | public JedisPool getJedisPool(){ 17 | return new JedisPool("127.0.0.1",6379); 18 | } 19 | @Override 20 | public String get(String key) { 21 | Jedis jedis = getJedisPool().getResource(); 22 | String string = jedis.get(key); 23 | jedis.close(); 24 | return string; 25 | } 26 | 27 | @Override 28 | public String set(String key, String value) { 29 | Jedis jedis = getJedisPool().getResource(); 30 | String string = jedis.set(key, value); 31 | jedis.close(); 32 | return string; 33 | } 34 | 35 | @Override 36 | public String hget(String hkey, String key) { 37 | System.out.println("jedisPool "+getJedisPool()); 38 | Jedis jedis = getJedisPool().getResource(); 39 | System.out.println("jedis "+jedis); 40 | String string = jedis.hget(hkey, key); 41 | jedis.close(); 42 | return string; 43 | } 44 | 45 | @Override 46 | public long hset(String hkey, String key, String value) { 47 | Jedis jedis = getJedisPool().getResource(); 48 | Long result = jedis.hset(hkey, key, value); 49 | jedis.close(); 50 | return result; 51 | } 52 | 53 | @Override 54 | public long incr(String key) { 55 | Jedis jedis = getJedisPool().getResource(); 56 | Long result = jedis.incr(key); 57 | jedis.close(); 58 | return result; 59 | } 60 | 61 | @Override 62 | public long expire(String key, int second) { 63 | Jedis jedis = getJedisPool().getResource(); 64 | Long result = jedis.expire(key, second); 65 | jedis.close(); 66 | return result; 67 | } 68 | 69 | @Override 70 | public long ttl(String key) { 71 | Jedis jedis = getJedisPool().getResource(); 72 | Long result = jedis.ttl(key); 73 | jedis.close(); 74 | return result; 75 | } 76 | 77 | @Override 78 | public long del(String key) { 79 | Jedis jedis = getJedisPool().getResource(); 80 | Long result = jedis.del(key); 81 | jedis.close(); 82 | return result; 83 | } 84 | 85 | @Override 86 | public long hdel(String hkey, String key) { 87 | Jedis jedis = getJedisPool().getResource(); 88 | Long result = jedis.hdel(hkey,key); 89 | jedis.close(); 90 | return result; 91 | } 92 | } -------------------------------------------------------------------------------- /target/classes/META-INF/springmvc/spring-mvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | application/x-www-form-urlencoded;charset=UTF-8 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/springmvc/spring-mvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | application/x-www-form-urlencoded;charset=UTF-8 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/META-INF/springmvc/spring-mvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | application/x-www-form-urlencoded;charset=UTF-8 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /target/classes/META-INF/log4j.properties: -------------------------------------------------------------------------------- 1 | 2 | # +======================================================================+# 3 | # | log4j config 4 | # +----------------------------------------------------------------------+# 5 | log4j.log.dir=/root/aidou 6 | log4j.log.name=aidou 7 | log4j.log.encoding=UTF-8 8 | log4j.log.layout=org.apache.log4j.PatternLayout 9 | log4j.log.layout.pattern=[%d{HH:mm:ss}] [%-5p] [%l] [%m]%n 10 | log4j.log.file.appender=org.apache.log4j.DailyRollingFileAppender 11 | 12 | #log4j.log.level=ALL,TRACE,DEBUG,INFO,WARN,ERROR,FATAL,OFF 13 | log4j.log.level=DEBUG 14 | #\u6839\u8def\u5f84log\u8f93\u51fa\u76ee\u6807 15 | log4j.log.target=CONSOLE,ERROR,FILE 16 | 17 | log4j.logger.java.sql.ResultSet=INFO 18 | log4j.logger.java.sql.Connection=INFO 19 | log4j.logger.java.sql.Statement=INFO 20 | log4j.logger.java.sql.PreparedStatement=INFO 21 | log4j.logger.org.springframework=INFO 22 | log4j.logger.org.apache=INFO 23 | log4j.logger.org.mybatis=INFO 24 | 25 | 26 | # +======================================================================+# 27 | # | [rootLogger] - config 28 | log4j.rootLogger=${log4j.log.level},${log4j.log.target} 29 | log4j.addivity.org.apache=true 30 | # +======================================================================+# 31 | 32 | # +======================================================================+# 33 | # | [target] - Console 34 | # +----------------------------------------------------------------------+# 35 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 36 | log4j.appender.CONSOLE.Threshold=${log4j.log.level} 37 | log4j.appender.CONSOLE.Encoding=${log4j.log.encoding} 38 | log4j.appender.CONSOLE.Target=System.out 39 | log4j.appender.CONSOLE.layout=${log4j.log.layout} 40 | log4j.appender.CONSOLE.layout.ConversionPattern=${log4j.log.layout.pattern} 41 | # +======================================================================+# 42 | # | [target] - FILE 43 | # +----------------------------------------------------------------------+# 44 | log4j.appender.FILE=${log4j.log.file.appender} 45 | log4j.appender.FILE.Threshold=${log4j.log.level} 46 | log4j.appender.FILE.Encoding=${log4j.log.encoding} 47 | log4j.appender.FILE.File=${log4j.log.dir}/${log4j.log.name}.log 48 | log4j.appender.FILE.Append=true 49 | log4j.appender.FILE.layout=${log4j.log.layout} 50 | log4j.appender.FILE.layout.ConversionPattern=${log4j.log.layout.pattern} 51 | # +=====================================================================+# 52 | # | [target] - ERROR 53 | # +---------------------------------------------------------------------+# 54 | log4j.appender.ERROR=${log4j.log.file.appender} 55 | log4j.appender.ERROR.Threshold=ERROR 56 | log4j.appender.ERROR.Encoding=${log4j.log.encoding} 57 | log4j.appender.ERROR.File=${log4j.log.dir}/${log4j.log.name}-error.log 58 | log4j.appender.ERROR.Append=true 59 | log4j.appender.ERROR.layout=${log4j.log.layout} 60 | log4j.appender.ERROR.layout.ConversionPattern=${log4j.log.layout.pattern} 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/log4j.properties: -------------------------------------------------------------------------------- 1 | 2 | # +======================================================================+# 3 | # | log4j config 4 | # +----------------------------------------------------------------------+# 5 | log4j.log.dir=/root/aidou 6 | log4j.log.name=aidou 7 | log4j.log.encoding=UTF-8 8 | log4j.log.layout=org.apache.log4j.PatternLayout 9 | log4j.log.layout.pattern=[%d{HH:mm:ss}] [%-5p] [%l] [%m]%n 10 | log4j.log.file.appender=org.apache.log4j.DailyRollingFileAppender 11 | 12 | #log4j.log.level=ALL,TRACE,DEBUG,INFO,WARN,ERROR,FATAL,OFF 13 | log4j.log.level=DEBUG 14 | #\u6839\u8def\u5f84log\u8f93\u51fa\u76ee\u6807 15 | log4j.log.target=CONSOLE,ERROR,FILE 16 | 17 | log4j.logger.java.sql.ResultSet=INFO 18 | log4j.logger.java.sql.Connection=INFO 19 | log4j.logger.java.sql.Statement=INFO 20 | log4j.logger.java.sql.PreparedStatement=INFO 21 | log4j.logger.org.springframework=INFO 22 | log4j.logger.org.apache=INFO 23 | log4j.logger.org.mybatis=INFO 24 | 25 | 26 | # +======================================================================+# 27 | # | [rootLogger] - config 28 | log4j.rootLogger=${log4j.log.level},${log4j.log.target} 29 | log4j.addivity.org.apache=true 30 | # +======================================================================+# 31 | 32 | # +======================================================================+# 33 | # | [target] - Console 34 | # +----------------------------------------------------------------------+# 35 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 36 | log4j.appender.CONSOLE.Threshold=${log4j.log.level} 37 | log4j.appender.CONSOLE.Encoding=${log4j.log.encoding} 38 | log4j.appender.CONSOLE.Target=System.out 39 | log4j.appender.CONSOLE.layout=${log4j.log.layout} 40 | log4j.appender.CONSOLE.layout.ConversionPattern=${log4j.log.layout.pattern} 41 | # +======================================================================+# 42 | # | [target] - FILE 43 | # +----------------------------------------------------------------------+# 44 | log4j.appender.FILE=${log4j.log.file.appender} 45 | log4j.appender.FILE.Threshold=${log4j.log.level} 46 | log4j.appender.FILE.Encoding=${log4j.log.encoding} 47 | log4j.appender.FILE.File=${log4j.log.dir}/${log4j.log.name}.log 48 | log4j.appender.FILE.Append=true 49 | log4j.appender.FILE.layout=${log4j.log.layout} 50 | log4j.appender.FILE.layout.ConversionPattern=${log4j.log.layout.pattern} 51 | # +=====================================================================+# 52 | # | [target] - ERROR 53 | # +---------------------------------------------------------------------+# 54 | log4j.appender.ERROR=${log4j.log.file.appender} 55 | log4j.appender.ERROR.Threshold=ERROR 56 | log4j.appender.ERROR.Encoding=${log4j.log.encoding} 57 | log4j.appender.ERROR.File=${log4j.log.dir}/${log4j.log.name}-error.log 58 | log4j.appender.ERROR.Append=true 59 | log4j.appender.ERROR.layout=${log4j.log.layout} 60 | log4j.appender.ERROR.layout.ConversionPattern=${log4j.log.layout.pattern} 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/META-INF/log4j.properties: -------------------------------------------------------------------------------- 1 | 2 | # +======================================================================+# 3 | # | log4j config 4 | # +----------------------------------------------------------------------+# 5 | log4j.log.dir=/root/aidou 6 | log4j.log.name=aidou 7 | log4j.log.encoding=UTF-8 8 | log4j.log.layout=org.apache.log4j.PatternLayout 9 | log4j.log.layout.pattern=[%d{HH:mm:ss}] [%-5p] [%l] [%m]%n 10 | log4j.log.file.appender=org.apache.log4j.DailyRollingFileAppender 11 | 12 | #log4j.log.level=ALL,TRACE,DEBUG,INFO,WARN,ERROR,FATAL,OFF 13 | log4j.log.level=DEBUG 14 | #\u6839\u8def\u5f84log\u8f93\u51fa\u76ee\u6807 15 | log4j.log.target=CONSOLE,ERROR,FILE 16 | 17 | log4j.logger.java.sql.ResultSet=INFO 18 | log4j.logger.java.sql.Connection=INFO 19 | log4j.logger.java.sql.Statement=INFO 20 | log4j.logger.java.sql.PreparedStatement=INFO 21 | log4j.logger.org.springframework=INFO 22 | log4j.logger.org.apache=INFO 23 | log4j.logger.org.mybatis=INFO 24 | 25 | 26 | # +======================================================================+# 27 | # | [rootLogger] - config 28 | log4j.rootLogger=${log4j.log.level},${log4j.log.target} 29 | log4j.addivity.org.apache=true 30 | # +======================================================================+# 31 | 32 | # +======================================================================+# 33 | # | [target] - Console 34 | # +----------------------------------------------------------------------+# 35 | log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender 36 | log4j.appender.CONSOLE.Threshold=${log4j.log.level} 37 | log4j.appender.CONSOLE.Encoding=${log4j.log.encoding} 38 | log4j.appender.CONSOLE.Target=System.out 39 | log4j.appender.CONSOLE.layout=${log4j.log.layout} 40 | log4j.appender.CONSOLE.layout.ConversionPattern=${log4j.log.layout.pattern} 41 | # +======================================================================+# 42 | # | [target] - FILE 43 | # +----------------------------------------------------------------------+# 44 | log4j.appender.FILE=${log4j.log.file.appender} 45 | log4j.appender.FILE.Threshold=${log4j.log.level} 46 | log4j.appender.FILE.Encoding=${log4j.log.encoding} 47 | log4j.appender.FILE.File=${log4j.log.dir}/${log4j.log.name}.log 48 | log4j.appender.FILE.Append=true 49 | log4j.appender.FILE.layout=${log4j.log.layout} 50 | log4j.appender.FILE.layout.ConversionPattern=${log4j.log.layout.pattern} 51 | # +=====================================================================+# 52 | # | [target] - ERROR 53 | # +---------------------------------------------------------------------+# 54 | log4j.appender.ERROR=${log4j.log.file.appender} 55 | log4j.appender.ERROR.Threshold=ERROR 56 | log4j.appender.ERROR.Encoding=${log4j.log.encoding} 57 | log4j.appender.ERROR.File=${log4j.log.dir}/${log4j.log.name}-error.log 58 | log4j.appender.ERROR.Append=true 59 | log4j.appender.ERROR.layout=${log4j.log.layout} 60 | log4j.appender.ERROR.layout.ConversionPattern=${log4j.log.layout.pattern} 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /springdatajpa.sql: -------------------------------------------------------------------------------- 1 | -- -------------------------------------------------------- 2 | -- 主机: 127.0.0.1 3 | -- 服务器版本: 5.5.51 - MySQL Community Server (GPL) 4 | -- 服务器操作系统: Win64 5 | -- HeidiSQL 版本: 9.4.0.5125 6 | -- -------------------------------------------------------- 7 | 8 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 9 | /*!40101 SET NAMES utf8 */; 10 | /*!50503 SET NAMES utf8mb4 */; 11 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 12 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 13 | 14 | -- 导出 表 aidou.i_dou_change 结构 15 | CREATE TABLE IF NOT EXISTS `i_dou_change` ( 16 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 17 | `change_type` varchar(255) DEFAULT NULL, 18 | `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 19 | `i_dou_count` int(11) DEFAULT NULL, 20 | `user_id` bigint(20) DEFAULT NULL, 21 | PRIMARY KEY (`id`), 22 | KEY `FK_giqq7yns6cxf6ovmpdohhjnkw` (`user_id`), 23 | CONSTRAINT `FK_giqq7yns6cxf6ovmpdohhjnkw` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) 24 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; 25 | 26 | -- 正在导出表 aidou.i_dou_change 的数据:~0 rows (大约) 27 | /*!40000 ALTER TABLE `i_dou_change` DISABLE KEYS */; 28 | INSERT INTO `i_dou_change` (`id`, `change_type`, `create_time`, `i_dou_count`, `user_id`) VALUES 29 | (1, '注册成功', '2017-03-21 07:57:57', 100, 1), 30 | (2, '吃吃', '2017-03-21 08:27:15', 1000, NULL); 31 | /*!40000 ALTER TABLE `i_dou_change` ENABLE KEYS */; 32 | 33 | -- 导出 表 aidou.user 结构 34 | CREATE TABLE IF NOT EXISTS `user` ( 35 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 36 | `account` varchar(255) DEFAULT NULL, 37 | `avatar` varchar(255) DEFAULT NULL, 38 | `charge_money` bigint(20) NOT NULL DEFAULT '0', 39 | `city` varchar(255) DEFAULT NULL, 40 | `country` varchar(255) DEFAULT NULL, 41 | `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 42 | `i_dou_count` bigint(20) NOT NULL DEFAULT '0', 43 | `latitude` double DEFAULT NULL, 44 | `log_out` tinyint(1) DEFAULT NULL, 45 | `log_out_time` datetime DEFAULT NULL, 46 | `longitude` double DEFAULT NULL, 47 | `name` varchar(255) DEFAULT NULL, 48 | `province` varchar(255) DEFAULT NULL, 49 | `sex` varchar(255) DEFAULT NULL, 50 | `update_time` datetime DEFAULT NULL, 51 | PRIMARY KEY (`id`) 52 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; 53 | 54 | -- 正在导出表 aidou.user 的数据:~0 rows (大约) 55 | /*!40000 ALTER TABLE `user` DISABLE KEYS */; 56 | INSERT INTO `user` (`id`, `account`, `avatar`, `charge_money`, `city`, `country`, `create_time`, `i_dou_count`, `latitude`, `log_out`, `log_out_time`, `longitude`, `name`, `province`, `sex`, `update_time`) VALUES 57 | (1, '89351', NULL, 0, NULL, NULL, '2017-03-21 07:57:57', 100, NULL, 0, NULL, NULL, 'af12', NULL, NULL, NULL); 58 | /*!40000 ALTER TABLE `user` ENABLE KEYS */; 59 | 60 | /*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; 61 | /*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; 62 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 63 | -------------------------------------------------------------------------------- /target/classes/META-INF/spring/spring-jpa.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring/spring-jpa.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/classes/META-INF/spring/spring-jpa.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | Archetype Created Web Application 12 | 13 | 14 | contextConfigLocation 15 | classpath:META-INF/spring/spring-jpa.xml,classpath:META-INF/spring/spring-jedis.xml 16 | 17 | 18 | org.springframework.web.context.ContextLoaderListener 19 | 20 | 21 | 22 | log4jConfigLocation 23 | classpath:META-INF/log4j.properties 24 | 25 | 26 | org.springframework.web.util.Log4jConfigListener 27 | 28 | 29 | 30 | 31 | Set Character Encoding 32 | org.springframework.web.filter.CharacterEncodingFilter 33 | 34 | encoding 35 | UTF-8 36 | 37 | 38 | forceEncoding 39 | true 40 | 41 | 42 | 43 | Set Character Encoding 44 | /* 45 | 46 | 47 | 48 | 49 | appServlet 50 | org.springframework.web.servlet.DispatcherServlet 51 | 52 | contextConfigLocation 53 | classpath:META-INF/springmvc/spring-mvc.xml 54 | 55 | 1 56 | 57 | 58 | appServlet 59 | / 60 | 61 | 62 | 63 | Spring OpenEntityManagerInViewFilter 64 | org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter 65 | 66 | 68 | entityManagerFactoryBeanName 69 | entityManagerFactory 70 | 71 | 72 | 73 | Spring OpenEntityManagerInViewFilter 74 | /* 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | DruidWebStatFilter 84 | com.alibaba.druid.support.http.WebStatFilter 85 | 86 | exclusions 87 | *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/* 88 | 89 | 90 | sessionStatMaxCount 91 | 1000 92 | 93 | 94 | sessionStatEnable 95 | false 96 | 97 | 98 | 99 | DruidWebStatFilter 100 | /* 101 | 102 | 103 | 104 | DruidStatView 105 | com.alibaba.druid.support.http.StatViewServlet 106 | 107 | 108 | resetEnable 109 | true 110 | 111 | 112 | 113 | loginUsername 114 | druid 115 | 116 | 117 | 118 | loginPassword 119 | druid 120 | 121 | 122 | 123 | DruidStatView 124 | /druid/* 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /target/springdatajpa/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 11 | Archetype Created Web Application 12 | 13 | 14 | contextConfigLocation 15 | classpath:META-INF/spring/spring-jpa.xml,classpath:META-INF/spring/spring-jedis.xml 16 | 17 | 18 | org.springframework.web.context.ContextLoaderListener 19 | 20 | 21 | 22 | log4jConfigLocation 23 | classpath:META-INF/log4j.properties 24 | 25 | 26 | org.springframework.web.util.Log4jConfigListener 27 | 28 | 29 | 30 | 31 | Set Character Encoding 32 | org.springframework.web.filter.CharacterEncodingFilter 33 | 34 | encoding 35 | UTF-8 36 | 37 | 38 | forceEncoding 39 | true 40 | 41 | 42 | 43 | Set Character Encoding 44 | /* 45 | 46 | 47 | 48 | 49 | appServlet 50 | org.springframework.web.servlet.DispatcherServlet 51 | 52 | contextConfigLocation 53 | classpath:META-INF/springmvc/spring-mvc.xml 54 | 55 | 1 56 | 57 | 58 | appServlet 59 | / 60 | 61 | 62 | 63 | Spring OpenEntityManagerInViewFilter 64 | org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter 65 | 66 | 68 | entityManagerFactoryBeanName 69 | entityManagerFactory 70 | 71 | 72 | 73 | Spring OpenEntityManagerInViewFilter 74 | /* 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | DruidWebStatFilter 84 | com.alibaba.druid.support.http.WebStatFilter 85 | 86 | exclusions 87 | *.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/* 88 | 89 | 90 | sessionStatMaxCount 91 | 1000 92 | 93 | 94 | sessionStatEnable 95 | false 96 | 97 | 98 | 99 | DruidWebStatFilter 100 | /* 101 | 102 | 103 | 104 | DruidStatView 105 | com.alibaba.druid.support.http.StatViewServlet 106 | 107 | 108 | resetEnable 109 | true 110 | 111 | 112 | 113 | loginUsername 114 | druid 115 | 116 | 117 | 118 | loginPassword 119 | druid 120 | 121 | 122 | 123 | DruidStatView 124 | /druid/* 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /src/main/java/com/ima/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.ima.controller; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.alibaba.fastjson.JSONArray; 5 | import com.ima.dao.JedisClient; 6 | import com.ima.dto.DTO; 7 | import com.ima.model.IDouChange; 8 | import com.ima.model.User; 9 | import com.ima.service.AiDouService; 10 | import com.ima.service.UserService; 11 | import com.ima.utils.AuthUtil; 12 | import com.ima.utils.JavaWebToken; 13 | import com.ima.utils.JsonUtils; 14 | import org.springframework.beans.factory.annotation.Autowired; 15 | import org.springframework.web.bind.annotation.RequestMapping; 16 | import org.springframework.web.bind.annotation.RequestMethod; 17 | import org.springframework.web.bind.annotation.RestController; 18 | 19 | import javax.servlet.http.HttpServletRequest; 20 | import java.util.HashMap; 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | /** 25 | * 用户各种操作接口 26 | * Created by 符柱成 on 17-3-11. 27 | */ 28 | @RestController 29 | @RequestMapping("/user") 30 | public class UserController { 31 | @Autowired 32 | private UserService userService; 33 | @Autowired 34 | private AiDouService aiDouService; 35 | @Autowired 36 | private JedisClient jedisClient; 37 | 38 | //test: 39 | @RequestMapping(value = "/test", method = {RequestMethod.GET, RequestMethod.POST}, produces = "text/html;charset=UTF-8") 40 | public String test(String type, Integer iDouCount ) { 41 | DTO dto = new DTO(); 42 | IDouChange iDouChange = new IDouChange(); 43 | iDouChange.setChangeType(type); 44 | iDouChange.setiDouCount(iDouCount); 45 | aiDouService.save(iDouChange); 46 | if (iDouChange == null) { 47 | dto.code = "-1"; 48 | dto.msg = "Have bean registered"; 49 | return JSON.toJSONString(dto); 50 | } else { 51 | return JSON.toJSONString(iDouChange); 52 | } 53 | } 54 | 55 | //登录 56 | @RequestMapping(value = "/login", method = {RequestMethod.GET, RequestMethod.POST}, produces = "text/html;charset=UTF-8") 57 | public String login(String account) { 58 | User user = userService.login(account); 59 | 60 | DTO dto = new DTO(); 61 | if (user == null) { 62 | dto.code = "-1"; 63 | dto.msg = "Have not registered"; 64 | } else { 65 | //把用户登录信息放进Session 66 | Map loginInfo = new HashMap<>(); 67 | loginInfo.put("userId", user.getId()); 68 | String sessionId = JavaWebToken.createJavaWebToken(loginInfo); 69 | System.out.println("sessionID"+sessionId); 70 | dto.data = sessionId; 71 | } 72 | return JSON.toJSONString(dto); 73 | } 74 | 75 | //注册: 76 | @RequestMapping(value = "/register", method = {RequestMethod.GET, RequestMethod.POST}, produces = "text/html;charset=UTF-8") 77 | public String register(String account, String name, String sex) { 78 | User user = null; 79 | DTO dto = new DTO(); 80 | user = userService.register(account, name, sex); 81 | aiDouService.registerCount(user); 82 | if (user == null) { 83 | dto.code = "-1"; 84 | dto.msg = "Have bean registered"; 85 | return JSON.toJSONString(dto); 86 | } else { 87 | return JSON.toJSONString(user); 88 | } 89 | } 90 | 91 | //修改昵称 92 | @RequestMapping(value = "/updateName", method = {RequestMethod.GET, RequestMethod.POST}) 93 | public String updateName(HttpServletRequest request, String name) { 94 | DTO dto = new DTO(); 95 | try { 96 | Long userId = AuthUtil.getUserId(request); 97 | boolean userIsExist = userService.updateName(userId, name); 98 | if (userIsExist == false) { 99 | dto.code = "-1"; 100 | dto.msg = "Have not updateAvatar"; 101 | } 102 | } catch (Exception e) { 103 | e.printStackTrace(); 104 | } 105 | return JSON.toJSONString(dto); 106 | } 107 | //查历史记录 108 | @RequestMapping(value = "/findHistory", method = {RequestMethod.GET, RequestMethod.POST}) 109 | public String findHistory(Long id) { 110 | DTO dto = new DTO(); 111 | List iDouChangeList = null; 112 | System.out.println("jedisClient :" + jedisClient); 113 | try { 114 | String resulthget = jedisClient.hget("个人积分记录", id + ""); 115 | if (resulthget != null) { 116 | //字符串转为list 117 | System.out.println("有缓存啦啦啦!!!"); 118 | JSONArray array = JSONArray.parseArray(resulthget); 119 | iDouChangeList = (List) array; 120 | } else { 121 | System.out.println("个人积分记录没查过"); 122 | iDouChangeList = aiDouService.getHistory(id); 123 | } 124 | } catch (Exception e) { 125 | e.printStackTrace(); 126 | } 127 | if (iDouChangeList == null) { 128 | dto.code = "-1"; 129 | dto.msg = "Have not updateAvatar"; 130 | } 131 | try { 132 | String cacheString = JsonUtils.objectToJson(iDouChangeList); 133 | jedisClient.hset("个人积分记录", id + "", cacheString); 134 | } catch (Exception e) { 135 | e.printStackTrace(); 136 | } 137 | return JSON.toJSONString(iDouChangeList); 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /src/main/java/com/ima/model/User.java: -------------------------------------------------------------------------------- 1 | package com.ima.model; 2 | 3 | import javax.persistence.*; 4 | import java.util.Date; 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | /** 9 | * 用户实体类 10 | * Created by 符柱成 on 17-3-11. 11 | */ 12 | @Entity 13 | @Table(name = "user") 14 | public class User { 15 | private Long id; 16 | //账号 17 | private String account; 18 | //头像 19 | private String avatar; 20 | //市 21 | private String city; 22 | //省 23 | private String province; 24 | //国家 25 | private String country; 26 | private Date createTime; 27 | //爱豆数目 28 | private Long iDouCount; 29 | //是否已经下线 30 | private boolean logOut; 31 | //最近下线时间 32 | private Date logOutTime; 33 | //纬度 34 | private Double latitude; 35 | //经度 36 | private Double longitude; 37 | //用户名 38 | private String name; 39 | //用户性别,F:女,M:男 40 | private String sex; 41 | //爱豆变化 42 | private Set iDouChanges=new HashSet(); 43 | 44 | //充值金额 45 | private Long chargeMoney; 46 | //最新主动行为时间 47 | private Date updateTime; 48 | 49 | public User(Long id, String account, String avatar, String city, String province, String country, Date createTime, Long iDouCount, boolean logOut, Date logOutTime, Double latitude, Double longitude, String name, String sex, Set iDouChanges, Long chargeMoney, Date updateTime) { 50 | this.id = id; 51 | this.account = account; 52 | this.avatar = avatar; 53 | this.city = city; 54 | this.province = province; 55 | this.country = country; 56 | this.createTime = createTime; 57 | this.iDouCount = iDouCount; 58 | this.logOut = logOut; 59 | this.logOutTime = logOutTime; 60 | this.latitude = latitude; 61 | this.longitude = longitude; 62 | this.name = name; 63 | this.sex = sex; 64 | this.iDouChanges = iDouChanges; 65 | 66 | this.chargeMoney = chargeMoney; 67 | this.updateTime = updateTime; 68 | } 69 | 70 | public User() { 71 | } 72 | 73 | @Id 74 | @GeneratedValue 75 | public Long getId() { 76 | return id; 77 | } 78 | 79 | public void setId(Long id) { 80 | this.id = id; 81 | } 82 | 83 | public String getAccount() { 84 | return account; 85 | } 86 | 87 | public void setAccount(String account) { 88 | this.account = account; 89 | } 90 | 91 | public String getAvatar() { 92 | return avatar; 93 | } 94 | 95 | public void setAvatar(String avatar) { 96 | this.avatar = avatar; 97 | } 98 | 99 | public String getCity() { 100 | return city; 101 | } 102 | 103 | public void setCity(String city) { 104 | this.city = city; 105 | } 106 | 107 | public String getCountry() { 108 | return country; 109 | } 110 | 111 | public void setCountry(String country) { 112 | this.country = country; 113 | } 114 | 115 | @Temporal(TemporalType.TIMESTAMP) 116 | @Column(name = "create_time",nullable=true,columnDefinition="timestamp default current_timestamp") 117 | public Date getCreateTime() { 118 | return createTime; 119 | } 120 | 121 | public void setCreateTime(Date createTime) { 122 | this.createTime = createTime; 123 | } 124 | 125 | @Column(name = "i_dou_count",nullable=false,columnDefinition = "BIGINT default 0") 126 | public Long getiDouCount() { 127 | return iDouCount; 128 | } 129 | 130 | public void setiDouCount(Long iDouCount) { 131 | this.iDouCount = iDouCount; 132 | } 133 | 134 | 135 | @Temporal(TemporalType.TIMESTAMP) 136 | @Column(name = "log_out_time") 137 | public Date getLogOutTime() { 138 | return logOutTime; 139 | } 140 | 141 | public void setLogOutTime(Date logOutTime) { 142 | this.logOutTime = logOutTime; 143 | } 144 | 145 | public String getName() { 146 | return name; 147 | } 148 | 149 | public void setName(String name) { 150 | this.name = name; 151 | } 152 | public String getProvince() { 153 | return province; 154 | } 155 | 156 | public void setProvince(String province) { 157 | this.province = province; 158 | } 159 | 160 | public String getSex() { 161 | return sex; 162 | } 163 | 164 | public void setSex(String sex) { 165 | this.sex = sex; 166 | } 167 | 168 | @OneToMany(fetch= FetchType.LAZY,cascade={CascadeType.REMOVE},mappedBy="user") 169 | public Set getiDouChanges() { 170 | return iDouChanges; 171 | } 172 | 173 | public void setiDouChanges(Set iDouChanges) { 174 | this.iDouChanges = iDouChanges; 175 | } 176 | 177 | @Column(name = "log_out") 178 | public boolean getLogOut() { 179 | return logOut; 180 | } 181 | 182 | public void setLogOut(boolean logOut) { 183 | this.logOut = logOut; 184 | } 185 | 186 | 187 | 188 | @Column(name = "charge_money",nullable=false,columnDefinition = "BIGINT default 0") 189 | public Long getChargeMoney() { 190 | return chargeMoney; 191 | } 192 | 193 | public void setChargeMoney(Long chargeMoney) { 194 | this.chargeMoney = chargeMoney; 195 | } 196 | 197 | public Double getLatitude() { 198 | return latitude; 199 | } 200 | 201 | public void setLatitude(Double latitude) { 202 | this.latitude = latitude; 203 | } 204 | 205 | public Double getLongitude() { 206 | return longitude; 207 | } 208 | 209 | public void setLongitude(Double longitude) { 210 | this.longitude = longitude; 211 | } 212 | 213 | @Temporal(TemporalType.TIMESTAMP) 214 | @Column(name = "update_time") 215 | public Date getUpdateTime() { 216 | return updateTime; 217 | } 218 | 219 | public void setUpdateTime(Date updateTime) { 220 | this.updateTime = updateTime; 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /.idea/artifacts/SpringdataJpaDemo_war_exploded.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/target/springdatajpa 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /SpringdataJpaDemo.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.ima 5 | springdatajpademo 6 | war 7 | 1.0-SNAPSHOT 8 | springdatajpademo Maven Webapp 9 | http://maven.apache.org 10 | 11 | 12 | 13 | UTF-8 14 | 15 | yyyyMMdd'T'HHmmss 16 | ${maven.build.timestamp} 17 | 18 | 1.7 19 | 1.7 20 | 21 | 1.7 22 | 23 | 4.0.4.RELEASE 24 | 1.6.6 25 | 5.0.1.Final 26 | 1.0.1.Final 27 | 4.2.6.Final 28 | 5.1.35 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework 37 | spring-web 38 | ${version-springframework} 39 | 40 | 41 | org.springframework 42 | spring-webmvc 43 | ${version-springframework} 44 | 45 | 46 | 47 | org.springframework 48 | spring-expression 49 | ${version-springframework} 50 | 51 | 52 | 53 | org.springframework 54 | spring-core 55 | ${version-springframework} 56 | 57 | 58 | org.springframework 59 | spring-context 60 | ${version-springframework} 61 | 62 | 63 | 64 | commons-logging 65 | commons-logging 66 | 67 | 68 | 69 | 70 | 71 | 72 | org.springframework 73 | spring-context-support 74 | ${version-springframework} 75 | 76 | 77 | org.springframework 78 | spring-aop 79 | ${version-springframework} 80 | 81 | 82 | 83 | org.springframework 84 | spring-beans 85 | ${version-springframework} 86 | 87 | 88 | 89 | org.springframework 90 | spring-tx 91 | ${version-springframework} 92 | 93 | 94 | 95 | org.springframework 96 | spring-test 97 | ${version-springframework} 98 | 99 | 100 | 101 | org.hibernate 102 | hibernate-core 103 | ${version-hibernate} 104 | 105 | 106 | org.hibernate 107 | hibernate-entitymanager 108 | ${version-hibernate} 109 | 110 | 111 | cglib 112 | cglib 113 | 114 | 115 | dom4j 116 | dom4j 117 | 118 | 119 | 120 | 121 | org.hibernate 122 | hibernate-validator 123 | ${version-hibernate.validator} 124 | 125 | 126 | org.hibernate.javax.persistence 127 | hibernate-jpa-2.0-api 128 | ${version-hibernate.jpa} 129 | 130 | 131 | org.hibernate 132 | hibernate-ehcache 133 | ${version-hibernate} 134 | 135 | 136 | 137 | 138 | org.springframework.data 139 | spring-data-jpa 140 | 1.6.2.RELEASE 141 | 142 | 143 | 144 | 145 | org.aspectj 146 | aspectjrt 147 | 1.6.10 148 | 149 | 150 | 151 | 152 | org.slf4j 153 | slf4j-api 154 | ${version-slf4j} 155 | 156 | 157 | org.slf4j 158 | jcl-over-slf4j 159 | ${version-slf4j} 160 | runtime 161 | 162 | 163 | log4j 164 | log4j 165 | 1.2.17 166 | 167 | 168 | 169 | 170 | 171 | org.slf4j 172 | slf4j-api 173 | 1.7.7 174 | 175 | 176 | 177 | org.slf4j 178 | slf4j-log4j12 179 | 1.7.12 180 | 181 | 182 | 183 | javax.servlet 184 | servlet-api 185 | 3.0-alpha-1 186 | provided 187 | 188 | 189 | javax.servlet.jsp 190 | jsp-api 191 | 2.2 192 | provided 193 | 194 | 195 | javax.servlet 196 | jstl 197 | 1.2 198 | 199 | 200 | 201 | 202 | com.alibaba 203 | druid 204 | 1.0.0 205 | 206 | 207 | 208 | 209 | mysql 210 | mysql-connector-java 211 | ${mysql.version} 212 | 213 | 214 | 215 | 216 | org.apache.commons 217 | commons-lang3 218 | 3.3.2 219 | 220 | 221 | 222 | commons-fileupload 223 | commons-fileupload 224 | 1.3.1 225 | 226 | 227 | 228 | org.apache.commons 229 | commons-digester3 230 | 3.2 231 | 232 | 233 | 234 | commons-io 235 | commons-io 236 | 2.4 237 | 238 | 239 | 240 | org.apache.commons 241 | commons-exec 242 | 1.2 243 | 244 | 245 | 246 | commons-beanutils 247 | commons-beanutils 248 | 1.9.1 249 | 250 | 251 | 252 | commons-codec 253 | commons-codec 254 | 1.9 255 | 256 | 257 | 258 | 259 | cglib 260 | cglib 261 | 2.2.2 262 | 263 | 264 | 265 | 266 | com.alibaba 267 | fastjson 268 | 1.2.5 269 | 270 | 271 | 272 | com.fasterxml.jackson.core 273 | jackson-core 274 | 2.1.0 275 | 276 | 277 | com.fasterxml.jackson.core 278 | jackson-databind 279 | 2.1.0 280 | 281 | 282 | com.fasterxml.jackson.core 283 | jackson-annotations 284 | 2.1.0 285 | 286 | 287 | 288 | 289 | org.hamcrest 290 | hamcrest-core 291 | 1.3 292 | test 293 | 294 | 295 | org.hamcrest 296 | hamcrest-library 297 | 1.3 298 | test 299 | 300 | 301 | junit 302 | junit 303 | 4.12 304 | test 305 | 306 | 307 | 308 | 309 | io.jsonwebtoken 310 | jjwt 311 | 0.6.0 312 | 313 | 314 | 315 | redis.clients 316 | jedis 317 | 2.7.3 318 | 319 | 320 | 321 | 322 | 323 | springdatajpa 324 | 325 | 326 | org.apache.maven.plugins 327 | maven-compiler-plugin 328 | 329 | 1.7 330 | 1.7 331 | 332 | 333 | 334 | 335 | 336 | --------------------------------------------------------------------------------