├── out └── production │ ├── common-bootcwenao │ └── confing │ │ └── application.yml │ ├── bigdata-bootcwenao │ ├── config │ │ ├── hbase.properties │ │ ├── bootstrap.yml │ │ ├── application.yml │ │ └── hbase-spring.xml │ ├── web │ │ └── hbase │ │ │ └── hbasetest.html │ └── log4j2-spring.xml │ ├── hystrix-dashboard-bootcwenao │ └── config │ │ ├── bootstrap.yml │ │ └── application.yml │ ├── feign-server-bootcwenao │ └── config │ │ ├── bootstrap.yml │ │ └── application.yml │ ├── db-server-bootcwenao │ ├── config │ │ ├── bootstrap.yml │ │ ├── mybatis-spring.xml │ │ └── application.yml │ ├── web │ │ └── userinfo │ │ │ └── accountInfo.html │ ├── log4j2-spring.xml │ └── com │ │ └── bootcwenao │ │ └── dbserver │ │ └── mapper │ │ └── AccountInfoMapper.xml │ ├── es-server-bootcwenao │ ├── config │ │ ├── bootstrap.yml │ │ ├── mybatis-spring.xml │ │ └── application.yml │ ├── web │ │ └── accountInfo.html │ └── log4j2-spring.xml │ ├── ribbon-server-bootcwenao │ ├── config │ │ ├── bootstrap.yml │ │ └── application.yml │ ├── web │ │ └── index.html │ └── log4j2-spring.xml │ ├── discovery-bootcwenao │ └── config │ │ ├── bootstrap.yml │ │ └── application.yml │ ├── configserver-bootcwenao │ ├── config │ │ ├── bootstrap.yml │ │ └── application.yml │ └── log4j2-spring.xml │ └── apigateway-bootcwenao │ └── config │ ├── application.yml │ └── bootstrap.yml ├── common-bootcwenao ├── src │ ├── main │ │ ├── resources │ │ │ └── confing │ │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── bootcwenao │ │ │ └── common │ │ │ └── CommonBootcwenaoApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── common │ │ └── CommonBootcwenaoApplicationTests.java └── build.gradle ├── bigdata-bootcwenao ├── src │ └── main │ │ ├── resources │ │ ├── config │ │ │ ├── hbase.properties │ │ │ ├── bootstrap.yml │ │ │ ├── application.yml │ │ │ └── hbase-spring.xml │ │ ├── web │ │ │ └── hbase │ │ │ │ └── hbasetest.html │ │ └── log4j2-spring.xml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── bigdataserver │ │ ├── hbase │ │ ├── service │ │ │ ├── HbaseAccountInfoService.java │ │ │ └── impl │ │ │ │ └── HbaseAccountInfoServiceImpl.java │ │ ├── mapper │ │ │ ├── HbaseAccountInfoMapper.java │ │ │ └── impl │ │ │ │ └── HbaseAccountInfoMapperImpl.java │ │ ├── controller │ │ │ └── HbaseAccountController.java │ │ ├── domain │ │ │ └── pojo │ │ │ │ └── UserInfo.java │ │ └── handler │ │ │ ├── HbasePutBuilder.java │ │ │ └── HbaseFindBuilder.java │ │ ├── BigDataApplication.java │ │ └── utils │ │ ├── Test.java │ │ ├── HumpNameOrMethodUtils.java │ │ └── EntityUtils.java └── build.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── hystrix-dashboard-bootcwenao ├── src │ └── main │ │ ├── resources │ │ └── config │ │ │ ├── bootstrap.yml │ │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── hystrixdashboard │ │ └── HystrixdashboardApplication.java └── build.gradle ├── feign-server-bootcwenao ├── src │ └── main │ │ ├── resources │ │ └── config │ │ │ ├── bootstrap.yml │ │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── feignserver │ │ ├── servers │ │ ├── impl │ │ │ ├── FeignServerImpl.java │ │ │ └── FeignServerFactoryImpl.java │ │ └── FeignServer.java │ │ ├── FeignServerApplication.java │ │ ├── kafka │ │ └── listeners │ │ │ └── KafkaListeners.java │ │ ├── controller │ │ └── FeignController.java │ │ └── config │ │ ├── Swagger2Config.java │ │ ├── KafkaProducersConfig.java │ │ └── KafkaConsumerConfig.java └── build.gradle ├── db-server-bootcwenao ├── src │ └── main │ │ ├── resources │ │ ├── config │ │ │ ├── bootstrap.yml │ │ │ ├── mybatis-spring.xml │ │ │ └── application.yml │ │ ├── web │ │ │ └── userinfo │ │ │ │ └── accountInfo.html │ │ ├── log4j2-spring.xml │ │ └── com │ │ │ └── bootcwenao │ │ │ └── dbserver │ │ │ └── mapper │ │ │ └── AccountInfoMapper.xml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── dbserver │ │ ├── server │ │ ├── AccountInfoServer.java │ │ ├── MsgInfoRepository.java │ │ └── impl │ │ │ └── AccountInfoServerImpl.java │ │ ├── DbServerApplication.java │ │ ├── config │ │ ├── DataConfig.java │ │ ├── RedisConfig.java │ │ └── MybatisConfig.java │ │ ├── handler │ │ └── validator │ │ │ └── AbstractCacheSupport.java │ │ ├── mapper │ │ └── AccountInfoMapper.java │ │ ├── controller │ │ └── UserInfoController.java │ │ └── pojo │ │ ├── MessageInfo.java │ │ └── AccountInfo.java └── build.gradle ├── es-server-bootcwenao ├── src │ └── main │ │ ├── resources │ │ ├── config │ │ │ ├── bootstrap.yml │ │ │ ├── mybatis-spring.xml │ │ │ └── application.yml │ │ ├── web │ │ │ └── accountInfo.html │ │ └── log4j2-spring.xml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── esserver │ │ ├── service │ │ ├── ESAccountInfoService.java │ │ └── impl │ │ │ └── ESAccountInfoServiceImpl.java │ │ ├── ESServerApplication.java │ │ ├── mapper │ │ └── ElasticAccountInfoRepository.java │ │ ├── controller │ │ └── ESController.java │ │ ├── pojo │ │ └── AccountInfo.java │ │ └── config │ │ ├── RedisConfig.java │ │ ├── MybatisConfig.java │ │ └── DataConfig.java └── build.gradle ├── ribbon-server-bootcwenao ├── src │ └── main │ │ ├── resources │ │ ├── config │ │ │ ├── bootstrap.yml │ │ │ └── application.yml │ │ ├── web │ │ │ └── index.html │ │ └── log4j2-spring.xml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── ribbonserver │ │ ├── servers │ │ ├── RibbonBootcwenaoServer.java │ │ └── impl │ │ │ └── RibbonBootcwenaoServerImpl.java │ │ ├── controller │ │ ├── RibbonRealVontroller.java │ │ └── RibbonController.java │ │ └── RibbonServerApplication.java └── build.gradle ├── discovery-bootcwenao ├── src │ └── main │ │ ├── resources │ │ └── config │ │ │ ├── bootstrap.yml │ │ │ └── application.yml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── discovery │ │ └── DiscoveryBootcwenaoApplication.java └── build.gradle ├── .gitignore ├── configserver-bootcwenao ├── src │ └── main │ │ ├── resources │ │ ├── config │ │ │ ├── bootstrap.yml │ │ │ └── application.yml │ │ └── log4j2-spring.xml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── configserver │ │ └── ConfigserverBootcwenaoApplication.java └── build.gradle ├── settings.gradle ├── hadoop-base-bootcwenao ├── src │ └── main │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── hadoopbase │ │ └── HadoopBaseApplication.java └── build.gradle ├── apigateway-bootcwenao ├── src │ └── main │ │ ├── resources │ │ └── config │ │ │ ├── application.yml │ │ │ └── bootstrap.yml │ │ └── java │ │ └── com │ │ └── bootcwenao │ │ └── apigateway │ │ ├── ApiGatewayBootcwenaoApplication.java │ │ └── filter │ │ └── AccessSignFilter.java └── build.gradle ├── LICENSE ├── README.md ├── gradlew.bat └── gradlew /out/production/common-bootcwenao/confing/application.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /common-bootcwenao/src/main/resources/confing/application.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /out/production/bigdata-bootcwenao/config/hbase.properties: -------------------------------------------------------------------------------- 1 | hbase.zk.host=127.0.0.1 2 | hbase.zk.port=2181 -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/resources/config/hbase.properties: -------------------------------------------------------------------------------- 1 | hbase.zk.host=127.0.0.1 2 | hbase.zk.port=2181 -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwenao/springboot_cwenao/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /out/production/hystrix-dashboard-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: hystrix-dashboard 4 | -------------------------------------------------------------------------------- /hystrix-dashboard-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: hystrix-dashboard 4 | -------------------------------------------------------------------------------- /out/production/feign-server-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8084 3 | 4 | spring: 5 | application: 6 | name: feignserver -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8084 3 | 4 | spring: 5 | application: 6 | name: feignserver -------------------------------------------------------------------------------- /out/production/db-server-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: dbserver 4 | logging: 5 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: dbserver 4 | logging: 5 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8586 3 | spring: 4 | application: 5 | name: esserver 6 | logging: 7 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /out/production/es-server-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8586 3 | spring: 4 | application: 5 | name: esserver 6 | logging: 7 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /out/production/ribbon-server-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8083 3 | 4 | spring: 5 | application: 6 | name: ribbonserver 7 | logging: 8 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8083 3 | 4 | spring: 5 | application: 6 | name: ribbonserver 7 | logging: 8 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /out/production/discovery-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: discovery 4 | security: 5 | basic: 6 | enabled: true 7 | user: 8 | name: aa 9 | password: abcd 10 | -------------------------------------------------------------------------------- /discovery-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: discovery 4 | security: 5 | basic: 6 | enabled: true 7 | user: 8 | name: aa 9 | password: abcd 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jan 10 11:28:22 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /out/production/ribbon-server-bootcwenao/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

Test the Thymeleaf

9 | 10 | 11 | -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/resources/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 |

Test the Thymeleaf

9 | 10 | 11 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: bigdataserver 4 | aop: 5 | auto: true 6 | cloud: 7 | stream: 8 | kafka: 9 | binder: 10 | brokers: 127.0.0.1:9092 11 | zk-nodes: 127.0.0.1:2181 12 | logging: 13 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /out/production/bigdata-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: bigdataserver 4 | aop: 5 | auto: true 6 | cloud: 7 | stream: 8 | kafka: 9 | binder: 10 | brokers: 127.0.0.1:9092 11 | zk-nodes: 127.0.0.1:2181 12 | logging: 13 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | !gradle/wrapper/gradle-wrapper.jar 4 | 5 | ### STS ### 6 | .apt_generated 7 | .classpath 8 | .factorypath 9 | .project 10 | .settings 11 | .springBeans 12 | 13 | ### IntelliJ IDEA ### 14 | .idea 15 | *.iws 16 | *.iml 17 | *.ipr 18 | 19 | ### NetBeans ### 20 | nbproject/private/ 21 | build/ 22 | nbbuild/ 23 | dist/ 24 | nbdist/ 25 | .nb-gradle/ -------------------------------------------------------------------------------- /out/production/configserver-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | instance: 3 | hostname: configserver 4 | prefer-ip-address: true 5 | client: 6 | registerWithEureka: true 7 | fetchRegistry: true 8 | service-url: 9 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 10 | 11 | spring: 12 | application: 13 | name: configserver 14 | 15 | logging: 16 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /configserver-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | instance: 3 | hostname: configserver 4 | prefer-ip-address: true 5 | client: 6 | registerWithEureka: true 7 | fetchRegistry: true 8 | service-url: 9 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 10 | 11 | spring: 12 | application: 13 | name: configserver 14 | 15 | logging: 16 | config: classpath:log4j2-spring.xml -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'bootcwenao' 2 | include 'common-bootcwenao' 3 | include 'apigateway-bootcwenao' 4 | include 'discovery-bootcwenao' 5 | include 'configserver-bootcwenao' 6 | include 'hystrix-dashboard-bootcwenao' 7 | include 'ribbon-server-bootcwenao' 8 | include 'feign-server-bootcwenao' 9 | include 'db-server-bootcwenao' 10 | include 'es-server-bootcwenao' 11 | include 'hadoop-base-bootcwenao' 12 | include 'bigdata-bootcwenao' 13 | -------------------------------------------------------------------------------- /hadoop-base-bootcwenao/src/main/java/com/bootcwenao/hadoopbase/HadoopBaseApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.hadoopbase; 6 | 7 | /** 8 | * @author cwenao 9 | * @version $Id HadoopBaseApplication.java, v 0.1 2017-02-23 13:51 cwenao Exp $$ 10 | */ 11 | public class HadoopBaseApplication { 12 | public static void main(String[] args) { 13 | 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/java/com/bootcwenao/ribbonserver/servers/RibbonBootcwenaoServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.ribbonserver.servers; 6 | 7 | /** 8 | * @author cwenao 9 | * @version $Id RibbonBootcwenaoServer.java, v 0.1 2017-01-15 10:41 cwenao Exp $$ 10 | */ 11 | public interface RibbonBootcwenaoServer { 12 | 13 | String testRibbon(String content); 14 | 15 | } -------------------------------------------------------------------------------- /common-bootcwenao/src/main/java/com/bootcwenao/common/CommonBootcwenaoApplication.java: -------------------------------------------------------------------------------- 1 | package com.bootcwenao.common; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class CommonBootcwenaoApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(CommonBootcwenaoApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /out/production/apigateway-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 10002 3 | sidecar: 4 | port: 20001 5 | 6 | endpoints: 7 | restart: 8 | enabled: true 9 | shutdown: 10 | enabled: true 11 | health: 12 | sensitive: false 13 | 14 | eureka: 15 | instance: 16 | hostname: apigateway 17 | client: 18 | registerWithEureka: true 19 | fetchRegistry: true 20 | service-url: 21 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 22 | -------------------------------------------------------------------------------- /apigateway-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 10002 3 | sidecar: 4 | port: 20001 5 | 6 | endpoints: 7 | restart: 8 | enabled: true 9 | shutdown: 10 | enabled: true 11 | health: 12 | sensitive: false 13 | 14 | eureka: 15 | instance: 16 | hostname: apigateway 17 | client: 18 | registerWithEureka: true 19 | fetchRegistry: true 20 | service-url: 21 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 22 | -------------------------------------------------------------------------------- /common-bootcwenao/src/test/java/com/bootcwenao/common/CommonBootcwenaoApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.bootcwenao.common; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class CommonBootcwenaoApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /out/production/hystrix-dashboard-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | info: 2 | component: Hystrix Dashboard 3 | 4 | server: 5 | port: 4500 6 | 7 | endpoints: 8 | restart: 9 | enabled: true 10 | shutdown: 11 | enabled: true 12 | health: 13 | sensitive: false 14 | 15 | eureka: 16 | instance: 17 | hostname: hystrix-dashboard 18 | client: 19 | registerWithEureka: true 20 | fetchRegistry: true 21 | serviceUrl: 22 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 23 | -------------------------------------------------------------------------------- /hystrix-dashboard-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | info: 2 | component: Hystrix Dashboard 3 | 4 | server: 5 | port: 4500 6 | 7 | endpoints: 8 | restart: 9 | enabled: true 10 | shutdown: 11 | enabled: true 12 | health: 13 | sensitive: false 14 | 15 | eureka: 16 | instance: 17 | hostname: hystrix-dashboard 18 | client: 19 | registerWithEureka: true 20 | fetchRegistry: true 21 | serviceUrl: 22 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 23 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/server/AccountInfoServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.server; 6 | 7 | import com.bootcwenao.dbserver.pojo.AccountInfo; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id AccountInfoServer.java, v 0.1 2017-01-25 17:44 cwenao Exp $$ 14 | */ 15 | public interface AccountInfoServer { 16 | List selectByName(String accountName); 17 | } -------------------------------------------------------------------------------- /out/production/db-server-bootcwenao/web/userinfo/accountInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
aabbcc123dds
16 | 17 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/resources/web/userinfo/accountInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
aabbcc123dds
16 | 17 | -------------------------------------------------------------------------------- /out/production/es-server-bootcwenao/web/accountInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
aabbcc123dds
16 | 17 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/resources/web/accountInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Title 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
aabbcc123dds
16 | 17 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/service/ESAccountInfoService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver.service; 6 | 7 | import com.bootcwenao.esserver.pojo.AccountInfo; 8 | 9 | /** 10 | * @author cwenao 11 | * @version $Id ESAccountInfoService.java, v 0.1 2017-02-06 10:36 cwenao Exp $$ 12 | */ 13 | public interface ESAccountInfoService { 14 | 15 | AccountInfo queryAccountInfoById(String id); 16 | 17 | AccountInfo queryAccountInfoByName(String accountName); 18 | } -------------------------------------------------------------------------------- /out/production/bigdata-bootcwenao/web/hbase/hbasetest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hbase Test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
aabbcc
123dds
123dds
20 | 21 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/resources/web/hbase/hbasetest.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hbase Test 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
aabbcc
123dds
123dds
20 | 21 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/server/MsgInfoRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.server; 6 | 7 | import com.bootcwenao.dbserver.pojo.MessageInfo; 8 | import org.springframework.data.mongodb.repository.MongoRepository; 9 | 10 | /** 11 | * @author cwenao 12 | * @version $Id MsgInfoRepository.java, v 0.1 2017-01-30 12:33 cwenao Exp $$ 13 | */ 14 | public interface MsgInfoRepository extends MongoRepository { 15 | 16 | MessageInfo queryMsgInfoByTitle(String title); 17 | } -------------------------------------------------------------------------------- /out/production/discovery-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8761 3 | eureka: 4 | instance: 5 | hostname: discovery 6 | client: 7 | registerWithEureka: false 8 | fetchRegistry: false 9 | service-url: 10 | defaultZone: http://discovery:${server.port}/eureka/ 11 | 12 | #spring 13 | spring: 14 | cloud: 15 | config: 16 | discovery: 17 | enabled: true 18 | redis: 19 | host: 127.0.0.1 20 | port: 6379 21 | password: 111222333444555666 22 | timeout: 5000 23 | pool: 24 | max-idle: 8 25 | min-idle: 0 26 | max-active: 8 27 | max-wait: -1 -------------------------------------------------------------------------------- /discovery-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8761 3 | eureka: 4 | instance: 5 | hostname: discovery 6 | client: 7 | registerWithEureka: false 8 | fetchRegistry: false 9 | service-url: 10 | defaultZone: http://discovery:${server.port}/eureka/ 11 | 12 | #spring 13 | spring: 14 | cloud: 15 | config: 16 | discovery: 17 | enabled: true 18 | redis: 19 | host: 127.0.0.1 20 | port: 6379 21 | password: 111222333444555666 22 | timeout: 5000 23 | pool: 24 | max-idle: 8 25 | min-idle: 0 26 | max-active: 8 27 | max-wait: -1 -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/resources/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/resources/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /out/production/db-server-bootcwenao/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /out/production/es-server-bootcwenao/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /configserver-bootcwenao/src/main/resources/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /out/production/configserver-bootcwenao/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /out/production/ribbon-server-bootcwenao/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/resources/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/hbase/service/HbaseAccountInfoService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.hbase.service; 6 | 7 | import com.bootcwenao.bigdataserver.hbase.domain.pojo.UserInfo; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id HbaseAccountInfoService.java, v 0.1 2017-02-17 11:52 cwenao Exp $$ 14 | */ 15 | public interface HbaseAccountInfoService { 16 | 17 | UserInfo findUserInfoByEntity(String table, String family, String rowKey, UserInfo userInfo); 18 | 19 | List findAll(String tablename,String family); 20 | 21 | } -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/hbase/mapper/HbaseAccountInfoMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.hbase.mapper; 6 | 7 | import com.bootcwenao.bigdataserver.hbase.domain.pojo.UserInfo; 8 | 9 | import java.util.List; 10 | 11 | 12 | /** 13 | * @author cwenao 14 | * @version $Id HbaseAccountInfoMapper.java, v 0.1 2017-02-16 17:37 cwenao Exp $$ 15 | */ 16 | public interface HbaseAccountInfoMapper { 17 | 18 | UserInfo findUserInfoByEntity(String table, String family, String rowKey, UserInfo userInfo); 19 | 20 | List findAll(String tablename, String family); 21 | 22 | } 23 | 24 | -------------------------------------------------------------------------------- /out/production/ribbon-server-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | thymeleaf: 3 | cache: false 4 | mode: LEGACYHTML5 5 | prefix: classpath:/web/ 6 | suffix: .html 7 | content-type: text/html 8 | mvc: 9 | view: 10 | prefix: /jsp 11 | suffix: .jsp 12 | eureka: 13 | instance: 14 | prefer-ip-address: true 15 | hostname: ribbonserver 16 | client: 17 | registerWithEureka: true 18 | fetchRegistry: true 19 | service-url: 20 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 21 | endpoints: 22 | restart: 23 | enabled: true 24 | shutdown: 25 | enabled: true 26 | health: 27 | sensitive: false 28 | 29 | ribbon: 30 | eureka: 31 | enabled: true -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | thymeleaf: 3 | cache: false 4 | mode: LEGACYHTML5 5 | prefix: classpath:/web/ 6 | suffix: .html 7 | content-type: text/html 8 | mvc: 9 | view: 10 | prefix: /jsp 11 | suffix: .jsp 12 | eureka: 13 | instance: 14 | prefer-ip-address: true 15 | hostname: ribbonserver 16 | client: 17 | registerWithEureka: true 18 | fetchRegistry: true 19 | service-url: 20 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 21 | endpoints: 22 | restart: 23 | enabled: true 24 | shutdown: 25 | enabled: true 26 | health: 27 | sensitive: false 28 | 29 | ribbon: 30 | eureka: 31 | enabled: true -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/java/com/bootcwenao/ribbonserver/servers/impl/RibbonBootcwenaoServerImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.ribbonserver.servers.impl; 6 | 7 | import com.bootcwenao.ribbonserver.servers.RibbonBootcwenaoServer; 8 | import org.springframework.stereotype.Service; 9 | 10 | /** 11 | * @author cwenao 12 | * @version $Id RibbonBootcwenaoServerImpl.java, v 0.1 2017-01-15 10:42 cwenao Exp $$ 13 | */ 14 | 15 | @Service("ribbonBootcwenaoServerImpl") 16 | public class RibbonBootcwenaoServerImpl implements RibbonBootcwenaoServer{ 17 | public String testRibbon(String content) { 18 | return content + " for Spring Boot"; 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/java/com/bootcwenao/feignserver/servers/impl/FeignServerImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.feignserver.servers.impl; 6 | 7 | import com.bootcwenao.feignserver.servers.FeignServer; 8 | import org.springframework.stereotype.Component; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id FeignServerImpl.java, v 0.1 2017-01-17 9:24 cwenao Exp $$ 14 | */ 15 | @Component 16 | public class FeignServerImpl implements FeignServer { 17 | 18 | public String testRealRibbon(@RequestParam("content") String content) { 19 | return content + ", it's fallback with feign"; 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/ESServerApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver; 6 | 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id EsServerApplication.java, v 0.1 2017-02-04 16:29 cwenao Exp $$ 14 | */ 15 | @SpringBootApplication 16 | @EnableDiscoveryClient 17 | public class ESServerApplication { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(ESServerApplication.class, args); 21 | } 22 | 23 | } 24 | 25 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/DbServerApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver; 6 | 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.boot.builder.SpringApplicationBuilder; 9 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id DbServerApplication.java, v 0.1 2017-01-22 16:12 cwenao Exp $$ 14 | */ 15 | @SpringBootApplication 16 | @EnableDiscoveryClient 17 | public class DbServerApplication { 18 | public static void main(String[] args) { 19 | new SpringApplicationBuilder(DbServerApplication.class).web(true).run(args); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/mapper/ElasticAccountInfoRepository.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver.mapper; 6 | 7 | import com.bootcwenao.esserver.pojo.AccountInfo; 8 | 9 | import org.springframework.data.elasticsearch.repository.ElasticsearchRepository; 10 | import org.springframework.stereotype.Component; 11 | 12 | /** 13 | * @author cwenao 14 | * @version $Id ElasticAccountInfoRepository.java, v 0.1 2017-02-06 10:26 cwenao Exp $$ 15 | */ 16 | @Component("elasticAccountInfoRepository") 17 | public interface ElasticAccountInfoRepository extends ElasticsearchRepository { 18 | //TODO define the search 19 | AccountInfo findByAccountName(String accountName); 20 | } 21 | -------------------------------------------------------------------------------- /out/production/bigdata-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8686 3 | eureka: 4 | instance: 5 | hostname: bigdataserver 6 | prefer-ip-address: true 7 | client: 8 | registerWithEureka: true 9 | fetchRegistry: true 10 | service-url: 11 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 12 | 13 | spring: 14 | thymeleaf: 15 | cache: false 16 | mode: LEGACYHTML5 17 | prefix: classpath:/web/ 18 | suffix: .html 19 | content-type: text/html 20 | redis: 21 | host: 127.0.0.1 22 | port: 6379 23 | password: xxxxxxx 24 | timeout: 5000 25 | pool: 26 | max-idle: 8 27 | min-idle: 0 28 | max-active: 8 29 | max-wait: -1 30 | data: 31 | mongodb: 32 | uri: mongodb://username:password@127.0.0.1:27017/kakme -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8686 3 | eureka: 4 | instance: 5 | hostname: bigdataserver 6 | prefer-ip-address: true 7 | client: 8 | registerWithEureka: true 9 | fetchRegistry: true 10 | service-url: 11 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 12 | 13 | spring: 14 | thymeleaf: 15 | cache: false 16 | mode: LEGACYHTML5 17 | prefix: classpath:/web/ 18 | suffix: .html 19 | content-type: text/html 20 | redis: 21 | host: 127.0.0.1 22 | port: 6379 23 | password: xxxxxxx 24 | timeout: 5000 25 | pool: 26 | max-idle: 8 27 | min-idle: 0 28 | max-active: 8 29 | max-wait: -1 30 | data: 31 | mongodb: 32 | uri: mongodb://username:password@127.0.0.1:27017/kakme -------------------------------------------------------------------------------- /out/production/configserver-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8881 3 | 4 | endpoints: 5 | restart: 6 | enabled: true 7 | shutdown: 8 | enabled: true 9 | health: 10 | sensitive: false 11 | encrypt: 12 | cwenao 13 | spring: 14 | cloud: 15 | config: 16 | server: 17 | git: 18 | uri: https://github.com/cwenao/kakmeconfig/ 19 | search-paths: config 20 | default-label: master 21 | stream: 22 | kafka: 23 | binder: 24 | brokers: 127.0.0.1:9092 25 | zk-nodes: 127.0.0.1:2181 26 | redis: 27 | host: 127.0.0.1 28 | port: 6379 29 | password: 111222333444555666 30 | timeout: 5000 31 | pool: 32 | max-idle: 8 33 | min-idle: 0 34 | max-active: 8 35 | max-wait: -1 -------------------------------------------------------------------------------- /configserver-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8881 3 | 4 | endpoints: 5 | restart: 6 | enabled: true 7 | shutdown: 8 | enabled: true 9 | health: 10 | sensitive: false 11 | encrypt: 12 | cwenao 13 | spring: 14 | cloud: 15 | config: 16 | server: 17 | git: 18 | uri: https://github.com/cwenao/kakmeconfig/ 19 | search-paths: config 20 | default-label: master 21 | stream: 22 | kafka: 23 | binder: 24 | brokers: 127.0.0.1:9092 25 | zk-nodes: 127.0.0.1:2181 26 | redis: 27 | host: 127.0.0.1 28 | port: 6379 29 | password: 111222333444555666 30 | timeout: 5000 31 | pool: 32 | max-idle: 8 33 | min-idle: 0 34 | max-active: 8 35 | max-wait: -1 -------------------------------------------------------------------------------- /out/production/bigdata-bootcwenao/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/resources/log4j2-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{yyyy-MM-dd HH:mm:ss.SSS} |-%-5level [%thread] %c [%L] -| %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /discovery-bootcwenao/src/main/java/com/bootcwenao/discovery/DiscoveryBootcwenaoApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.discovery; 6 | 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.boot.builder.SpringApplicationBuilder; 9 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id DiscoveryBootcwenaoApplication.java, v 0.1 2017-01-12 9:56 cwenao Exp $$ 14 | */ 15 | @EnableEurekaServer 16 | @SpringBootApplication 17 | public class DiscoveryBootcwenaoApplication { 18 | 19 | public static void main(String[] args) { 20 | new SpringApplicationBuilder(DiscoveryBootcwenaoApplication.class).web(true).run(args); 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /apigateway-bootcwenao/src/main/java/com/bootcwenao/apigateway/ApiGatewayBootcwenaoApplication.java: -------------------------------------------------------------------------------- 1 | package com.bootcwenao.apigateway; 2 | 3 | import com.bootcwenao.apigateway.filter.AccessSignFilter; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.cloud.client.SpringCloudApplication; 6 | import org.springframework.cloud.netflix.sidecar.EnableSidecar; 7 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy; 8 | import org.springframework.context.annotation.Bean; 9 | 10 | @SpringCloudApplication 11 | @EnableZuulProxy 12 | @EnableSidecar 13 | public class ApiGatewayBootcwenaoApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(ApiGatewayBootcwenaoApplication.class, args); 17 | } 18 | 19 | @Bean 20 | public AccessSignFilter accessSignFilter(){ 21 | return new AccessSignFilter(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /hadoop-base-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement { 4 | imports { 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:" + springCloudVersion 6 | mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion 7 | } 8 | } 9 | repositories { 10 | mavenCentral() 11 | } 12 | 13 | dependencies { 14 | compile ('org.springframework.data:spring-data-hadoop:'+ springDataHadoopVersion) 15 | compile ('org.apache.hadoop:hadoop-common:'+hadoopVersion) 16 | } 17 | 18 | configurations { 19 | all*.exclude module: 'spring-boot-starter-logging' 20 | all*.exclude module: 'logback-classic' 21 | all*.exclude module: 'log4j-over-slf4j' 22 | all*.exclude module: 'slf4j-log4j12' 23 | all*.exclude module: 'snappy-java' 24 | } 25 | 26 | jar { 27 | baseName = 'hadoop-base-bootcwenao' 28 | } -------------------------------------------------------------------------------- /discovery-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement { 4 | imports { 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:"+ springCloudVersion 6 | //mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion 7 | } 8 | } 9 | 10 | sourceCompatibility = 1.8 11 | 12 | repositories { 13 | mavenCentral() 14 | } 15 | 16 | dependencies { 17 | 18 | compile ('org.springframework.cloud:spring-cloud-starter-eureka-server') 19 | compile ('org.springframework.cloud:spring-cloud-config-server') 20 | compile ('org.springframework.boot:spring-boot-starter-web:'+springBootVersion) 21 | compile ('org.springframework.boot:spring-boot-starter-redis:'+springBootVersion) 22 | compile ('org.springframework.boot:spring-boot-starter-security:'+springBootVersion) 23 | 24 | } 25 | 26 | jar { 27 | baseName = 'discovery-bootcwenao' 28 | } -------------------------------------------------------------------------------- /out/production/feign-server-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | thymeleaf: 3 | cache: false 4 | mode: LEGACYHTML5 5 | prefix: classpath:/web/ 6 | suffix: .html 7 | content-type: text/html 8 | mvc: 9 | view: 10 | prefix: /jsp 11 | suffix: .jsp 12 | eureka: 13 | instance: 14 | prefer-ip-address: true 15 | hostname: feignserver 16 | client: 17 | registerWithEureka: true 18 | fetchRegistry: true 19 | service-url: 20 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 21 | endpoints: 22 | restart: 23 | enabled: true 24 | shutdown: 25 | enabled: true 26 | health: 27 | sensitive: false 28 | ribbon: 29 | eureka: 30 | enabled: true 31 | feign: 32 | httpclient: 33 | enabled: true 34 | hystrix: 35 | enabled: true 36 | bootcwenao: 37 | kafka: 38 | binder: 39 | brokers: 127.0.0.1:9092 40 | zk-nodes: 127.0.0.1:2181 41 | group: cwenao-group -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | thymeleaf: 3 | cache: false 4 | mode: LEGACYHTML5 5 | prefix: classpath:/web/ 6 | suffix: .html 7 | content-type: text/html 8 | mvc: 9 | view: 10 | prefix: /jsp 11 | suffix: .jsp 12 | eureka: 13 | instance: 14 | prefer-ip-address: true 15 | hostname: feignserver 16 | client: 17 | registerWithEureka: true 18 | fetchRegistry: true 19 | service-url: 20 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 21 | endpoints: 22 | restart: 23 | enabled: true 24 | shutdown: 25 | enabled: true 26 | health: 27 | sensitive: false 28 | ribbon: 29 | eureka: 30 | enabled: true 31 | feign: 32 | httpclient: 33 | enabled: true 34 | hystrix: 35 | enabled: true 36 | bootcwenao: 37 | kafka: 38 | binder: 39 | brokers: 127.0.0.1:9092 40 | zk-nodes: 127.0.0.1:2181 41 | group: cwenao-group -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/java/com/bootcwenao/feignserver/FeignServerApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.feignserver; 6 | 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.boot.builder.SpringApplicationBuilder; 9 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 10 | import org.springframework.cloud.netflix.feign.EnableFeignClients; 11 | 12 | /** 13 | * @author cwenao 14 | * @version $Id FeignServerApplication.java, v 0.1 2017-01-15 13:32 cwenao Exp $$ 15 | */ 16 | @SpringBootApplication(scanBasePackages={"com.bootcwenao.feignserver"}) 17 | @EnableDiscoveryClient 18 | @EnableFeignClients 19 | public class FeignServerApplication { 20 | public static void main(String[] args) { 21 | new SpringApplicationBuilder(FeignServerApplication.class).web(true).run(args); 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/java/com/bootcwenao/feignserver/kafka/listeners/KafkaListeners.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.feignserver.kafka.listeners; 6 | 7 | import org.apache.kafka.clients.consumer.ConsumerRecord; 8 | import org.springframework.kafka.annotation.KafkaListener; 9 | 10 | import java.util.Optional; 11 | 12 | /** 13 | * @author cwenao 14 | * @version $Id KafkaListeners.java, v 0.1 2017-01-21 21:31 cwenao Exp $$ 15 | */ 16 | public class KafkaListeners { 17 | 18 | @KafkaListener(topics = {"bootcwenaoTopic"}) 19 | public void testListener(ConsumerRecord record) { 20 | 21 | Optional messages = Optional.ofNullable(record.value()); 22 | 23 | if (messages.isPresent()) { 24 | Object msg = messages.get(); 25 | System.out.println(" this is the testTopic send message: " + msg); 26 | } 27 | 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/java/com/bootcwenao/feignserver/servers/FeignServer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.feignserver.servers; 6 | 7 | import com.bootcwenao.feignserver.servers.impl.FeignServerFactoryImpl; 8 | import com.bootcwenao.feignserver.servers.impl.FeignServerImpl; 9 | import org.springframework.cloud.netflix.feign.FeignClient; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | 14 | /** 15 | * @author cwenao 16 | * @version $Id FeignServer.java, v 0.1 2017-01-15 13:51 cwenao Exp $$ 17 | */ 18 | @FeignClient(value = "ribbonserver" , fallbackFactory = FeignServerFactoryImpl.class ) 19 | public interface FeignServer { 20 | 21 | @RequestMapping(value ="/testRealRibbon",method= RequestMethod.GET) 22 | String testRealRibbon(@RequestParam("content") String content); 23 | 24 | } -------------------------------------------------------------------------------- /common-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | 2 | dependencies { 3 | compile('org.springframework.boot:spring-boot-starter-log4j2:'+springBootVersion) 4 | 5 | 6 | compile('org.mybatis.spring.boot:mybatis-spring-boot-starter:'+mybatisSpringBootVersion) 7 | compile('com.alibaba:druid:'+ druidVersion) 8 | compile('org.mybatis:mybatis:'+ mybatisVersion) 9 | 10 | //apache 11 | compile('org.apache.commons:commons-lang3:'+commonsLang3Version) 12 | 13 | 14 | runtime('mysql:mysql-connector-java:' + mysqlVersion) 15 | 16 | testCompile('org.springframework.boot:spring-boot-starter-test:'+springBootVersion) 17 | testCompile group: 'junit', name: 'junit', version: '4.11' 18 | } 19 | 20 | configurations { 21 | all*.exclude module: 'spring-boot-starter-logging' 22 | } 23 | 24 | sourceSets { 25 | main { 26 | resources.srcDirs = ['src/main/resources', 'src/main/java'] 27 | resources.includes = ['**/*.xml', '**/*.yml'] 28 | } 29 | } 30 | jar { 31 | baseName = 'common-bootcwenao' 32 | } 33 | 34 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/server/impl/AccountInfoServerImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.server.impl; 6 | 7 | import com.bootcwenao.dbserver.mapper.AccountInfoMapper; 8 | import com.bootcwenao.dbserver.pojo.AccountInfo; 9 | import com.bootcwenao.dbserver.server.AccountInfoServer; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @author cwenao 17 | * @version $Id AccountInfoServerImpl.java, v 0.1 2017-01-25 18:31 cwenao Exp $$ 18 | */ 19 | @Service("accountInfoServerImpl") 20 | public class AccountInfoServerImpl implements AccountInfoServer{ 21 | 22 | @Autowired 23 | AccountInfoMapper accountInfoMapper; 24 | 25 | @Override 26 | public List selectByName(String accountName) { 27 | return accountInfoMapper.selectByName(accountName); 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /configserver-bootcwenao/src/main/java/com/bootcwenao/configserver/ConfigserverBootcwenaoApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.configserver; 6 | 7 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | import org.springframework.boot.builder.SpringApplicationBuilder; 10 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 11 | import org.springframework.cloud.config.server.EnableConfigServer; 12 | 13 | /** 14 | * @author cwenao 15 | * @version $Id ConfigserverBootcwenaoApplication.java, v 0.1 2017-01-12 14:21 cwenao Exp $$ 16 | */ 17 | @EnableDiscoveryClient 18 | @SpringBootApplication 19 | @EnableAutoConfiguration 20 | @EnableConfigServer 21 | public class ConfigserverBootcwenaoApplication { 22 | public static void main(String[] args) { 23 | new SpringApplicationBuilder(ConfigserverBootcwenaoApplication.class).web(true).run(args); 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /hystrix-dashboard-bootcwenao/src/main/java/com/bootcwenao/hystrixdashboard/HystrixdashboardApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.hystrixdashboard; 6 | 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.boot.builder.SpringApplicationBuilder; 9 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | 13 | /** 14 | * @author cwenao 15 | * @version $Id HystrixdashboardApplication.java, v 0.1 2017-01-13 13:32 cwenao Exp $$ 16 | */ 17 | @SpringBootApplication 18 | @EnableEurekaClient 19 | @Controller 20 | public class HystrixdashboardApplication { 21 | @RequestMapping("/") 22 | public String hystrixDashboard() { 23 | return "forward:/hystrix"; 24 | } 25 | 26 | public static void main(String[] args) { 27 | new SpringApplicationBuilder(HystrixdashboardApplication.class).web(true).run(args); 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/BigDataApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver; 6 | 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 9 | import org.springframework.boot.autoconfigure.SpringBootApplication; 10 | import org.springframework.cloud.client.SpringCloudApplication; 11 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 12 | import org.springframework.context.annotation.ImportResource; 13 | 14 | /** 15 | * @author cwenao 16 | * @version $Id BigDataApplication.java, v 0.1 2017-02-21 22:38 cwenao Exp $$ 17 | */ 18 | @SpringBootApplication 19 | @EnableDiscoveryClient 20 | @ImportResource(locations = {"classpath:/config/hbase-spring.xml"}) 21 | public class BigDataApplication { 22 | public static void main(String[] args) { 23 | System.setProperty("hadoop.home.dir", "D:\\\\dev_evn\\\\hadoop-2.7.3"); 24 | SpringApplication.run(BigDataApplication.class, args); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 cwenao 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/java/com/bootcwenao/ribbonserver/controller/RibbonRealVontroller.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.ribbonserver.controller; 6 | 7 | import com.bootcwenao.ribbonserver.servers.RibbonBootcwenaoServer; 8 | import com.fasterxml.jackson.databind.util.JSONPObject; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RestController; 13 | 14 | /** 15 | * @author cwenao 16 | * @version $Id RibbonRealVontroller.java, v 0.1 2017-01-15 11:33 cwenao Exp $$ 17 | */ 18 | @RestController 19 | public class RibbonRealVontroller { 20 | @Autowired 21 | private RibbonBootcwenaoServer ribbonBootcwenaoServerImpl; 22 | 23 | @RequestMapping("/testRealRibbon") 24 | public String testRealRibbon(String content) { 25 | String resultStr = ribbonBootcwenaoServerImpl.testRibbon(content); 26 | System.out.println(resultStr); 27 | return resultStr; 28 | } 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/java/com/bootcwenao/feignserver/servers/impl/FeignServerFactoryImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.feignserver.servers.impl; 6 | 7 | import com.bootcwenao.feignserver.servers.FeignServer; 8 | import feign.hystrix.FallbackFactory; 9 | import org.springframework.stereotype.Component; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id FeignServerFactoryImpl.java, v 0.1 2017-01-17 10:40 cwenao Exp $$ 14 | */ 15 | @Component 16 | public class FeignServerFactoryImpl implements FallbackFactory { 17 | /** 18 | * Returns an instance of the fallback appropriate for the given cause 19 | * 20 | * @param cause corresponds to {@link AbstractCommand#getFailedExecutionException()} 21 | * often, but not always an instance of {@link FeignException}. 22 | */ 23 | public FeignServer create(Throwable cause) { 24 | 25 | return new FeignServer() { 26 | public String testRealRibbon(String content) { 27 | return content + ", it's fallback Factory with feign"; 28 | } 29 | }; 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/service/impl/ESAccountInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver.service.impl; 6 | 7 | 8 | import com.bootcwenao.esserver.mapper.ElasticAccountInfoRepository; 9 | import com.bootcwenao.esserver.pojo.AccountInfo; 10 | import com.bootcwenao.esserver.service.ESAccountInfoService; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.stereotype.Service; 13 | 14 | /** 15 | * @author cwenao 16 | * @version $Id ESAccountInfoServiceImpl.java, v 0.1 2017-02-06 10:38 cwenao Exp $$ 17 | */ 18 | @Service("esAccountInfoServiceImpl") 19 | public class ESAccountInfoServiceImpl implements ESAccountInfoService { 20 | 21 | @Autowired 22 | private ElasticAccountInfoRepository elasticAccountInfoRepository; 23 | 24 | public AccountInfo queryAccountInfoById(String id) { 25 | return elasticAccountInfoRepository.findOne(id); 26 | } 27 | 28 | @Override 29 | public AccountInfo queryAccountInfoByName(String accountName) { 30 | return elasticAccountInfoRepository.findByAccountName(accountName); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /out/production/apigateway-bootcwenao/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 10002 3 | sidecar: 4 | port: 20001 5 | 6 | #configServer 7 | spring: 8 | application: 9 | name: apigateway 10 | profiles: 11 | active: dev 12 | cloud: 13 | config: 14 | #uri: http://localhost:8888/ 15 | discovery: 16 | enabled: true 17 | serviceId: CONFIGSERVER 18 | stream: 19 | kafka: 20 | binder: 21 | brokers: 127.0.0.1:9092 22 | zk-nodes: 127.0.0.1:2181 23 | zuul: 24 | routes: 25 | servers: 26 | path: /servers/** 27 | serviceId: FEIGNSERVER 28 | dbserver: 29 | path: /dbserver/** 30 | serviceId: DBSERVER 31 | esserver: 32 | path: /esserver/** 33 | serviceId: ESSERVER 34 | configserver: 35 | path: /configserver/** 36 | serviceId: CONFIGSERVER 37 | bigdataserver: 38 | path: /bigdataserver/** 39 | serviceId: BIGDATASERVER 40 | max: 41 | host: 42 | connections: 200 43 | host: 44 | socket-timeout-millis: 60000 45 | connect-timeout-millis: 60000 46 | hystrix: 47 | command: 48 | default: 49 | execution: 50 | isolation: 51 | thread: 52 | timeoutInMilliseconds: 10000 -------------------------------------------------------------------------------- /apigateway-bootcwenao/src/main/resources/config/bootstrap.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 10002 3 | sidecar: 4 | port: 20001 5 | 6 | #configServer 7 | spring: 8 | application: 9 | name: apigateway 10 | profiles: 11 | active: dev 12 | cloud: 13 | config: 14 | #uri: http://localhost:8888/ 15 | discovery: 16 | enabled: true 17 | serviceId: CONFIGSERVER 18 | stream: 19 | kafka: 20 | binder: 21 | brokers: 127.0.0.1:9092 22 | zk-nodes: 127.0.0.1:2181 23 | zuul: 24 | routes: 25 | servers: 26 | path: /servers/** 27 | serviceId: FEIGNSERVER 28 | dbserver: 29 | path: /dbserver/** 30 | serviceId: DBSERVER 31 | esserver: 32 | path: /esserver/** 33 | serviceId: ESSERVER 34 | configserver: 35 | path: /configserver/** 36 | serviceId: CONFIGSERVER 37 | bigdataserver: 38 | path: /bigdataserver/** 39 | serviceId: BIGDATASERVER 40 | max: 41 | host: 42 | connections: 200 43 | host: 44 | socket-timeout-millis: 60000 45 | connect-timeout-millis: 60000 46 | hystrix: 47 | command: 48 | default: 49 | execution: 50 | isolation: 51 | thread: 52 | timeoutInMilliseconds: 10000 -------------------------------------------------------------------------------- /out/production/bigdata-bootcwenao/config/hbase-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | fs.defaultFS=hdfs://127.0.0.1:9000 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/hbase/service/impl/HbaseAccountInfoServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.hbase.service.impl; 6 | 7 | import com.bootcwenao.bigdataserver.hbase.domain.pojo.UserInfo; 8 | import com.bootcwenao.bigdataserver.hbase.mapper.HbaseAccountInfoMapper; 9 | import com.bootcwenao.bigdataserver.hbase.service.HbaseAccountInfoService; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @author cwenao 17 | * @version $Id HbaseAccountInfoServiceImpl.java, v 0.1 2017-02-21 21:09 cwenao Exp $$ 18 | */ 19 | @Service("hbaseAccountInfoServiceImpl") 20 | public class HbaseAccountInfoServiceImpl implements HbaseAccountInfoService { 21 | 22 | @Autowired 23 | HbaseAccountInfoMapper hbaseAccountInfoMapper; 24 | @Override 25 | public UserInfo findUserInfoByEntity(String table, String family, String rowKey, UserInfo userInfo) { 26 | return hbaseAccountInfoMapper.findUserInfoByEntity(table,family,rowKey,userInfo); 27 | } 28 | 29 | @Override 30 | public List findAll(String tablename,String family) { 31 | return hbaseAccountInfoMapper.findAll(tablename,family); 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/resources/config/hbase-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | fs.defaultFS=hdfs://127.0.0.1:9000 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/config/DataConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.config; 6 | 7 | import com.alibaba.druid.pool.DruidDataSource; 8 | import org.springframework.boot.context.properties.ConfigurationProperties; 9 | import org.springframework.context.annotation.Bean; 10 | import org.springframework.context.annotation.Configuration; 11 | import org.springframework.context.support.ResourceBundleMessageSource; 12 | import org.springframework.transaction.annotation.EnableTransactionManagement; 13 | 14 | import javax.sql.DataSource; 15 | 16 | /** 17 | * @author cwenao 18 | * @version $Id DataConfig.java, v 0.1 2017-01-24 17:43 cwenao Exp $$ 19 | */ 20 | 21 | @Configuration 22 | @EnableTransactionManagement 23 | public class DataConfig { 24 | 25 | @Bean(name="dataSource") 26 | @ConfigurationProperties(prefix = "druid.datasource") 27 | public DataSource dataSource() { 28 | return new DruidDataSource(); 29 | } 30 | @Bean 31 | public ResourceBundleMessageSource messageSource() { 32 | ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); 33 | messageSource.setBasename("config.message"); 34 | messageSource.setDefaultEncoding("UTF-8"); 35 | return messageSource; 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/java/com/bootcwenao/ribbonserver/controller/RibbonController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.ribbonserver.controller; 6 | 7 | import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.ModelMap; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.client.RestTemplate; 13 | 14 | /** 15 | * @author cwenao 16 | * @version $Id RibbonController.java, v 0.1 2017-01-15 10:46 cwenao Exp $$ 17 | */ 18 | @Controller 19 | public class RibbonController { 20 | 21 | @Autowired 22 | RestTemplate restTemplate; 23 | 24 | private final static String serverURI = "http://ribbonserver/"; 25 | @RequestMapping("/test") 26 | @HystrixCommand(fallbackMethod = "testError") 27 | public String testRibbon(String content, ModelMap modelMap) { 28 | 29 | System.out.println(content); 30 | String resultStr = restTemplate.getForEntity(serverURI+"testRealRibbon?content="+content,String.class).getBody(); 31 | 32 | modelMap.addAttribute("result",resultStr); 33 | 34 | return "index"; 35 | } 36 | 37 | public String testError() { 38 | return "404"; 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/handler/validator/AbstractCacheSupport.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.handler.validator; 6 | 7 | import org.springframework.cache.Cache; 8 | 9 | /** 10 | * @author cwenao 11 | * @version $Id AbstractCacheSupport.java, v 0.1 2017-01-29 15:35 cwenao Exp $$ 12 | */ 13 | public abstract class AbstractCacheSupport { 14 | 15 | /** 16 | * 获取缓存内容 17 | * @param cache 18 | * @param key 19 | * @return 20 | */ 21 | protected Object getFromCache(Cache cache, String key) { 22 | final Cache.ValueWrapper valueWrapper = cache.get(key); 23 | return null == valueWrapper ? null : valueWrapper.get(); 24 | } 25 | 26 | /** 27 | * 设置缓存数据 28 | * @param cache 29 | * @param key 30 | * @param value 31 | * @return 32 | */ 33 | protected boolean putCache(Cache cache, String key, Object value) { 34 | if (null == value) { 35 | return false; 36 | } 37 | cache.put(key, value); 38 | 39 | return true; 40 | } 41 | 42 | /** 43 | * 删除缓存数据 44 | * @param cache 45 | * @param key 46 | * @return 47 | */ 48 | protected boolean evictFromCache(Cache cache,Object key){ 49 | if(null == key){ 50 | return false; 51 | } 52 | cache.evict(key); 53 | 54 | return true; 55 | } 56 | } 57 | 58 | -------------------------------------------------------------------------------- /hystrix-dashboard-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement{ 4 | imports{ 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:"+ springCloudVersion 6 | } 7 | } 8 | 9 | repositories { 10 | mavenCentral() 11 | } 12 | 13 | dependencies { 14 | 15 | compile('org.springframework.cloud:spring-cloud-starter-hystrix-dashboard') 16 | compile('org.springframework.cloud:spring-cloud-starter-eureka') 17 | 18 | compile('org.springframework.cloud:spring-cloud-config-server') 19 | compile('org.springframework.boot:spring-boot-starter-actuator') 20 | 21 | compile('org.springframework.boot:spring-boot-starter-log4j2') 22 | compile('org.apache.logging.log4j:log4j-1.2-api:'+ log4jAPIVersion) 23 | compile('org.xerial.snappy:snappy-java:' + snappyVersion) 24 | 25 | testCompile('org.springframework.cloud:spring-cloud-starter-hystrix') 26 | testCompile('org.springframework.boot:spring-boot-starter-test') 27 | 28 | testCompile group: 'junit', name: 'junit', version: '4.11' 29 | } 30 | 31 | configurations { 32 | all*.exclude module: 'spring-boot-starter-logging' 33 | all*.exclude module: 'logback-classic' 34 | all*.exclude module: 'log4j-over-slf4j' 35 | all*.exclude module: 'snappy-java' 36 | } 37 | 38 | sourceSets { 39 | main { 40 | resources.srcDirs = ['src/main/resources', 'src/main/java'] 41 | resources.includes = ['**/*.xml', '**/*.yml'] 42 | } 43 | } 44 | 45 | jar { 46 | baseName = 'hystrixdashboard-bootcwenao' 47 | } -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/hbase/controller/HbaseAccountController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.hbase.controller; 6 | 7 | import com.bootcwenao.bigdataserver.hbase.domain.pojo.UserInfo; 8 | import com.bootcwenao.bigdataserver.hbase.service.HbaseAccountInfoService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.ModelMap; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author cwenao 18 | * @version $Id HbaseAccountController.java, v 0.1 2017-02-21 22:20 cwenao Exp $$ 19 | */ 20 | @Controller 21 | public class HbaseAccountController { 22 | 23 | private final static String TABLE_NAME = "user"; 24 | 25 | private final static String FAMILY_INFO = "info"; 26 | 27 | @Autowired 28 | private HbaseAccountInfoService hbaseAccountInfoServiceImpl; 29 | @RequestMapping(value = "/bigdata/find") 30 | public String findUserInfoByName(String name, ModelMap modelMap) { 31 | UserInfo userInfo = hbaseAccountInfoServiceImpl.findUserInfoByEntity(TABLE_NAME, FAMILY_INFO, 32 | "1", new UserInfo()); 33 | 34 | modelMap.addAttribute("userInfo", userInfo); 35 | 36 | return "hbase/hbasetest"; 37 | 38 | /*List list = hbaseAccountInfoServiceImpl.findAll(TABLE_NAME, FAMILY_INFO);*/ 39 | 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/src/main/java/com/bootcwenao/ribbonserver/RibbonServerApplication.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.ribbonserver; 6 | 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.boot.builder.SpringApplicationBuilder; 9 | import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; 10 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 11 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 12 | import org.springframework.context.annotation.Bean; 13 | import org.springframework.http.client.SimpleClientHttpRequestFactory; 14 | import org.springframework.web.client.RestTemplate; 15 | 16 | /** 17 | * @author cwenao 18 | * @version $Id RibbonServerApplication.java, v 0.1 2017-01-14 16:50 cwenao Exp $$ 19 | */ 20 | @SpringBootApplication(scanBasePackages = {"com.bootcwenao.ribbonserver"}) 21 | @EnableDiscoveryClient 22 | @EnableCircuitBreaker 23 | public class RibbonServerApplication { 24 | 25 | @Bean 26 | @LoadBalanced 27 | public RestTemplate restTemplate () { 28 | 29 | RestTemplate restTemplate = new RestTemplate(); 30 | SimpleClientHttpRequestFactory factory = (SimpleClientHttpRequestFactory) restTemplate.getRequestFactory(); 31 | //TODO there can do some for request 32 | 33 | return restTemplate; 34 | 35 | } 36 | 37 | public static void main(String[] args) { 38 | new SpringApplicationBuilder(RibbonServerApplication.class).web(true).run(args); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/java/com/bootcwenao/feignserver/controller/FeignController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.feignserver.controller; 6 | 7 | import com.bootcwenao.feignserver.servers.FeignServer; 8 | import io.swagger.annotations.ApiOperation; 9 | import io.swagger.annotations.ApiParam; 10 | import org.codehaus.jettison.json.JSONObject; 11 | import org.springframework.beans.factory.annotation.Autowired; 12 | import org.springframework.kafka.core.KafkaTemplate; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.web.bind.annotation.RequestMapping; 15 | import org.springframework.web.bind.annotation.ResponseBody; 16 | 17 | /** 18 | * @author cwenao 19 | * @version $Id FeignController.java, v 0.1 2017-01-15 13:50 cwenao Exp $$ 20 | */ 21 | @Controller 22 | public class FeignController { 23 | @Autowired 24 | FeignServer feignServer; 25 | 26 | @Autowired 27 | KafkaTemplate kafkaTemplate; 28 | 29 | @ApiOperation(value = "/testFeign",notes = "测试Feign",httpMethod = "GET") 30 | @ApiParam(name = "content",value = "参数:content") 31 | @RequestMapping("/testFeign") 32 | @ResponseBody 33 | public void testFeign(String content) { 34 | String ribbonStr = feignServer.testRealRibbon(content); 35 | System.out.println(ribbonStr); 36 | } 37 | 38 | @RequestMapping("/testKafka") 39 | @ResponseBody 40 | public void testkafka(String message) { 41 | System.out.println(message); 42 | kafkaTemplate.send("bootcwenaoTopic", "bootcwnao", message); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/mapper/AccountInfoMapper.java: -------------------------------------------------------------------------------- 1 | package com.bootcwenao.dbserver.mapper; 2 | 3 | 4 | import com.bootcwenao.dbserver.pojo.AccountInfo; 5 | import org.springframework.stereotype.Component; 6 | 7 | import java.util.List; 8 | 9 | @Component("accountInfoMapper") 10 | public interface AccountInfoMapper { 11 | /** 12 | * 根据主键删除 13 | * 参数:主键 14 | * 返回:删除个数 15 | * @author: lying 16 | * @time: 2016-10-31 10:10:15 17 | */ 18 | int deleteByPrimaryKey(String id); 19 | 20 | /** 21 | * 插入,空属性也会插入 22 | * 参数:pojo对象 23 | * 返回:删除个数 24 | * @author: lying 25 | * @time: 2016-10-31 10:10:15 26 | */ 27 | int insert(AccountInfo record); 28 | 29 | /** 30 | * 插入,空属性不会插入 31 | * 参数:pojo对象 32 | * 返回:删除个数 33 | * @author: lying 34 | * @time: 2016-10-31 10:10:15 35 | */ 36 | int insertSelective(AccountInfo record); 37 | 38 | /** 39 | * 根据主键查询 40 | * 参数:查询条件,主键值 41 | * 返回:对象 42 | * @author: lying 43 | * @time: 2016-10-31 10:10:15 44 | */ 45 | AccountInfo selectByPrimaryKey(String id); 46 | 47 | /** 48 | * 根据主键修改,空值条件不会修改成null 49 | * 参数:1.要修改成的值 50 | * 返回:成功修改个数 51 | * @author: lying 52 | * @time: 2016-10-31 10:10:15 53 | */ 54 | int updateByPrimaryKeySelective(AccountInfo record); 55 | 56 | /** 57 | * 根据主键修改,空值条件会修改成null 58 | * 参数:1.要修改成的值 59 | * 返回:成功修改个数 60 | * @author: lying 61 | * @time: 2016-10-31 10:10:15 62 | */ 63 | int updateByPrimaryKey(AccountInfo record); 64 | 65 | List selectByName(String accountName); 66 | } -------------------------------------------------------------------------------- /configserver-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement { 4 | imports { 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:"+ springCloudVersion 6 | mavenBom "org.springframework.boot:spring-boot-dependencies:"+ springBootVersion 7 | mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion 8 | } 9 | } 10 | 11 | dependencies { 12 | compile('org.springframework.cloud:spring-cloud-config-server') 13 | compile('org.springframework.cloud:spring-cloud-starter-eureka') 14 | compile('org.springframework.boot:spring-boot-starter-actuator') 15 | compile('org.springframework.cloud:spring-cloud-config-monitor') 16 | compile('org.springframework.boot:spring-boot-autoconfigure') 17 | compile('org.springframework.cloud:spring-cloud-starter-bus-kafka') 18 | compile('org.springframework.boot:spring-boot-starter-log4j2') 19 | 20 | compile('org.apache.logging.log4j:log4j-1.2-api:'+ log4jAPIVersion) 21 | compile('org.xerial.snappy:snappy-java:' + snappyVersion) 22 | testCompile('org.springframework.boot:spring-boot-starter-test') 23 | 24 | testCompile group: 'junit', name: 'junit', version: '4.11' 25 | } 26 | 27 | configurations { 28 | all*.exclude module: 'spring-boot-starter-logging' 29 | all*.exclude module: 'logback-classic' 30 | all*.exclude module: 'log4j-over-slf4j' 31 | all*.exclude module: 'snappy-java' 32 | } 33 | 34 | sourceSets { 35 | main { 36 | resources.srcDirs = ['src/main/resources', 'src/main/java'] 37 | resources.includes = ['**/*.xml', '**/*.yml'] 38 | } 39 | } 40 | 41 | jar { 42 | baseName = 'configserver-bootcwenao' 43 | } -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/controller/ESController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver.controller; 6 | 7 | import com.bootcwenao.esserver.pojo.AccountInfo; 8 | import com.bootcwenao.esserver.service.ESAccountInfoService; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.ui.ModelMap; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | 14 | import java.nio.channels.FileChannel; 15 | 16 | /** 17 | * @author cwenao 18 | * @version $Id ESController.java, v 0.1 2017-02-06 10:44 cwenao Exp $$ 19 | */ 20 | @Controller 21 | public class ESController { 22 | 23 | @Autowired 24 | private ESAccountInfoService esAccountInfoServiceImpl; 25 | 26 | @RequestMapping("/esAccountInfo") 27 | public String queryAccountInfo(String id, ModelMap modelMap){ 28 | 29 | AccountInfo accountInfo = esAccountInfoServiceImpl.queryAccountInfoById(id); 30 | modelMap.addAttribute("esAccountInfo",accountInfo); 31 | modelMap.addAttribute("test_elastic","Test the elasticsearch"); 32 | 33 | 34 | return "accountInfo"; 35 | 36 | } 37 | 38 | @RequestMapping("/esAccountInfoName") 39 | public String queryAccountInfoByAccountName(String accountName, ModelMap modelMap){ 40 | 41 | AccountInfo accountInfo = esAccountInfoServiceImpl.queryAccountInfoByName(accountName); 42 | modelMap.addAttribute("esAccountInfo",accountInfo); 43 | modelMap.addAttribute("test_elastic","Test the elasticsearch"); 44 | 45 | return "accountInfo"; 46 | 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /ribbon-server-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | 4 | dependencyManagement { 5 | imports { 6 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:" + springCloudVersion 7 | mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion } 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | dependencies { 15 | 16 | compile ('org.springframework.cloud:spring-cloud-starter-ribbon') 17 | compile('org.springframework.cloud:spring-cloud-starter-eureka') 18 | compile('org.springframework.cloud:spring-cloud-starter-hystrix') 19 | 20 | compile ('org.springframework.boot:spring-boot-starter-web') 21 | compile('org.springframework.boot:spring-boot-starter-log4j2') 22 | compile('org.apache.logging.log4j:log4j-1.2-api:'+ log4jAPIVersion) 23 | compile ('org.springframework.boot:spring-boot-starter-thymeleaf') 24 | // freemarker 25 | //compile ('org.springframework.boot:spring-boot-starter-freemarker') 26 | 27 | //JSP 28 | //compile ('org.springframework.boot:spring-boot-starter-tomcat') 29 | //compile ('org.apache.tomcat.embed:tomcat-embed-jasper') 30 | //compile ('javax.servlet:jstl') 31 | 32 | compile ('net.sourceforge.nekohtml:nekohtml:'+nekoHtmlVersion) 33 | 34 | testCompile ('org.springframework.boot:spring-boot-starter-test') 35 | testCompile group: 'junit', name: 'junit', version: '4.11' 36 | } 37 | 38 | configurations { 39 | all*.exclude module: 'spring-boot-starter-logging' 40 | all*.exclude module: 'logback-classic' 41 | all*.exclude module: 'log4j-over-slf4j' 42 | all*.exclude module: 'snappy-java' 43 | } 44 | 45 | jar { 46 | baseName = 'ribbonserver-bootcwenao' 47 | } -------------------------------------------------------------------------------- /apigateway-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement { 4 | imports { 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:"+ springCloudVersion 6 | mavenBom "org.springframework.boot:spring-boot-dependencies:"+ springBootVersion 7 | mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion 8 | } 9 | } 10 | 11 | dependencies { 12 | compile('org.springframework.cloud:spring-cloud-starter-config') 13 | compile('org.springframework.cloud:spring-cloud-starter-eureka') 14 | compile('org.springframework.cloud:spring-cloud-starter-zuul') 15 | compile('org.springframework.cloud:spring-cloud-netflix-sidecar') 16 | compile('org.springframework.cloud:spring-cloud-starter-bus-kafka') 17 | 18 | compile('org.springframework.cloud:spring-cloud-stream') 19 | 20 | compile('org.xerial.snappy:snappy-java:' + snappyVersion) 21 | compile ('org.springframework.boot:spring-boot-starter-web') 22 | compile('org.springframework.boot:spring-boot-starter-log4j2') 23 | 24 | compile('org.apache.logging.log4j:log4j-1.2-api:'+ log4jAPIVersion) 25 | 26 | 27 | testCompile('org.springframework.boot:spring-boot-starter-test') 28 | testCompile group: 'junit', name: 'junit', version: '4.11' 29 | 30 | } 31 | 32 | configurations { 33 | all*.exclude module: 'spring-boot-starter-logging' 34 | all*.exclude module: 'logback-classic' 35 | all*.exclude module: 'log4j-over-slf4j' 36 | all*.exclude module: 'snappy-java' 37 | } 38 | 39 | sourceSets { 40 | main { 41 | resources.srcDirs = ['src/main/resources', 'src/main/java'] 42 | resources.includes = ['**/*.xml', '**/*.yml'] 43 | } 44 | } 45 | 46 | 47 | jar { 48 | baseName = 'apigateway-bootcwenao' 49 | } -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/utils/Test.java: -------------------------------------------------------------------------------- 1 | ///** 2 | // * Company 3 | // * Copyright (C) 2014-2017 All Rights Reserved. 4 | // */ 5 | //package com.bootcwenao.bigdataserver.utils; 6 | // 7 | //import com.bootcwenao.bigdataserver.hbase.domain.pojo.UserInfo; 8 | //import org.apache.commons.collections.map.HashedMap; 9 | //import org.apache.hadoop.hbase.util.Bytes; 10 | //import org.springframework.beans.BeanUtils; 11 | //import org.springframework.boot.autoconfigure.security.oauth2.resource.UserInfoRestTemplateFactory; 12 | // 13 | //import java.beans.PropertyDescriptor; 14 | //import java.util.Arrays; 15 | //import java.util.List; 16 | //import java.util.Map; 17 | // 18 | ///** 19 | // * @author cwenao 20 | // * @version $Id Test.java, v 0.1 2017-02-20 12:50 cwenao Exp $$ 21 | // */ 22 | //public class Test { 23 | // /*public static void main(String[] args) { 24 | // Map map = new HashedMap(); 25 | // map.put("aa", 1); 26 | // map.put("bb", "womennenenen"); 27 | // map.put("cc", 1.2333); 28 | // 29 | // for (Map.Entry entry : map.entrySet()) { 30 | // System.out.println("key: " + entry.getKey() + " value: " + entry.getValue()); 31 | // } 32 | // 33 | // System.out.println(Bytes.toString("aa".getBytes())); 34 | // 35 | // System.out.println(HumpNameOrMethodUtils.humpVarForEntity("aa_bb_ABC_aBc_Abc")+" "+HumpNameOrMethodUtils.humpVarForEntity("Ba_bb_ABC_aBc_Abc")); 36 | // 37 | // System.out.println(HumpNameOrMethodUtils.humpEntityForVar("userNameF")); 38 | // 39 | // PropertyDescriptor[] p = BeanUtils.getPropertyDescriptors(UserInfo.class); 40 | // 41 | // for (int i=0; i< p.length;i++) { 42 | // PropertyDescriptor pd = p[i]; 43 | // } 44 | // 45 | // }*/ 46 | //} 47 | // 48 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/hbase/domain/pojo/UserInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.hbase.domain.pojo; 6 | 7 | /** 8 | * @author cwenao 9 | * @version $Id UserInfo.java, v 0.1 2017-02-21 15:27 cwenao Exp $$ 10 | */ 11 | public class UserInfo { 12 | 13 | private String id; 14 | 15 | private String userName; 16 | 17 | private Integer age; 18 | 19 | 20 | /** 21 | * Getter method for property id. 22 | * 23 | * @return property value of id 24 | */ 25 | 26 | public String getId() { 27 | return id; 28 | } 29 | 30 | /** 31 | * Setter method for property id. 32 | * 33 | * @param id value to be assigned to property id 34 | */ 35 | public void setId(String id) { 36 | this.id = id; 37 | } 38 | 39 | /** 40 | * Getter method for property userName. 41 | * 42 | * @return property value of userName 43 | */ 44 | 45 | public String getUserName() { 46 | return userName; 47 | } 48 | 49 | /** 50 | * Setter method for property userName. 51 | * 52 | * @param userName value to be assigned to property userName 53 | */ 54 | public void setUserName(String userName) { 55 | this.userName = userName; 56 | } 57 | 58 | /** 59 | * Getter method for property age. 60 | * 61 | * @return property value of age 62 | */ 63 | 64 | public Integer getAge() { 65 | return age; 66 | } 67 | 68 | /** 69 | * Setter method for property age. 70 | * 71 | * @param age value to be assigned to property age 72 | */ 73 | public void setAge(Integer age) { 74 | this.age = age; 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/java/com/bootcwenao/feignserver/config/Swagger2Config.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.feignserver.config; 6 | 7 | import org.springframework.context.annotation.Bean; 8 | import org.springframework.context.annotation.ComponentScan; 9 | import org.springframework.context.annotation.Configuration; 10 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 11 | import springfox.documentation.builders.ApiInfoBuilder; 12 | import springfox.documentation.builders.PathSelectors; 13 | import springfox.documentation.builders.RequestHandlerSelectors; 14 | import springfox.documentation.service.ApiInfo; 15 | import springfox.documentation.spi.DocumentationType; 16 | import springfox.documentation.spring.web.plugins.Docket; 17 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 18 | 19 | /** 20 | * @author cwenao 21 | * @version $Id Swagger2Application.java, v 0.1 2017-01-18 16:58 cwenao Exp $$ 22 | */ 23 | @Configuration 24 | @EnableSwagger2 25 | public class Swagger2Config { 26 | 27 | @Bean 28 | public Docket createRestApi(){ 29 | return new Docket(DocumentationType.SWAGGER_2) 30 | .apiInfo(apiInfo()) 31 | .select() 32 | .apis(RequestHandlerSelectors.basePackage("com.bootcwenao.feignserver.controller")) 33 | .paths(PathSelectors.any()) 34 | .build(); 35 | } 36 | 37 | private ApiInfo apiInfo() { 38 | return new ApiInfoBuilder() 39 | .title("Spring Boot Swagger2 test Restful API") 40 | .description("更多内容请详见代码") 41 | .termsOfServiceUrl("http://blog.csdn.net/cwenao") 42 | .contact("cwenao") 43 | .version("0.5.0") 44 | .build(); 45 | } 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /out/production/db-server-bootcwenao/config/mybatis-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | -------------------------------------------------------------------------------- /out/production/es-server-bootcwenao/config/mybatis-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/resources/config/mybatis-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/resources/config/mybatis-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 36 | -------------------------------------------------------------------------------- /db-server-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement { 4 | imports { 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:" + springCloudVersion 6 | mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion 7 | } 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | dependencies { 15 | 16 | compile ('org.springframework.data:spring-data-redis') 17 | compile ('org.springframework.boot:spring-boot-starter-data-mongodb:'+springBootVersion) 18 | compile ('org.springframework.boot:spring-boot-starter-web:'+springBootVersion) 19 | compile('org.springframework.cloud:spring-cloud-starter-eureka') 20 | compile ('mysql:mysql-connector-java:'+mysqlVersion) 21 | compile ('com.alibaba:druid:'+druidVersion) 22 | compile ('org.mybatis:mybatis-spring:'+mybatisSpringBootVersion) 23 | compile ('org.mybatis:mybatis:'+mybatisVersion) 24 | compile('org.springframework.boot:spring-boot-starter-log4j2') 25 | compile ('org.springframework.boot:spring-boot-starter-thymeleaf') 26 | compile ('net.sourceforge.nekohtml:nekohtml:'+nekoHtmlVersion) 27 | compile('org.apache.logging.log4j:log4j-1.2-api:'+ log4jAPIVersion) 28 | compile('org.springframework.boot:spring-boot-starter-jdbc') 29 | compile('org.springframework.boot:spring-boot-starter-aop') 30 | compile ('com.alibaba:fastjson:'+fastjsonVersion) 31 | compile ('redis.clients:jedis') 32 | 33 | testCompile ('org.springframework.boot:spring-boot-starter-test') 34 | testCompile group: 'junit', name: 'junit', version: '4.11' 35 | } 36 | 37 | 38 | 39 | configurations { 40 | all*.exclude module: 'spring-boot-starter-logging' 41 | all*.exclude module: 'logback-classic' 42 | all*.exclude module: 'log4j-over-slf4j' 43 | all*.exclude module: 'snappy-java' 44 | } 45 | 46 | jar { 47 | baseName = 'db-server-bootcwenao' 48 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## 此项目用于学习 springboot以及相关的springcloud、集成redis、mybatis等 3 | 4 | 博客:http://blog.csdn.net/cwenao 5 | 6 | GitHub:https://github.com/cwenao/springboot_cwenao 7 | 8 | Spring Boot系列:http://blog.csdn.net/cwenao/article/category/6671131 9 | 10 | 简书: http://www.jianshu.com/u/cec2e8665f7b 11 | 12 | ### *SpringBoot 实践目录* 13 | 14 | #### [一、工程搭建](http://blog.csdn.net/cwenao/article/details/54293391) 15 | #### [二、服务注册与发现](http://blog.csdn.net/cwenao/article/details/54425265) 16 | #### [三、配置中心服务](http://blog.csdn.net/cwenao/article/details/54426987) 17 | #### [四、负载均衡Ribbon](http://blog.csdn.net/cwenao/article/details/54565971) 18 | #### [五、Feign 声明式web service](http://blog.csdn.net/cwenao/article/details/54571816) 19 | #### [六、服务网关APIGateway](http://blog.csdn.net/cwenao/article/details/54572648) 20 | #### [七、熔断机制 Circuit Breaker](http://blog.csdn.net/cwenao/article/details/54580349) 21 | #### [八、日志集成 Log4j2](http://blog.csdn.net/cwenao/article/details/54600097) 22 | #### [九、thymeleaf](http://blog.csdn.net/cwenao/article/details/54600127) 23 | #### [十、Swagger2](http://blog.csdn.net/cwenao/article/details/54613266) 24 | #### [十、Kafka(一) 环境搭建](http://blog.csdn.net/cwenao/article/details/54613842) 25 | #### [十一、Kafka(二) Demo](http://blog.csdn.net/cwenao/article/details/54668590) 26 | #### [十二、集成Mybatis/Druid](http://blog.csdn.net/cwenao/article/details/54772939) 27 | #### [十三、集成Redis/CacheManager](http://blog.csdn.net/cwenao/article/details/54773508) 28 | #### [十四、集成Mongodb](http://blog.csdn.net/cwenao/article/details/54783050) 29 | #### [十五、集成Elasticsearch](http://blog.csdn.net/cwenao/article/details/54943505) 30 | #### [十六、Elasticsearch从mysql获取数据](http://blog.csdn.net/cwenao/article/details/54944937) 31 | #### [十七、基于SpringDataHadoop集成HBASE](http://blog.csdn.net/cwenao/article/details/57980188) 32 | 33 | 34 | - 感谢您的 **Start**,谢谢给予支持!! 35 | - 如果您有任何问题,请联系我;关注公众号(K171),并留言; 36 | - 联系方式: 37 | 1. cwenao@126.com(主要联系方式)、K171 38 | 2. CSDN、简书留言板(随缘) 39 | 40 | ![公众号_k171](http://bimg.kakme.com/k171.jpg?imageMogr2/auto-orient/thumbnail/!50p) 41 | -------------------------------------------------------------------------------- /apigateway-bootcwenao/src/main/java/com/bootcwenao/apigateway/filter/AccessSignFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.apigateway.filter; 6 | 7 | import com.netflix.zuul.ZuulFilter; 8 | 9 | /** 10 | * @author cwenao 11 | * @version $Id AccessSignFilter.java, v 0.1 2017-01-16 12:12 cwenao Exp $$ 12 | */ 13 | public class AccessSignFilter extends ZuulFilter { 14 | /** 15 | * to classify a filter by type. Standard types in Zuul are "pre" for pre-routing filtering, 16 | * "route" for routing to an origin, "post" for post-routing filters, "error" for error handling. 17 | * We also support a "static" type for static responses see StaticResponseFilter. 18 | * Any filterType made be created or added and run by calling FilterProcessor.runFilters(type) 19 | * 20 | * @return A String representing that type 21 | */ 22 | @Override 23 | public String filterType() { 24 | return "pre"; 25 | } 26 | 27 | /** 28 | * filterOrder() must also be defined for a filter. Filters may have the same filterOrder if precedence is not 29 | * important for a filter. filterOrders do not need to be sequential. 30 | * 31 | * @return the int order of a filter 32 | */ 33 | @Override 34 | public int filterOrder() { 35 | return 0; 36 | } 37 | 38 | /** 39 | * a "true" return from this method means that the run() method should be invoked 40 | * 41 | * @return true if the run() method should be invoked. false will not invoke the run() method 42 | */ 43 | @Override 44 | public boolean shouldFilter() { 45 | return false; 46 | } 47 | 48 | /** 49 | * if shouldFilter() is true, this method will be invoked. this method is the core method of a ZuulFilter 50 | * 51 | * @return Some arbitrary artifact may be returned. Current implementation ignores it. 52 | */ 53 | @Override 54 | public Object run() { 55 | return null; 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /es-server-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement{ 4 | imports { 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:" + springCloudVersion 6 | mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion 7 | } 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | dependencies { 15 | 16 | compile ('org.springframework.data:spring-data-redis') 17 | compile ('org.springframework.boot:spring-boot-starter-data-mongodb:'+springBootVersion) 18 | compile ('org.springframework.boot:spring-boot-starter-web:'+springBootVersion) 19 | compile('org.springframework.cloud:spring-cloud-starter-eureka') 20 | compile ('mysql:mysql-connector-java:'+mysqlVersion) 21 | compile ('com.alibaba:druid:'+druidVersion) 22 | compile ('org.mybatis:mybatis-spring:'+mybatisSpringBootVersion) 23 | compile ('org.mybatis:mybatis:'+mybatisVersion) 24 | compile('org.springframework.boot:spring-boot-starter-log4j2') 25 | compile ('org.springframework.boot:spring-boot-starter-thymeleaf') 26 | compile ('net.sourceforge.nekohtml:nekohtml:'+nekoHtmlVersion) 27 | compile('org.apache.logging.log4j:log4j-1.2-api:'+ log4jAPIVersion) 28 | compile('org.springframework.boot:spring-boot-starter-jdbc') 29 | compile('org.springframework.boot:spring-boot-starter-aop') 30 | compile ('com.alibaba:fastjson:'+fastjsonVersion) 31 | compile ('redis.clients:jedis') 32 | compile ('org.springframework.boot:spring-boot-starter-data-elasticsearch:'+springBootVersion) 33 | compile ('org.springframework.data:spring-data-elasticsearch') 34 | 35 | testCompile ('org.springframework.boot:spring-boot-starter-test') 36 | testCompile group: 'junit', name: 'junit', version: '4.11' 37 | } 38 | 39 | 40 | 41 | configurations { 42 | all*.exclude module: 'spring-boot-starter-logging' 43 | all*.exclude module: 'logback-classic' 44 | all*.exclude module: 'log4j-over-slf4j' 45 | all*.exclude module: 'snappy-java' 46 | } 47 | 48 | jar { 49 | baseName = 'es-server-bootcwenao' 50 | } -------------------------------------------------------------------------------- /feign-server-bootcwenao/src/main/java/com/bootcwenao/feignserver/config/KafkaProducersConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.feignserver.config; 6 | 7 | import org.apache.kafka.clients.producer.ProducerConfig; 8 | import org.apache.kafka.common.serialization.StringSerializer; 9 | import org.springframework.beans.factory.annotation.Value; 10 | import org.springframework.context.annotation.Bean; 11 | import org.springframework.context.annotation.Configuration; 12 | import org.springframework.kafka.annotation.EnableKafka; 13 | import org.springframework.kafka.core.DefaultKafkaProducerFactory; 14 | import org.springframework.kafka.core.KafkaTemplate; 15 | import org.springframework.kafka.core.ProducerFactory; 16 | 17 | import java.util.HashMap; 18 | import java.util.Map; 19 | 20 | /** 21 | * @author cwenao 22 | * @version $Id KafkaConfig.java, v 0.1 2017-01-20 9:51 cwenao Exp $$ 23 | */ 24 | 25 | @Configuration 26 | @EnableKafka 27 | public class KafkaProducersConfig { 28 | @Value("${bootcwenao.kafka.binder.brokers}") 29 | private String brokers; 30 | 31 | @Bean("kafkaTemplate") 32 | public KafkaTemplate kafkaTemplate() { 33 | KafkaTemplate kafkaTemplate = new KafkaTemplate(producerFactory()); 34 | return kafkaTemplate; 35 | } 36 | 37 | public ProducerFactory producerFactory() { 38 | 39 | // set the producer properties 40 | Map properties = new HashMap(); 41 | properties.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, brokers); 42 | properties.put(ProducerConfig.RETRIES_CONFIG, 0); 43 | properties.put(ProducerConfig.BATCH_SIZE_CONFIG, 4096); 44 | properties.put(ProducerConfig.LINGER_MS_CONFIG, 1); 45 | properties.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 40960); 46 | properties.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); 47 | properties.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class); 48 | 49 | return new DefaultKafkaProducerFactory(properties); 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/pojo/AccountInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver.pojo; 6 | 7 | import org.springframework.data.annotation.Id; 8 | import org.springframework.data.elasticsearch.annotations.Document; 9 | import org.springframework.data.elasticsearch.annotations.Field; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id AccountInfo.java, v 0.1 2017-02-06 10:28 cwenao Exp $$ 14 | */ 15 | @Document(indexName = "cwenao",type = "accountinfo", shards = 1,replicas = 0, refreshInterval = "-1") 16 | public class AccountInfo { 17 | 18 | @Id 19 | private String id; 20 | @Field 21 | private String accountName; 22 | @Field 23 | private String nickName; 24 | 25 | /** 26 | * Getter method for property id. 27 | * 28 | * @return property value of id 29 | */ 30 | 31 | public String getId() { 32 | return id; 33 | } 34 | 35 | /** 36 | * Setter method for property id. 37 | * 38 | * @param id value to be assigned to property id 39 | */ 40 | public void setId(String id) { 41 | this.id = id; 42 | } 43 | 44 | /** 45 | * Getter method for property accountName. 46 | * 47 | * @return property value of accountName 48 | */ 49 | 50 | public String getAccountName() { 51 | return accountName; 52 | } 53 | 54 | /** 55 | * Setter method for property accountName. 56 | * 57 | * @param accountName value to be assigned to property accountName 58 | */ 59 | public void setAccountName(String accountName) { 60 | this.accountName = accountName; 61 | } 62 | 63 | /** 64 | * Getter method for property nickName. 65 | * 66 | * @return property value of nickName 67 | */ 68 | 69 | public String getNickName() { 70 | return nickName; 71 | } 72 | 73 | /** 74 | * Setter method for property nickName. 75 | * 76 | * @param nickName value to be assigned to property nickName 77 | */ 78 | public void setNickName(String nickName) { 79 | this.nickName = nickName; 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement { 4 | imports { 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:" + springCloudVersion 6 | mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion 7 | } 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | dependencies { 15 | 16 | compile project(':hadoop-base-bootcwenao') 17 | 18 | compile ('org.springframework.data:spring-data-redis') 19 | 20 | compile ('org.springframework.boot:spring-boot-starter-data-mongodb:'+springBootVersion) 21 | compile ('org.apache.hbase:hbase-client:'+hbaseClientVersion) 22 | compile ('org.springframework.boot:spring-boot-starter-web:'+springBootVersion) 23 | compile('org.springframework.cloud:spring-cloud-starter-eureka') 24 | compile ('mysql:mysql-connector-java:'+mysqlVersion) 25 | compile ('com.alibaba:druid:'+druidVersion) 26 | compile ('org.mybatis:mybatis-spring:'+mybatisSpringBootVersion) 27 | compile ('org.mybatis:mybatis:'+mybatisVersion) 28 | compile('org.springframework.boot:spring-boot-starter-log4j2') 29 | compile ('org.springframework.boot:spring-boot-starter-thymeleaf') 30 | compile ('net.sourceforge.nekohtml:nekohtml:'+nekoHtmlVersion) 31 | compile('org.apache.logging.log4j:log4j-1.2-api:'+ log4jAPIVersion) 32 | /*compile('org.springframework.boot:spring-boot-starter-jdbc')*/ 33 | compile('org.springframework.boot:spring-boot-starter-aop') 34 | compile ('com.alibaba:fastjson:'+fastjsonVersion) 35 | compile ('redis.clients:jedis') 36 | compile ('com.google.guava:guava:12.0.1') 37 | 38 | testCompile ('org.springframework.boot:spring-boot-starter-test') 39 | testCompile group: 'junit', name: 'junit', version: '4.11' 40 | } 41 | 42 | 43 | configurations { 44 | all*.exclude module: 'spring-boot-starter-logging' 45 | all*.exclude module: 'servlet-api' 46 | all*.exclude group: 'com.google.guava', module: 'guava:18.0' 47 | all*.exclude module: 'logback-classic' 48 | all*.exclude module: 'log4j-over-slf4j' 49 | all*.exclude module: 'slf4j-log4j12' 50 | all*.exclude module: 'snappy-java' 51 | } 52 | 53 | jar { 54 | baseName = 'bigdata-server-bootcwenao' 55 | } -------------------------------------------------------------------------------- /out/production/db-server-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8383 3 | eureka: 4 | instance: 5 | hostname: dbserver 6 | prefer-ip-address: true 7 | client: 8 | registerWithEureka: true 9 | fetchRegistry: true 10 | service-url: 11 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 12 | 13 | druid: 14 | datasource: 15 | driverClassName: com.mysql.jdbc.Driver 16 | url: jdbc:mysql://localhost:3306/kakme?useUnicode=true&characterEncoding=UTF-8&useSSL=false 17 | username: root 18 | password: 123456 19 | #初始化连接数量,最大最小连接数 20 | initialSize: 5 21 | maxActive: 10 22 | minIdle: 3 23 | #获取连接等待超时的时间 24 | maxWait: 600000 25 | #超过时间限制是否回收 26 | removeAbandoned: true 27 | #超过时间限制多长 28 | removeAbandonedTimeout: 180 29 | #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 30 | timeBetweenEvictionRunsMillis: 600000 31 | #配置一个连接在池中最小生存的时间,单位是毫秒 32 | minEvictableIdleTimeMillis: 300000 33 | #用来检测连接是否有效的sql,要求是一个查询语句 34 | validationQuery: SELECT 1 FROM DUAL 35 | #申请连接的时候检测 36 | testWhileIdle: true 37 | #申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 38 | testOnBorrow: false 39 | #归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 40 | testOnReturn: false 41 | #打开PSCache,并且指定每个连接上PSCache的大小 42 | poolPreparedStatements: true 43 | maxPoolPreparedStatementPerConnectionSize: 50 44 | #属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有: 45 | #监控统计用的filter:stat 日志用的filter:log4j 防御SQL注入的filter:wall 46 | filters: stat 47 | 48 | spring: 49 | thymeleaf: 50 | cache: false 51 | mode: LEGACYHTML5 52 | prefix: classpath:/web/ 53 | suffix: .html 54 | content-type: text/html 55 | redis: 56 | host: 127.0.0.1 57 | port: 6379 58 | password: 111222333444555666 59 | timeout: 5000 60 | pool: 61 | max-idle: 8 62 | min-idle: 0 63 | max-active: 8 64 | max-wait: -1 65 | data: 66 | mongodb: 67 | # host: 127.0.0.1 68 | # port: 27017 69 | # username: dev_xxx 70 | # password: dev_xxxx 71 | # database: kakme 72 | uri: mongodb://dev_xxx:dev_xxxx@127.0.0.1:27017/kakme 73 | 74 | mybatis: 75 | typeAliasesPackage: com.bootcwenao.dbserver.pojo,com.bootcwenao.dbserver.vo 76 | mapper-locations: classpath:/com/bootcwenao/dbserver/mapper/*Mapper.xml 77 | configLocation: classpath:/config/mybatis-spring.xml 78 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8383 3 | eureka: 4 | instance: 5 | hostname: dbserver 6 | prefer-ip-address: true 7 | client: 8 | registerWithEureka: true 9 | fetchRegistry: true 10 | service-url: 11 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 12 | 13 | druid: 14 | datasource: 15 | driverClassName: com.mysql.jdbc.Driver 16 | url: jdbc:mysql://localhost:3306/kakme?useUnicode=true&characterEncoding=UTF-8&useSSL=false 17 | username: root 18 | password: 123456 19 | #初始化连接数量,最大最小连接数 20 | initialSize: 5 21 | maxActive: 10 22 | minIdle: 3 23 | #获取连接等待超时的时间 24 | maxWait: 600000 25 | #超过时间限制是否回收 26 | removeAbandoned: true 27 | #超过时间限制多长 28 | removeAbandonedTimeout: 180 29 | #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 30 | timeBetweenEvictionRunsMillis: 600000 31 | #配置一个连接在池中最小生存的时间,单位是毫秒 32 | minEvictableIdleTimeMillis: 300000 33 | #用来检测连接是否有效的sql,要求是一个查询语句 34 | validationQuery: SELECT 1 FROM DUAL 35 | #申请连接的时候检测 36 | testWhileIdle: true 37 | #申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 38 | testOnBorrow: false 39 | #归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 40 | testOnReturn: false 41 | #打开PSCache,并且指定每个连接上PSCache的大小 42 | poolPreparedStatements: true 43 | maxPoolPreparedStatementPerConnectionSize: 50 44 | #属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有: 45 | #监控统计用的filter:stat 日志用的filter:log4j 防御SQL注入的filter:wall 46 | filters: stat 47 | 48 | spring: 49 | thymeleaf: 50 | cache: false 51 | mode: LEGACYHTML5 52 | prefix: classpath:/web/ 53 | suffix: .html 54 | content-type: text/html 55 | redis: 56 | host: 127.0.0.1 57 | port: 6379 58 | password: 111222333444555666 59 | timeout: 5000 60 | pool: 61 | max-idle: 8 62 | min-idle: 0 63 | max-active: 8 64 | max-wait: -1 65 | data: 66 | mongodb: 67 | # host: 127.0.0.1 68 | # port: 27017 69 | # username: dev_xxx 70 | # password: dev_xxxx 71 | # database: kakme 72 | uri: mongodb://dev_xxx:dev_xxxx@127.0.0.1:27017/kakme 73 | 74 | mybatis: 75 | typeAliasesPackage: com.bootcwenao.dbserver.pojo,com.bootcwenao.dbserver.vo 76 | mapper-locations: classpath:/com/bootcwenao/dbserver/mapper/*Mapper.xml 77 | configLocation: classpath:/config/mybatis-spring.xml 78 | -------------------------------------------------------------------------------- /out/production/es-server-bootcwenao/config/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | instance: 3 | hostname: esserver 4 | prefer-ip-address: true 5 | client: 6 | registerWithEureka: true 7 | fetchRegistry: true 8 | service-url: 9 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 10 | druid: 11 | datasource: 12 | driverClassName: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://localhost:3306/kakme?useUnicode=true&characterEncoding=UTF-8&useSSL=false 14 | username: root 15 | password: 123456 16 | #初始化连接数量,最大最小连接数 17 | initialSize: 5 18 | maxActive: 10 19 | minIdle: 3 20 | #获取连接等待超时的时间 21 | maxWait: 600000 22 | #超过时间限制是否回收 23 | removeAbandoned: true 24 | #超过时间限制多长 25 | removeAbandonedTimeout: 180 26 | #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 27 | timeBetweenEvictionRunsMillis: 600000 28 | #配置一个连接在池中最小生存的时间,单位是毫秒 29 | minEvictableIdleTimeMillis: 300000 30 | #用来检测连接是否有效的sql,要求是一个查询语句 31 | validationQuery: SELECT 1 FROM DUAL 32 | #申请连接的时候检测 33 | testWhileIdle: true 34 | #申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 35 | testOnBorrow: false 36 | #归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 37 | testOnReturn: false 38 | #打开PSCache,并且指定每个连接上PSCache的大小 39 | poolPreparedStatements: true 40 | maxPoolPreparedStatementPerConnectionSize: 50 41 | #属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有: 42 | #监控统计用的filter:stat 日志用的filter:log4j 防御SQL注入的filter:wall 43 | filters: stat 44 | 45 | spring: 46 | thymeleaf: 47 | cache: false 48 | mode: LEGACYHTML5 49 | prefix: classpath:/web/ 50 | suffix: .html 51 | content-type: text/html 52 | redis: 53 | host: 127.0.0.1 54 | port: 6379 55 | password: xxxx 56 | timeout: 5000 57 | pool: 58 | max-idle: 8 59 | min-idle: 0 60 | max-active: 8 61 | max-wait: -1 62 | data: 63 | mongodb: 64 | uri: mongodb://dev_kakme:dev_kakmeQQWWSS@127.0.0.1:27017/kakme 65 | elasticsearch: 66 | cluster-name: nini 67 | cluster-nodes: 127.0.0.1:9300 68 | local: false 69 | repositories: 70 | enable: true 71 | 72 | mybatis: 73 | typeAliasesPackage: com.bootcwenao.esserver.pojo,com.bootcwenao.esserver.vo 74 | mapper-locations: classpath:/com/bootcwenao/esserver/mapper/*Mapper.xml 75 | configLocation: classpath:/config/mybatis-spring.xml 76 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | eureka: 2 | instance: 3 | hostname: esserver 4 | prefer-ip-address: true 5 | client: 6 | registerWithEureka: true 7 | fetchRegistry: true 8 | service-url: 9 | defaultZone: http://aa:abcd@localhost:8761/eureka/ 10 | druid: 11 | datasource: 12 | driverClassName: com.mysql.jdbc.Driver 13 | url: jdbc:mysql://localhost:3306/kakme?useUnicode=true&characterEncoding=UTF-8&useSSL=false 14 | username: root 15 | password: 123456 16 | #初始化连接数量,最大最小连接数 17 | initialSize: 5 18 | maxActive: 10 19 | minIdle: 3 20 | #获取连接等待超时的时间 21 | maxWait: 600000 22 | #超过时间限制是否回收 23 | removeAbandoned: true 24 | #超过时间限制多长 25 | removeAbandonedTimeout: 180 26 | #配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 27 | timeBetweenEvictionRunsMillis: 600000 28 | #配置一个连接在池中最小生存的时间,单位是毫秒 29 | minEvictableIdleTimeMillis: 300000 30 | #用来检测连接是否有效的sql,要求是一个查询语句 31 | validationQuery: SELECT 1 FROM DUAL 32 | #申请连接的时候检测 33 | testWhileIdle: true 34 | #申请连接时执行validationQuery检测连接是否有效,配置为true会降低性能 35 | testOnBorrow: false 36 | #归还连接时执行validationQuery检测连接是否有效,配置为true会降低性能 37 | testOnReturn: false 38 | #打开PSCache,并且指定每个连接上PSCache的大小 39 | poolPreparedStatements: true 40 | maxPoolPreparedStatementPerConnectionSize: 50 41 | #属性类型是字符串,通过别名的方式配置扩展插件,常用的插件有: 42 | #监控统计用的filter:stat 日志用的filter:log4j 防御SQL注入的filter:wall 43 | filters: stat 44 | 45 | spring: 46 | thymeleaf: 47 | cache: false 48 | mode: LEGACYHTML5 49 | prefix: classpath:/web/ 50 | suffix: .html 51 | content-type: text/html 52 | redis: 53 | host: 127.0.0.1 54 | port: 6379 55 | password: xxxx 56 | timeout: 5000 57 | pool: 58 | max-idle: 8 59 | min-idle: 0 60 | max-active: 8 61 | max-wait: -1 62 | data: 63 | mongodb: 64 | uri: mongodb://dev_kakme:dev_kakmeQQWWSS@127.0.0.1:27017/kakme 65 | elasticsearch: 66 | cluster-name: nini 67 | cluster-nodes: 127.0.0.1:9300 68 | local: false 69 | repositories: 70 | enable: true 71 | 72 | mybatis: 73 | typeAliasesPackage: com.bootcwenao.esserver.pojo,com.bootcwenao.esserver.vo 74 | mapper-locations: classpath:/com/bootcwenao/esserver/mapper/*Mapper.xml 75 | configLocation: classpath:/config/mybatis-spring.xml 76 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/hbase/handler/HbasePutBuilder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.hbase.handler; 6 | 7 | import org.apache.hadoop.hbase.client.Put; 8 | 9 | import java.nio.ByteBuffer; 10 | 11 | /** 12 | * @author cwenao 13 | * @version $Id HbasePutBuilder.java, v 0.1 2017-02-24 9:31 cwenao Exp $$ 14 | */ 15 | public class HbasePutBuilder extends Put{ 16 | /** 17 | * Create a Put operation for the specified row. 18 | * 19 | * @param row row key 20 | */ 21 | public HbasePutBuilder(byte[] row) { 22 | super(row); 23 | } 24 | 25 | /** 26 | * Create a Put operation for the specified row, using a given timestamp. 27 | * 28 | * @param row row key; we make a copy of what we are passed to keep local. 29 | * @param ts timestamp 30 | */ 31 | public HbasePutBuilder(byte[] row, long ts) { 32 | super(row, ts); 33 | } 34 | 35 | /** 36 | * We make a copy of the passed in row key to keep local. 37 | * 38 | * @param rowArray 39 | * @param rowOffset 40 | * @param rowLength 41 | */ 42 | public HbasePutBuilder(byte[] rowArray, int rowOffset, int rowLength) { 43 | super(rowArray, rowOffset, rowLength); 44 | } 45 | 46 | /** 47 | * @param row row key; we make a copy of what we are passed to keep local. 48 | * @param ts timestamp 49 | */ 50 | public HbasePutBuilder(ByteBuffer row, long ts) { 51 | super(row, ts); 52 | } 53 | 54 | /** 55 | * @param row row key; we make a copy of what we are passed to keep local. 56 | */ 57 | public HbasePutBuilder(ByteBuffer row) { 58 | super(row); 59 | } 60 | 61 | /** 62 | * We make a copy of the passed in row key to keep local. 63 | * 64 | * @param rowArray 65 | * @param rowOffset 66 | * @param rowLength 67 | * @param ts 68 | */ 69 | public HbasePutBuilder(byte[] rowArray, int rowOffset, int rowLength, long ts) { 70 | super(rowArray, rowOffset, rowLength, ts); 71 | } 72 | 73 | /** 74 | * Copy constructor. Creates a Put operation cloned from the specified Put. 75 | * 76 | * @param putToCopy put to copy 77 | */ 78 | public HbasePutBuilder(Put putToCopy) { 79 | super(putToCopy); 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/hbase/mapper/impl/HbaseAccountInfoMapperImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.hbase.mapper.impl; 6 | 7 | import com.bootcwenao.bigdataserver.hbase.domain.pojo.UserInfo; 8 | import com.bootcwenao.bigdataserver.hbase.handler.HbaseFindBuilder; 9 | import com.bootcwenao.bigdataserver.hbase.mapper.HbaseAccountInfoMapper; 10 | import org.apache.hadoop.hbase.client.Result; 11 | import org.apache.hadoop.hbase.util.Bytes; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.data.hadoop.hbase.HbaseTemplate; 14 | import org.springframework.data.hadoop.hbase.RowMapper; 15 | import org.springframework.stereotype.Repository; 16 | 17 | import java.util.List; 18 | 19 | /** 20 | * @author cwenao 21 | * @version $Id HbaseAccountInfoMapperImpl.java, v 0.1 2017-02-21 21:14 cwenao Exp $$ 22 | */ 23 | @Repository("hbaseAccountInfoMapperImpl") 24 | public class HbaseAccountInfoMapperImpl implements HbaseAccountInfoMapper { 25 | 26 | @Autowired 27 | private HbaseTemplate hbaseTemplate; 28 | 29 | public UserInfo findUserInfoByEntity(String table, String family, String rowKey, UserInfo userInfo) { 30 | 31 | return (UserInfo) hbaseTemplate.get(table, rowKey, family, 32 | (result, rowNum) -> new HbaseFindBuilder<>(family, result, userInfo.getClass()).build("userName","age","id").fetch()); 33 | } 34 | 35 | @Override 36 | public List findAll(String tablename, String family) { 37 | 38 | byte[] cf_info = family.getBytes(); 39 | 40 | byte[] age_info = Bytes.toBytes("age"); 41 | byte[] id_info = Bytes.toBytes("id"); 42 | byte[] username_info = Bytes.toBytes("userName"); 43 | 44 | return hbaseTemplate.find(tablename, family, new RowMapper() { 45 | @Override 46 | public UserInfo mapRow(Result result, int rowNum) throws Exception { 47 | 48 | UserInfo u = new UserInfo(); 49 | 50 | u.setId(Bytes.toString(result.getValue(cf_info,id_info))); 51 | u.setUserName(Bytes.toString(result.getValue(cf_info,username_info))); 52 | u.setAge(Bytes.toInt(result.getValue(cf_info,age_info))); 53 | 54 | return u; 55 | } 56 | }); 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/controller/UserInfoController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.controller; 6 | 7 | import com.bootcwenao.dbserver.handler.validator.AbstractCacheSupport; 8 | import com.bootcwenao.dbserver.pojo.AccountInfo; 9 | import com.bootcwenao.dbserver.pojo.MessageInfo; 10 | import com.bootcwenao.dbserver.server.AccountInfoServer; 11 | import com.bootcwenao.dbserver.server.MsgInfoRepository; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.cache.Cache; 14 | import org.springframework.cache.CacheManager; 15 | import org.springframework.data.redis.core.RedisTemplate; 16 | import org.springframework.stereotype.Controller; 17 | import org.springframework.ui.ModelMap; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | 20 | import java.util.List; 21 | 22 | /** 23 | * @author cwenao 24 | * @version $Id UserInfoController.java, v 0.1 2017-01-25 18:35 cwenao Exp $$ 25 | */ 26 | @Controller 27 | public class UserInfoController extends AbstractCacheSupport { 28 | 29 | @Autowired 30 | AccountInfoServer accountInfoServerImpl; 31 | 32 | @Autowired 33 | CacheManager cacheManager; 34 | 35 | @Autowired 36 | MsgInfoRepository msgInfoRepository; 37 | 38 | 39 | private final static String TEST_REDIS = "test_redis"; 40 | 41 | @RequestMapping("/accountInfo") 42 | public String accountInfo(String name, ModelMap modelMap) { 43 | Cache cache = cacheManager.getCache(TEST_REDIS); 44 | putCache(cache,"test_aa","111111"); 45 | List accountInfoList = accountInfoServerImpl.selectByName(name); 46 | modelMap.addAttribute("accountList", accountInfoList); 47 | System.out.println(getFromCache(cache,"test_aa")); 48 | return "userinfo/accountInfo"; 49 | 50 | } 51 | @RequestMapping("/messageInfo") 52 | public String messageInfo(String title, ModelMap modelMap) { 53 | 54 | MessageInfo messageInfo = new MessageInfo(); 55 | messageInfo.setMsgInfo("hello world !"); 56 | messageInfo.setTitle(title); 57 | messageInfo.setMsgType("1"); 58 | 59 | msgInfoRepository.save(messageInfo); 60 | modelMap.addAttribute("test_mongodb", msgInfoRepository.queryMsgInfoByTitle("cwenao").toString()); 61 | 62 | return "userinfo/accountInfo"; 63 | 64 | } 65 | 66 | } 67 | 68 | -------------------------------------------------------------------------------- /feign-server-bootcwenao/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'org.springframework.boot' 2 | 3 | dependencyManagement { 4 | imports { 5 | mavenBom "org.springframework.cloud:spring-cloud-dependencies:" + springCloudVersion 6 | mavenBom "org.springframework.boot:spring-boot-starter:"+ springBootVersion 7 | } 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | dependencies { 15 | 16 | compile ('org.springframework.cloud:spring-cloud-starter-feign') 17 | compile('org.springframework.cloud:spring-cloud-starter-eureka') 18 | compile('org.springframework.cloud:spring-cloud-starter-hystrix') 19 | 20 | compile ('org.springframework.boot:spring-boot-starter-web') 21 | 22 | compile('org.springframework.boot:spring-boot-starter-log4j2') 23 | compile ('org.springframework.boot:spring-boot-starter-thymeleaf') 24 | 25 | compile('org.apache.logging.log4j:log4j-1.2-api:'+ log4jAPIVersion) 26 | compile ('net.sourceforge.nekohtml:nekohtml:'+nekoHtmlVersion) 27 | 28 | compile ('org.apache.httpcomponents:httpclient:'+ httpclientVersion) 29 | compile ('com.netflix.feign:feign-httpclient:'+ feignHttpclientVersion) 30 | 31 | // freemarker 32 | //compile ('org.springframework.boot:spring-boot-starter-freemarker') 33 | 34 | //JSP 35 | //compile ('org.springframework.boot:spring-boot-starter-tomcat') 36 | //compile ('org.apache.tomcat.embed:tomcat-embed-jasper') 37 | //compile ('javax.servlet:jstl') 38 | 39 | 40 | //kafka 41 | // compile ('org.springframework.boot:spring-boot-starter-integration') 42 | // compile ('org.springframework.integration:spring-integration-kafka:'+ springIntegrationKafkaVersion) 43 | compile ('org.springframework.integration:spring-integration-core:'+ springKafkaCoreVersion) 44 | compile ('org.springframework.kafka:spring-kafka:'+springKafkaVersion) 45 | 46 | //swagger2 47 | 48 | compile ('io.springfox:springfox-swagger2:'+swagger2Version) 49 | compile ('io.springfox:springfox-swagger-ui:'+swagger2Version) 50 | 51 | 52 | testCompile ('org.springframework.boot:spring-boot-starter-test') 53 | testCompile group: 'junit', name: 'junit', version: '4.11' 54 | } 55 | 56 | configurations { 57 | all*.exclude module: 'spring-boot-starter-logging' 58 | all*.exclude module: 'logback-classic' 59 | all*.exclude module: 'log4j-over-slf4j' 60 | all*.exclude module: 'snappy-java' 61 | } 62 | 63 | jar { 64 | baseName = 'feignserver-bootcwenao' 65 | } -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/pojo/MessageInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.pojo; 6 | 7 | import org.springframework.data.annotation.Id; 8 | 9 | /** 10 | * @author cwenao 11 | * @version $Id MessageInfo.java, v 0.1 2017-01-30 12:29 cwenao Exp $$ 12 | */ 13 | public class MessageInfo { 14 | 15 | @Id 16 | private String id; 17 | 18 | private String title; 19 | 20 | private String msgType; 21 | 22 | private String msgInfo; 23 | 24 | /** 25 | * Getter method for property id. 26 | * 27 | * @return property value of id 28 | */ 29 | 30 | public String getId() { 31 | return id; 32 | } 33 | 34 | /** 35 | * Setter method for property id. 36 | * 37 | * @param id value to be assigned to property id 38 | */ 39 | public void setId(String id) { 40 | this.id = id; 41 | } 42 | 43 | /** 44 | * Getter method for property title. 45 | * 46 | * @return property value of title 47 | */ 48 | 49 | public String getTitle() { 50 | return title; 51 | } 52 | 53 | /** 54 | * Setter method for property title. 55 | * 56 | * @param title value to be assigned to property title 57 | */ 58 | public void setTitle(String title) { 59 | this.title = title; 60 | } 61 | 62 | /** 63 | * Getter method for property msgType. 64 | * 65 | * @return property value of msgType 66 | */ 67 | 68 | public String getMsgType() { 69 | return msgType; 70 | } 71 | 72 | /** 73 | * Setter method for property msgType. 74 | * 75 | * @param msgType value to be assigned to property msgType 76 | */ 77 | public void setMsgType(String msgType) { 78 | this.msgType = msgType; 79 | } 80 | 81 | /** 82 | * Getter method for property msgInfo. 83 | * 84 | * @return property value of msgInfo 85 | */ 86 | 87 | public String getMsgInfo() { 88 | return msgInfo; 89 | } 90 | 91 | /** 92 | * Setter method for property msgInfo. 93 | * 94 | * @param msgInfo value to be assigned to property msgInfo 95 | */ 96 | public void setMsgInfo(String msgInfo) { 97 | this.msgInfo = msgInfo; 98 | } 99 | 100 | @Override 101 | public String toString() { 102 | return "[ id ="+id+", title ="+title+", msgInfo="+msgInfo+" ]"; 103 | } 104 | } 105 | 106 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.config; 6 | 7 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 8 | import com.fasterxml.jackson.annotation.PropertyAccessor; 9 | import com.fasterxml.jackson.databind.ObjectMapper; 10 | import org.springframework.cache.CacheManager; 11 | import org.springframework.cache.annotation.CachingConfigurerSupport; 12 | import org.springframework.cache.annotation.EnableCaching; 13 | import org.springframework.context.annotation.Bean; 14 | import org.springframework.context.annotation.Configuration; 15 | import org.springframework.data.redis.cache.RedisCacheManager; 16 | import org.springframework.data.redis.connection.RedisConnectionFactory; 17 | import org.springframework.data.redis.core.RedisTemplate; 18 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 19 | import org.springframework.data.redis.serializer.RedisSerializer; 20 | import org.springframework.data.redis.serializer.StringRedisSerializer; 21 | 22 | /** 23 | * @author cwenao 24 | * @version $Id RedisConfig.java, v 0.1 2017-01-29 15:17 cwenao Exp $$ 25 | */ 26 | @Configuration 27 | @EnableCaching 28 | public class RedisConfig extends CachingConfigurerSupport{ 29 | 30 | @Bean(name="redisTemplate") 31 | public RedisTemplate redisTemplate(RedisConnectionFactory factory) { 32 | 33 | RedisTemplate template = new RedisTemplate<>(); 34 | 35 | 36 | RedisSerializer redisSerializer = new StringRedisSerializer(); 37 | 38 | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); 39 | ObjectMapper om = new ObjectMapper(); 40 | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); 41 | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); 42 | jackson2JsonRedisSerializer.setObjectMapper(om); 43 | 44 | template.setConnectionFactory(factory); 45 | //key序列化方式 46 | template.setKeySerializer(redisSerializer); 47 | //value序列化 48 | template.setValueSerializer(jackson2JsonRedisSerializer); 49 | //value hashmap序列化 50 | template.setHashValueSerializer(jackson2JsonRedisSerializer); 51 | 52 | return template; 53 | } 54 | 55 | @Bean 56 | public CacheManager cacheManager(@SuppressWarnings("rawtypes")RedisTemplate redisTemplate) { 57 | 58 | RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate); 59 | cacheManager.setDefaultExpiration(3000); 60 | return cacheManager; 61 | } 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/config/RedisConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver.config; 6 | 7 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 8 | import com.fasterxml.jackson.annotation.PropertyAccessor; 9 | import com.fasterxml.jackson.databind.ObjectMapper; 10 | import org.springframework.boot.autoconfigure.AutoConfigureAfter; 11 | import org.springframework.cache.CacheManager; 12 | import org.springframework.cache.annotation.CachingConfigurerSupport; 13 | import org.springframework.cache.annotation.EnableCaching; 14 | import org.springframework.context.annotation.Bean; 15 | import org.springframework.context.annotation.Configuration; 16 | import org.springframework.data.redis.cache.RedisCacheManager; 17 | import org.springframework.data.redis.connection.RedisConnectionFactory; 18 | import org.springframework.data.redis.core.RedisTemplate; 19 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 20 | import org.springframework.data.redis.serializer.RedisSerializer; 21 | import org.springframework.data.redis.serializer.StringRedisSerializer; 22 | 23 | /** 24 | * @author cwenao 25 | * @version $Id RedisConfig.java, v 0.1 2017-01-29 15:17 cwenao Exp $$ 26 | */ 27 | @Configuration 28 | @EnableCaching 29 | @AutoConfigureAfter({DataConfig.class,MybatisConfig.class}) 30 | public class RedisConfig extends CachingConfigurerSupport{ 31 | 32 | @Bean(name="redisTemplate") 33 | public RedisTemplate redisTemplate(RedisConnectionFactory factory) { 34 | 35 | RedisTemplate template = new RedisTemplate<>(); 36 | 37 | 38 | RedisSerializer redisSerializer = new StringRedisSerializer(); 39 | 40 | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); 41 | ObjectMapper om = new ObjectMapper(); 42 | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); 43 | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); 44 | jackson2JsonRedisSerializer.setObjectMapper(om); 45 | 46 | template.setConnectionFactory(factory); 47 | //key序列化方式 48 | template.setKeySerializer(redisSerializer); 49 | //value序列化 50 | template.setValueSerializer(jackson2JsonRedisSerializer); 51 | //value hashmap序列化 52 | template.setHashValueSerializer(jackson2JsonRedisSerializer); 53 | 54 | return template; 55 | } 56 | 57 | @Bean 58 | public CacheManager cacheManager(@SuppressWarnings("rawtypes")RedisTemplate redisTemplate) { 59 | 60 | RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate); 61 | cacheManager.setDefaultExpiration(3000); 62 | return cacheManager; 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/config/MybatisConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver.config; 6 | 7 | import org.apache.ibatis.session.SqlSessionFactory; 8 | import org.mybatis.spring.SqlSessionFactoryBean; 9 | import org.mybatis.spring.annotation.MapperScan; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.boot.autoconfigure.AutoConfigureAfter; 12 | import org.springframework.boot.bind.RelaxedPropertyResolver; 13 | import org.springframework.context.EnvironmentAware; 14 | import org.springframework.context.annotation.Bean; 15 | import org.springframework.context.annotation.Configuration; 16 | import org.springframework.core.env.Environment; 17 | import org.springframework.core.io.DefaultResourceLoader; 18 | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; 19 | import org.springframework.core.io.support.ResourcePatternResolver; 20 | import org.springframework.jdbc.datasource.DataSourceTransactionManager; 21 | import org.springframework.transaction.PlatformTransactionManager; 22 | import org.springframework.transaction.annotation.EnableTransactionManagement; 23 | 24 | import javax.sql.DataSource; 25 | 26 | /** 27 | * @author cwenao 28 | * @version $Id MybatisConfig.java, v 0.1 2017-01-24 17:38 cwenao Exp $$ 29 | */ 30 | @Configuration 31 | @EnableTransactionManagement 32 | @AutoConfigureAfter({DataConfig.class}) 33 | @MapperScan(basePackages = {"com.bootcwenao.esserver.mapper"}) 34 | public class MybatisConfig implements EnvironmentAware { 35 | 36 | 37 | @Autowired 38 | DataSource dataSource; 39 | 40 | private RelaxedPropertyResolver propertyResolver; 41 | 42 | @Bean(name = "sqlSessionFactory") 43 | public SqlSessionFactory sqlSessionFactoryBean() { 44 | try { 45 | ResourcePatternResolver resourcePatternResolver; 46 | resourcePatternResolver = new PathMatchingResourcePatternResolver(); 47 | 48 | SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); 49 | bean.setDataSource(dataSource); 50 | bean.setTypeAliasesPackage(propertyResolver.getProperty("typeAliasesPackage")); 51 | bean.setMapperLocations(resourcePatternResolver.getResources(propertyResolver.getProperty("mapper-locations"))); 52 | bean.setConfigLocation(new DefaultResourceLoader().getResource(propertyResolver.getProperty("configLocation"))); 53 | 54 | return bean.getObject(); 55 | 56 | } catch (Exception e) { 57 | e.printStackTrace(); 58 | return null; 59 | } 60 | } 61 | 62 | @Bean 63 | public PlatformTransactionManager platformTransactionManager() { 64 | return new DataSourceTransactionManager(dataSource); 65 | } 66 | 67 | /** 68 | * Set the {@code Environment} that this object runs in. 69 | * 70 | * @param environment 71 | */ 72 | @Override 73 | public void setEnvironment(Environment environment) { 74 | this.propertyResolver = new RelaxedPropertyResolver(environment,"mybatis."); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/config/MybatisConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.dbserver.config; 6 | 7 | import org.apache.ibatis.session.SqlSessionFactory; 8 | import org.mybatis.spring.SqlSessionFactoryBean; 9 | import org.mybatis.spring.annotation.MapperScan; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.boot.autoconfigure.AutoConfigureAfter; 12 | import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration; 13 | import org.springframework.boot.bind.RelaxedPropertyResolver; 14 | import org.springframework.context.EnvironmentAware; 15 | import org.springframework.context.annotation.Bean; 16 | import org.springframework.context.annotation.Configuration; 17 | import org.springframework.core.env.Environment; 18 | import org.springframework.core.io.DefaultResourceLoader; 19 | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; 20 | import org.springframework.core.io.support.ResourcePatternResolver; 21 | import org.springframework.jdbc.datasource.DataSourceTransactionManager; 22 | import org.springframework.transaction.PlatformTransactionManager; 23 | import org.springframework.transaction.annotation.EnableTransactionManagement; 24 | 25 | import javax.sql.DataSource; 26 | 27 | /** 28 | * @author cwenao 29 | * @version $Id MybatisConfig.java, v 0.1 2017-01-24 17:38 cwenao Exp $$ 30 | */ 31 | @Configuration 32 | @EnableTransactionManagement 33 | @AutoConfigureAfter({DataConfig.class}) 34 | @MapperScan(basePackages = {"com.bootcwenao.dbserver.mapper"}) 35 | public class MybatisConfig implements EnvironmentAware { 36 | 37 | 38 | @Autowired 39 | DataSource dataSource; 40 | 41 | private RelaxedPropertyResolver propertyResolver; 42 | 43 | @Bean(name = "sqlSessionFactory") 44 | public SqlSessionFactory sqlSessionFactoryBean() { 45 | try { 46 | ResourcePatternResolver resourcePatternResolver; 47 | resourcePatternResolver = new PathMatchingResourcePatternResolver(); 48 | 49 | SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); 50 | bean.setDataSource(dataSource); 51 | bean.setTypeAliasesPackage(propertyResolver.getProperty("typeAliasesPackage")); 52 | bean.setMapperLocations(resourcePatternResolver.getResources(propertyResolver.getProperty("mapper-locations"))); 53 | bean.setConfigLocation(new DefaultResourceLoader().getResource(propertyResolver.getProperty("configLocation"))); 54 | 55 | return bean.getObject(); 56 | 57 | } catch (Exception e) { 58 | e.printStackTrace(); 59 | return null; 60 | } 61 | } 62 | 63 | @Bean 64 | public PlatformTransactionManager platformTransactionManager() { 65 | return new DataSourceTransactionManager(dataSource); 66 | } 67 | 68 | /** 69 | * Set the {@code Environment} that this object runs in. 70 | * 71 | * @param environment 72 | */ 73 | @Override 74 | public void setEnvironment(Environment environment) { 75 | this.propertyResolver = new RelaxedPropertyResolver(environment,"mybatis."); 76 | } 77 | 78 | 79 | } 80 | 81 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/utils/HumpNameOrMethodUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.utils; 6 | 7 | import org.springframework.util.StringUtils; 8 | 9 | import java.util.Arrays; 10 | import java.util.List; 11 | import java.util.Locale; 12 | 13 | /** 14 | * Transform the entity attribute hbase column attribute 15 | * @author cwenao 16 | * @version $Id HumpNameOrMethodUtils.java, v 0.1 2017-02-20 16:27 cwenao Exp $$ 17 | */ 18 | public class HumpNameOrMethodUtils { 19 | 20 | private final static String SEPARATOR_UNDER_SCORE = "_"; 21 | 22 | /** 23 | * 用驼峰命名法 将参数转换为Entity属性 24 | * @param var 25 | * @return 26 | */ 27 | public static String humpVarForEntity(String var) { 28 | 29 | if (StringUtils.isEmpty(var)) { 30 | return ""; 31 | } 32 | 33 | StringBuffer varBf = new StringBuffer(); 34 | 35 | var = var.replaceFirst(var.substring(0,1),var.substring(0,1).toLowerCase(Locale.US)); 36 | 37 | if (var.indexOf(SEPARATOR_UNDER_SCORE) > 0) { 38 | 39 | String[] underStr = var.split(SEPARATOR_UNDER_SCORE); 40 | 41 | for(int i =0; i implements Serializer 38 | 39 | @Value("${bootcwenao.kafka.binder.brokers}") 40 | private String brokers; 41 | 42 | @Value("${bootcwenao.kafka.group}") 43 | private String group; 44 | 45 | 46 | @Bean 47 | public KafkaListenerContainerFactory> kafkaListenerContainerFactory() { 48 | 49 | ConcurrentKafkaListenerContainerFactory factory = new ConcurrentKafkaListenerContainerFactory(); 50 | factory.setConsumerFactory(consumerFactory()); 51 | factory.setConcurrency(4); 52 | factory.getContainerProperties().setPollTimeout(4000); 53 | 54 | return factory; 55 | } 56 | 57 | @Bean 58 | public KafkaListeners kafkaListeners() { 59 | return new KafkaListeners(); 60 | } 61 | 62 | public ConsumerFactory consumerFactory() { 63 | 64 | Map properties = new HashMap(); 65 | 66 | properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, brokers); 67 | properties.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false); 68 | properties.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "100"); 69 | properties.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, "15000"); 70 | properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); 71 | properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class); 72 | properties.put(ConsumerConfig.GROUP_ID_CONFIG, group); 73 | properties.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest"); 74 | 75 | return new DefaultKafkaConsumerFactory(properties); 76 | 77 | } 78 | 79 | } 80 | 81 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/utils/EntityUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.utils; 6 | 7 | import java.io.Serializable; 8 | import java.lang.reflect.Field; 9 | import java.lang.reflect.InvocationTargetException; 10 | import java.lang.reflect.Method; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | /** 15 | * @author cwenao 16 | * @version $Id EntityUtils.java, v 0.1 2017-02-19 23:42 cwenao Exp $$ 17 | */ 18 | public abstract class EntityUtils{ 19 | 20 | /** 21 | * 删除Map中value为空值 22 | * @param map 23 | * @return 24 | */ 25 | public static Map removeEmptyForValues(Map map) { 26 | 27 | if (map == null) { 28 | return null; 29 | } 30 | 31 | for (Map.Entry entry : map.entrySet()) { 32 | if (entry.getValue() == null || entry.equals("")) { 33 | map.remove(entry.getKey()); 34 | } 35 | } 36 | 37 | return map; 38 | } 39 | 40 | /** 41 | * 删除map中key和value出现空的时候 42 | * @param map 43 | * @return 44 | */ 45 | public static Map removeEmptyForMap(Map map) { 46 | if (map == null) { 47 | return null; 48 | } 49 | 50 | for (Map.Entry entry : map.entrySet()) { 51 | 52 | if (entry.getKey() == null || entry.getKey().equals("")) { 53 | map.remove(entry.getKey()); 54 | continue; 55 | } 56 | 57 | if (entry.getValue() == null || entry.equals("")) { 58 | map.remove(entry.getKey()); 59 | } 60 | } 61 | 62 | return map; 63 | } 64 | 65 | /** 66 | * 将包含family-entity 转换为family-map 67 | * @param map 68 | * @return 69 | * @throws IllegalAccessException 70 | * @throws NoSuchMethodException 71 | * @throws InvocationTargetException 72 | */ 73 | public static Map transformEntity2Map(Map map) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException { 74 | 75 | if (map == null || map.size() < 1) { 76 | return null; 77 | } 78 | 79 | Map> entity2Map = new HashMap<>(); 80 | 81 | for (Map.Entry entry : map.entrySet()) { 82 | 83 | entity2Map.put(entry.getKey(), transformEntity(entry.getValue())); 84 | } 85 | 86 | return entity2Map; 87 | } 88 | 89 | /** 90 | * 将对象转换为Map 91 | * @param obj 92 | * @return 93 | * @throws IllegalAccessException 94 | * @throws NoSuchMethodException 95 | * @throws InvocationTargetException 96 | */ 97 | public static Map transformEntity(Object obj) throws IllegalAccessException, NoSuchMethodException, InvocationTargetException { 98 | Field[] fields = obj.getClass().getDeclaredFields(); 99 | Map tMap = new HashMap<>(); 100 | 101 | for (Field field : fields) { 102 | 103 | field.setAccessible(true); 104 | String name = field.getName().replaceFirst(field.getName().substring(0, 1),field.getName().substring(0, 1).toUpperCase()); 105 | 106 | Method method = obj.getClass().getMethod("get" + name); 107 | tMap.put(field.getName(), method.invoke(obj)); 108 | 109 | } 110 | return tMap; 111 | } 112 | } 113 | 114 | -------------------------------------------------------------------------------- /es-server-bootcwenao/src/main/java/com/bootcwenao/esserver/config/DataConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.esserver.config; 6 | 7 | import com.alibaba.druid.pool.DruidDataSource; 8 | import com.alibaba.druid.support.http.StatViewServlet; 9 | import com.alibaba.druid.support.http.WebStatFilter; 10 | import org.mybatis.spring.mapper.MapperScannerConfigurer; 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | import org.springframework.beans.factory.annotation.Value; 14 | import org.springframework.boot.context.embedded.FilterRegistrationBean; 15 | import org.springframework.boot.context.embedded.ServletRegistrationBean; 16 | import org.springframework.context.annotation.Bean; 17 | import org.springframework.context.annotation.Configuration; 18 | import org.springframework.transaction.annotation.EnableTransactionManagement; 19 | 20 | import javax.sql.DataSource; 21 | import java.sql.SQLException; 22 | 23 | /** 24 | * @author cwenao 25 | * @version $Id DataConfig.java, v 0.1 2017-01-24 17:43 cwenao Exp $$ 26 | */ 27 | 28 | @Configuration 29 | @EnableTransactionManagement 30 | public class DataConfig { 31 | Logger logger = LoggerFactory.getLogger(DataConfig.class); 32 | 33 | @Bean 34 | public ServletRegistrationBean druidServlet() { 35 | return new ServletRegistrationBean(new StatViewServlet(), "/druid/*"); 36 | } 37 | 38 | @Bean(name = "dataSource",initMethod = "init", destroyMethod = "close") 39 | public DataSource druidDataSource(@Value("${druid.datasource.driverClassName}") String driver, 40 | @Value("${druid.datasource.url}") String url, @Value("${druid.datasource.username}") String username, 41 | @Value("${druid.datasource.password}") String password, 42 | @Value("${druid.datasource.initialSize}") Integer initialSize, 43 | @Value("${druid.datasource.minIdle}") Integer minIdle, 44 | @Value("${druid.datasource.maxActive}") Integer maxActive) { 45 | DruidDataSource druidDataSource = new DruidDataSource(); 46 | druidDataSource.setDriverClassName(driver); 47 | druidDataSource.setUrl(url); 48 | druidDataSource.setUsername(username); 49 | druidDataSource.setPassword(password); 50 | druidDataSource.setValidationQuery("SELECT * FROM DUAL"); 51 | druidDataSource.setPoolPreparedStatements(false); 52 | try { 53 | druidDataSource.setFilters("stat"); 54 | } catch (SQLException e1) { 55 | logger.error("setFilters error", e1); 56 | } 57 | try { 58 | druidDataSource.setFilters("stat, wall"); 59 | } catch (SQLException e) { 60 | e.printStackTrace(); 61 | } 62 | return druidDataSource; 63 | } 64 | 65 | @Bean 66 | public MapperScannerConfigurer mapperScannerConfigurer() { 67 | MapperScannerConfigurer bean = new MapperScannerConfigurer(); 68 | bean.setBasePackage("com.bootcwenao.esserver.mapper"); 69 | return bean; 70 | } 71 | 72 | @Bean 73 | public FilterRegistrationBean filterRegistrationBean() { 74 | FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(); 75 | filterRegistrationBean.setFilter(new WebStatFilter()); 76 | filterRegistrationBean.addUrlPatterns("/*"); 77 | filterRegistrationBean.addInitParameter("exclusions", "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"); 78 | return filterRegistrationBean; 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /bigdata-bootcwenao/src/main/java/com/bootcwenao/bigdataserver/hbase/handler/HbaseFindBuilder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Company 3 | * Copyright (C) 2014-2017 All Rights Reserved. 4 | */ 5 | package com.bootcwenao.bigdataserver.hbase.handler; 6 | 7 | import com.bootcwenao.bigdataserver.utils.HumpNameOrMethodUtils; 8 | import org.apache.hadoop.hbase.client.Result; 9 | import org.apache.hadoop.hbase.util.Bytes; 10 | import org.springframework.beans.BeanUtils; 11 | import org.springframework.beans.BeanWrapper; 12 | import org.springframework.beans.PropertyAccessorFactory; 13 | import org.springframework.util.CollectionUtils; 14 | import org.springframework.util.StringUtils; 15 | 16 | import java.beans.PropertyDescriptor; 17 | import java.util.HashMap; 18 | import java.util.HashSet; 19 | import java.util.Map; 20 | import java.util.Set; 21 | 22 | /** 23 | * 按qualifier返回结果 24 | * @author cwenao 25 | * @version $Id HbaseFindBuilder.java, v 0.1 2017-02-20 16:05 cwenao Exp $$ 26 | */ 27 | public class HbaseFindBuilder { 28 | 29 | private String family; 30 | 31 | private Result result; 32 | 33 | private String qualifier; 34 | 35 | private Map fieldsMap; 36 | 37 | private Set propertiesSet; 38 | 39 | private Set qualifierSet; 40 | 41 | private BeanWrapper beanWrapper; 42 | 43 | private T tBean; 44 | 45 | /** 46 | * 按family查询 47 | * @param family 48 | * @param result 49 | * @param tclazz 50 | */ 51 | public HbaseFindBuilder(String family, Result result, Class tclazz) { 52 | 53 | this.family = family; 54 | this.result = result; 55 | fieldsMap = new HashMap(); 56 | propertiesSet = new HashSet<>(); 57 | 58 | reflectBean(tclazz); 59 | 60 | } 61 | 62 | /** 63 | * return the result by qulifier 64 | * @param qualifier 65 | * @return 66 | */ 67 | public HbaseFindBuilder build(String qualifier) { 68 | 69 | return this.build(qualifier,""); 70 | } 71 | 72 | /** 73 | * by multiple qualifier 74 | * @param qualifiers 75 | * @return 76 | */ 77 | public HbaseFindBuilder build(String... qualifiers) { 78 | 79 | if (qualifiers == null || qualifiers.length == 0) { 80 | return this; 81 | } 82 | PropertyDescriptor p = null; 83 | byte[] qualifierByte = null; 84 | 85 | for (String qualifier : qualifiers) { 86 | if (StringUtils.isEmpty(qualifier)) { 87 | continue; 88 | } 89 | p = fieldsMap.get(qualifier.trim()); 90 | qualifierByte = result.getValue(family.getBytes(), HumpNameOrMethodUtils.humpEntityForVar(qualifier).getBytes()); 91 | if (qualifierByte != null && qualifierByte.length > 0) { 92 | beanWrapper.setPropertyValue(p.getName(),Bytes.toString(qualifierByte)); 93 | propertiesSet.add(p.getName()); 94 | } 95 | } 96 | 97 | return this; 98 | } 99 | 100 | /** 101 | * by map 102 | * @param map 103 | * @return 104 | */ 105 | public HbaseFindBuilder build(Map map) { 106 | 107 | if (map == null || map.size() <= 0) { 108 | return this; 109 | } 110 | 111 | PropertyDescriptor p = null; 112 | byte[] qualifierByte = null; 113 | 114 | for (String value : map.values()) { 115 | if (StringUtils.isEmpty(value)) { 116 | continue; 117 | } 118 | 119 | p = fieldsMap.get(value.trim()); 120 | qualifierByte = result.getValue(family.getBytes(), HumpNameOrMethodUtils.humpEntityForVar(value).getBytes()); 121 | 122 | if (qualifierByte != null && qualifierByte.length > 0) { 123 | beanWrapper.setPropertyValue(p.getName(), Bytes.toString(qualifierByte)); 124 | propertiesSet.add(p.getName()); 125 | } 126 | } 127 | 128 | return this; 129 | } 130 | 131 | private void reflectBean(Class tclazz) { 132 | 133 | tBean = BeanUtils.instantiate(tclazz); 134 | 135 | PropertyDescriptor[] propertyDescriptors = BeanUtils.getPropertyDescriptors(tclazz); 136 | 137 | for (PropertyDescriptor p : propertyDescriptors) { 138 | if (p.getWriteMethod() != null) { 139 | this.fieldsMap.put(p.getName(), p); 140 | } 141 | } 142 | 143 | beanWrapper = PropertyAccessorFactory.forBeanPropertyAccess(tBean); 144 | } 145 | 146 | public T fetch() { 147 | if (!CollectionUtils.isEmpty(propertiesSet)) { 148 | return this.tBean; 149 | } 150 | return null; 151 | } 152 | 153 | } 154 | 155 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/java/com/bootcwenao/dbserver/pojo/AccountInfo.java: -------------------------------------------------------------------------------- 1 | package com.bootcwenao.dbserver.pojo; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | /** 7 | * 自动生成 8 | */ 9 | public class AccountInfo implements Serializable { 10 | /** 11 | * account_info.id 12 | * @author: cwenao 13 | * @time: 2016-10-31 10:10:15 14 | */ 15 | private String id; 16 | 17 | /** 18 | * account_info.account_name (用户名) 19 | * @author: cwenao 20 | * @time: 2016-10-31 10:10:15 21 | */ 22 | private String accountName; 23 | 24 | /** 25 | * account_info.nick_name (昵称) 26 | * @author: cwenao 27 | * @time: 2016-10-31 10:10:15 28 | */ 29 | private String nickName; 30 | 31 | /** 32 | * account_info.mail (邮箱) 33 | * @author: cwenao 34 | * @time: 2016-10-31 10:10:15 35 | */ 36 | private String mail; 37 | 38 | /** 39 | * account_info.m_tel (移动电话) 40 | * @author: cwenao 41 | * @time: 2016-10-31 10:10:15 42 | */ 43 | private String mTel; 44 | 45 | /** 46 | * account_info.land_tel (固定电话) 47 | * @author: cwenao 48 | * @time: 2016-10-31 10:10:15 49 | */ 50 | private String landTel; 51 | 52 | /** 53 | * account_info.is_vip 54 | * @author: cwenao 55 | * @time: 2016-10-31 10:10:15 56 | */ 57 | private Integer isVip; 58 | 59 | /** 60 | * account_info.password (密码) 61 | * @author: cwenao 62 | * @time: 2016-10-31 10:10:15 63 | */ 64 | private String password; 65 | 66 | /** 67 | * account_info.salt(盐值) 68 | * @author: 69 | * 70 | */ 71 | private String salt; 72 | 73 | /** 74 | * account_info.head_image (头像) 75 | * @author: cwenao 76 | * @time: 2016-10-31 10:10:15 77 | */ 78 | private String headImage; 79 | 80 | /** 81 | * account_info.back_image (背景图) 82 | * @author: cwenao 83 | * @time: 2016-10-31 10:10:15 84 | */ 85 | private String backImage; 86 | 87 | /** 88 | * account_info.account_type (账户类型:) 89 | * @author: cwenao 90 | * @time: 2016-10-31 10:10:15 91 | */ 92 | private Integer accountType; 93 | 94 | /** 95 | * account_info.source (注册来源:0 -- 网站注册; 1 -- 微信;2 -- qq;3--微博) 96 | * @author: cwenao 97 | * @time: 2016-10-31 10:10:15 98 | */ 99 | private Integer source; 100 | 101 | /** 102 | * account_info.audit_status 103 | * @author: cwenao 104 | * @time: 2016-10-31 10:10:15 105 | */ 106 | private Integer auditStatus; 107 | 108 | /** 109 | * account_info.create_time 110 | * @author: cwenao 111 | * @time: 2016-10-31 10:10:15 112 | */ 113 | private Date createTime; 114 | 115 | /** 116 | * account_info.update_time 117 | * @author: cwenao 118 | * @time: 2016-10-31 10:10:15 119 | */ 120 | private Date updateTime; 121 | 122 | /** 123 | * account_info.status 124 | * @author: cwenao 125 | * @time: 2016-10-31 10:10:15 126 | */ 127 | private Integer status; 128 | 129 | public String getId() { 130 | return id; 131 | } 132 | 133 | public void setId(String id) { 134 | this.id = id; 135 | } 136 | 137 | public String getAccountName() { 138 | return accountName; 139 | } 140 | 141 | public void setAccountName(String accountName) { 142 | this.accountName = accountName; 143 | } 144 | 145 | public String getNickName() { 146 | return nickName; 147 | } 148 | 149 | public void setNickName(String nickName) { 150 | this.nickName = nickName; 151 | } 152 | 153 | public String getMail() { 154 | return mail; 155 | } 156 | 157 | public void setMail(String mail) { 158 | this.mail = mail; 159 | } 160 | 161 | public String getmTel() { 162 | return mTel; 163 | } 164 | 165 | public void setmTel(String mTel) { 166 | this.mTel = mTel; 167 | } 168 | 169 | public String getLandTel() { 170 | return landTel; 171 | } 172 | 173 | public void setLandTel(String landTel) { 174 | this.landTel = landTel; 175 | } 176 | 177 | public Integer getIsVip() { 178 | return isVip; 179 | } 180 | 181 | public void setIsVip(Integer isVip) { 182 | this.isVip = isVip; 183 | } 184 | 185 | public String getPassword() { 186 | return password; 187 | } 188 | 189 | public void setPassword(String password) { 190 | this.password = password; 191 | } 192 | 193 | /** 194 | * Getter method for property salt. 195 | * 196 | * @return property value of salt 197 | */ 198 | 199 | public String getSalt() { 200 | return salt; 201 | } 202 | 203 | /** 204 | * Setter method for property salt. 205 | * 206 | * @param salt value to be assigned to property salt 207 | */ 208 | public void setSalt(String salt) { 209 | this.salt = salt; 210 | } 211 | 212 | public String getHeadImage() { 213 | return headImage; 214 | } 215 | 216 | public void setHeadImage(String headImage) { 217 | this.headImage = headImage; 218 | } 219 | 220 | public String getBackImage() { 221 | return backImage; 222 | } 223 | 224 | public void setBackImage(String backImage) { 225 | this.backImage = backImage; 226 | } 227 | 228 | public Integer getAccountType() { 229 | return accountType; 230 | } 231 | 232 | public void setAccountType(Integer accountType) { 233 | this.accountType = accountType; 234 | } 235 | 236 | public Integer getSource() { 237 | return source; 238 | } 239 | 240 | public void setSource(Integer source) { 241 | this.source = source; 242 | } 243 | 244 | public Integer getAuditStatus() { 245 | return auditStatus; 246 | } 247 | 248 | public void setAuditStatus(Integer auditStatus) { 249 | this.auditStatus = auditStatus; 250 | } 251 | 252 | public Date getCreateTime() { 253 | return createTime; 254 | } 255 | 256 | public void setCreateTime(Date createTime) { 257 | this.createTime = createTime; 258 | } 259 | 260 | public Date getUpdateTime() { 261 | return updateTime; 262 | } 263 | 264 | public void setUpdateTime(Date updateTime) { 265 | this.updateTime = updateTime; 266 | } 267 | 268 | public Integer getStatus() { 269 | return status; 270 | } 271 | 272 | public void setStatus(Integer status) { 273 | this.status = status; 274 | } 275 | } -------------------------------------------------------------------------------- /out/production/db-server-bootcwenao/com/bootcwenao/dbserver/mapper/AccountInfoMapper.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 | id, account_name, nick_name, mail, m_tel, land_tel, is_vip, `password`, salt, head_image, 25 | back_image, account_type, `source`, audit_status, create_time, update_time, `status` 26 | 27 | 33 | 34 | 40 | 41 | 42 | delete from account_info 43 | where id = #{id,jdbcType=VARCHAR} 44 | 45 | 46 | insert into account_info (id, account_name, nick_name, 47 | mail, m_tel, land_tel, 48 | is_vip, `password`, salt, 49 | head_image, back_image, account_type, 50 | `source`, audit_status, create_time, 51 | update_time, `status`) 52 | values (#{id,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR}, 53 | #{mail,jdbcType=VARCHAR}, #{mTel,jdbcType=VARCHAR}, #{landTel,jdbcType=VARCHAR}, 54 | #{isVip,jdbcType=INTEGER}, #{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR}, 55 | #{headImage,jdbcType=VARCHAR}, #{backImage,jdbcType=VARCHAR}, #{accountType,jdbcType=INTEGER}, 56 | #{source,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 57 | #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}) 58 | 59 | 60 | insert into account_info 61 | 62 | id, 63 | account_name, 64 | nick_name, 65 | mail, 66 | m_tel, 67 | land_tel, 68 | is_vip, 69 | `password`, 70 | salt, 71 | head_image, 72 | back_image, 73 | account_type, 74 | `source`, 75 | audit_status, 76 | create_time, 77 | update_time, 78 | `status`, 79 | 80 | 81 | #{id,jdbcType=VARCHAR}, 82 | #{accountName,jdbcType=VARCHAR}, 83 | #{nickName,jdbcType=VARCHAR}, 84 | #{mail,jdbcType=VARCHAR}, 85 | #{mTel,jdbcType=VARCHAR}, 86 | #{landTel,jdbcType=VARCHAR}, 87 | #{isVip,jdbcType=INTEGER}, 88 | #{password,jdbcType=VARCHAR}, 89 | #{salt,jdbcType=VARCHAR}, 90 | #{headImage,jdbcType=VARCHAR}, 91 | #{backImage,jdbcType=VARCHAR}, 92 | #{accountType,jdbcType=INTEGER}, 93 | #{source,jdbcType=INTEGER}, 94 | #{auditStatus,jdbcType=INTEGER}, 95 | #{createTime,jdbcType=TIMESTAMP}, 96 | #{updateTime,jdbcType=TIMESTAMP}, 97 | #{status,jdbcType=INTEGER}, 98 | 99 | 100 | 101 | update account_info 102 | 103 | 104 | account_name = #{accountName,jdbcType=VARCHAR}, 105 | 106 | 107 | nick_name = #{nickName,jdbcType=VARCHAR}, 108 | 109 | 110 | mail = #{mail,jdbcType=VARCHAR}, 111 | 112 | 113 | m_tel = #{mTel,jdbcType=VARCHAR}, 114 | 115 | 116 | land_tel = #{landTel,jdbcType=VARCHAR}, 117 | 118 | 119 | is_vip = #{isVip,jdbcType=INTEGER}, 120 | 121 | 122 | `password` = #{password,jdbcType=VARCHAR}, 123 | 124 | 125 | salt = #{salt,jdbcType=VARCHAR}, 126 | 127 | 128 | head_image = #{headImage,jdbcType=VARCHAR}, 129 | 130 | 131 | back_image = #{backImage,jdbcType=VARCHAR}, 132 | 133 | 134 | account_type = #{accountType,jdbcType=INTEGER}, 135 | 136 | 137 | `source` = #{source,jdbcType=INTEGER}, 138 | 139 | 140 | audit_status = #{auditStatus,jdbcType=INTEGER}, 141 | 142 | 143 | create_time = #{createTime,jdbcType=TIMESTAMP}, 144 | 145 | 146 | update_time = #{updateTime,jdbcType=TIMESTAMP}, 147 | 148 | 149 | `status` = #{status,jdbcType=INTEGER}, 150 | 151 | 152 | where id = #{id,jdbcType=VARCHAR} 153 | 154 | 155 | update account_info 156 | set account_name = #{accountName,jdbcType=VARCHAR}, 157 | nick_name = #{nickName,jdbcType=VARCHAR}, 158 | mail = #{mail,jdbcType=VARCHAR}, 159 | m_tel = #{mTel,jdbcType=VARCHAR}, 160 | land_tel = #{landTel,jdbcType=VARCHAR}, 161 | is_vip = #{isVip,jdbcType=INTEGER}, 162 | `password` = #{password,jdbcType=VARCHAR}, 163 | salt = #{salt,jdbcType=VARCHAR}, 164 | head_image = #{headImage,jdbcType=VARCHAR}, 165 | back_image = #{backImage,jdbcType=VARCHAR}, 166 | account_type = #{accountType,jdbcType=INTEGER}, 167 | `source` = #{source,jdbcType=INTEGER}, 168 | audit_status = #{auditStatus,jdbcType=INTEGER}, 169 | create_time = #{createTime,jdbcType=TIMESTAMP}, 170 | update_time = #{updateTime,jdbcType=TIMESTAMP}, 171 | `status` = #{status,jdbcType=INTEGER} 172 | where id = #{id,jdbcType=VARCHAR} 173 | 174 | -------------------------------------------------------------------------------- /db-server-bootcwenao/src/main/resources/com/bootcwenao/dbserver/mapper/AccountInfoMapper.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 | id, account_name, nick_name, mail, m_tel, land_tel, is_vip, `password`, salt, head_image, 25 | back_image, account_type, `source`, audit_status, create_time, update_time, `status` 26 | 27 | 33 | 34 | 40 | 41 | 42 | delete from account_info 43 | where id = #{id,jdbcType=VARCHAR} 44 | 45 | 46 | insert into account_info (id, account_name, nick_name, 47 | mail, m_tel, land_tel, 48 | is_vip, `password`, salt, 49 | head_image, back_image, account_type, 50 | `source`, audit_status, create_time, 51 | update_time, `status`) 52 | values (#{id,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, #{nickName,jdbcType=VARCHAR}, 53 | #{mail,jdbcType=VARCHAR}, #{mTel,jdbcType=VARCHAR}, #{landTel,jdbcType=VARCHAR}, 54 | #{isVip,jdbcType=INTEGER}, #{password,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR}, 55 | #{headImage,jdbcType=VARCHAR}, #{backImage,jdbcType=VARCHAR}, #{accountType,jdbcType=INTEGER}, 56 | #{source,jdbcType=INTEGER}, #{auditStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 57 | #{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}) 58 | 59 | 60 | insert into account_info 61 | 62 | id, 63 | account_name, 64 | nick_name, 65 | mail, 66 | m_tel, 67 | land_tel, 68 | is_vip, 69 | `password`, 70 | salt, 71 | head_image, 72 | back_image, 73 | account_type, 74 | `source`, 75 | audit_status, 76 | create_time, 77 | update_time, 78 | `status`, 79 | 80 | 81 | #{id,jdbcType=VARCHAR}, 82 | #{accountName,jdbcType=VARCHAR}, 83 | #{nickName,jdbcType=VARCHAR}, 84 | #{mail,jdbcType=VARCHAR}, 85 | #{mTel,jdbcType=VARCHAR}, 86 | #{landTel,jdbcType=VARCHAR}, 87 | #{isVip,jdbcType=INTEGER}, 88 | #{password,jdbcType=VARCHAR}, 89 | #{salt,jdbcType=VARCHAR}, 90 | #{headImage,jdbcType=VARCHAR}, 91 | #{backImage,jdbcType=VARCHAR}, 92 | #{accountType,jdbcType=INTEGER}, 93 | #{source,jdbcType=INTEGER}, 94 | #{auditStatus,jdbcType=INTEGER}, 95 | #{createTime,jdbcType=TIMESTAMP}, 96 | #{updateTime,jdbcType=TIMESTAMP}, 97 | #{status,jdbcType=INTEGER}, 98 | 99 | 100 | 101 | update account_info 102 | 103 | 104 | account_name = #{accountName,jdbcType=VARCHAR}, 105 | 106 | 107 | nick_name = #{nickName,jdbcType=VARCHAR}, 108 | 109 | 110 | mail = #{mail,jdbcType=VARCHAR}, 111 | 112 | 113 | m_tel = #{mTel,jdbcType=VARCHAR}, 114 | 115 | 116 | land_tel = #{landTel,jdbcType=VARCHAR}, 117 | 118 | 119 | is_vip = #{isVip,jdbcType=INTEGER}, 120 | 121 | 122 | `password` = #{password,jdbcType=VARCHAR}, 123 | 124 | 125 | salt = #{salt,jdbcType=VARCHAR}, 126 | 127 | 128 | head_image = #{headImage,jdbcType=VARCHAR}, 129 | 130 | 131 | back_image = #{backImage,jdbcType=VARCHAR}, 132 | 133 | 134 | account_type = #{accountType,jdbcType=INTEGER}, 135 | 136 | 137 | `source` = #{source,jdbcType=INTEGER}, 138 | 139 | 140 | audit_status = #{auditStatus,jdbcType=INTEGER}, 141 | 142 | 143 | create_time = #{createTime,jdbcType=TIMESTAMP}, 144 | 145 | 146 | update_time = #{updateTime,jdbcType=TIMESTAMP}, 147 | 148 | 149 | `status` = #{status,jdbcType=INTEGER}, 150 | 151 | 152 | where id = #{id,jdbcType=VARCHAR} 153 | 154 | 155 | update account_info 156 | set account_name = #{accountName,jdbcType=VARCHAR}, 157 | nick_name = #{nickName,jdbcType=VARCHAR}, 158 | mail = #{mail,jdbcType=VARCHAR}, 159 | m_tel = #{mTel,jdbcType=VARCHAR}, 160 | land_tel = #{landTel,jdbcType=VARCHAR}, 161 | is_vip = #{isVip,jdbcType=INTEGER}, 162 | `password` = #{password,jdbcType=VARCHAR}, 163 | salt = #{salt,jdbcType=VARCHAR}, 164 | head_image = #{headImage,jdbcType=VARCHAR}, 165 | back_image = #{backImage,jdbcType=VARCHAR}, 166 | account_type = #{accountType,jdbcType=INTEGER}, 167 | `source` = #{source,jdbcType=INTEGER}, 168 | audit_status = #{auditStatus,jdbcType=INTEGER}, 169 | create_time = #{createTime,jdbcType=TIMESTAMP}, 170 | update_time = #{updateTime,jdbcType=TIMESTAMP}, 171 | `status` = #{status,jdbcType=INTEGER} 172 | where id = #{id,jdbcType=VARCHAR} 173 | 174 | --------------------------------------------------------------------------------