File tree Expand file tree Collapse file tree 5 files changed +30
-10
lines changed
config-server/src/main/resources
service-customer/src/main
java/com/coderqian/eurekacustomer
service-order/src/main/java/com/coderqian/eurekaorder Expand file tree Collapse file tree 5 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 11spring.application.name =config-server
22server.port =1201
33
4- spring.cloud.config.server.git.uri =https://github.com/coderqianlq/spring-cloud/
4+ spring.cloud.config.server.git.uri =https://github.com/coderqianlq/spring-cloud-cli /
55spring.cloud.config.server.git.search-paths =config-coderqian
66spring.cloud.config.server.git.username =
77spring.cloud.config.server.git.password =
8+ # spring.cloud.config.server.git.repos.special.pattern=
89
Original file line number Diff line number Diff line change 66
77@ SpringBootApplication
88@ EnableEurekaClient
9- public class EurekaCustomerApplication {
9+ public class ServiceCustomerApplication {
1010
11- public static void main (String [] args ) {
12- SpringApplication .run (EurekaCustomerApplication .class , args );
13- }
11+ public static void main (String [] args ) {
12+ SpringApplication .run (ServiceCustomerApplication .class , args );
13+ }
1414}
Original file line number Diff line number Diff line change @@ -29,6 +29,12 @@ public class TestController {
2929// @Value("${profile}")
3030 private String profile ;
3131
32+ // @Value("${mysql}")
33+ private String mysql ;
34+
35+ // @Value("${redis}")
36+ private String redis ;
37+
3238 @ Autowired
3339 private TestService testService ;
3440
@@ -56,6 +62,12 @@ public BaseResult testMybatis(@RequestParam("id") String id) {
5662 return testService .testMybatis (id );
5763 }
5864
65+ @ ApiOperation (value = "读取配置文件" , notes = "读取配置文件" )
66+ @ RequestMapping (value = "/config" , method = RequestMethod .GET )
67+ public String testConfig () {
68+ return "mysql:" + mysql + ", redis:" + redis ;
69+ }
70+
5971 @ ApiOperation (value = "测试消息总线" , notes = "测试消息总线" )
6072 @ RequestMapping (value = "/bus" , method = RequestMethod .GET )
6173 public String testBus () {
Original file line number Diff line number Diff line change 11spring.application.name =service-customer
22server.port =8200
33
4- spring.cloud.config.profile =master
5- spring.cloud.config.label =
4+ # 指明远程仓库的分支
5+ spring.cloud.config.label =master
6+ # 开发环境的配置文件
7+ spring.cloud.config.profile =dev
8+ # 指定默认的配置环境
9+ spring.profiles.active =dev
10+
11+ # 指定具体的配置文件
12+ # spring.cloud.config.name=service-customer-mysql,service-customer-redis
613spring.cloud.config.uri =http://127.0.0.1:1201/
714
815spring.zipkin.base-url =http://127.0.0.1:9411
@@ -13,4 +20,4 @@ spring.rabbitmq.username=guest
1320spring.rabbitmq.password =guest
1421management.security.enabled =false
1522
16- # management.endpoints.web.exposure.include=bus-refresh
23+ # management.endpoints.web.exposure.include=bus-refresh
Original file line number Diff line number Diff line change 66
77@ SpringBootApplication
88@ EnableEurekaClient
9- public class EurekaOrderApplication {
9+ public class ServiceOrderApplication {
1010
1111 public static void main (String [] args ) {
12- SpringApplication .run (EurekaOrderApplication .class , args );
12+ SpringApplication .run (ServiceOrderApplication .class , args );
1313 }
1414}
You can’t perform that action at this time.
0 commit comments