From 223a8e434ca15e46766c8f37b6cc2ad787246d9e Mon Sep 17 00:00:00 2001 From: qinyingjie Date: Mon, 16 Jan 2023 16:58:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 1 + .../dev/application-goods9100.yaml | 4 ---- .../dev/application-goods9200.yaml | 4 ---- .../dev/application-goods9300.yaml | 4 ---- .../dev/application-portal8080.yaml | 4 ---- .../dev/application-portal8081.yaml | 4 ---- springcloud-service-config-info/pom.xml | 24 +++++++++++++++++++ .../src/main/resources/application.yaml | 6 ++--- .../src/main/resources/bootstrap.yml | 17 +++++++++++++ .../src/main/resources/bootstrap.yml | 17 +++++++++++++ .../src/main/resources/bootstrap.yml | 18 ++++++++++++++ springcloud-service-portal-8080/pom.xml | 10 +++++++- .../src/main/resources/bootstrap.yml | 17 +++++++++++++ springcloud-service-portal-8081/pom.xml | 11 ++++++--- .../src/main/resources/bootstrap.yml | 16 +++++++++++++ 15 files changed, 130 insertions(+), 27 deletions(-) rename springcloud-service-goods-9100/src/main/resources/application.yaml => springcloud-service-config-info/dev/application-goods9100.yaml (96%) rename springcloud-service-goods-9200/src/main/resources/application.yaml => springcloud-service-config-info/dev/application-goods9200.yaml (96%) rename springcloud-service-goods-9300/src/main/resources/application.yaml => springcloud-service-config-info/dev/application-goods9300.yaml (96%) rename springcloud-service-portal-8080/src/main/resources/application.yaml => springcloud-service-config-info/dev/application-portal8080.yaml (95%) rename springcloud-service-portal-8081/src/main/resources/application.yaml => springcloud-service-config-info/dev/application-portal8081.yaml (95%) create mode 100644 springcloud-service-config-info/pom.xml create mode 100644 springcloud-service-goods-9100/src/main/resources/bootstrap.yml create mode 100644 springcloud-service-goods-9200/src/main/resources/bootstrap.yml create mode 100644 springcloud-service-goods-9300/src/main/resources/bootstrap.yml create mode 100644 springcloud-service-portal-8080/src/main/resources/bootstrap.yml create mode 100644 springcloud-service-portal-8081/src/main/resources/bootstrap.yml diff --git a/pom.xml b/pom.xml index 5b8a7a8..1b2ef01 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,7 @@ springcloud-service-portal-8081 springcloud-service-config springcloud-service-config-client + springcloud-service-config-info springcloud-service-feign springcloud-service-zuul springcloud-service-consul diff --git a/springcloud-service-goods-9100/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-goods9100.yaml similarity index 96% rename from springcloud-service-goods-9100/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-goods9100.yaml index 297ced1..3b36723 100644 --- a/springcloud-service-goods-9100/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-goods9100.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 9100 - #兼容swagger配置 spring: # mysql diff --git a/springcloud-service-goods-9200/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-goods9200.yaml similarity index 96% rename from springcloud-service-goods-9200/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-goods9200.yaml index 5dff84d..881086a 100644 --- a/springcloud-service-goods-9200/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-goods9200.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 9200 - #兼容swagger配置 spring: # mysql diff --git a/springcloud-service-goods-9300/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-goods9300.yaml similarity index 96% rename from springcloud-service-goods-9300/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-goods9300.yaml index c176c35..5e214f1 100644 --- a/springcloud-service-goods-9300/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-goods9300.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 9300 - #兼容swagger配置 spring: # mysql diff --git a/springcloud-service-portal-8080/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-portal8080.yaml similarity index 95% rename from springcloud-service-portal-8080/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-portal8080.yaml index 514609c..0542506 100644 --- a/springcloud-service-portal-8080/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-portal8080.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 8080 - spring: application: name: portal-service #服务名称 diff --git a/springcloud-service-portal-8081/src/main/resources/application.yaml b/springcloud-service-config-info/dev/application-portal8081.yaml similarity index 95% rename from springcloud-service-portal-8081/src/main/resources/application.yaml rename to springcloud-service-config-info/dev/application-portal8081.yaml index 296990a..d9ba0e4 100644 --- a/springcloud-service-portal-8081/src/main/resources/application.yaml +++ b/springcloud-service-config-info/dev/application-portal8081.yaml @@ -1,7 +1,3 @@ -#端口号 -server: - port: 8081 - spring: application: name: portal-service #服务名称 diff --git a/springcloud-service-config-info/pom.xml b/springcloud-service-config-info/pom.xml new file mode 100644 index 0000000..bf506ed --- /dev/null +++ b/springcloud-service-config-info/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + com.kwan.springcloud + springcloud-service-parent + 1.0.0 + + springcloud-service-config-info + 0.0.1-SNAPSHOT + springcloud-service-config-info + + 1.8 + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + \ No newline at end of file diff --git a/springcloud-service-config/src/main/resources/application.yaml b/springcloud-service-config/src/main/resources/application.yaml index ea21a13..587f73e 100644 --- a/springcloud-service-config/src/main/resources/application.yaml +++ b/springcloud-service-config/src/main/resources/application.yaml @@ -9,12 +9,12 @@ spring: config: server: git: - uri: https://gitcode.net/qyj19920704/springcloud-config.git + uri: https://gitcode.net/qyj19920704/springcloud-study.git search-paths: - - config-repo + - springcloud-service-config-info/dev username: 13113691357 password: 15671628341qwe - label: master + label: main #服务提供者 eureka: diff --git a/springcloud-service-goods-9100/src/main/resources/bootstrap.yml b/springcloud-service-goods-9100/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..41144f7 --- /dev/null +++ b/springcloud-service-goods-9100/src/main/resources/bootstrap.yml @@ -0,0 +1,17 @@ +#端口号 +server: + port: 9100 + + +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-goods9100 #获取的文件名 + profile: goods9100 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file diff --git a/springcloud-service-goods-9200/src/main/resources/bootstrap.yml b/springcloud-service-goods-9200/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..63f3460 --- /dev/null +++ b/springcloud-service-goods-9200/src/main/resources/bootstrap.yml @@ -0,0 +1,17 @@ +#端口号 +server: + port: 9200 + + +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-goods9200 #获取的文件名 + profile: goods9200 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file diff --git a/springcloud-service-goods-9300/src/main/resources/bootstrap.yml b/springcloud-service-goods-9300/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..e1a0a16 --- /dev/null +++ b/springcloud-service-goods-9300/src/main/resources/bootstrap.yml @@ -0,0 +1,18 @@ +#端口号 +server: + port: 9300 + +#spring配置 +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-goods9300 #获取的文件名 + profile: goods9300 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +#注册中心配置 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file diff --git a/springcloud-service-portal-8080/pom.xml b/springcloud-service-portal-8080/pom.xml index c96c8bd..811d39b 100644 --- a/springcloud-service-portal-8080/pom.xml +++ b/springcloud-service-portal-8080/pom.xml @@ -33,7 +33,6 @@ org.springframework.cloud spring-cloud-openfeign-core - org.springframework.boot spring-boot-starter-actuator @@ -42,6 +41,15 @@ org.springframework.cloud spring-cloud-starter-netflix-hystrix + + org.springframework.cloud + spring-cloud-config-client + + + org.springframework.boot + spring-boot-starter-web + + diff --git a/springcloud-service-portal-8080/src/main/resources/bootstrap.yml b/springcloud-service-portal-8080/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..8b523f8 --- /dev/null +++ b/springcloud-service-portal-8080/src/main/resources/bootstrap.yml @@ -0,0 +1,17 @@ +#端口号 +server: + port: 8080 + + +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-portal8080 #获取的文件名 + profile: portal8080 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file diff --git a/springcloud-service-portal-8081/pom.xml b/springcloud-service-portal-8081/pom.xml index ee5573a..9dce6d2 100644 --- a/springcloud-service-portal-8081/pom.xml +++ b/springcloud-service-portal-8081/pom.xml @@ -33,7 +33,6 @@ org.springframework.cloud spring-cloud-openfeign-core - org.springframework.boot spring-boot-starter-actuator @@ -42,9 +41,15 @@ org.springframework.cloud spring-cloud-starter-netflix-hystrix - + + org.springframework.cloud + spring-cloud-config-client + + + org.springframework.boot + spring-boot-starter-web + - diff --git a/springcloud-service-portal-8081/src/main/resources/bootstrap.yml b/springcloud-service-portal-8081/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..36ee510 --- /dev/null +++ b/springcloud-service-portal-8081/src/main/resources/bootstrap.yml @@ -0,0 +1,16 @@ +#端口号,指定端口,不然默认是8080,会出现冲突 +server: + port: 8081 + +spring: + cloud: + config: + fail-fast: false #客户端连接失败时开启重试,需要结合spring-retry、spring-aop + label: main #获取配置文件的分支名 + name: application-portal8081 #获取的文件名 + profile: portal8081 #文件后缀 + uri: http://localhost:7001 #配置中心服务端地址 +eureka: + client: + service-url: + defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/ \ No newline at end of file -- GitLab