├── README.md ├── cloudE-admin-server ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── cloudE │ │ └── monitor │ │ └── server │ │ └── SpringBootAdminApplication.java │ └── resources │ ├── config │ ├── application-default.properties │ ├── application-dev.properties │ ├── application-pro.properties │ ├── application-qa.properties │ └── application.yml │ └── logback-spring.xml ├── cloudE-common ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── cloudE │ └── dto │ └── BaseResult.java ├── cloudE-config-server ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── cloud │ │ └── config │ │ └── server │ │ └── ConfigServerApplication.java │ └── resources │ ├── config │ └── application.yml │ ├── logback-spring.xml │ └── properties │ ├── cloud-config-dev.properties │ ├── cloud-config-local.properties │ ├── cloud-config-production.properties │ └── cloud-config-qa.properties ├── cloudE-eureka-server ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── cloudE │ │ └── eureka │ │ └── server │ │ └── EurekaServerApplication.java │ └── resources │ ├── config │ └── application.yml │ └── logback.xml ├── cloudE-gateway-server ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── cloudE │ │ └── zuul │ │ └── server │ │ ├── GatewayServerApplication.java │ │ ├── filter │ │ └── AccessFilter.java │ │ └── prometheus │ │ └── MetricsConfiguration.java │ └── resources │ ├── config │ ├── application-default.properties │ ├── application-dev.properties │ ├── application-pro.properties │ ├── application-qa.properties │ └── application.yml │ └── logback.xml ├── cloudE-hystrix-dashboard-server ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── cloudE │ │ └── hystrix │ │ └── dashboard │ │ └── HystrixDashboardApplication.java │ └── resources │ ├── config │ ├── application-default.properties │ ├── application-dev.properties │ ├── application-pro.properties │ ├── application-qa.properties │ └── application.yml │ └── logback.xml ├── cloudE-mapper ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── cloudE │ │ ├── entity │ │ ├── User.java │ │ └── UserExample.java │ │ └── mapper │ │ └── UserMapper.java │ └── resources │ ├── create.sql │ ├── generatorConfig.xml │ └── mapper │ └── UserMapper.xml ├── cloudE-pay-api ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── cloudE │ └── pay │ └── client │ └── ApplePayClient.java ├── cloudE-pay-provider ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── com │ │ └── cloudE │ │ ├── PayProviderApplication.java │ │ ├── Swagger2.java │ │ └── pay │ │ ├── prometheus │ │ └── MetricsConfiguration.java │ │ ├── provider │ │ └── ApplePayProvider.java │ │ └── redis │ │ ├── RedisConfig.java │ │ └── RedisService.java │ └── resources │ ├── config │ ├── application-default.properties │ ├── application-dev.properties │ ├── application-pro.properties │ ├── application-qa.properties │ └── application.yml │ └── logback.xml ├── cloudE-turbine-server ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── cloudE │ │ └── turbine │ │ └── server │ │ └── TurbineServerApplication.java │ └── resources │ ├── config │ ├── application-default.properties │ ├── application-dev.properties │ ├── application-pro.properties │ ├── application-qa.properties │ └── application.yml │ └── logback.xml ├── cloudE-ucenter-provider ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── com │ │ └── cloudE │ │ ├── Swagger2.java │ │ ├── UserProviderApplication.java │ │ ├── prometheus │ │ └── MetricsConfiguration.java │ │ └── ucenter │ │ ├── manager │ │ └── UserManager.java │ │ ├── provider │ │ └── RechargeProvider.java │ │ └── task │ │ └── UCenterTask.java │ └── resources │ ├── config │ ├── application-default.properties │ ├── application-dev.properties │ ├── application-pro.properties │ ├── application-qa.properties │ └── application.yml │ └── logback.xml ├── cloudE-zipkin-server ├── pom.xml └── src │ └── main │ ├── docker │ └── Dockerfile │ ├── java │ └── cloudE │ │ └── zipkin │ │ └── server │ │ └── ZipkinServerApplication.java │ └── resources │ ├── config │ ├── application-default.properties │ ├── application-dev.properties │ ├── application-pro.properties │ ├── application-qa.properties │ └── application.yml │ └── logback.xml ├── pom.xml └── project-bootstrap ├── grafana.png ├── hystrix.png ├── prometheus.png ├── spring-boot-admin.png ├── ucenterTask.png └── zipkin1.png /README.md: -------------------------------------------------------------------------------- 1 | ## 项目介绍 2 | 3 |   基于spring cloud的分布式系统架构。提供整套的微服务组件,包括服务发现、服务治理、链路追踪、服务监控等。所有服务均支持在docker中运行。 4 | 5 | 6 | ### 组织结构 7 | 8 | ``` lua 9 | cloudE 10 | ├── cloudE-eureka-server -- 服务发现 11 | ├── cloudE-config-server -- 分布式配置中心 12 | ├── cloudE-admin-server -- 服务监控 13 | ├── cloudE-gateway-server -- zuul网关 14 | ├── cloudE-hystrix-dashboard-server -- hystrix仪表盘 15 | ├── cloudE-turbine-server -- hystrix仪表盘聚合服务 16 | ├── cloudE-zipkin-server -- 链路监控 17 | ├── cloudE-pay-api -- 支付服务api,提供feign接口 18 | ├── cloudE-pay-provider -- 支付服务 19 | ├── cloudE-ucenter-provider -- 用户中心 20 | ├── cloudE-mapper -- mybatis生成模块 21 | ├── cloudE-common 公共模块、工具类等 22 | ``` 23 | 24 | ### 技术选型 25 | 26 | 技术 | 说明 | 官网 27 | ----|------|---- 28 | Spring cloud eureka | 云端服务发现,一个基于 REST 的服务,用于定位服务,以实现云端中间层服务发现和故障转移。 | [https://projects.spring.io/spring-cloud/](https://projects.spring.io/spring-cloud/) 29 | Spring cloud config server | 让你可以把配置放到远程服务器,集中化管理集群配置,目前支持本地存储、Git以及Subversion | [https://projects.spring.io/spring-cloud/](https://projects.spring.io/spring-cloud/) 30 | Spring cloud zuul | Zuul 是在云平台上提供动态路由,监控,弹性,安全等边缘服务的框架 | [https://projects.spring.io/spring-cloud/](https://projects.spring.io/spring-cloud/) 31 | Spring Cloud Sleuth | 日志收集工具包,封装了Dapper和log-based追踪以及Zipkin和HTrace操作,为SpringCloud应用实现了一种分布式追踪解决方案。 | [https://projects.spring.io/spring-cloud/](https://projects.spring.io/spring-cloud/) 32 | Spring boot admin | 服务监控 | [http://projects.spring.io/spring-boot/](http://projects.spring.io/spring-boot/) 33 | Hystrix | 熔断器,容错管理工具,旨在通过熔断机制控制服务和第三方库的节点,从而对延迟和故障提供更强大的容错能力。 | 34 | Hystrix-dashboard | hystrix 仪表盘 35 | zipkin | 分布式链路调用监控系统,聚合各业务系统调用延迟数据,达到链路调用监控跟踪。 | 36 | Turbine | 聚合服务器发送事件流数据的工具,用来监控集群下hystrix的metrics情况。 37 | Feign | 一种声明式、模板化的HTTP客户端。 38 | MyBatis Generator | 代码生成 | [http://www.mybatis.org/generator/index.html](http://www.mybatis.org/generator/index.html) 39 | Redis | 分布式缓存数据库 | [https://redis.io/](https://redis.io/) 40 | Log4J | 日志组件 | [http://logging.apache.org/log4j/1.2/](http://logging.apache.org/log4j/1.2/) 41 | Swagger2 | 接口测试框架 | [http://swagger.io/](http://swagger.io/) 42 | Maven | 项目构建管理 | [http://maven.apache.org/](http://maven.apache.org/) 43 | prometheus | 时间序列数据库 | [https://prometheus.io/](https://prometheus.io/) 44 | 45 | ### 模块介绍 46 | 47 | > cloudE-common 48 | 49 | 包含了公共模块,以及工具类等。 50 | 51 | > cloudE-pay-api 52 | 53 | 支付服务api包,以feign的形式暴露支付接口 54 | 55 | > cloudE-pay-provider 56 | 57 | 提供支付服务 58 | 59 | > cloudE-ucenter-provider 60 | 61 | 用户中心,通过feign调用支付服务 62 | 63 | 64 | ### 环境搭建 65 | 66 | > 开发环境 67 | 68 | - 1、本机安装Jdk8、Mysql并**启动相关服务**,使用默认配置默认端口即可 69 | - 2、克隆源代码到本地并打开,**推荐使用IntelliJ IDEA** 70 | 71 | > 准备工作 72 | 73 | - 创建数据库,导入cloudE-mapper项目中的create.sql 74 | 75 | - 修改cloudE-config-server中对应的配置信息(properties) 76 | 77 | > 启动服务 78 | 79 | - 启动服务有三种方式: 80 | 81 | - 1、执行spring boot main方法 82 | 83 | - 2、执行maven打包命令 mvn clean install -Dmaven.test.skip=true ,jar包会被打到target目录下,进入该目录,执行 java -jar cloudE-xxxxx-xxxx.jar --spring.profiles.active=dev 84 | 85 | - 3、构建docker镜像(mvn package docker:build),然后执行docker run xxxxx/xxxxx 86 | 87 | > 启动顺序 88 | 89 | - 优先启动cloudE-eureka-server,cloudE-config-server。其他服务顺序随意 90 | 91 | 92 | ### 服务监控 93 | 94 | > 通过prometheus client暴露Metrics到/prometheus。然后通过简单的配置Prometheus,就可以采集到监控数据。还可以使用Grafana,更好的展示监控数据。 95 | 96 | 下面放上两张监控的效果图: 97 | - 1、prometheus 98 | ![prometheus](project-bootstrap/prometheus.png) 99 | - 2、grafana 100 | ![grafana](project-bootstrap/grafana.png) 101 | 102 | 另外,通过spring cloud生态内的hystrix dashboard,以及zipkin(链路监控),也可以很好的监控服务,排查问题 103 | - 1、hystrix dashboard 104 | ![hystrix](project-bootstrap/hystrix.png) 105 | - 2、zipkin 106 | ![zipkin1](project-bootstrap/zipkin1.png) 107 | 108 | 109 | ### 动态参数注入 110 | 111 | > 有时候业务上需要用到可以热修改的参数,可以通过@RefreshScope注解,和spring boot admin来实现 112 | 113 | 例子在cloudE-ucenter-provider中。实现如下: 114 | - 1.在启动类上加上@RefreshScope注解 115 | - 2.类中注入参数(参数配在properites中) 116 | ![ucenterTask](project-bootstrap/ucenterTask.png) 117 | - 3.spring boot admin修改对应参数,即可实时生效 118 | ![spring-boot-admin](project-bootstrap/spring-boot-admin.png) 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /cloudE-admin-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cloudE 7 | cloudE-admin-server 8 | 1.0.0 9 | cloude-admin-server 10 | jar 11 | 12 | 13 | com.cloudE 14 | cloudE-parent 15 | 1.0.0 16 | 17 | 18 | 19 | 20 | 21 | 22 | org.springframework.cloud 23 | spring-cloud-starter 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-actuator 28 | 29 | 30 | org.springframework.cloud 31 | spring-cloud-starter-eureka 32 | 33 | 34 | de.codecentric 35 | spring-boot-admin-server 36 | 1.5.6 37 | 38 | 39 | de.codecentric 40 | spring-boot-admin-server-ui 41 | 1.5.6 42 | 43 | 44 | de.codecentric 45 | spring-boot-admin-server-ui-hystrix 46 | 1.5.6 47 | 48 | 49 | org.jolokia 50 | jolokia-core 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /cloudE-admin-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-admin-server-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-admin-server/src/main/java/cloudE/monitor/server/SpringBootAdminApplication.java: -------------------------------------------------------------------------------- 1 | 2 | package cloudE.monitor.server; 3 | 4 | import de.codecentric.boot.admin.config.EnableAdminServer; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 8 | 9 | /** 10 | * @author vangao1989 11 | * @Description: 服务监控 12 | * @date 2017年7月24日 13 | */ 14 | @SpringBootApplication 15 | @EnableEurekaClient 16 | @EnableAdminServer 17 | public class SpringBootAdminApplication { 18 | public static void main(String[] args) { 19 | SpringApplication.run(SpringBootAdminApplication.class, args); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cloudE-admin-server/src/main/resources/config/application-default.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloudE-config 2 | spring.cloud.config.profile=local 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-admin-server/src/main/resources/config/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloudE-config 2 | spring.cloud.config.profile=dev 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-admin-server/src/main/resources/config/application-pro.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloudE-config 2 | spring.cloud.config.profile=production 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-admin-server/src/main/resources/config/application-qa.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloudE-config 2 | spring.cloud.config.profile=qa 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-admin-server/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: cloudE-admin-server 4 | cloud: 5 | config: 6 | uri: http://localhost:8888 7 | 8 | eureka: 9 | instance: 10 | prefer-ip-address: true 11 | 12 | server: 13 | port: 8050 14 | 15 | 16 | -------------------------------------------------------------------------------- /cloudE-admin-server/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.cloudE 8 | cloudE-common 9 | jar 10 | 1.0.0 11 | cloudE-common 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1.8 20 | 1.8 21 | 22 | 23 | 24 | 25 | org.apache.maven.plugins 26 | maven-source-plugin 27 | 3.0.1 28 | 29 | 30 | 31 | jar-no-fork 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /cloudE-common/src/main/java/com/cloudE/dto/BaseResult.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.dto; 2 | 3 | import java.io.Serializable; 4 | 5 | /** 6 | * @author vangao1989 7 | * @Description: 返回值统一封装类 8 | * @date 2017年7月26日 9 | */ 10 | public class BaseResult implements Serializable { 11 | 12 | 13 | private static final long serialVersionUID = 1368407471638948451L; 14 | 15 | public Boolean success; 16 | 17 | private T content; 18 | 19 | private String message; 20 | 21 | private String code; 22 | 23 | public BaseResult() { 24 | } 25 | 26 | public BaseResult(T content) { 27 | this.content = content; 28 | success = true; 29 | } 30 | 31 | public BaseResult(String code, String message) { 32 | this.message = message; 33 | this.code = code; 34 | success = false; 35 | } 36 | 37 | public BaseResult(Boolean success, String message) { 38 | this.message = message; 39 | this.success = success; 40 | } 41 | 42 | public BaseResult(Boolean success, String code, String message) { 43 | this.message = message; 44 | this.code = code; 45 | this.success = success; 46 | } 47 | 48 | public BaseResult(Boolean success, T content, String code, String message) { 49 | this.message = message; 50 | this.code = code; 51 | this.content = content; 52 | this.success = success; 53 | } 54 | 55 | public BaseResult success(String message) { 56 | this.setSuccess(true); 57 | this.setMessage(message); 58 | return this; 59 | } 60 | 61 | public BaseResult failure(String message) { 62 | this.setSuccess(false); 63 | this.setMessage(message); 64 | return this; 65 | } 66 | 67 | public BaseResult content(T t) { 68 | this.setContent(t); 69 | return this; 70 | } 71 | 72 | public BaseResult code(String code) { 73 | this.setCode(code); 74 | return this; 75 | } 76 | 77 | public BaseResult successContent(T t) { 78 | this.content(t); 79 | this.success = true; 80 | return this; 81 | } 82 | 83 | public Boolean getSuccess() { 84 | return success; 85 | } 86 | 87 | public void setSuccess(Boolean success) { 88 | this.success = success; 89 | } 90 | 91 | public T getContent() { 92 | return content; 93 | } 94 | 95 | public void setContent(T content) { 96 | this.content = content; 97 | } 98 | 99 | public String getMessage() { 100 | return message; 101 | } 102 | 103 | public void setMessage(String message) { 104 | this.message = message; 105 | } 106 | 107 | public String getCode() { 108 | return code; 109 | } 110 | 111 | public void setCode(String code) { 112 | this.code = code; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /cloudE-config-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.cloudE 7 | cloudE-config-server 8 | 1.0.0 9 | jar 10 | 11 | cloude-config-serve 12 | 13 | 14 | com.cloudE 15 | cloudE-parent 16 | 1.0.0 17 | 18 | 19 | 20 | 21 | 22 | org.springframework.cloud 23 | spring-cloud-config-server 24 | 25 | 26 | org.springframework.cloud 27 | spring-cloud-starter-eureka-server 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /cloudE-config-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-config-server-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-config-server/src/main/java/cloud/config/server/ConfigServerApplication.java: -------------------------------------------------------------------------------- 1 | package cloud.config.server; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | import org.springframework.cloud.config.server.EnableConfigServer; 7 | 8 | /** 9 | * @author vangao1989 10 | * @Description: spring cloud admin 11 | * @date 2017年7月24日 12 | */ 13 | @SpringBootApplication 14 | @EnableDiscoveryClient 15 | @EnableConfigServer 16 | public class ConfigServerApplication { 17 | 18 | public static void main(String[] args) { 19 | SpringApplication.run(ConfigServerApplication.class, args); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cloudE-config-server/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8888 3 | 4 | #spring: 5 | # application: 6 | # name: cloudE-config-server 7 | # cloud: 8 | # config: 9 | # server: 10 | # git: 11 | # uri: https://github.com/vangao1989/cloudE.git 12 | # searchPaths: cloudE-config-repo 13 | # lable: master 14 | 15 | #使用本地属性文件 16 | #属性文件地址,只要指定文件夹的路径 17 | spring: 18 | application: 19 | name: cloudE-config-server 20 | profiles: 21 | active: native 22 | cloud: 23 | config: 24 | server: 25 | native: 26 | search-locations: classpath:/properties/ 27 | 28 | 29 | eureka: 30 | instance: 31 | prefer-ip-address: true 32 | client: 33 | serviceUrl: 34 | defaultZone: http://localhost:8761/eureka/ 35 | 36 | -------------------------------------------------------------------------------- /cloudE-config-server/src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-config-server/src/main/resources/properties/cloud-config-dev.properties: -------------------------------------------------------------------------------- 1 | ## eureka 服务发现 2 | eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/ 3 | 4 | ## mysql 5 | spring.datasource.url=jdbc:mysql://localhost:3306/db?useUnicode=true&characterEncoding=utf-8 6 | spring.datasource.username=username 7 | spring.datasource.password=password 8 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 9 | 10 | ## redis 缓存 11 | #spring.redis.database= # database name 12 | #spring.redis.host=localhost 13 | #spring.redis.password= # server password 14 | #spring.redis.port=6379 15 | #spring.redis.pool.max-idle=8 # pool settings ... 16 | #spring.redis.pool.min-idle=0 17 | #spring.redis.pool.max-active=8 18 | #spring.redis.pool.max-wait=-1 19 | #redis.defaultExpirationTime=60 20 | 21 | 22 | ## rabbitmq 23 | #spring.rabbitmq.host=localhost 24 | #spring.rabbitmq.port=5672 25 | #spring.rabbitmq.username=username 26 | #spring.rabbitmq.password=username 27 | 28 | 29 | ## 默认超时时间 30 | hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds = 10000 31 | hystrix.command.cloudE-user-provider.execution.isolation.thread.timeoutInMilliseconds = 200000 32 | 33 | ## zipkin 34 | spring.zipkin.base-url=http://localhost:9411 35 | 36 | spring.cloud.config.allowOverride = true 37 | spring.cloud.config.overrideNone = true 38 | 39 | management.security.enabled=false -------------------------------------------------------------------------------- /cloudE-config-server/src/main/resources/properties/cloud-config-local.properties: -------------------------------------------------------------------------------- 1 | ## eureka 服务发现 2 | eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/ 3 | 4 | ## mysql 5 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf-8 6 | spring.datasource.username=root 7 | spring.datasource.password=123456 8 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 9 | 10 | ## redis 缓存 11 | #spring.redis.database= # database name 12 | #spring.redis.host=localhost 13 | #spring.redis.password= # server password 14 | #spring.redis.port=6379 15 | #spring.redis.pool.max-idle=8 # pool settings ... 16 | #spring.redis.pool.min-idle=0 17 | #spring.redis.pool.max-active=8 18 | #spring.redis.pool.max-wait=-1 19 | #redis.defaultExpirationTime=60 20 | 21 | 22 | ## rabbitmq 23 | #spring.rabbitmq.host=localhost 24 | #spring.rabbitmq.port=5672 25 | #spring.rabbitmq.username=username 26 | #spring.rabbitmq.password=username 27 | 28 | 29 | ## 默认超时时间 30 | hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds = 10000 31 | hystrix.command.cloudE-user-provider.execution.isolation.thread.timeoutInMilliseconds = 200000 32 | 33 | ## zipkin 34 | spring.zipkin.base-url=http://localhost:9411 35 | spring.zipkin.baseUrl=http://localhost:9411 36 | spring.zipkin.sender.type=web 37 | 38 | spring.cloud.config.allowOverride = true 39 | spring.cloud.config.overrideNone = true 40 | 41 | management.security.enabled=false -------------------------------------------------------------------------------- /cloudE-config-server/src/main/resources/properties/cloud-config-production.properties: -------------------------------------------------------------------------------- 1 | ## eureka 服务发现 2 | eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/ 3 | 4 | ## mysql 5 | spring.datasource.url=jdbc:mysql://localhost:3306/db?useUnicode=true&characterEncoding=utf-8 6 | spring.datasource.username=username 7 | spring.datasource.password=password 8 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 9 | 10 | ## redis 缓存 11 | #spring.redis.database= # database name 12 | #spring.redis.host=localhost 13 | #spring.redis.password= # server password 14 | #spring.redis.port=6379 15 | #spring.redis.pool.max-idle=8 # pool settings ... 16 | #spring.redis.pool.min-idle=0 17 | #spring.redis.pool.max-active=8 18 | #spring.redis.pool.max-wait=-1 19 | #redis.defaultExpirationTime=60 20 | 21 | 22 | ## rabbitmq 23 | #spring.rabbitmq.host=localhost 24 | #spring.rabbitmq.port=5672 25 | #spring.rabbitmq.username=username 26 | #spring.rabbitmq.password=username 27 | 28 | 29 | ## 默认超时时间 30 | hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds = 10000 31 | hystrix.command.cloudE-user-provider.execution.isolation.thread.timeoutInMilliseconds = 200000 32 | 33 | ## zipkin 34 | spring.zipkin.base-url=http://localhost:9411 35 | 36 | spring.cloud.config.allowOverride = true 37 | spring.cloud.config.overrideNone = true 38 | 39 | management.security.enabled=false -------------------------------------------------------------------------------- /cloudE-config-server/src/main/resources/properties/cloud-config-qa.properties: -------------------------------------------------------------------------------- 1 | ## eureka 服务发现 2 | eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/ 3 | 4 | ## mysql 5 | spring.datasource.url=jdbc:mysql://localhost:3306/db?useUnicode=true&characterEncoding=utf-8 6 | spring.datasource.username=username 7 | spring.datasource.password=password 8 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 9 | 10 | ## redis 缓存 11 | #spring.redis.database= # database name 12 | #spring.redis.host=localhost 13 | #spring.redis.password= # server password 14 | #spring.redis.port=6379 15 | #spring.redis.pool.max-idle=8 # pool settings ... 16 | #spring.redis.pool.min-idle=0 17 | #spring.redis.pool.max-active=8 18 | #spring.redis.pool.max-wait=-1 19 | #redis.defaultExpirationTime=60 20 | 21 | 22 | ## rabbitmq 23 | #spring.rabbitmq.host=localhost 24 | #spring.rabbitmq.port=5672 25 | #spring.rabbitmq.username=username 26 | #spring.rabbitmq.password=username 27 | 28 | 29 | ## 默认超时时间 30 | hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds = 10000 31 | hystrix.command.cloudE-user-provider.execution.isolation.thread.timeoutInMilliseconds = 200000 32 | 33 | ## zipkin 34 | spring.zipkin.base-url=http://localhost:9411 35 | 36 | spring.cloud.config.allowOverride = true 37 | spring.cloud.config.overrideNone = true 38 | 39 | management.security.enabled=false -------------------------------------------------------------------------------- /cloudE-eureka-server/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.cloudE 6 | cloudE-eureka-server 7 | 1.0.0 8 | jar 9 | 10 | cloude-eureka-server 11 | 12 | 13 | com.cloudE 14 | cloudE-parent 15 | 1.0.0 16 | 17 | 18 | 19 | 20 | org.springframework.cloud 21 | spring-cloud-starter-eureka-server 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /cloudE-eureka-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-eureka-server-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-eureka-server/src/main/java/cloudE/eureka/server/EurekaServerApplication.java: -------------------------------------------------------------------------------- 1 | package cloudE.eureka.server; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | /** 8 | * @author vangao1989 9 | * @Description: 服务发现 10 | * @date 2017年7月24日 11 | */ 12 | @SpringBootApplication 13 | @EnableEurekaServer 14 | public class EurekaServerApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(EurekaServerApplication.class, args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /cloudE-eureka-server/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8761 3 | 4 | spring: 5 | application: 6 | name: cloudE-eureka-server 7 | 8 | eureka: 9 | instance: 10 | hostname: localhost 11 | prefer-ip-address: true 12 | client: 13 | registerWithEureka: true 14 | fetchRegistry: false 15 | serviceUrl: 16 | defaultZone: http://localhost:8761/eureka/ 17 | -------------------------------------------------------------------------------- /cloudE-eureka-server/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-gateway-server/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.cloudE 6 | cloudE-gateway-server 7 | 1.0.0 8 | jar 9 | 10 | cloude-gateway-server 11 | 12 | 13 | com.cloudE 14 | cloudE-parent 15 | 1.0.0 16 | 17 | 18 | 19 | 20 | org.springframework.cloud 21 | spring-cloud-starter-zuul 22 | 23 | 24 | org.springframework.cloud 25 | spring-cloud-config-client 26 | 27 | 28 | org.springframework.cloud 29 | spring-cloud-starter-eureka-server 30 | 31 | 32 | 33 | org.springframework.cloud 34 | spring-cloud-starter-sleuth 35 | 36 | 37 | org.springframework.cloud 38 | spring-cloud-sleuth-zipkin 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-gateway-server-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/java/cloudE/zuul/server/GatewayServerApplication.java: -------------------------------------------------------------------------------- 1 | package cloudE.zuul.server; 2 | 3 | import cloudE.zuul.server.filter.AccessFilter; 4 | import io.prometheus.client.spring.boot.EnableSpringBootMetricsCollector; 5 | import org.springframework.boot.SpringApplication; 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; 7 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 8 | import org.springframework.cloud.netflix.zuul.EnableZuulProxy; 9 | import org.springframework.context.annotation.Bean; 10 | 11 | 12 | /** 13 | * @author vangao1989 14 | * @Description: 网关 15 | * @date 2017年7月26日 16 | */ 17 | @SpringBootApplication 18 | @EnableZuulProxy 19 | @EnableEurekaClient 20 | @EnableSpringBootMetricsCollector 21 | public class GatewayServerApplication { 22 | 23 | public static void main(String[] args) { 24 | SpringApplication.run(GatewayServerApplication.class, args); 25 | } 26 | 27 | @Bean 28 | public AccessFilter accessFilter() { 29 | return new AccessFilter(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/java/cloudE/zuul/server/filter/AccessFilter.java: -------------------------------------------------------------------------------- 1 | package cloudE.zuul.server.filter; 2 | 3 | import com.netflix.zuul.ZuulFilter; 4 | import com.netflix.zuul.context.RequestContext; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | /** 11 | * @author vangao1989 12 | * @Description: filter 前置过滤器 13 | * @date 2017年7月26日 14 | */ 15 | public class AccessFilter extends ZuulFilter { 16 | 17 | private static Logger logger = LoggerFactory.getLogger(AccessFilter.class); 18 | 19 | @Override 20 | public Object run() { 21 | try { 22 | RequestContext ctx = RequestContext.getCurrentContext(); 23 | HttpServletRequest request = ctx.getRequest(); 24 | String requestURL = request.getRequestURL().toString(); 25 | logger.info("{} AccessFilter request to {}", request.getMethod(), requestURL); 26 | if (true) { 27 | ctx.setRequest(request); 28 | ctx.setSendZuulResponse(true);// 对该请求进行路由 29 | ctx.setResponseStatusCode(200); 30 | ctx.set("isSuccess", true);// 设值,让下一个Filter看到上一个Filter的状态 31 | } else { 32 | ctx.setSendZuulResponse(false);// 过滤该请求,不对其进行路由 33 | ctx.setResponseStatusCode(401);// 返回错误码 34 | ctx.setResponseBody("{\"result\":\"request fail!\"}");// 返回错误内容 35 | ctx.set("isSuccess", false); 36 | } 37 | 38 | } catch (Throwable throwable) { 39 | logger.error("AccessFilter fail", throwable); 40 | } 41 | return null; 42 | 43 | } 44 | 45 | @Override 46 | public boolean shouldFilter() { 47 | return true;// 是否执行该过滤器,此处为true,说明需要过滤 48 | } 49 | 50 | @Override 51 | public int filterOrder() { 52 | return 0;// 优先级为0,数字越大,优先级越低 53 | } 54 | 55 | @Override 56 | public String filterType() { 57 | return "pre";// 前置过滤器 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/java/cloudE/zuul/server/prometheus/MetricsConfiguration.java: -------------------------------------------------------------------------------- 1 | package cloudE.zuul.server.prometheus; 2 | 3 | import io.prometheus.client.exporter.MetricsServlet; 4 | import io.prometheus.client.hotspot.DefaultExports; 5 | import io.prometheus.client.spring.boot.SpringBootMetricsCollector; 6 | import org.springframework.boot.actuate.endpoint.PublicMetrics; 7 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | import java.util.Collection; 12 | 13 | @Configuration 14 | public class MetricsConfiguration { 15 | 16 | @Bean 17 | public ServletRegistrationBean servletRegistrationBean() { 18 | DefaultExports.initialize(); 19 | return new ServletRegistrationBean(new MetricsServlet(), "/prometheus"); 20 | } 21 | 22 | @Bean 23 | public SpringBootMetricsCollector springBootMetricsCollector(Collection publicMetrics) { 24 | SpringBootMetricsCollector springBootMetricsCollector = new SpringBootMetricsCollector( 25 | publicMetrics); 26 | springBootMetricsCollector.register(); 27 | return springBootMetricsCollector; 28 | } 29 | } -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/resources/config/application-default.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=local 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/resources/config/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=dev 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/resources/config/application-pro.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=production 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/resources/config/application-qa.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=qa 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: cloudE-gateway-server 4 | cloud: 5 | config: 6 | uri: http://localhost:8888 7 | 8 | eureka: 9 | instance: 10 | prefer-ip-address: true 11 | 12 | server: 13 | port: 5555 14 | 15 | 16 | ribbon: 17 | # # Max number of next servers to retry (excluding the first server) 18 | # MaxAutoRetries: 1 19 | # # Whether all operations can be retried for this client 20 | # MaxAutoRetriesNextServer: 1 21 | # # Interval to refresh the server list from the source 22 | # OkToRetryOnAllOperations: true 23 | # # Interval to refresh the server list from the source 24 | # ServerListRefreshInterval: 2000 25 | # # Connect timeout used by Apache HttpClient 26 | ConnectTimeout: 20000 27 | # # Read timeout used by Apache HttpClient 28 | ReadTimeout: 20000 29 | 30 | hystrix: 31 | command: 32 | default: 33 | execution: 34 | isolation: 35 | thread: 36 | timeoutInMilliseconds: 10000 37 | zuul: 38 | routes: 39 | ucenter: 40 | path: /ucenter/** 41 | serviceId: cloudE-ucenter-provider 42 | -------------------------------------------------------------------------------- /cloudE-gateway-server/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.cloudE 6 | cloudE-hystrix-dashboard-server 7 | 1.0.0 8 | cloude-hystrix-dashboard-server 9 | jar 10 | 11 | com.cloudE 12 | cloudE-parent 13 | 1.0.0 14 | 15 | 16 | 17 | 18 | org.springframework.cloud 19 | spring-cloud-starter 20 | 21 | 22 | org.springframework.cloud 23 | spring-cloud-starter-hystrix-dashboard 24 | 25 | 26 | org.springframework.cloud 27 | spring-cloud-starter-eureka-server 28 | 29 | 30 | org.springframework.cloud 31 | spring-cloud-netflix-eureka-client 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-hystrix-dashboard-server-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/src/main/java/cloudE/hystrix/dashboard/HystrixDashboardApplication.java: -------------------------------------------------------------------------------- 1 | package cloudE.hystrix.dashboard; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | 10 | @SpringBootApplication 11 | @EnableHystrixDashboard 12 | @Controller 13 | @EnableEurekaClient 14 | public class HystrixDashboardApplication { 15 | 16 | @RequestMapping("/") 17 | public String home() { 18 | return "forward:/hystrix"; 19 | } 20 | 21 | public static void main(String[] args) { 22 | SpringApplication.run(HystrixDashboardApplication.class, args); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/src/main/resources/config/application-default.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=local 3 | spring.cloud.config.label=master 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/src/main/resources/config/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=dev 3 | spring.cloud.config.label=master 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/src/main/resources/config/application-pro.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=production 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/src/main/resources/config/application-qa.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=qa 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: cloudE-hystrix-dashboard-server 4 | cloud: 5 | config: 6 | uri: http://localhost:8888 7 | 8 | eureka: 9 | instance: 10 | prefer-ip-address: true 11 | 12 | server: 13 | port: 8022 14 | 15 | 16 | -------------------------------------------------------------------------------- /cloudE-hystrix-dashboard-server/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-mapper/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.cloudE 6 | cloudE-mapper 7 | 1.0.0 8 | jar 9 | cloudE-mapper 10 | 11 | 12 | 13 | 14 | com.mchange 15 | c3p0 16 | 0.9.5.2 17 | 18 | 19 | mysql 20 | mysql-connector-java 21 | 5.1.35 22 | 23 | 24 | org.mybatis 25 | mybatis 26 | 3.4.1 27 | 28 | 29 | org.mybatis 30 | mybatis-spring 31 | 1.3.0 32 | 33 | 34 | tk.mybatis 35 | mapper 36 | 3.4.0 37 | 38 | 39 | org.springframework 40 | spring-context 41 | 4.3.7.RELEASE 42 | 43 | 44 | 45 | 46 | 47 | 48 | org.mybatis.generator 49 | mybatis-generator-maven-plugin 50 | 1.3.5 51 | 52 | true 53 | true 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | org.eclipse.m2e 62 | lifecycle-mapping 63 | 1.0.0 64 | 65 | 66 | 67 | 68 | 69 | org.mybatis.generator 70 | mybatis-generator-maven-plugin 71 | [1.3.5,) 72 | 73 | generate 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /cloudE-mapper/src/main/java/com/cloudE/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | public class User implements Serializable { 7 | /** 8 | * 9 | * This field was generated by MyBatis Generator. 10 | * This field corresponds to the database column user.id 11 | * 12 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 13 | */ 14 | private Long id; 15 | 16 | /** 17 | * 18 | * This field was generated by MyBatis Generator. 19 | * This field corresponds to the database column user.username 20 | * 21 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 22 | */ 23 | private String username; 24 | 25 | /** 26 | * 27 | * This field was generated by MyBatis Generator. 28 | * This field corresponds to the database column user.password 29 | * 30 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 31 | */ 32 | private String password; 33 | 34 | /** 35 | * 36 | * This field was generated by MyBatis Generator. 37 | * This field corresponds to the database column user.status 38 | * 39 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 40 | */ 41 | private Byte status; 42 | 43 | /** 44 | * 45 | * This field was generated by MyBatis Generator. 46 | * This field corresponds to the database column user.reg_login_ip 47 | * 48 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 49 | */ 50 | private String regLoginIp; 51 | 52 | /** 53 | * 54 | * This field was generated by MyBatis Generator. 55 | * This field corresponds to the database column user.last_login_ip 56 | * 57 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 58 | */ 59 | private String lastLoginIp; 60 | 61 | /** 62 | * 63 | * This field was generated by MyBatis Generator. 64 | * This field corresponds to the database column user.last_login_time 65 | * 66 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 67 | */ 68 | private Date lastLoginTime; 69 | 70 | /** 71 | * 72 | * This field was generated by MyBatis Generator. 73 | * This field corresponds to the database column user.create_time 74 | * 75 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 76 | */ 77 | private Date createTime; 78 | 79 | /** 80 | * 81 | * This field was generated by MyBatis Generator. 82 | * This field corresponds to the database column user.update_time 83 | * 84 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 85 | */ 86 | private Date updateTime; 87 | 88 | /** 89 | * 90 | * This field was generated by MyBatis Generator. 91 | * This field corresponds to the database column user.del_status 92 | * 93 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 94 | */ 95 | private Boolean delStatus; 96 | 97 | /** 98 | * This field was generated by MyBatis Generator. 99 | * This field corresponds to the database table user 100 | * 101 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 102 | */ 103 | private static final long serialVersionUID = 1L; 104 | 105 | /** 106 | * This method was generated by MyBatis Generator. 107 | * This method returns the value of the database column user.id 108 | * 109 | * @return the value of user.id 110 | * 111 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 112 | */ 113 | public Long getId() { 114 | return id; 115 | } 116 | 117 | /** 118 | * This method was generated by MyBatis Generator. 119 | * This method sets the value of the database column user.id 120 | * 121 | * @param id the value for user.id 122 | * 123 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 124 | */ 125 | public void setId(Long id) { 126 | this.id = id; 127 | } 128 | 129 | /** 130 | * This method was generated by MyBatis Generator. 131 | * This method returns the value of the database column user.username 132 | * 133 | * @return the value of user.username 134 | * 135 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 136 | */ 137 | public String getUsername() { 138 | return username; 139 | } 140 | 141 | /** 142 | * This method was generated by MyBatis Generator. 143 | * This method sets the value of the database column user.username 144 | * 145 | * @param username the value for user.username 146 | * 147 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 148 | */ 149 | public void setUsername(String username) { 150 | this.username = username == null ? null : username.trim(); 151 | } 152 | 153 | /** 154 | * This method was generated by MyBatis Generator. 155 | * This method returns the value of the database column user.password 156 | * 157 | * @return the value of user.password 158 | * 159 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 160 | */ 161 | public String getPassword() { 162 | return password; 163 | } 164 | 165 | /** 166 | * This method was generated by MyBatis Generator. 167 | * This method sets the value of the database column user.password 168 | * 169 | * @param password the value for user.password 170 | * 171 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 172 | */ 173 | public void setPassword(String password) { 174 | this.password = password == null ? null : password.trim(); 175 | } 176 | 177 | /** 178 | * This method was generated by MyBatis Generator. 179 | * This method returns the value of the database column user.status 180 | * 181 | * @return the value of user.status 182 | * 183 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 184 | */ 185 | public Byte getStatus() { 186 | return status; 187 | } 188 | 189 | /** 190 | * This method was generated by MyBatis Generator. 191 | * This method sets the value of the database column user.status 192 | * 193 | * @param status the value for user.status 194 | * 195 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 196 | */ 197 | public void setStatus(Byte status) { 198 | this.status = status; 199 | } 200 | 201 | /** 202 | * This method was generated by MyBatis Generator. 203 | * This method returns the value of the database column user.reg_login_ip 204 | * 205 | * @return the value of user.reg_login_ip 206 | * 207 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 208 | */ 209 | public String getRegLoginIp() { 210 | return regLoginIp; 211 | } 212 | 213 | /** 214 | * This method was generated by MyBatis Generator. 215 | * This method sets the value of the database column user.reg_login_ip 216 | * 217 | * @param regLoginIp the value for user.reg_login_ip 218 | * 219 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 220 | */ 221 | public void setRegLoginIp(String regLoginIp) { 222 | this.regLoginIp = regLoginIp == null ? null : regLoginIp.trim(); 223 | } 224 | 225 | /** 226 | * This method was generated by MyBatis Generator. 227 | * This method returns the value of the database column user.last_login_ip 228 | * 229 | * @return the value of user.last_login_ip 230 | * 231 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 232 | */ 233 | public String getLastLoginIp() { 234 | return lastLoginIp; 235 | } 236 | 237 | /** 238 | * This method was generated by MyBatis Generator. 239 | * This method sets the value of the database column user.last_login_ip 240 | * 241 | * @param lastLoginIp the value for user.last_login_ip 242 | * 243 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 244 | */ 245 | public void setLastLoginIp(String lastLoginIp) { 246 | this.lastLoginIp = lastLoginIp == null ? null : lastLoginIp.trim(); 247 | } 248 | 249 | /** 250 | * This method was generated by MyBatis Generator. 251 | * This method returns the value of the database column user.last_login_time 252 | * 253 | * @return the value of user.last_login_time 254 | * 255 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 256 | */ 257 | public Date getLastLoginTime() { 258 | return lastLoginTime; 259 | } 260 | 261 | /** 262 | * This method was generated by MyBatis Generator. 263 | * This method sets the value of the database column user.last_login_time 264 | * 265 | * @param lastLoginTime the value for user.last_login_time 266 | * 267 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 268 | */ 269 | public void setLastLoginTime(Date lastLoginTime) { 270 | this.lastLoginTime = lastLoginTime; 271 | } 272 | 273 | /** 274 | * This method was generated by MyBatis Generator. 275 | * This method returns the value of the database column user.create_time 276 | * 277 | * @return the value of user.create_time 278 | * 279 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 280 | */ 281 | public Date getCreateTime() { 282 | return createTime; 283 | } 284 | 285 | /** 286 | * This method was generated by MyBatis Generator. 287 | * This method sets the value of the database column user.create_time 288 | * 289 | * @param createTime the value for user.create_time 290 | * 291 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 292 | */ 293 | public void setCreateTime(Date createTime) { 294 | this.createTime = createTime; 295 | } 296 | 297 | /** 298 | * This method was generated by MyBatis Generator. 299 | * This method returns the value of the database column user.update_time 300 | * 301 | * @return the value of user.update_time 302 | * 303 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 304 | */ 305 | public Date getUpdateTime() { 306 | return updateTime; 307 | } 308 | 309 | /** 310 | * This method was generated by MyBatis Generator. 311 | * This method sets the value of the database column user.update_time 312 | * 313 | * @param updateTime the value for user.update_time 314 | * 315 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 316 | */ 317 | public void setUpdateTime(Date updateTime) { 318 | this.updateTime = updateTime; 319 | } 320 | 321 | /** 322 | * This method was generated by MyBatis Generator. 323 | * This method returns the value of the database column user.del_status 324 | * 325 | * @return the value of user.del_status 326 | * 327 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 328 | */ 329 | public Boolean getDelStatus() { 330 | return delStatus; 331 | } 332 | 333 | /** 334 | * This method was generated by MyBatis Generator. 335 | * This method sets the value of the database column user.del_status 336 | * 337 | * @param delStatus the value for user.del_status 338 | * 339 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 340 | */ 341 | public void setDelStatus(Boolean delStatus) { 342 | this.delStatus = delStatus; 343 | } 344 | } -------------------------------------------------------------------------------- /cloudE-mapper/src/main/java/com/cloudE/entity/UserExample.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.entity; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | public class UserExample { 8 | /** 9 | * This field was generated by MyBatis Generator. 10 | * This field corresponds to the database table user 11 | * 12 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 13 | */ 14 | protected String orderByClause; 15 | 16 | /** 17 | * This field was generated by MyBatis Generator. 18 | * This field corresponds to the database table user 19 | * 20 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 21 | */ 22 | protected boolean distinct; 23 | 24 | /** 25 | * This field was generated by MyBatis Generator. 26 | * This field corresponds to the database table user 27 | * 28 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 29 | */ 30 | protected List oredCriteria; 31 | 32 | /** 33 | * This method was generated by MyBatis Generator. 34 | * This method corresponds to the database table user 35 | * 36 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 37 | */ 38 | public UserExample() { 39 | oredCriteria = new ArrayList(); 40 | } 41 | 42 | /** 43 | * This method was generated by MyBatis Generator. 44 | * This method corresponds to the database table user 45 | * 46 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 47 | */ 48 | public void setOrderByClause(String orderByClause) { 49 | this.orderByClause = orderByClause; 50 | } 51 | 52 | /** 53 | * This method was generated by MyBatis Generator. 54 | * This method corresponds to the database table user 55 | * 56 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 57 | */ 58 | public String getOrderByClause() { 59 | return orderByClause; 60 | } 61 | 62 | /** 63 | * This method was generated by MyBatis Generator. 64 | * This method corresponds to the database table user 65 | * 66 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 67 | */ 68 | public void setDistinct(boolean distinct) { 69 | this.distinct = distinct; 70 | } 71 | 72 | /** 73 | * This method was generated by MyBatis Generator. 74 | * This method corresponds to the database table user 75 | * 76 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 77 | */ 78 | public boolean isDistinct() { 79 | return distinct; 80 | } 81 | 82 | /** 83 | * This method was generated by MyBatis Generator. 84 | * This method corresponds to the database table user 85 | * 86 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 87 | */ 88 | public List getOredCriteria() { 89 | return oredCriteria; 90 | } 91 | 92 | /** 93 | * This method was generated by MyBatis Generator. 94 | * This method corresponds to the database table user 95 | * 96 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 97 | */ 98 | public void or(Criteria criteria) { 99 | oredCriteria.add(criteria); 100 | } 101 | 102 | /** 103 | * This method was generated by MyBatis Generator. 104 | * This method corresponds to the database table user 105 | * 106 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 107 | */ 108 | public Criteria or() { 109 | Criteria criteria = createCriteriaInternal(); 110 | oredCriteria.add(criteria); 111 | return criteria; 112 | } 113 | 114 | /** 115 | * This method was generated by MyBatis Generator. 116 | * This method corresponds to the database table user 117 | * 118 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 119 | */ 120 | public Criteria createCriteria() { 121 | Criteria criteria = createCriteriaInternal(); 122 | if (oredCriteria.size() == 0) { 123 | oredCriteria.add(criteria); 124 | } 125 | return criteria; 126 | } 127 | 128 | /** 129 | * This method was generated by MyBatis Generator. 130 | * This method corresponds to the database table user 131 | * 132 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 133 | */ 134 | protected Criteria createCriteriaInternal() { 135 | Criteria criteria = new Criteria(); 136 | return criteria; 137 | } 138 | 139 | /** 140 | * This method was generated by MyBatis Generator. 141 | * This method corresponds to the database table user 142 | * 143 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 144 | */ 145 | public void clear() { 146 | oredCriteria.clear(); 147 | orderByClause = null; 148 | distinct = false; 149 | } 150 | 151 | /** 152 | * This class was generated by MyBatis Generator. 153 | * This class corresponds to the database table user 154 | * 155 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 156 | */ 157 | protected abstract static class GeneratedCriteria { 158 | protected List criteria; 159 | 160 | protected GeneratedCriteria() { 161 | super(); 162 | criteria = new ArrayList(); 163 | } 164 | 165 | public boolean isValid() { 166 | return criteria.size() > 0; 167 | } 168 | 169 | public List getAllCriteria() { 170 | return criteria; 171 | } 172 | 173 | public List getCriteria() { 174 | return criteria; 175 | } 176 | 177 | protected void addCriterion(String condition) { 178 | if (condition == null) { 179 | throw new RuntimeException("Value for condition cannot be null"); 180 | } 181 | criteria.add(new Criterion(condition)); 182 | } 183 | 184 | protected void addCriterion(String condition, Object value, String property) { 185 | if (value == null) { 186 | throw new RuntimeException("Value for " + property + " cannot be null"); 187 | } 188 | criteria.add(new Criterion(condition, value)); 189 | } 190 | 191 | protected void addCriterion(String condition, Object value1, Object value2, String property) { 192 | if (value1 == null || value2 == null) { 193 | throw new RuntimeException("Between values for " + property + " cannot be null"); 194 | } 195 | criteria.add(new Criterion(condition, value1, value2)); 196 | } 197 | 198 | public Criteria andIdIsNull() { 199 | addCriterion("id is null"); 200 | return (Criteria) this; 201 | } 202 | 203 | public Criteria andIdIsNotNull() { 204 | addCriterion("id is not null"); 205 | return (Criteria) this; 206 | } 207 | 208 | public Criteria andIdEqualTo(Long value) { 209 | addCriterion("id =", value, "id"); 210 | return (Criteria) this; 211 | } 212 | 213 | public Criteria andIdNotEqualTo(Long value) { 214 | addCriterion("id <>", value, "id"); 215 | return (Criteria) this; 216 | } 217 | 218 | public Criteria andIdGreaterThan(Long value) { 219 | addCriterion("id >", value, "id"); 220 | return (Criteria) this; 221 | } 222 | 223 | public Criteria andIdGreaterThanOrEqualTo(Long value) { 224 | addCriterion("id >=", value, "id"); 225 | return (Criteria) this; 226 | } 227 | 228 | public Criteria andIdLessThan(Long value) { 229 | addCriterion("id <", value, "id"); 230 | return (Criteria) this; 231 | } 232 | 233 | public Criteria andIdLessThanOrEqualTo(Long value) { 234 | addCriterion("id <=", value, "id"); 235 | return (Criteria) this; 236 | } 237 | 238 | public Criteria andIdIn(List values) { 239 | addCriterion("id in", values, "id"); 240 | return (Criteria) this; 241 | } 242 | 243 | public Criteria andIdNotIn(List values) { 244 | addCriterion("id not in", values, "id"); 245 | return (Criteria) this; 246 | } 247 | 248 | public Criteria andIdBetween(Long value1, Long value2) { 249 | addCriterion("id between", value1, value2, "id"); 250 | return (Criteria) this; 251 | } 252 | 253 | public Criteria andIdNotBetween(Long value1, Long value2) { 254 | addCriterion("id not between", value1, value2, "id"); 255 | return (Criteria) this; 256 | } 257 | 258 | public Criteria andUsernameIsNull() { 259 | addCriterion("username is null"); 260 | return (Criteria) this; 261 | } 262 | 263 | public Criteria andUsernameIsNotNull() { 264 | addCriterion("username is not null"); 265 | return (Criteria) this; 266 | } 267 | 268 | public Criteria andUsernameEqualTo(String value) { 269 | addCriterion("username =", value, "username"); 270 | return (Criteria) this; 271 | } 272 | 273 | public Criteria andUsernameNotEqualTo(String value) { 274 | addCriterion("username <>", value, "username"); 275 | return (Criteria) this; 276 | } 277 | 278 | public Criteria andUsernameGreaterThan(String value) { 279 | addCriterion("username >", value, "username"); 280 | return (Criteria) this; 281 | } 282 | 283 | public Criteria andUsernameGreaterThanOrEqualTo(String value) { 284 | addCriterion("username >=", value, "username"); 285 | return (Criteria) this; 286 | } 287 | 288 | public Criteria andUsernameLessThan(String value) { 289 | addCriterion("username <", value, "username"); 290 | return (Criteria) this; 291 | } 292 | 293 | public Criteria andUsernameLessThanOrEqualTo(String value) { 294 | addCriterion("username <=", value, "username"); 295 | return (Criteria) this; 296 | } 297 | 298 | public Criteria andUsernameLike(String value) { 299 | addCriterion("username like", value, "username"); 300 | return (Criteria) this; 301 | } 302 | 303 | public Criteria andUsernameNotLike(String value) { 304 | addCriterion("username not like", value, "username"); 305 | return (Criteria) this; 306 | } 307 | 308 | public Criteria andUsernameIn(List values) { 309 | addCriterion("username in", values, "username"); 310 | return (Criteria) this; 311 | } 312 | 313 | public Criteria andUsernameNotIn(List values) { 314 | addCriterion("username not in", values, "username"); 315 | return (Criteria) this; 316 | } 317 | 318 | public Criteria andUsernameBetween(String value1, String value2) { 319 | addCriterion("username between", value1, value2, "username"); 320 | return (Criteria) this; 321 | } 322 | 323 | public Criteria andUsernameNotBetween(String value1, String value2) { 324 | addCriterion("username not between", value1, value2, "username"); 325 | return (Criteria) this; 326 | } 327 | 328 | public Criteria andPasswordIsNull() { 329 | addCriterion("password is null"); 330 | return (Criteria) this; 331 | } 332 | 333 | public Criteria andPasswordIsNotNull() { 334 | addCriterion("password is not null"); 335 | return (Criteria) this; 336 | } 337 | 338 | public Criteria andPasswordEqualTo(String value) { 339 | addCriterion("password =", value, "password"); 340 | return (Criteria) this; 341 | } 342 | 343 | public Criteria andPasswordNotEqualTo(String value) { 344 | addCriterion("password <>", value, "password"); 345 | return (Criteria) this; 346 | } 347 | 348 | public Criteria andPasswordGreaterThan(String value) { 349 | addCriterion("password >", value, "password"); 350 | return (Criteria) this; 351 | } 352 | 353 | public Criteria andPasswordGreaterThanOrEqualTo(String value) { 354 | addCriterion("password >=", value, "password"); 355 | return (Criteria) this; 356 | } 357 | 358 | public Criteria andPasswordLessThan(String value) { 359 | addCriterion("password <", value, "password"); 360 | return (Criteria) this; 361 | } 362 | 363 | public Criteria andPasswordLessThanOrEqualTo(String value) { 364 | addCriterion("password <=", value, "password"); 365 | return (Criteria) this; 366 | } 367 | 368 | public Criteria andPasswordLike(String value) { 369 | addCriterion("password like", value, "password"); 370 | return (Criteria) this; 371 | } 372 | 373 | public Criteria andPasswordNotLike(String value) { 374 | addCriterion("password not like", value, "password"); 375 | return (Criteria) this; 376 | } 377 | 378 | public Criteria andPasswordIn(List values) { 379 | addCriterion("password in", values, "password"); 380 | return (Criteria) this; 381 | } 382 | 383 | public Criteria andPasswordNotIn(List values) { 384 | addCriterion("password not in", values, "password"); 385 | return (Criteria) this; 386 | } 387 | 388 | public Criteria andPasswordBetween(String value1, String value2) { 389 | addCriterion("password between", value1, value2, "password"); 390 | return (Criteria) this; 391 | } 392 | 393 | public Criteria andPasswordNotBetween(String value1, String value2) { 394 | addCriterion("password not between", value1, value2, "password"); 395 | return (Criteria) this; 396 | } 397 | 398 | public Criteria andStatusIsNull() { 399 | addCriterion("status is null"); 400 | return (Criteria) this; 401 | } 402 | 403 | public Criteria andStatusIsNotNull() { 404 | addCriterion("status is not null"); 405 | return (Criteria) this; 406 | } 407 | 408 | public Criteria andStatusEqualTo(Byte value) { 409 | addCriterion("status =", value, "status"); 410 | return (Criteria) this; 411 | } 412 | 413 | public Criteria andStatusNotEqualTo(Byte value) { 414 | addCriterion("status <>", value, "status"); 415 | return (Criteria) this; 416 | } 417 | 418 | public Criteria andStatusGreaterThan(Byte value) { 419 | addCriterion("status >", value, "status"); 420 | return (Criteria) this; 421 | } 422 | 423 | public Criteria andStatusGreaterThanOrEqualTo(Byte value) { 424 | addCriterion("status >=", value, "status"); 425 | return (Criteria) this; 426 | } 427 | 428 | public Criteria andStatusLessThan(Byte value) { 429 | addCriterion("status <", value, "status"); 430 | return (Criteria) this; 431 | } 432 | 433 | public Criteria andStatusLessThanOrEqualTo(Byte value) { 434 | addCriterion("status <=", value, "status"); 435 | return (Criteria) this; 436 | } 437 | 438 | public Criteria andStatusIn(List values) { 439 | addCriterion("status in", values, "status"); 440 | return (Criteria) this; 441 | } 442 | 443 | public Criteria andStatusNotIn(List values) { 444 | addCriterion("status not in", values, "status"); 445 | return (Criteria) this; 446 | } 447 | 448 | public Criteria andStatusBetween(Byte value1, Byte value2) { 449 | addCriterion("status between", value1, value2, "status"); 450 | return (Criteria) this; 451 | } 452 | 453 | public Criteria andStatusNotBetween(Byte value1, Byte value2) { 454 | addCriterion("status not between", value1, value2, "status"); 455 | return (Criteria) this; 456 | } 457 | 458 | public Criteria andRegLoginIpIsNull() { 459 | addCriterion("reg_login_ip is null"); 460 | return (Criteria) this; 461 | } 462 | 463 | public Criteria andRegLoginIpIsNotNull() { 464 | addCriterion("reg_login_ip is not null"); 465 | return (Criteria) this; 466 | } 467 | 468 | public Criteria andRegLoginIpEqualTo(String value) { 469 | addCriterion("reg_login_ip =", value, "regLoginIp"); 470 | return (Criteria) this; 471 | } 472 | 473 | public Criteria andRegLoginIpNotEqualTo(String value) { 474 | addCriterion("reg_login_ip <>", value, "regLoginIp"); 475 | return (Criteria) this; 476 | } 477 | 478 | public Criteria andRegLoginIpGreaterThan(String value) { 479 | addCriterion("reg_login_ip >", value, "regLoginIp"); 480 | return (Criteria) this; 481 | } 482 | 483 | public Criteria andRegLoginIpGreaterThanOrEqualTo(String value) { 484 | addCriterion("reg_login_ip >=", value, "regLoginIp"); 485 | return (Criteria) this; 486 | } 487 | 488 | public Criteria andRegLoginIpLessThan(String value) { 489 | addCriterion("reg_login_ip <", value, "regLoginIp"); 490 | return (Criteria) this; 491 | } 492 | 493 | public Criteria andRegLoginIpLessThanOrEqualTo(String value) { 494 | addCriterion("reg_login_ip <=", value, "regLoginIp"); 495 | return (Criteria) this; 496 | } 497 | 498 | public Criteria andRegLoginIpLike(String value) { 499 | addCriterion("reg_login_ip like", value, "regLoginIp"); 500 | return (Criteria) this; 501 | } 502 | 503 | public Criteria andRegLoginIpNotLike(String value) { 504 | addCriterion("reg_login_ip not like", value, "regLoginIp"); 505 | return (Criteria) this; 506 | } 507 | 508 | public Criteria andRegLoginIpIn(List values) { 509 | addCriterion("reg_login_ip in", values, "regLoginIp"); 510 | return (Criteria) this; 511 | } 512 | 513 | public Criteria andRegLoginIpNotIn(List values) { 514 | addCriterion("reg_login_ip not in", values, "regLoginIp"); 515 | return (Criteria) this; 516 | } 517 | 518 | public Criteria andRegLoginIpBetween(String value1, String value2) { 519 | addCriterion("reg_login_ip between", value1, value2, "regLoginIp"); 520 | return (Criteria) this; 521 | } 522 | 523 | public Criteria andRegLoginIpNotBetween(String value1, String value2) { 524 | addCriterion("reg_login_ip not between", value1, value2, "regLoginIp"); 525 | return (Criteria) this; 526 | } 527 | 528 | public Criteria andLastLoginIpIsNull() { 529 | addCriterion("last_login_ip is null"); 530 | return (Criteria) this; 531 | } 532 | 533 | public Criteria andLastLoginIpIsNotNull() { 534 | addCriterion("last_login_ip is not null"); 535 | return (Criteria) this; 536 | } 537 | 538 | public Criteria andLastLoginIpEqualTo(String value) { 539 | addCriterion("last_login_ip =", value, "lastLoginIp"); 540 | return (Criteria) this; 541 | } 542 | 543 | public Criteria andLastLoginIpNotEqualTo(String value) { 544 | addCriterion("last_login_ip <>", value, "lastLoginIp"); 545 | return (Criteria) this; 546 | } 547 | 548 | public Criteria andLastLoginIpGreaterThan(String value) { 549 | addCriterion("last_login_ip >", value, "lastLoginIp"); 550 | return (Criteria) this; 551 | } 552 | 553 | public Criteria andLastLoginIpGreaterThanOrEqualTo(String value) { 554 | addCriterion("last_login_ip >=", value, "lastLoginIp"); 555 | return (Criteria) this; 556 | } 557 | 558 | public Criteria andLastLoginIpLessThan(String value) { 559 | addCriterion("last_login_ip <", value, "lastLoginIp"); 560 | return (Criteria) this; 561 | } 562 | 563 | public Criteria andLastLoginIpLessThanOrEqualTo(String value) { 564 | addCriterion("last_login_ip <=", value, "lastLoginIp"); 565 | return (Criteria) this; 566 | } 567 | 568 | public Criteria andLastLoginIpLike(String value) { 569 | addCriterion("last_login_ip like", value, "lastLoginIp"); 570 | return (Criteria) this; 571 | } 572 | 573 | public Criteria andLastLoginIpNotLike(String value) { 574 | addCriterion("last_login_ip not like", value, "lastLoginIp"); 575 | return (Criteria) this; 576 | } 577 | 578 | public Criteria andLastLoginIpIn(List values) { 579 | addCriterion("last_login_ip in", values, "lastLoginIp"); 580 | return (Criteria) this; 581 | } 582 | 583 | public Criteria andLastLoginIpNotIn(List values) { 584 | addCriterion("last_login_ip not in", values, "lastLoginIp"); 585 | return (Criteria) this; 586 | } 587 | 588 | public Criteria andLastLoginIpBetween(String value1, String value2) { 589 | addCriterion("last_login_ip between", value1, value2, "lastLoginIp"); 590 | return (Criteria) this; 591 | } 592 | 593 | public Criteria andLastLoginIpNotBetween(String value1, String value2) { 594 | addCriterion("last_login_ip not between", value1, value2, "lastLoginIp"); 595 | return (Criteria) this; 596 | } 597 | 598 | public Criteria andLastLoginTimeIsNull() { 599 | addCriterion("last_login_time is null"); 600 | return (Criteria) this; 601 | } 602 | 603 | public Criteria andLastLoginTimeIsNotNull() { 604 | addCriterion("last_login_time is not null"); 605 | return (Criteria) this; 606 | } 607 | 608 | public Criteria andLastLoginTimeEqualTo(Date value) { 609 | addCriterion("last_login_time =", value, "lastLoginTime"); 610 | return (Criteria) this; 611 | } 612 | 613 | public Criteria andLastLoginTimeNotEqualTo(Date value) { 614 | addCriterion("last_login_time <>", value, "lastLoginTime"); 615 | return (Criteria) this; 616 | } 617 | 618 | public Criteria andLastLoginTimeGreaterThan(Date value) { 619 | addCriterion("last_login_time >", value, "lastLoginTime"); 620 | return (Criteria) this; 621 | } 622 | 623 | public Criteria andLastLoginTimeGreaterThanOrEqualTo(Date value) { 624 | addCriterion("last_login_time >=", value, "lastLoginTime"); 625 | return (Criteria) this; 626 | } 627 | 628 | public Criteria andLastLoginTimeLessThan(Date value) { 629 | addCriterion("last_login_time <", value, "lastLoginTime"); 630 | return (Criteria) this; 631 | } 632 | 633 | public Criteria andLastLoginTimeLessThanOrEqualTo(Date value) { 634 | addCriterion("last_login_time <=", value, "lastLoginTime"); 635 | return (Criteria) this; 636 | } 637 | 638 | public Criteria andLastLoginTimeIn(List values) { 639 | addCriterion("last_login_time in", values, "lastLoginTime"); 640 | return (Criteria) this; 641 | } 642 | 643 | public Criteria andLastLoginTimeNotIn(List values) { 644 | addCriterion("last_login_time not in", values, "lastLoginTime"); 645 | return (Criteria) this; 646 | } 647 | 648 | public Criteria andLastLoginTimeBetween(Date value1, Date value2) { 649 | addCriterion("last_login_time between", value1, value2, "lastLoginTime"); 650 | return (Criteria) this; 651 | } 652 | 653 | public Criteria andLastLoginTimeNotBetween(Date value1, Date value2) { 654 | addCriterion("last_login_time not between", value1, value2, "lastLoginTime"); 655 | return (Criteria) this; 656 | } 657 | 658 | public Criteria andCreateTimeIsNull() { 659 | addCriterion("create_time is null"); 660 | return (Criteria) this; 661 | } 662 | 663 | public Criteria andCreateTimeIsNotNull() { 664 | addCriterion("create_time is not null"); 665 | return (Criteria) this; 666 | } 667 | 668 | public Criteria andCreateTimeEqualTo(Date value) { 669 | addCriterion("create_time =", value, "createTime"); 670 | return (Criteria) this; 671 | } 672 | 673 | public Criteria andCreateTimeNotEqualTo(Date value) { 674 | addCriterion("create_time <>", value, "createTime"); 675 | return (Criteria) this; 676 | } 677 | 678 | public Criteria andCreateTimeGreaterThan(Date value) { 679 | addCriterion("create_time >", value, "createTime"); 680 | return (Criteria) this; 681 | } 682 | 683 | public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { 684 | addCriterion("create_time >=", value, "createTime"); 685 | return (Criteria) this; 686 | } 687 | 688 | public Criteria andCreateTimeLessThan(Date value) { 689 | addCriterion("create_time <", value, "createTime"); 690 | return (Criteria) this; 691 | } 692 | 693 | public Criteria andCreateTimeLessThanOrEqualTo(Date value) { 694 | addCriterion("create_time <=", value, "createTime"); 695 | return (Criteria) this; 696 | } 697 | 698 | public Criteria andCreateTimeIn(List values) { 699 | addCriterion("create_time in", values, "createTime"); 700 | return (Criteria) this; 701 | } 702 | 703 | public Criteria andCreateTimeNotIn(List values) { 704 | addCriterion("create_time not in", values, "createTime"); 705 | return (Criteria) this; 706 | } 707 | 708 | public Criteria andCreateTimeBetween(Date value1, Date value2) { 709 | addCriterion("create_time between", value1, value2, "createTime"); 710 | return (Criteria) this; 711 | } 712 | 713 | public Criteria andCreateTimeNotBetween(Date value1, Date value2) { 714 | addCriterion("create_time not between", value1, value2, "createTime"); 715 | return (Criteria) this; 716 | } 717 | 718 | public Criteria andUpdateTimeIsNull() { 719 | addCriterion("update_time is null"); 720 | return (Criteria) this; 721 | } 722 | 723 | public Criteria andUpdateTimeIsNotNull() { 724 | addCriterion("update_time is not null"); 725 | return (Criteria) this; 726 | } 727 | 728 | public Criteria andUpdateTimeEqualTo(Date value) { 729 | addCriterion("update_time =", value, "updateTime"); 730 | return (Criteria) this; 731 | } 732 | 733 | public Criteria andUpdateTimeNotEqualTo(Date value) { 734 | addCriterion("update_time <>", value, "updateTime"); 735 | return (Criteria) this; 736 | } 737 | 738 | public Criteria andUpdateTimeGreaterThan(Date value) { 739 | addCriterion("update_time >", value, "updateTime"); 740 | return (Criteria) this; 741 | } 742 | 743 | public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { 744 | addCriterion("update_time >=", value, "updateTime"); 745 | return (Criteria) this; 746 | } 747 | 748 | public Criteria andUpdateTimeLessThan(Date value) { 749 | addCriterion("update_time <", value, "updateTime"); 750 | return (Criteria) this; 751 | } 752 | 753 | public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { 754 | addCriterion("update_time <=", value, "updateTime"); 755 | return (Criteria) this; 756 | } 757 | 758 | public Criteria andUpdateTimeIn(List values) { 759 | addCriterion("update_time in", values, "updateTime"); 760 | return (Criteria) this; 761 | } 762 | 763 | public Criteria andUpdateTimeNotIn(List values) { 764 | addCriterion("update_time not in", values, "updateTime"); 765 | return (Criteria) this; 766 | } 767 | 768 | public Criteria andUpdateTimeBetween(Date value1, Date value2) { 769 | addCriterion("update_time between", value1, value2, "updateTime"); 770 | return (Criteria) this; 771 | } 772 | 773 | public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { 774 | addCriterion("update_time not between", value1, value2, "updateTime"); 775 | return (Criteria) this; 776 | } 777 | 778 | public Criteria andDelStatusIsNull() { 779 | addCriterion("del_status is null"); 780 | return (Criteria) this; 781 | } 782 | 783 | public Criteria andDelStatusIsNotNull() { 784 | addCriterion("del_status is not null"); 785 | return (Criteria) this; 786 | } 787 | 788 | public Criteria andDelStatusEqualTo(Boolean value) { 789 | addCriterion("del_status =", value, "delStatus"); 790 | return (Criteria) this; 791 | } 792 | 793 | public Criteria andDelStatusNotEqualTo(Boolean value) { 794 | addCriterion("del_status <>", value, "delStatus"); 795 | return (Criteria) this; 796 | } 797 | 798 | public Criteria andDelStatusGreaterThan(Boolean value) { 799 | addCriterion("del_status >", value, "delStatus"); 800 | return (Criteria) this; 801 | } 802 | 803 | public Criteria andDelStatusGreaterThanOrEqualTo(Boolean value) { 804 | addCriterion("del_status >=", value, "delStatus"); 805 | return (Criteria) this; 806 | } 807 | 808 | public Criteria andDelStatusLessThan(Boolean value) { 809 | addCriterion("del_status <", value, "delStatus"); 810 | return (Criteria) this; 811 | } 812 | 813 | public Criteria andDelStatusLessThanOrEqualTo(Boolean value) { 814 | addCriterion("del_status <=", value, "delStatus"); 815 | return (Criteria) this; 816 | } 817 | 818 | public Criteria andDelStatusIn(List values) { 819 | addCriterion("del_status in", values, "delStatus"); 820 | return (Criteria) this; 821 | } 822 | 823 | public Criteria andDelStatusNotIn(List values) { 824 | addCriterion("del_status not in", values, "delStatus"); 825 | return (Criteria) this; 826 | } 827 | 828 | public Criteria andDelStatusBetween(Boolean value1, Boolean value2) { 829 | addCriterion("del_status between", value1, value2, "delStatus"); 830 | return (Criteria) this; 831 | } 832 | 833 | public Criteria andDelStatusNotBetween(Boolean value1, Boolean value2) { 834 | addCriterion("del_status not between", value1, value2, "delStatus"); 835 | return (Criteria) this; 836 | } 837 | } 838 | 839 | /** 840 | * This class was generated by MyBatis Generator. 841 | * This class corresponds to the database table user 842 | * 843 | * @mbg.generated do_not_delete_during_merge Mon Jul 24 13:56:47 CST 2017 844 | */ 845 | public static class Criteria extends GeneratedCriteria { 846 | 847 | protected Criteria() { 848 | super(); 849 | } 850 | } 851 | 852 | /** 853 | * This class was generated by MyBatis Generator. 854 | * This class corresponds to the database table user 855 | * 856 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 857 | */ 858 | public static class Criterion { 859 | private String condition; 860 | 861 | private Object value; 862 | 863 | private Object secondValue; 864 | 865 | private boolean noValue; 866 | 867 | private boolean singleValue; 868 | 869 | private boolean betweenValue; 870 | 871 | private boolean listValue; 872 | 873 | private String typeHandler; 874 | 875 | public String getCondition() { 876 | return condition; 877 | } 878 | 879 | public Object getValue() { 880 | return value; 881 | } 882 | 883 | public Object getSecondValue() { 884 | return secondValue; 885 | } 886 | 887 | public boolean isNoValue() { 888 | return noValue; 889 | } 890 | 891 | public boolean isSingleValue() { 892 | return singleValue; 893 | } 894 | 895 | public boolean isBetweenValue() { 896 | return betweenValue; 897 | } 898 | 899 | public boolean isListValue() { 900 | return listValue; 901 | } 902 | 903 | public String getTypeHandler() { 904 | return typeHandler; 905 | } 906 | 907 | protected Criterion(String condition) { 908 | super(); 909 | this.condition = condition; 910 | this.typeHandler = null; 911 | this.noValue = true; 912 | } 913 | 914 | protected Criterion(String condition, Object value, String typeHandler) { 915 | super(); 916 | this.condition = condition; 917 | this.value = value; 918 | this.typeHandler = typeHandler; 919 | if (value instanceof List) { 920 | this.listValue = true; 921 | } else { 922 | this.singleValue = true; 923 | } 924 | } 925 | 926 | protected Criterion(String condition, Object value) { 927 | this(condition, value, null); 928 | } 929 | 930 | protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { 931 | super(); 932 | this.condition = condition; 933 | this.value = value; 934 | this.secondValue = secondValue; 935 | this.typeHandler = typeHandler; 936 | this.betweenValue = true; 937 | } 938 | 939 | protected Criterion(String condition, Object value, Object secondValue) { 940 | this(condition, value, secondValue, null); 941 | } 942 | } 943 | } -------------------------------------------------------------------------------- /cloudE-mapper/src/main/java/com/cloudE/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.mapper; 2 | 3 | import com.cloudE.entity.User; 4 | import com.cloudE.entity.UserExample; 5 | import java.util.List; 6 | 7 | import org.apache.ibatis.annotations.Mapper; 8 | import org.apache.ibatis.annotations.Param; 9 | 10 | @Mapper 11 | public interface UserMapper { 12 | /** 13 | * This method was generated by MyBatis Generator. 14 | * This method corresponds to the database table user 15 | * 16 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 17 | */ 18 | long countByExample(UserExample example); 19 | 20 | /** 21 | * This method was generated by MyBatis Generator. 22 | * This method corresponds to the database table user 23 | * 24 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 25 | */ 26 | int deleteByExample(UserExample example); 27 | 28 | /** 29 | * This method was generated by MyBatis Generator. 30 | * This method corresponds to the database table user 31 | * 32 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 33 | */ 34 | int deleteByPrimaryKey(Long id); 35 | 36 | /** 37 | * This method was generated by MyBatis Generator. 38 | * This method corresponds to the database table user 39 | * 40 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 41 | */ 42 | int insert(User record); 43 | 44 | /** 45 | * This method was generated by MyBatis Generator. 46 | * This method corresponds to the database table user 47 | * 48 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 49 | */ 50 | int insertSelective(User record); 51 | 52 | /** 53 | * This method was generated by MyBatis Generator. 54 | * This method corresponds to the database table user 55 | * 56 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 57 | */ 58 | List selectByExample(UserExample example); 59 | 60 | /** 61 | * This method was generated by MyBatis Generator. 62 | * This method corresponds to the database table user 63 | * 64 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 65 | */ 66 | User selectByPrimaryKey(Long id); 67 | 68 | /** 69 | * This method was generated by MyBatis Generator. 70 | * This method corresponds to the database table user 71 | * 72 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 73 | */ 74 | int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); 75 | 76 | /** 77 | * This method was generated by MyBatis Generator. 78 | * This method corresponds to the database table user 79 | * 80 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 81 | */ 82 | int updateByExample(@Param("record") User record, @Param("example") UserExample example); 83 | 84 | /** 85 | * This method was generated by MyBatis Generator. 86 | * This method corresponds to the database table user 87 | * 88 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 89 | */ 90 | int updateByPrimaryKeySelective(User record); 91 | 92 | /** 93 | * This method was generated by MyBatis Generator. 94 | * This method corresponds to the database table user 95 | * 96 | * @mbg.generated Mon Jul 24 13:56:47 CST 2017 97 | */ 98 | int updateByPrimaryKey(User record); 99 | } -------------------------------------------------------------------------------- /cloudE-mapper/src/main/resources/create.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `user` ( 2 | `id` bigint(16) NOT NULL AUTO_INCREMENT, 3 | `username` varchar(128) NOT NULL COMMENT '

用户名

不允许重复,要求应用层不允许重复', 4 | `password` varchar(32) NOT NULL COMMENT '

用户密码

', 5 | `status` tinyint(4) DEFAULT NULL COMMENT '

用户状态

', 6 | `reg_login_ip` varchar(32) DEFAULT NULL COMMENT '

用户注册时的ip地址

', 7 | `last_login_ip` varchar(32) DEFAULT NULL COMMENT '

最后登陆的ip

', 8 | `last_login_time` datetime DEFAULT NULL COMMENT '

最后登陆的时间

', 9 | `create_time` datetime NOT NULL COMMENT '

用户创建日期

系统时间', 10 | `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '

最后修改日期

系统时间', 11 | `del_status` tinyint(1) NOT NULL DEFAULT '0', 12 | PRIMARY KEY (`id`) 13 | ) ENGINE=InnoDB AUTO_INCREMENT=12244 DEFAULT CHARSET=utf8 COMMENT='

用户基本信息表

' -------------------------------------------------------------------------------- /cloudE-mapper/src/main/resources/generatorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 17 | 18 | 19 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 48 | 49 | 50 | 54 | 55 | 63 | 64 | 65 | 66 | 71 | 73 | 74 | 75 | 79 | 80 | 81 | 82 | 83 | 84 | 89 | 91 | 92 | 93 | 94 | 102 | 104 | 105 | 106 | 107 | 145 | 146 | 147 | 149 |
150 | 151 | 152 |
153 | 154 | 155 |
-------------------------------------------------------------------------------- /cloudE-mapper/src/main/resources/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | and ${criterion.condition} 35 | 36 | 37 | and ${criterion.condition} #{criterion.value} 38 | 39 | 40 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 41 | 42 | 43 | and ${criterion.condition} 44 | 45 | #{listItem} 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | and ${criterion.condition} 69 | 70 | 71 | and ${criterion.condition} #{criterion.value} 72 | 73 | 74 | and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} 75 | 76 | 77 | and ${criterion.condition} 78 | 79 | #{listItem} 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 95 | id, username, password, status, reg_login_ip, last_login_ip, last_login_time, create_time, 96 | update_time, del_status 97 | 98 | 117 | 128 | 129 | 134 | delete from user 135 | where id = #{id,jdbcType=BIGINT} 136 | 137 | 138 | 143 | delete from user 144 | 145 | 146 | 147 | 148 | 149 | 154 | 155 | SELECT LAST_INSERT_ID() 156 | 157 | insert into user (username, password, status, 158 | reg_login_ip, last_login_ip, last_login_time, 159 | create_time, update_time, del_status 160 | ) 161 | values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, 162 | #{regLoginIp,jdbcType=VARCHAR}, #{lastLoginIp,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP}, 163 | #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{delStatus,jdbcType=BIT} 164 | ) 165 | 166 | 167 | 172 | 173 | SELECT LAST_INSERT_ID() 174 | 175 | insert into user 176 | 177 | 178 | username, 179 | 180 | 181 | password, 182 | 183 | 184 | status, 185 | 186 | 187 | reg_login_ip, 188 | 189 | 190 | last_login_ip, 191 | 192 | 193 | last_login_time, 194 | 195 | 196 | create_time, 197 | 198 | 199 | update_time, 200 | 201 | 202 | del_status, 203 | 204 | 205 | 206 | 207 | #{username,jdbcType=VARCHAR}, 208 | 209 | 210 | #{password,jdbcType=VARCHAR}, 211 | 212 | 213 | #{status,jdbcType=TINYINT}, 214 | 215 | 216 | #{regLoginIp,jdbcType=VARCHAR}, 217 | 218 | 219 | #{lastLoginIp,jdbcType=VARCHAR}, 220 | 221 | 222 | #{lastLoginTime,jdbcType=TIMESTAMP}, 223 | 224 | 225 | #{createTime,jdbcType=TIMESTAMP}, 226 | 227 | 228 | #{updateTime,jdbcType=TIMESTAMP}, 229 | 230 | 231 | #{delStatus,jdbcType=BIT}, 232 | 233 | 234 | 235 | 246 | 247 | 252 | update user 253 | 254 | 255 | id = #{record.id,jdbcType=BIGINT}, 256 | 257 | 258 | username = #{record.username,jdbcType=VARCHAR}, 259 | 260 | 261 | password = #{record.password,jdbcType=VARCHAR}, 262 | 263 | 264 | status = #{record.status,jdbcType=TINYINT}, 265 | 266 | 267 | reg_login_ip = #{record.regLoginIp,jdbcType=VARCHAR}, 268 | 269 | 270 | last_login_ip = #{record.lastLoginIp,jdbcType=VARCHAR}, 271 | 272 | 273 | last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP}, 274 | 275 | 276 | create_time = #{record.createTime,jdbcType=TIMESTAMP}, 277 | 278 | 279 | update_time = #{record.updateTime,jdbcType=TIMESTAMP}, 280 | 281 | 282 | del_status = #{record.delStatus,jdbcType=BIT}, 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 295 | update user 296 | set id = #{record.id,jdbcType=BIGINT}, 297 | username = #{record.username,jdbcType=VARCHAR}, 298 | password = #{record.password,jdbcType=VARCHAR}, 299 | status = #{record.status,jdbcType=TINYINT}, 300 | reg_login_ip = #{record.regLoginIp,jdbcType=VARCHAR}, 301 | last_login_ip = #{record.lastLoginIp,jdbcType=VARCHAR}, 302 | last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP}, 303 | create_time = #{record.createTime,jdbcType=TIMESTAMP}, 304 | update_time = #{record.updateTime,jdbcType=TIMESTAMP}, 305 | del_status = #{record.delStatus,jdbcType=BIT} 306 | 307 | 308 | 309 | 310 | 311 | 316 | update user 317 | 318 | 319 | username = #{username,jdbcType=VARCHAR}, 320 | 321 | 322 | password = #{password,jdbcType=VARCHAR}, 323 | 324 | 325 | status = #{status,jdbcType=TINYINT}, 326 | 327 | 328 | reg_login_ip = #{regLoginIp,jdbcType=VARCHAR}, 329 | 330 | 331 | last_login_ip = #{lastLoginIp,jdbcType=VARCHAR}, 332 | 333 | 334 | last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}, 335 | 336 | 337 | create_time = #{createTime,jdbcType=TIMESTAMP}, 338 | 339 | 340 | update_time = #{updateTime,jdbcType=TIMESTAMP}, 341 | 342 | 343 | del_status = #{delStatus,jdbcType=BIT}, 344 | 345 | 346 | where id = #{id,jdbcType=BIGINT} 347 | 348 | 349 | 354 | update user 355 | set username = #{username,jdbcType=VARCHAR}, 356 | password = #{password,jdbcType=VARCHAR}, 357 | status = #{status,jdbcType=TINYINT}, 358 | reg_login_ip = #{regLoginIp,jdbcType=VARCHAR}, 359 | last_login_ip = #{lastLoginIp,jdbcType=VARCHAR}, 360 | last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP}, 361 | create_time = #{createTime,jdbcType=TIMESTAMP}, 362 | update_time = #{updateTime,jdbcType=TIMESTAMP}, 363 | del_status = #{delStatus,jdbcType=BIT} 364 | where id = #{id,jdbcType=BIGINT} 365 | 366 | -------------------------------------------------------------------------------- /cloudE-pay-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.cloudE 6 | cloudE-pay-api 7 | 1.0.0 8 | jar 9 | cloude-pay-api 10 | 11 | 12 | 13 | com.cloudE 14 | cloudE-common 15 | 1.0.0 16 | 17 | 18 | org.springframework 19 | spring-context 20 | 4.3.7.RELEASE 21 | 22 | 23 | org.springframework 24 | spring-web 25 | 4.3.7.RELEASE 26 | 27 | 28 | org.springframework.cloud 29 | spring-cloud-netflix-core 30 | 1.2.6.RELEASE 31 | 32 | 33 | 34 | 35 | 36 | 37 | 1.8 38 | 1.8 39 | 40 | 41 | 42 | 43 | 44 | org.apache.maven.plugins 45 | maven-source-plugin 46 | 3.0.1 47 | 48 | 49 | 50 | jar-no-fork 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /cloudE-pay-api/src/main/java/com/cloudE/pay/client/ApplePayClient.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.pay.client; 2 | 3 | import com.cloudE.dto.BaseResult; 4 | import org.springframework.cloud.netflix.feign.FeignClient; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestMethod; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | 9 | 10 | @FeignClient(name = "cloudE-pay-provider") 11 | public interface ApplePayClient { 12 | 13 | @RequestMapping(value = "apple/recharge", method = RequestMethod.POST) 14 | BaseResult recharge(@RequestParam("userId") Long userId, @RequestParam("amount") Double amount); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cloudE-pay-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | cloud 6 | cloudE-pay-provider 7 | 1.0.0 8 | cloude-pay-provider 9 | 10 | 11 | com.cloudE 12 | cloudE-parent 13 | 1.0.0 14 | 15 | 16 | 17 | 18 | com.cloudE 19 | cloudE-mapper 20 | ${cloudE-mapper-version} 21 | 22 | 23 | com.cloudE 24 | cloudE-common 25 | ${cloudE-common-version} 26 | 27 | 28 | com.cloudE 29 | cloudE-pay-api 30 | ${cloudE-pay-api-version} 31 | 32 | 33 | 34 | org.springframework.cloud 35 | spring-cloud-starter-eureka-server 36 | 37 | 38 | org.springframework.cloud 39 | spring-cloud-starter-sleuth 40 | 41 | 42 | org.springframework.cloud 43 | spring-cloud-sleuth-zipkin 44 | 45 | 46 | org.springframework.cloud 47 | spring-cloud-config-client 48 | 49 | 50 | org.springframework.cloud 51 | spring-cloud-starter-hystrix 52 | 53 | 54 | org.mybatis.spring.boot 55 | mybatis-spring-boot-starter 56 | 1.1.1 57 | 58 | 59 | 60 | 61 | tk.mybatis 62 | mapper-spring-boot-starter 63 | 1.1.1 64 | 65 | 66 | 67 | org.jolokia 68 | jolokia-core 69 | 70 | 71 | org.springframework.boot 72 | spring-boot-starter-test 73 | test 74 | 75 | 76 | 77 | 78 | org.springframework.boot 79 | spring-boot-starter-data-redis 80 | 81 | 82 | 83 | 84 | io.springfox 85 | springfox-swagger2 86 | 2.6.1 87 | compile 88 | 89 | 90 | io.springfox 91 | springfox-swagger-ui 92 | 2.6.1 93 | compile 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-pay-provider-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/java/com/cloudE/PayProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloudE; 2 | 3 | import io.prometheus.client.spring.boot.EnableSpringBootMetricsCollector; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 7 | import org.springframework.cloud.netflix.hystrix.EnableHystrix; 8 | 9 | /** 10 | * @author vangao1989 11 | * @Description: 支付服务 12 | * @date 2017年7月26日 13 | */ 14 | @SpringBootApplication 15 | @EnableEurekaClient 16 | @EnableHystrix 17 | @EnableSpringBootMetricsCollector 18 | public class PayProviderApplication { 19 | 20 | public static void main(String[] args) { 21 | SpringApplication.run(PayProviderApplication.class, args); 22 | 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/java/com/cloudE/Swagger2.java: -------------------------------------------------------------------------------- 1 | package com.cloudE; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | /** 14 | * @author vangao1989 15 | * @Description: Swagger 16 | * @date 2017年7月26日 17 | */ 18 | @Configuration 19 | @EnableSwagger2 20 | public class Swagger2 { 21 | @Bean 22 | public Docket createRestApi() { 23 | return new Docket(DocumentationType.SWAGGER_2) 24 | .apiInfo(apiInfo()) 25 | .select() 26 | .apis(RequestHandlerSelectors.basePackage("com.cloudE.pay.provider")) 27 | .paths(PathSelectors.any()) 28 | .build(); 29 | } 30 | private ApiInfo apiInfo() { 31 | return new ApiInfoBuilder() 32 | .title("支付服务") 33 | .description("") 34 | .termsOfServiceUrl("") 35 | .contact("vangao1989@126.com") 36 | .version("1.0") 37 | .build(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/java/com/cloudE/pay/prometheus/MetricsConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.pay.prometheus; 2 | 3 | import io.prometheus.client.exporter.MetricsServlet; 4 | import io.prometheus.client.hotspot.DefaultExports; 5 | import io.prometheus.client.spring.boot.SpringBootMetricsCollector; 6 | import org.springframework.boot.actuate.endpoint.PublicMetrics; 7 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | import java.util.Collection; 12 | 13 | @Configuration 14 | public class MetricsConfiguration { 15 | 16 | @Bean 17 | public ServletRegistrationBean servletRegistrationBean() { 18 | DefaultExports.initialize(); 19 | return new ServletRegistrationBean(new MetricsServlet(), "/prometheus"); 20 | } 21 | 22 | @Bean 23 | public SpringBootMetricsCollector springBootMetricsCollector(Collection publicMetrics) { 24 | SpringBootMetricsCollector springBootMetricsCollector = new SpringBootMetricsCollector( 25 | publicMetrics); 26 | springBootMetricsCollector.register(); 27 | return springBootMetricsCollector; 28 | } 29 | } -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/java/com/cloudE/pay/provider/ApplePayProvider.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.pay.provider; 2 | 3 | import com.cloudE.dto.BaseResult; 4 | import com.cloudE.pay.redis.RedisService; 5 | import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; 6 | import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty; 7 | import io.swagger.annotations.Api; 8 | import io.swagger.annotations.ApiOperation; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | import org.springframework.web.bind.annotation.PostMapping; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | import org.springframework.web.bind.annotation.RestController; 14 | 15 | import javax.annotation.Resource; 16 | 17 | 18 | @Api("apple支付") 19 | @RestController 20 | public class ApplePayProvider { 21 | 22 | private static final Logger log = LoggerFactory.getLogger(ApplePayProvider.class); 23 | 24 | 25 | @Resource 26 | private RedisService redisService; 27 | 28 | 29 | @ApiOperation(value = "apple充值", notes = "测试接口") 30 | @HystrixCommand(fallbackMethod = "rechargeFallBack", commandProperties = { 31 | @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "5000")}) 32 | @PostMapping(value = "apple/recharge") 33 | public BaseResult applePayRecharge(@RequestParam("userId") Long userId, @RequestParam("amount") Double amount) throws Exception { 34 | log.info("apple recharge {}", amount); 35 | redisService.set("apple_recharge_" + userId, amount.toString(), 3600); 36 | return new BaseResult<>(true); 37 | } 38 | 39 | private BaseResult rechargeFallBack(Long userId, Double amount, Throwable e) { 40 | log.error("user:{},apple recharge amount:{}, fail :{}", userId, amount, e.getMessage(), e); 41 | return new BaseResult<>(false, e.getMessage()); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/java/com/cloudE/pay/redis/RedisConfig.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.pay.redis; 2 | 3 | import com.fasterxml.jackson.annotation.JsonAutoDetect; 4 | import com.fasterxml.jackson.annotation.PropertyAccessor; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.beans.factory.annotation.Value; 10 | import org.springframework.cache.CacheManager; 11 | import org.springframework.cache.annotation.CachingConfigurerSupport; 12 | import org.springframework.cache.annotation.EnableCaching; 13 | import org.springframework.cache.interceptor.KeyGenerator; 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.data.redis.cache.RedisCacheManager; 18 | import org.springframework.data.redis.connection.RedisConnectionFactory; 19 | import org.springframework.data.redis.core.RedisTemplate; 20 | import org.springframework.data.redis.core.StringRedisTemplate; 21 | import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 22 | 23 | import java.lang.reflect.Method; 24 | 25 | 26 | @Configuration 27 | @EnableCaching 28 | public class RedisConfig extends CachingConfigurerSupport { 29 | 30 | 31 | private static final Logger LOGGER = LoggerFactory.getLogger(RedisConfig.class); 32 | 33 | 34 | // @Value("${redis.defaultExpirationTime}") 35 | private String defaultExpirationTime = "600"; 36 | 37 | 38 | @Bean 39 | public KeyGenerator keyGenerator() { 40 | return new KeyGenerator() { 41 | @Override 42 | public Object generate(Object target, Method method, Object... params) { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(target.getClass().getName()); 45 | sb.append(method.getName()); 46 | for (Object obj : params) { 47 | sb.append(obj.toString()); 48 | } 49 | return sb.toString(); 50 | } 51 | }; 52 | } 53 | 54 | @SuppressWarnings("rawtypes") 55 | @Bean 56 | public CacheManager cacheManager(RedisTemplate redisTemplate) { 57 | RedisCacheManager rcm = new RedisCacheManager(redisTemplate); 58 | //设置缓存过期时间 59 | rcm.setDefaultExpiration(Long.parseLong(defaultExpirationTime));//秒 60 | return rcm; 61 | } 62 | 63 | @Bean 64 | public RedisTemplate redisTemplate(RedisConnectionFactory factory) { 65 | StringRedisTemplate template = new StringRedisTemplate(factory); 66 | Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); 67 | ObjectMapper om = new ObjectMapper(); 68 | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); 69 | om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); 70 | jackson2JsonRedisSerializer.setObjectMapper(om); 71 | template.setValueSerializer(jackson2JsonRedisSerializer); 72 | template.afterPropertiesSet(); 73 | return template; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/java/com/cloudE/pay/redis/RedisService.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.pay.redis; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.dao.DataAccessException; 5 | import org.springframework.data.redis.connection.RedisConnection; 6 | import org.springframework.data.redis.core.RedisCallback; 7 | import org.springframework.data.redis.core.RedisTemplate; 8 | import org.springframework.stereotype.Service; 9 | 10 | import java.io.UnsupportedEncodingException; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | 15 | 16 | @Service 17 | public class RedisService { 18 | 19 | private static String redisCode = "utf-8"; 20 | 21 | public RedisService() { 22 | } 23 | 24 | @Autowired 25 | private RedisTemplate redisTemplate; 26 | 27 | public long del(final String... keys) { 28 | return (long) redisTemplate.execute(new RedisCallback() { 29 | public Long doInRedis(RedisConnection connection) throws DataAccessException { 30 | long result = 0; 31 | for (int i = 0; i < keys.length; i++) { 32 | result = connection.del(keys[i].getBytes()); 33 | } 34 | return result; 35 | } 36 | }); 37 | } 38 | 39 | /** 40 | * @param key 41 | * @param value 42 | * @param liveTime 43 | */ 44 | public void set(final byte[] key, final byte[] value, final long liveTime) { 45 | redisTemplate.execute(new RedisCallback() { 46 | public Long doInRedis(RedisConnection connection) throws DataAccessException { 47 | connection.set(key, value); 48 | if (liveTime > 0) { 49 | connection.expire(key, liveTime); 50 | } 51 | return 1L; 52 | } 53 | }); 54 | } 55 | 56 | /** 57 | * @param key 58 | * @param value 59 | * @param liveTime 60 | */ 61 | public void set(String key, String value, long liveTime) { 62 | this.set(key.getBytes(), value.getBytes(), liveTime); 63 | } 64 | 65 | /** 66 | * @param key 67 | * @param value 68 | */ 69 | public void set(String key, String value) { 70 | this.set(key, value, 0L); 71 | } 72 | 73 | /** 74 | * @param key 75 | * @param value 76 | */ 77 | public void set(byte[] key, byte[] value) { 78 | this.set(key, value, 0L); 79 | } 80 | 81 | /** 82 | * @param key 83 | * @return 84 | */ 85 | public String get(final String key) { 86 | return (String) redisTemplate.execute(new RedisCallback() { 87 | public String doInRedis(RedisConnection connection) throws DataAccessException { 88 | try { 89 | return new String(connection.get(key.getBytes()), redisCode); 90 | } catch (UnsupportedEncodingException e) { 91 | e.printStackTrace(); 92 | } 93 | return ""; 94 | } 95 | }); 96 | } 97 | 98 | // /** 99 | // * @param pattern 100 | // * @return 101 | // */ 102 | // public Setkeys(String pattern) { 103 | // return redisTemplate.keys(pattern); 104 | // 105 | // } 106 | 107 | /** 108 | * @param key 109 | * @return 110 | */ 111 | public boolean exists(final String key) { 112 | return (boolean) redisTemplate.execute(new RedisCallback() { 113 | public Boolean doInRedis(RedisConnection connection) throws DataAccessException { 114 | return connection.exists(key.getBytes()); 115 | } 116 | }); 117 | } 118 | 119 | /** 120 | * @return 121 | */ 122 | public String flushDB() { 123 | return (String) redisTemplate.execute(new RedisCallback() { 124 | public String doInRedis(RedisConnection connection) throws DataAccessException { 125 | connection.flushDb(); 126 | return "ok"; 127 | } 128 | }); 129 | } 130 | 131 | /** 132 | * @return 133 | */ 134 | public long dbSize() { 135 | return (long) redisTemplate.execute(new RedisCallback() { 136 | public Long doInRedis(RedisConnection connection) throws DataAccessException { 137 | return connection.dbSize(); 138 | } 139 | }); 140 | } 141 | 142 | /** 143 | * @return 144 | */ 145 | public String ping() { 146 | return (String) redisTemplate.execute(new RedisCallback() { 147 | public String doInRedis(RedisConnection connection) throws DataAccessException { 148 | 149 | return connection.ping(); 150 | } 151 | }); 152 | } 153 | 154 | public void hSet(String key, String field, String value) { 155 | redisTemplate.execute(new RedisCallback() { 156 | public Boolean doInRedis(RedisConnection connection) throws DataAccessException { 157 | Boolean isSuccess = connection.hSet(key.getBytes(), field.getBytes(), value.getBytes()); 158 | return isSuccess; 159 | } 160 | }); 161 | } 162 | 163 | public void hSet(String key, String field, String value, Long liveTime) { 164 | redisTemplate.execute(new RedisCallback() { 165 | public Boolean doInRedis(RedisConnection connection) throws DataAccessException { 166 | Boolean isSuccess = connection.hSet(key.getBytes(), field.getBytes(), value.getBytes()); 167 | if (liveTime > 0) { 168 | connection.expire(key.getBytes(), liveTime); 169 | } 170 | return isSuccess; 171 | } 172 | }); 173 | } 174 | 175 | public String hGet(String key, String field) { 176 | return (String) redisTemplate.execute(new RedisCallback() { 177 | public String doInRedis(RedisConnection connection) throws DataAccessException { 178 | if(exists(key)){ 179 | return new String(connection.hGet(key.getBytes(), field.getBytes())); 180 | }else { 181 | return null; 182 | } 183 | 184 | } 185 | }); 186 | } 187 | 188 | public Map hGetAll(String key) { 189 | return (Map) redisTemplate.execute(new RedisCallback() { 190 | public Map doInRedis(RedisConnection connection) throws DataAccessException { 191 | if(exists(key)){ 192 | Map map = connection.hGetAll(key.getBytes()); 193 | Map resMap = new HashMap<>(); 194 | map.forEach((key, value) -> resMap.put(new String(key), new String(value))); 195 | return resMap; 196 | }else { 197 | return new HashMap<>(); 198 | } 199 | 200 | } 201 | }); 202 | } 203 | 204 | 205 | } 206 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/resources/config/application-default.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=local 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/resources/config/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=dev 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/resources/config/application-pro.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=production 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/resources/config/application-qa.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=qa 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: cloudE-pay-provider 4 | cloud: 5 | config: 6 | uri: http://localhost:8888 7 | 8 | eureka: 9 | instance: 10 | prefer-ip-address: true 11 | 12 | server: 13 | port: 8081 14 | 15 | mybatis: 16 | mapperLocations: classpath:mapper/*.xml 17 | typeAliasesPackage: com.cloudE.mapper 18 | -------------------------------------------------------------------------------- /cloudE-pay-provider/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-turbine-server/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.cloudE 6 | cloudE-turbine-server 7 | 1.0.0 8 | jar 9 | 10 | cloude-turbine-server 11 | 12 | 13 | com.cloudE 14 | cloudE-parent 15 | 1.0.0 16 | 17 | 18 | 19 | 20 | org.springframework.cloud 21 | spring-cloud-starter-eureka-server 22 | 23 | 24 | org.springframework.cloud 25 | spring-cloud-starter-turbine 26 | 27 | 28 | org.springframework.cloud 29 | spring-cloud-netflix-turbine 30 | 31 | 32 | org.springframework.boot 33 | spring-boot-starter-actuator 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /cloudE-turbine-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-turbine-server-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-turbine-server/src/main/java/cloudE/turbine/server/TurbineServerApplication.java: -------------------------------------------------------------------------------- 1 | package cloudE.turbine.server; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | import org.springframework.cloud.netflix.turbine.EnableTurbine; 7 | 8 | 9 | /** 10 | * @author vangao1989 11 | * @Description: hystrix dashboard 聚合 12 | * @date 2017年7月26日 13 | */ 14 | @SpringBootApplication 15 | @EnableTurbine 16 | @EnableEurekaClient 17 | public class TurbineServerApplication { 18 | 19 | public static void main(String[] args) { 20 | SpringApplication.run(TurbineServerApplication.class, args); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cloudE-turbine-server/src/main/resources/config/application-default.properties: -------------------------------------------------------------------------------- 1 | ## 配置Eureka中的serviceId列表,表明监控哪些服务 2 | #turbine.appConfig=cloudE-ucenter-provider 3 | ## 指定聚合哪些集群,多个使用","分割,默认为default。可使用http://.../turbine.stream?cluster={clusterConfig之一}访问 4 | #turbine.aggregator.clusterConfig=default 5 | ## 1. clusterNameExpression指定集群名称,默认表达式appName;此时:turbine.aggregator.clusterConfig需要配置想要监控的应用名称 6 | ## 2. 当clusterNameExpression: default时,turbine.aggregator.clusterConfig可以不写,因为默认就是default 7 | ## 3. 当clusterNameExpression: metadata['cluster']时,假设想要监控的应用配置了eureka.instance.metadata-map.cluster: ABC,则需要配置,同时turbine.aggregator.clusterConfig: ABC 8 | #turbine.clusterNameExpression= new String("default") 9 | 10 | spring.cloud.config.name=cloud-config 11 | spring.cloud.config.profile=local 12 | spring.cloud.config.label=master 13 | 14 | -------------------------------------------------------------------------------- /cloudE-turbine-server/src/main/resources/config/application-dev.properties: -------------------------------------------------------------------------------- 1 | ## 配置Eureka中的serviceId列表,表明监控哪些服务 2 | #turbine.appConfig=cloudE-ucenter-provider 3 | ## 指定聚合哪些集群,多个使用","分割,默认为default。可使用http://.../turbine.stream?cluster={clusterConfig之一}访问 4 | #turbine.aggregator.clusterConfig=default 5 | ## 1. clusterNameExpression指定集群名称,默认表达式appName;此时:turbine.aggregator.clusterConfig需要配置想要监控的应用名称 6 | ## 2. 当clusterNameExpression: default时,turbine.aggregator.clusterConfig可以不写,因为默认就是default 7 | ## 3. 当clusterNameExpression: metadata['cluster']时,假设想要监控的应用配置了eureka.instance.metadata-map.cluster: ABC,则需要配置,同时turbine.aggregator.clusterConfig: ABC 8 | #turbine.clusterNameExpression= new String("default") 9 | 10 | spring.cloud.config.name=cloud-config 11 | spring.cloud.config.profile=dev 12 | spring.cloud.config.label=master 13 | 14 | -------------------------------------------------------------------------------- /cloudE-turbine-server/src/main/resources/config/application-pro.properties: -------------------------------------------------------------------------------- 1 | ## 配置Eureka中的serviceId列表,表明监控哪些服务 2 | #turbine.appConfig=cloudE-ucenter-provider 3 | ## 指定聚合哪些集群,多个使用","分割,默认为default。可使用http://.../turbine.stream?cluster={clusterConfig之一}访问 4 | #turbine.aggregator.clusterConfig=default 5 | ## 1. clusterNameExpression指定集群名称,默认表达式appName;此时:turbine.aggregator.clusterConfig需要配置想要监控的应用名称 6 | ## 2. 当clusterNameExpression: default时,turbine.aggregator.clusterConfig可以不写,因为默认就是default 7 | ## 3. 当clusterNameExpression: metadata['cluster']时,假设想要监控的应用配置了eureka.instance.metadata-map.cluster: ABC,则需要配置,同时turbine.aggregator.clusterConfig: ABC 8 | #turbine.clusterNameExpression= new String("default") 9 | 10 | spring.cloud.config.name=cloud-config 11 | spring.cloud.config.profile=production 12 | spring.cloud.config.label=master 13 | 14 | -------------------------------------------------------------------------------- /cloudE-turbine-server/src/main/resources/config/application-qa.properties: -------------------------------------------------------------------------------- 1 | ## 配置Eureka中的serviceId列表,表明监控哪些服务 2 | #turbine.appConfig=cloudE-ucenter-provider 3 | ## 指定聚合哪些集群,多个使用","分割,默认为default。可使用http://.../turbine.stream?cluster={clusterConfig之一}访问 4 | #turbine.aggregator.clusterConfig=default 5 | ## 1. clusterNameExpression指定集群名称,默认表达式appName;此时:turbine.aggregator.clusterConfig需要配置想要监控的应用名称 6 | ## 2. 当clusterNameExpression: default时,turbine.aggregator.clusterConfig可以不写,因为默认就是default 7 | ## 3. 当clusterNameExpression: metadata['cluster']时,假设想要监控的应用配置了eureka.instance.metadata-map.cluster: ABC,则需要配置,同时turbine.aggregator.clusterConfig: ABC 8 | #turbine.clusterNameExpression= new String("default") 9 | 10 | spring.cloud.config.name=cloud-config 11 | spring.cloud.config.profile=qa 12 | spring.cloud.config.label=master 13 | -------------------------------------------------------------------------------- /cloudE-turbine-server/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: cloudE-turbine-server 4 | cloud: 5 | config: 6 | uri: http://localhost:8888 7 | 8 | eureka: 9 | instance: 10 | prefer-ip-address: true 11 | 12 | server: 13 | port: 8031 14 | turbine: 15 | app-config: cloudE-ucenter-provider,cloudE-pay-provider 16 | aggregator: 17 | cluster-config: default 18 | cluster-name-expression: new String("default") 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /cloudE-turbine-server/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.cloudE 6 | cloudE-ucenter-provider 7 | 1.0.0 8 | cloude-ucenter-provider 9 | 10 | 11 | com.cloudE 12 | cloudE-parent 13 | 1.0.0 14 | 15 | 16 | 17 | 18 | 19 | com.cloudE 20 | cloudE-mapper 21 | ${cloudE-mapper-version} 22 | 23 | 24 | com.cloudE 25 | cloudE-common 26 | ${cloudE-common-version} 27 | 28 | 29 | com.cloudE 30 | cloudE-pay-api 31 | ${cloudE-pay-api-version} 32 | 33 | 34 | 35 | org.springframework.cloud 36 | spring-cloud-starter-eureka-server 37 | 38 | 39 | org.springframework.cloud 40 | spring-cloud-starter-hystrix 41 | 42 | 43 | org.springframework.cloud 44 | spring-cloud-starter-sleuth 45 | 46 | 47 | org.springframework.cloud 48 | spring-cloud-sleuth-zipkin 49 | 50 | 51 | org.springframework.cloud 52 | spring-cloud-netflix-turbine 53 | 54 | 55 | org.springframework.cloud 56 | spring-cloud-config-client 57 | 58 | 59 | org.springframework.boot 60 | spring-boot-starter-data-redis 61 | 62 | 63 | org.springframework.boot 64 | spring-boot-starter-amqp 65 | 66 | 67 | org.springframework.cloud 68 | spring-cloud-starter-feign 69 | 70 | 71 | 72 | org.jolokia 73 | jolokia-core 74 | 75 | 76 | org.mybatis.spring.boot 77 | mybatis-spring-boot-starter 78 | 1.1.1 79 | 80 | 81 | com.alibaba 82 | fastjson 83 | 1.2.29 84 | 85 | 86 | com.google.code.gson 87 | gson 88 | 89 | 90 | 91 | org.springframework.boot 92 | spring-boot-starter-test 93 | test 94 | 95 | 96 | 97 | 98 | com.github.pagehelper 99 | pagehelper-spring-boot-starter 100 | 1.1.1 101 | 102 | 103 | 104 | 105 | io.springfox 106 | springfox-swagger2 107 | 2.6.1 108 | compile 109 | 110 | 111 | io.springfox 112 | springfox-swagger-ui 113 | 2.6.1 114 | compile 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-ucenter-provider-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/java/com/cloudE/Swagger2.java: -------------------------------------------------------------------------------- 1 | package com.cloudE; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.spi.DocumentationType; 10 | import springfox.documentation.spring.web.plugins.Docket; 11 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 12 | 13 | /** 14 | * @author vangao1989 15 | * @date 2017年7月24日 16 | */ 17 | @Configuration 18 | @EnableSwagger2 19 | public class Swagger2 { 20 | 21 | @Bean 22 | public Docket createRestApi() { 23 | return new Docket(DocumentationType.SWAGGER_2) 24 | .apiInfo(apiInfo()) 25 | .select() 26 | .apis(RequestHandlerSelectors.basePackage("com.cloudE.ucenter.provider")) 27 | .paths(PathSelectors.any()) 28 | .build(); 29 | } 30 | 31 | private ApiInfo apiInfo() { 32 | return new ApiInfoBuilder() 33 | .title("用户中心") 34 | .contact("vangao1989@126.com") 35 | .version("1.0") 36 | .build(); 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/java/com/cloudE/UserProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.cloudE; 2 | 3 | import io.prometheus.client.spring.boot.EnableSpringBootMetricsCollector; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.cloud.context.config.annotation.RefreshScope; 7 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 8 | import org.springframework.cloud.netflix.feign.EnableFeignClients; 9 | import org.springframework.cloud.netflix.hystrix.EnableHystrix; 10 | 11 | 12 | /** 13 | * @author vangao1989 14 | * @Description: 微服务 15 | * @date 2017年7月24日 16 | */ 17 | @SpringBootApplication 18 | @EnableEurekaClient 19 | @EnableHystrix 20 | @EnableFeignClients 21 | @EnableSpringBootMetricsCollector 22 | @RefreshScope 23 | public class UserProviderApplication { 24 | public static void main(String[] args) { 25 | SpringApplication.run(UserProviderApplication.class, args); 26 | } 27 | } -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/java/com/cloudE/prometheus/MetricsConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.prometheus; 2 | 3 | import io.prometheus.client.exporter.MetricsServlet; 4 | import io.prometheus.client.hotspot.DefaultExports; 5 | import io.prometheus.client.spring.boot.SpringBootMetricsCollector; 6 | import org.springframework.boot.actuate.endpoint.PublicMetrics; 7 | import org.springframework.boot.web.servlet.ServletRegistrationBean; 8 | import org.springframework.context.annotation.Bean; 9 | import org.springframework.context.annotation.Configuration; 10 | 11 | import java.util.Collection; 12 | 13 | @Configuration 14 | public class MetricsConfiguration { 15 | 16 | @Bean 17 | public ServletRegistrationBean servletRegistrationBean() { 18 | DefaultExports.initialize(); 19 | return new ServletRegistrationBean(new MetricsServlet(), "/prometheus"); 20 | } 21 | 22 | @Bean 23 | public SpringBootMetricsCollector springBootMetricsCollector(Collection publicMetrics) { 24 | SpringBootMetricsCollector springBootMetricsCollector = new SpringBootMetricsCollector( 25 | publicMetrics); 26 | springBootMetricsCollector.register(); 27 | return springBootMetricsCollector; 28 | } 29 | } -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/java/com/cloudE/ucenter/manager/UserManager.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.ucenter.manager; 2 | 3 | import com.cloudE.entity.User; 4 | import com.cloudE.mapper.UserMapper; 5 | import org.springframework.stereotype.Component; 6 | 7 | import javax.annotation.Resource; 8 | 9 | @Component 10 | public class UserManager { 11 | 12 | @Resource 13 | private UserMapper userMapper; 14 | 15 | public User getUserByUserId(Long userId) { 16 | return userMapper.selectByPrimaryKey(userId); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/java/com/cloudE/ucenter/provider/RechargeProvider.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.ucenter.provider; 2 | 3 | import com.alibaba.fastjson.JSON; 4 | import com.cloudE.dto.BaseResult; 5 | import com.cloudE.entity.User; 6 | import com.cloudE.pay.client.ApplePayClient; 7 | import com.cloudE.ucenter.manager.UserManager; 8 | import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; 9 | import io.swagger.annotations.ApiParam; 10 | import org.slf4j.Logger; 11 | import org.slf4j.LoggerFactory; 12 | import org.springframework.web.bind.annotation.*; 13 | 14 | import javax.annotation.Resource; 15 | 16 | /** 17 | * @author vangao1989 18 | * @date 2017年7月26日 19 | */ 20 | @RestController 21 | public class RechargeProvider { 22 | 23 | private static final Logger LOGGER = LoggerFactory.getLogger(RechargeProvider.class); 24 | 25 | @Resource 26 | private UserManager userManager; 27 | @Resource 28 | private ApplePayClient applePayClient; 29 | 30 | 31 | @HystrixCommand(fallbackMethod = "rechargeFallback") 32 | @RequestMapping(value = "/recharge", method = RequestMethod.POST) 33 | public BaseResult recharge(@RequestParam @ApiParam(name = "userId",value = "用户名") Long userId, 34 | @RequestParam @ApiParam(name = "amount",value = "金额") Double amount, 35 | @RequestParam @ApiParam(name = "type",value = "充值方式:1.支付宝|2.微信支付") String type) { 36 | User user = userManager.getUserByUserId(userId); 37 | LOGGER.info("user {} recharge {},type:{}", user.getUsername(), amount, type); 38 | BaseResult baseResult = applePayClient.recharge(userId, amount); 39 | LOGGER.info("user {} recharge res:{}", user.getUsername(), JSON.toJSONString(baseResult)); 40 | return baseResult; 41 | 42 | } 43 | 44 | private BaseResult rechargeFallback(Long useId, Double amount, String type, Throwable throwable) { 45 | LOGGER.error("user:{} recharge,amount:{},type:{}, fail:{}", useId, amount, type, throwable.getMessage(), throwable); 46 | return new BaseResult<>(false, throwable.getMessage()); 47 | } 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/java/com/cloudE/ucenter/task/UCenterTask.java: -------------------------------------------------------------------------------- 1 | package com.cloudE.ucenter.task; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Configurable; 6 | import org.springframework.beans.factory.annotation.Value; 7 | import org.springframework.boot.context.properties.ConfigurationProperties; 8 | import org.springframework.scheduling.annotation.EnableScheduling; 9 | import org.springframework.scheduling.annotation.Scheduled; 10 | import org.springframework.stereotype.Component; 11 | 12 | /** 13 | * Created by carl_gao on 2017/5/17. 14 | */ 15 | @Component 16 | @Configurable 17 | @ConfigurationProperties(prefix = "ucTask") 18 | public class UCenterTask { 19 | 20 | private static final Logger LOGGER = LoggerFactory.getLogger(UCenterTask.class); 21 | 22 | private Integer dynamicParameter; 23 | 24 | @Scheduled(cron = "0/5 * * * * * ") 25 | public void dynamicParameterTest() { 26 | LOGGER.info("dynamicParameterTest,dynamicParameter:{}", dynamicParameter); 27 | if (dynamicParameter == 1) { 28 | //TODO 业务1 29 | } else if (dynamicParameter == 2) { 30 | //TODO 业务2 31 | } 32 | } 33 | 34 | 35 | public Integer getDynamicParameter() { 36 | return dynamicParameter; 37 | } 38 | 39 | public void setDynamicParameter(Integer dynamicParameter) { 40 | this.dynamicParameter = dynamicParameter; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/resources/config/application-default.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=local 3 | spring.cloud.config.label=master 4 | 5 | ucTask.dynamicParameter=1 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/resources/config/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=dev 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/resources/config/application-pro.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=production 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/resources/config/application-qa.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloud-config 2 | spring.cloud.config.profile=qa 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8082 3 | 4 | spring: 5 | application: 6 | name: cloudE-ucenter-provider 7 | cloud: 8 | config: 9 | uri: http://localhost:8888 10 | 11 | mybatis: 12 | mapperLocations: classpath:mapper/*.xml 13 | typeAliasesPackage: com.cloudE.mapper 14 | 15 | eureka: 16 | instance: 17 | prefer-ip-address: true 18 | -------------------------------------------------------------------------------- /cloudE-ucenter-provider/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.cloudE 6 | cloudE-zipkin-server 7 | 1.0.0 8 | jar 9 | 10 | cloude-zipkin-server 11 | 12 | 13 | com.cloudE 14 | cloudE-parent 15 | 1.0.0 16 | 17 | 18 | 19 | 20 | org.springframework.cloud 21 | spring-cloud-starter-eureka-server 22 | 23 | 24 | io.zipkin.java 25 | zipkin-server 26 | 27 | 28 | io.zipkin.java 29 | zipkin-autoconfigure-ui 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM frolvlad/alpine-oraclejdk8:slim 2 | VOLUME /tmp 3 | ADD cloudE-zipkin-server-1.0.0.jar app.jar 4 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] 5 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/src/main/java/cloudE/zipkin/server/ZipkinServerApplication.java: -------------------------------------------------------------------------------- 1 | package cloudE.zipkin.server; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 7 | import zipkin.server.EnableZipkinServer; 8 | 9 | /** 10 | * @author vangao1989 11 | * @Description: 链路监控 12 | * @date 2017年7月24日 13 | */ 14 | @SpringBootApplication 15 | @EnableZipkinServer 16 | @EnableEurekaClient 17 | public class ZipkinServerApplication { 18 | public static void main(String[] args) { 19 | SpringApplication.run(ZipkinServerApplication.class, args); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/src/main/resources/config/application-default.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloudE-config 2 | spring.cloud.config.profile=local 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/src/main/resources/config/application-dev.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloudE-config 2 | spring.cloud.config.profile=dev 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/src/main/resources/config/application-pro.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloudE-config 2 | spring.cloud.config.profile=production 3 | spring.cloud.config.label=master 4 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/src/main/resources/config/application-qa.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.name=cloudE-config 2 | spring.cloud.config.profile=qa 3 | spring.cloud.config.label=master 4 | 5 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/src/main/resources/config/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: cloudE-zipkin-server 4 | cloud: 5 | config: 6 | uri: http://localhost:8888 7 | 8 | eureka: 9 | instance: 10 | prefer-ip-address: true 11 | 12 | server: 13 | port: 9411 14 | 15 | 16 | -------------------------------------------------------------------------------- /cloudE-zipkin-server/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | com.cloudE 5 | cloudE-parent 6 | 1.0.0 7 | pom 8 | cloudE-parent 9 | cloudE-parent 10 | 11 | 12 | org.springframework.boot 13 | spring-boot-starter-parent 14 | 1.5.9.RELEASE 15 | 16 | 17 | 18 | 1.8 19 | UTF-8 20 | 21 | 1.0.0 22 | 1.0.0 23 | 1.0.0 24 | 25 | vangao1989 26 | 27 | 28 | 29 | 30 | 31 | 32 | cloudE-common 33 | cloudE-mapper 34 | cloudE-eureka-server 35 | cloudE-admin-server 36 | cloudE-config-server 37 | cloudE-hystrix-dashboard-server 38 | cloudE-zipkin-server 39 | cloudE-gateway-server 40 | cloudE-turbine-server 41 | cloudE-pay-api 42 | cloudE-pay-provider 43 | cloudE-ucenter-provider 44 | 45 | 46 | 47 | 48 | 49 | io.prometheus 50 | simpleclient 51 | 0.0.24 52 | 53 | 54 | io.prometheus 55 | simpleclient_spring_boot 56 | 0.0.24 57 | 58 | 59 | 60 | io.prometheus 61 | simpleclient_hotspot 62 | 0.0.24 63 | 64 | 65 | 66 | io.prometheus 67 | simpleclient_servlet 68 | 0.0.24 69 | 70 | 71 | 72 | io.prometheus 73 | simpleclient_pushgateway 74 | 0.0.24 75 | 76 | 77 | 78 | 79 | 80 | 81 | org.springframework.cloud 82 | spring-cloud-starter-parent 83 | Edgware.RELEASE 84 | pom 85 | import 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | org.springframework.boot 94 | spring-boot-maven-plugin 95 | 96 | 97 | 98 | com.spotify 99 | docker-maven-plugin 100 | 0.4.11 101 | 102 | ${docker.image.prefix}/${project.name} 103 | src/main/docker 104 | 105 | 106 | / 107 | ${project.build.directory} 108 | ${project.build.finalName}.jar 109 | 110 | 111 | 112 | 113 | 114 | compile 115 | 116 | 117 | -------------------------------------------------------------------------------- /project-bootstrap/grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vangao1989/cloudE/be4b925ae04fb08d2799d14bd90c5efe9fd7f325/project-bootstrap/grafana.png -------------------------------------------------------------------------------- /project-bootstrap/hystrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vangao1989/cloudE/be4b925ae04fb08d2799d14bd90c5efe9fd7f325/project-bootstrap/hystrix.png -------------------------------------------------------------------------------- /project-bootstrap/prometheus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vangao1989/cloudE/be4b925ae04fb08d2799d14bd90c5efe9fd7f325/project-bootstrap/prometheus.png -------------------------------------------------------------------------------- /project-bootstrap/spring-boot-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vangao1989/cloudE/be4b925ae04fb08d2799d14bd90c5efe9fd7f325/project-bootstrap/spring-boot-admin.png -------------------------------------------------------------------------------- /project-bootstrap/ucenterTask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vangao1989/cloudE/be4b925ae04fb08d2799d14bd90c5efe9fd7f325/project-bootstrap/ucenterTask.png -------------------------------------------------------------------------------- /project-bootstrap/zipkin1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vangao1989/cloudE/be4b925ae04fb08d2799d14bd90c5efe9fd7f325/project-bootstrap/zipkin1.png --------------------------------------------------------------------------------