Browse Source

dashboard测试通过

master
yirenyishi 6 years ago
parent
commit
c28cb558db
  1. 2
      sc-config/src/main/resources/application.yml
  2. 1
      sc-consumer/src/main/java/com/trgis/sb2sc/Sb2scConsumerApplication.java
  3. 6
      sc-consumer/src/main/resources/bootstrap.yml
  4. 16
      sc-consumer/src/test/java/com/trgis/sb2sc/Sb2scApplicationTests.java
  5. 27
      sc-dashboard/.gitignore
  6. 45
      sc-dashboard/build.gradle
  7. 18
      sc-dashboard/src/main/java/com/trgis/sb2sc/Sb2scDashboardApplication.java
  8. 23
      sc-dashboard/src/main/resources/application.yml
  9. 3
      sc-provider/src/main/resources/bootstrap.yml
  10. 2
      settings.gradle

2
sc-config/src/main/resources/application.yml

@ -8,7 +8,7 @@ spring:
name: root
password: booszy
application:
name: springcloud-config-server
name:
cloud:
config:
server:

1
sc-consumer/src/main/java/com/trgis/sb2sc/Sb2scConsumerApplication.java

@ -14,7 +14,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@EnableDiscoveryClient
//@EnableEurekaClient
@EnableFeignClients
@EnableCircuitBreaker
@EnableHystrix

6
sc-consumer/src/main/resources/bootstrap.yml

@ -19,4 +19,8 @@ spring:
username: root
password: booszy
profile: csdn
management:
endpoints:
web:
exposure:
include: '*'

16
sc-consumer/src/test/java/com/trgis/sb2sc/Sb2scApplicationTests.java

@ -1,16 +0,0 @@
package com.trgis.sb2sc;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class Sb2scApplicationTests {
@Test
public void contextLoads() {
}
}

27
sc-dashboard/.gitignore

@ -0,0 +1,27 @@
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
/out/
### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

45
sc-dashboard/build.gradle

@ -0,0 +1,45 @@
buildscript {
ext {
springBootVersion = '2.0.3.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.trgis'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
ext {
springCloudVersion = 'Finchley.RELEASE'
}
dependencies {
compile('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client')
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.cloud:spring-cloud-starter-netflix-hystrix')
compile('org.springframework.cloud:spring-cloud-starter-netflix-hystrix-dashboard')
compile('org.springframework.cloud:spring-cloud-starter-netflix-turbine')
//compile('org.springframework.cloud:spring-cloud-starter-netflix-turbine-stream')
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

18
sc-dashboard/src/main/java/com/trgis/sb2sc/Sb2scDashboardApplication.java

@ -0,0 +1,18 @@
package com.trgis.sb2sc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.cloud.netflix.turbine.EnableTurbine;
@EnableDiscoveryClient
@SpringBootApplication
@EnableTurbine
@EnableHystrixDashboard
public class Sb2scDashboardApplication {
public static void main(String[] args) {
SpringApplication.run(Sb2scDashboardApplication.class, args);
}
}

23
sc-dashboard/src/main/resources/application.yml

@ -0,0 +1,23 @@
server:
port: 8900
eureka:
client:
service-url:
defaultZone: http://root:booszy@localhost:8761/eureka/
instance:
prefer-ip-address: true
instance-id: ${spring.application.name}:${spring.application.instance_id:${server.port}}
appname: sc-dashboard
turbine:
aggregator:
clusterConfig: default
appConfig: sc-consumer
clusterNameExpression: "'default'"
spring:
application:
name: sc-dashboard
#management:
# endpoints:
# web:
# exposure:
# include: '*'

3
sc-provider/src/main/resources/bootstrap.yml

@ -18,5 +18,4 @@ spring:
fail-fast: true
username: root
password: booszy
profile: csdn
profile: csdn

2
settings.gradle

@ -1,2 +1,2 @@
rootProject.name = 'sb2sc'
include('sc-eureka','sc-config','sc-provider','sc-consumer','sc-zuul')
include('sc-eureka','sc-config','sc-provider','sc-consumer','sc-zuul','sc-dashboard')
Loading…
Cancel
Save