Pārlūkot izejas kodu

增加多配置文件

hanqingsong 1 gadu atpakaļ
vecāks
revīzija
117c3f89f5

+ 50 - 0
src/main/resources/bootstrap-dev.yml

@@ -0,0 +1,50 @@
1
+feign:
2
+  hystrix:
3
+    enabled: true # 开启Feign熔断
4
+# 注册中心配置
5
+eureka:
6
+  client:
7
+    service-url:
8
+      defaultZone: http://localhost:9001/eureka/
9
+    #register-with-eureka: false
10
+    #fetchRegistry: false
11
+  instance:
12
+    hostname: 172.16.0.46
13
+    #hostname: localhost
14
+    prefer-ip-address: true
15
+    lease-renewal-interval-in-seconds: 10
16
+    lease-expiration-duration-in-seconds: 30
17
+    status-page-url: http://${eureka.instance.hostname}:${server.port}/swagger-ui.html
18
+spring:
19
+  # 数据库配置
20
+  datasource:
21
+    driver-class-name: com.mysql.jdbc.Driver
22
+    url: jdbc:mysql://172.16.0.36:3306/depot_qh?useUnicode=true&characterEncoding=utf-8&useSSL=false
23
+    username: root
24
+    password: admin@1234
25
+  # 缓存配置 host: redis-depot
26
+  session:
27
+    store-type: redis
28
+  redis:
29
+    database: 0
30
+    host: 172.16.0.36
31
+    port: 6379
32
+    password: admin@1234
33
+    timeout: 3000ms
34
+    jedis:
35
+      pool:
36
+        max-active: 8
37
+        max-wait: -1ms
38
+        max-idle: 8
39
+        min-idle: 0
40
+  servlet:
41
+    multipart:
42
+      max-file-size: 20MB
43
+      max-request-size: 20MB
44
+# 设置是否开放swagger API接口
45
+swagger:
46
+  enabled: true
47
+# 配置控制台打印sql 测试用
48
+#logging:
49
+#    level:
50
+#      com.chinaitop.depot.grainSituationCard.mapper: DEBUG #包路径为mapper文件包路径

+ 50 - 0
src/main/resources/bootstrap-prod.yml

@@ -0,0 +1,50 @@
1
+feign:
2
+  hystrix:
3
+    enabled: true # 开启Feign熔断
4
+# 注册中心配置
5
+eureka:
6
+  client:
7
+    service-url:
8
+      defaultZone: http://localhost:9001/eureka/
9
+    #register-with-eureka: false
10
+    #fetchRegistry: false
11
+  instance:
12
+    hostname: 127.0.0.1
13
+    #hostname: localhost
14
+    prefer-ip-address: true
15
+    lease-renewal-interval-in-seconds: 10
16
+    lease-expiration-duration-in-seconds: 30
17
+    status-page-url: http://${eureka.instance.hostname}:${server.port}/swagger-ui.html
18
+spring:
19
+  # 数据库配置
20
+  datasource:
21
+    driver-class-name: com.mysql.jdbc.Driver
22
+    url: jdbc:mysql://172.18.93.244:3306/depot_qh?useUnicode=true&characterEncoding=utf-8&useSSL=false
23
+    username: root
24
+    password: qh_admin@3579
25
+  # 缓存配置 host: redis-depot
26
+  session:
27
+    store-type: redis
28
+  redis:
29
+    database: 0
30
+    host: 172.18.93.229
31
+    port: 6379
32
+    password: qh_redis@3579
33
+    timeout: 3000ms
34
+    jedis:
35
+      pool:
36
+        max-active: 8
37
+        max-wait: -1ms
38
+        max-idle: 8
39
+        min-idle: 0
40
+  servlet:
41
+    multipart:
42
+      max-file-size: 20MB
43
+      max-request-size: 20MB
44
+# 设置是否开放swagger API接口
45
+swagger:
46
+  enabled: true
47
+# 配置控制台打印sql 测试用
48
+#logging:
49
+#    level:
50
+#      com.chinaitop.depot.grainSituationCard.mapper: DEBUG #包路径为mapper文件包路径

+ 4 - 54
src/main/resources/bootstrap.yml

@@ -2,60 +2,10 @@ server:
2 2
   port: 9004
3 3
   tomcat:
4 4
     uri-encoding: utf-8
5
-mybatis:
6
-  config-location: classpath:mybatis/mybatis-config.xml
7
-feign:
8
-  hystrix:
9
-    enabled: true # 开启Feign熔断
10
-
11
-#开发环境
12
-# 注册中心配置
13
-eureka:
14
-  client:
15
-    service-url:
16
-      defaultZone: http://localhost:9001/eureka/
17
-    #register-with-eureka: false
18
-    #fetchRegistry: false
19
-  instance:
20
-    hostname: localhost
21
-    #hostname: localhost
22
-    prefer-ip-address: true
23
-    lease-renewal-interval-in-seconds: 10
24
-    lease-expiration-duration-in-seconds: 30
25
-    status-page-url: http://${eureka.instance.hostname}:${server.port}/swagger-ui.html
26
-
27 5
 spring:
28 6
   application:
29 7
     name: depot-shared
30
-  # 数据库配置
31
-  datasource:
32
-    driver-class-name: com.mysql.jdbc.Driver
33
-    url: jdbc:mysql://101.36.160.140:10311/depot_qh?useUnicode=true&characterEncoding=utf-8
34
-    username: root
35
-    password: admin@1234
36
-  # 缓存配置 host: redis-depot
37
-  session:
38
-    store-type: redis
39
-  redis:
40
-    database: 0
41
-    host: 101.36.160.140
42
-    port: 10316
43
-    password: admin@1234
44
-    timeout: 3000
45
-    jedis:
46
-      pool:
47
-        max-active: 8
48
-        max-wait: -1
49
-        max-idle: 8
50
-        min-idle: 0
51
-  servlet:
52
-    multipart:
53
-      max-file-size: 20MB
54
-      max-request-size: 20MB
55
-# 设置是否开放swagger API接口
56
-swagger:
57
-  enabled: true
58
-# 配置控制台打印sql 测试用
59
-#logging:
60
-#    level:
61
-#      com.chinaitop.depot.grainSituationCard.mapper: DEBUG #包路径为mapper文件包路径
8
+  profiles:
9
+    active: dev
10
+mybatis:
11
+  config-location: classpath:mybatis/mybatis-config.xml