-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yzz
committed
May 7, 2020
1 parent
2f71d55
commit aa41ad9
Showing
12 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
cloud-consumer-hystrix-dashboard9001/cloud-consumer-hystrix-dashboard9001.iml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>springcloud2020</artifactId> | ||
<groupId>com.yanzhen.springcloud</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>cloud-consumer-hystrix-dashboard9001</artifactId> | ||
|
||
|
||
<dependencies> | ||
<!--hystrix dashboard--> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId> | ||
</dependency> | ||
<!--监控--> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
</dependency> | ||
<!--热部署--> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-devtools</artifactId> | ||
<scope>runtime</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
13 changes: 13 additions & 0 deletions
13
...hystrix-dashboard9001/src/main/java/com/yanzhen/springcloud/HystrixDashboardMain9001.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.yanzhen.springcloud; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard; | ||
|
||
@SpringBootApplication | ||
@EnableHystrixDashboard | ||
public class HystrixDashboardMain9001 { | ||
public static void main(String[] args) { | ||
SpringApplication.run(HystrixDashboardMain9001.class,args); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
cloud-consumer-hystrix-dashboard9001/src/main/resources/application.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
server: | ||
port: 9001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>springcloud2020</artifactId> | ||
<groupId>com.yanzhen.springcloud</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>cloud-gateway-gateway9527</artifactId> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-gateway</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.yanzhen.springcloud</groupId> | ||
<artifactId>cloud-api-common</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
</dependency> | ||
|
||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-devtools</artifactId> | ||
<scope>runtime</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
13 changes: 13 additions & 0 deletions
13
cloud-gateway-gateway9527/src/main/java/com/yanzhen/springcloud/GateWayMain9527.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.yanzhen.springcloud; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.netflix.eureka.EnableEurekaClient; | ||
|
||
@SpringBootApplication | ||
@EnableEurekaClient | ||
public class GateWayMain9527 { | ||
public static void main(String[] args) { | ||
SpringApplication.run(GateWayMain9527.class,args); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
cloud-gateway-gateway9527/src/main/java/com/yanzhen/springcloud/config/GateWayConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.yanzhen.springcloud.config; | ||
|
||
import org.springframework.cloud.gateway.route.RouteLocator; | ||
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class GateWayConfig { | ||
@Bean | ||
public RouteLocator routeLocator(RouteLocatorBuilder routeLocatorBuilder){ | ||
RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes(); | ||
routes.route("yz",r -> r.path("/aaa").uri("http://qq.com")).build(); | ||
return routes.build(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
cloud-gateway-gateway9527/src/main/resources/application.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
server: | ||
port: 9527 | ||
|
||
|
||
eureka: | ||
client: | ||
register-with-eureka: true | ||
service-url: | ||
defaultZone: http://localhost:7001/eureka | ||
fetch-registry: true | ||
instance: | ||
hostname: cloud-gateway-service | ||
spring: | ||
application: | ||
name: cloud-gateway | ||
cloud: | ||
gateway: | ||
routes: | ||
- id: payment_routh | ||
uri: lb://CLOUD-PAYMENT-SERVICE | ||
predicates: | ||
- Path=/payment/get/** | ||
|
||
- id: payment_routh2 | ||
uri: lb://CLOUD-PAYMENT-SERVICE | ||
predicates: | ||
- Path=/payment/lb | ||
# - After=2020-05-07T15:47:17.798+08:00[Asia/Shanghai] | ||
- Cookie=yz,123 | ||
discovery: | ||
locator: | ||
enabled: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import org.junit.Test; | ||
|
||
import java.time.ZonedDateTime; | ||
|
||
public class Test1 { | ||
@Test | ||
public void test1(){ | ||
ZonedDateTime zonedDateTime = ZonedDateTime.now(); | ||
System.out.println(zonedDateTime); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters