Browse Source

调整配置

gaoyu 2 years ago
parent
commit
c6f6abad18

+ 1 - 1
src/main/java/com/persagy/apm/alarmservice/dependency/eqdiagnose/client/EqDiagnoseClient.java

@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.PostMapping;
  * @author lixing
  * @version V1.0 2021/3/22 2:13 下午
  **/
-@FeignClient(name = FeignClientNameConstants.ENERGY_EQ_RUN_DIAGNOSE, url="https://bz-develop.persagy.com/energy-eq-run-diagnose/", fallbackFactory = EqDiagnoseClientFallbackFactory.class)
+@FeignClient(name = FeignClientNameConstants.ENERGY_EQ_RUN_DIAGNOSE, url="${diagnose.url}", fallbackFactory = EqDiagnoseClientFallbackFactory.class)
 public interface EqDiagnoseClient {
 
     /**

+ 1 - 1
src/main/java/com/persagy/apm/alarmservice/dependency/rwd/client/DmpRwdClient.java

@@ -25,7 +25,7 @@ import feign.Headers;
  * @author lixing
  * @version V1.0 2021/3/22 2:13 下午
  **/
-@FeignClient(name = FeignClientNameConstants.DMP_RWD, url="https://bz-develop.persagy.com/dmp-rwd/" ,fallbackFactory = DmpRwdClientFallbackFactory.class)
+@FeignClient(name = FeignClientNameConstants.DMP_RWD, url="${dmp_rwd.url}" ,fallbackFactory = DmpRwdClientFallbackFactory.class)
 public interface DmpRwdClient {
 
     /**

+ 1 - 1
src/main/java/com/persagy/apm/alarmservice/dependency/saasweb/client/SaasWebClient.java

@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
  * @author lixing
  * @version V1.0 2021/3/22 2:13 下午
  **/
-@FeignClient(name = FeignClientNameConstants.SAAS_WEB, url="https://bz-develop.persagy.com/ems-saas-web/", fallbackFactory = SaasWebClientFallbackFactory.class)
+@FeignClient(name = FeignClientNameConstants.SAAS_WEB, url="${saas_web.url}", fallbackFactory = SaasWebClientFallbackFactory.class)
 public interface SaasWebClient {
 
     /**

+ 24 - 27
src/main/resources/bootstrap.yml

@@ -1,13 +1,15 @@
+
 server:
   port:
-    9977
+    ${SERVER_PORT:8080}
 paas:
   nacos:
-    ip: 139.155.212.245
-    port: 8080
-    username: nacos
-    password: nacos
-
+    ip: ${pass.nacos.ip}
+    port: ${pass.nacos.port}
+    username: ${pass.nacos.username}
+    password: ${pass.nacos.password}
+    namespace: ${pass.nacos.namespace}
+    group: ${pass.nacos.group}
 spring:
   application:
     name: dmp-alarm
@@ -28,35 +30,33 @@ spring:
           data: classpath*:db/init/data.sql
           continue-on-error: true
           # MYSQL_SCHEMA建议使用默认值。如果有特殊需求,建议在环境变量中配置该值
-          url: jdbc:mysql://${persagy.mysql.ip}:${persagy.mysql.port}/${MYSQL_SCHEMA_ALARM_SERVICE:energy_alarm}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
+          url: jdbc:mysql://${persagy.mysql.ip}:${persagy.mysql.port}/${persagy.db_name.dmp-alarm}?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai
           username: ${persagy.mysql.username}
           password: ${persagy.mysql.password}
           driver-class-name: com.mysql.cj.jdbc.Driver
   rabbitmq:
-    host: ${persagy.rabbitmq.host}
-    port: ${persagy.rabbitmq.port}
-    username: ${persagy.rabbitmq.username}
-    password: ${persagy.rabbitmq.password}
-    virtual-host: ${persagy.rabbitmq.virtual-host}
+    host: ${spring.rabbitmq.host}
+    port: ${spring.rabbitmq.port}
+    username: ${spring.rabbitmq.username}
+    password: ${spring.rabbitmq.password}
+    virtual-host: ${spring.rabbitmq.virtual-host}
   redis:
     #数据库索引
-    database: ${persagy.redis.database}
-    host: ${persagy.redis.host}
-    port: ${persagy.redis.port}
-    password: ${persagy.redis.password}  
+    database: ${spring.redis.database.zero}
+    host: ${spring.redis.host}
+    port: ${spring.redis.port}
+    password: ${spring.redis.password}  
   cloud:
     nacos:
       config:
         server-addr: ${paas.nacos.ip}:${paas.nacos.port}
-        file-extension: yml
-        namespace: d38f0226-7c0a-4961-b087-a99591ae10c3
+        namespace: ${pass.nacos.namespace}
         shared-configs:
-          - dataId: mysql.yml
-            refresh: true
-          - dataId: rabbitmq.yml
+          - dataId: common
             refresh: true
-          - dataId: redis.yml
+          - dataId: dmp-alarm
             refresh: true
+            group: v4.2.0
         enabled: true
         username: ${paas.nacos.username}
         password: ${paas.nacos.password}
@@ -65,7 +65,7 @@ spring:
         username: ${paas.nacos.username}
         password: ${paas.nacos.password}
         server-addr: ${paas.nacos.ip}:${paas.nacos.port}
-        namespace: d38f0226-7c0a-4961-b087-a99591ae10c3
+        namespace: ${pass.nacos.namespace}
         metadata: # 元数据,用于权限服务实时获取各个服务的所有接口
           management.context-path: ${server.servlet.context-path:}${spring.mvc.servlet.path:}${management.endpoints.web.base-path:}
 feign:
@@ -107,8 +107,5 @@ logging:
 dynamic:
   not-url: /alarm/comment,/alarm/config,/alarm/event,/alarm/item,/alarm/log,/alarm/record,/alarm/target
   db:
-    name: energy_alarm
-
-
-
+    name: ${persagy.db_name.dmp-alarm}