Przeglądaj źródła

修改添加多环境

chenjx 5 lat temu
rodzic
commit
26f63b47bd

+ 79 - 0
src/main/resources/application-dev.yml

@@ -0,0 +1,79 @@
+#测试环境
+spring:
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: oracle.jdbc.OracleDriver
+        username: N_DATACENTER_TEST2
+        password: select!#%*(
+#        url: jdbc:oracle:thin:@10.8.0.19:1521:orcl
+        url: jdbc:oracle:thin:@127.0.0.1:1521:orcl
+        initialSize: 10
+        maxActive: 80
+        minIdle: 10
+        maxWait: 60000
+        testOnBorrow: true
+        testOnReturn: false
+        testWhileIdle: true
+        validationQuery: SELECT 1 FROM DUAL
+        timeBetweenEvictionRunsMillis: 60000
+        minEvictableIdleTimeMillis: 300000
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 80
+        filters: stat
+        removeAbandoned: true
+        removeAbandonedTimeout: 1800
+     ## Redis 配置
+    redis:
+        ## Redis数据库索引(默认为0)
+        database: 2
+        ## Redis服务器地址
+        host: 127.0.0.1
+        ## Redis服务器连接端口
+        port: 56379
+        ## Redis服务器连接密码(默认为空)
+        password:
+        jedis:
+          pool:
+            ## 连接池最大连接数(使用负值表示没有限制)
+            #spring.redis.pool.max-active=8
+            max-active: 8
+            ## 连接池最大阻塞等待时间(使用负值表示没有限制)
+            #spring.redis.pool.max-wait=-1
+            max-wait: -1
+            ## 连接池中的最大空闲连接
+            #spring.redis.pool.max-idle=8
+            max-idle: 8
+            ## 连接池中的最小空闲连接
+            #spring.redis.pool.min-idle=0
+            min-idle: 0
+        ## 连接超时时间(毫秒)
+        timeout: 1200
+    http:
+        encoding:
+            force: true
+            charset: UTF-8
+            enabled: true
+    message:
+        encoding: UTF-8
+    jpa:
+      show-sql: false
+      hibernate:
+        ddl-auto: update
+      database: oracle
+
+server:
+    tomcat:
+        uri_encoding: UTF-8
+    port: 8008
+    context-path: /EIS_T
+action:
+    api_action: /EIS_T/api
+    public_actions: /EIS_T/logout,/EIS_T/hello1
+logging:
+  level:
+    org:
+      hibernate:
+        type: trace
+
+SECURITY_KEY: 435aMe9L5itTrckY35kfcOQvPkBGZtGo
+KEEP: 86400000

+ 79 - 0
src/main/resources/application-prod.yml

@@ -0,0 +1,79 @@
+#生产环境
+spring:
+    datasource:
+        type: com.alibaba.druid.pool.DruidDataSource
+        driverClassName: oracle.jdbc.OracleDriver
+        username: N_DATACENTER_TEST2
+        password: select!#%*(
+#        url: jdbc:oracle:thin:@10.8.0.19:1521:orcl
+        url: jdbc:oracle:thin:@127.0.0.1:1521:orcl
+        initialSize: 10
+        maxActive: 80
+        minIdle: 10
+        maxWait: 60000
+        testOnBorrow: true
+        testOnReturn: false
+        testWhileIdle: true
+        validationQuery: SELECT 1 FROM DUAL
+        timeBetweenEvictionRunsMillis: 60000
+        minEvictableIdleTimeMillis: 300000
+        poolPreparedStatements: true
+        maxPoolPreparedStatementPerConnectionSize: 80
+        filters: stat
+        removeAbandoned: true
+        removeAbandonedTimeout: 1800
+     ## Redis 配置
+    redis:
+        ## Redis数据库索引(默认为0)
+        database: 1
+        ## Redis服务器地址
+        host: 127.0.0.1
+        ## Redis服务器连接端口
+        port: 56379
+        ## Redis服务器连接密码(默认为空)
+        password:
+        jedis:
+          pool:
+            ## 连接池最大连接数(使用负值表示没有限制)
+            #spring.redis.pool.max-active=8
+            max-active: 8
+            ## 连接池最大阻塞等待时间(使用负值表示没有限制)
+            #spring.redis.pool.max-wait=-1
+            max-wait: -1
+            ## 连接池中的最大空闲连接
+            #spring.redis.pool.max-idle=8
+            max-idle: 8
+            ## 连接池中的最小空闲连接
+            #spring.redis.pool.min-idle=0
+            min-idle: 0
+        ## 连接超时时间(毫秒)
+        timeout: 1200
+    http:
+        encoding:
+            force: true
+            charset: UTF-8
+            enabled: true
+    message:
+        encoding: UTF-8
+    jpa:
+      show-sql: false
+      hibernate:
+        ddl-auto: update
+      database: oracle
+
+server:
+    tomcat:
+        uri_encoding: UTF-8
+    port: 8009
+    context-path: /EIS
+action:
+    api_action: /EIS/api
+    public_actions: /EIS/logout,/EIS_T/hello1
+logging:
+  level:
+    org:
+      hibernate:
+        type: trace
+
+SECURITY_KEY: 435aMe9L5itTrckY35kfcOQvPkBGZtGo
+KEEP: 86400000

+ 2 - 77
src/main/resources/application.yml

@@ -1,78 +1,3 @@
 spring:
-    datasource:
-        type: com.alibaba.druid.pool.DruidDataSource
-        driverClassName: oracle.jdbc.OracleDriver
-        username: N_DATACENTER_TEST2
-        password: select!#%*(
-#        url: jdbc:oracle:thin:@10.8.0.19:1521:orcl
-        url: jdbc:oracle:thin:@127.0.0.1:1521:orcl
-        initialSize: 10
-        maxActive: 80
-        minIdle: 10
-        maxWait: 60000
-        testOnBorrow: true
-        testOnReturn: false
-        testWhileIdle: true
-        validationQuery: SELECT 1 FROM DUAL
-        timeBetweenEvictionRunsMillis: 60000
-        minEvictableIdleTimeMillis: 300000
-        poolPreparedStatements: true
-        maxPoolPreparedStatementPerConnectionSize: 80
-        filters: stat
-        removeAbandoned: true
-        removeAbandonedTimeout: 1800
-     ## Redis 配置
-    redis:
-        ## Redis数据库索引(默认为0)
-        database: 2
-        ## Redis服务器地址
-        host: 127.0.0.1
-        ## Redis服务器连接端口
-        port: 6379
-        ## Redis服务器连接密码(默认为空)
-        password:
-        jedis:
-          pool:
-            ## 连接池最大连接数(使用负值表示没有限制)
-            #spring.redis.pool.max-active=8
-            max-active: 8
-            ## 连接池最大阻塞等待时间(使用负值表示没有限制)
-            #spring.redis.pool.max-wait=-1
-            max-wait: -1
-            ## 连接池中的最大空闲连接
-            #spring.redis.pool.max-idle=8
-            max-idle: 8
-            ## 连接池中的最小空闲连接
-            #spring.redis.pool.min-idle=0
-            min-idle: 0
-        ## 连接超时时间(毫秒)
-        timeout: 1200
-    http:
-        encoding:
-            force: true
-            charset: UTF-8
-            enabled: true
-    message:
-        encoding: UTF-8
-    jpa:
-      show-sql: false
-      hibernate:
-        ddl-auto: update
-      database: oracle
-
-server:
-    tomcat:
-        uri_encoding: UTF-8
-    port: 8008
-    context-path: /EIS_T
-action:
-    api_action: /EIS_T/api
-    public_actions: /EIS_T/logout,/EIS_T/hello1
-logging:
-  level:
-    org:
-      hibernate:
-        type: trace
-
-SECURITY_KEY: 435aMe9L5itTrckY35kfcOQvPkBGZtGo
-KEEP: 86400000
+  profiles:
+    active: dev