From 5b35a58a85f4564ae7ae2dd0a910666735b830b3 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" <123456> Date: Wed, 31 May 2023 11:34:20 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9basedata=20test=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-test.yml | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-basicdata/src/main/resources/application-test.yml b/blade-service/logpm-basicdata/src/main/resources/application-test.yml index c4f22a92f..abb6e8a17 100644 --- a/blade-service/logpm-basicdata/src/main/resources/application-test.yml +++ b/blade-service/logpm-basicdata/src/main/resources/application-test.yml @@ -3,8 +3,43 @@ server: port: 8400 #数据源配置 +#spring: +# datasource: +# url: ${blade.datasource.dev.url} +# username: ${blade.datasource.dev.username} +# password: ${blade.datasource.dev.password} + spring: + #排除DruidDataSourceAutoConfigure + autoconfigure: + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure datasource: - url: ${blade.datasource.test.url} - username: ${blade.datasource.test.username} - password: ${blade.datasource.test.password} + dynamic: + druid: + #通用校验配置 + validation-query: select 1 + #启用sql日志拦截器 + proxy-filters: + - sqlLogInterceptor + #设置默认的数据源或者数据源组,默认值即为master + primary: master + datasource: + master: + druid: + #独立校验配置 + validation-query: select 1 + #oracle校验 + #validation-query: select 1 from dual + url: ${blade.datasource.basicdata.master.url} + username: ${blade.datasource.basicdata.master.username} + password: ${blade.datasource.basicdata.master.password} + slave: + druid: + #独立校验配置 + validation-query: select 1 + #oracle校验 + #validation-query: select 1 from dual + url: ${blade.datasource.basicdata.slave.url} + username: ${blade.datasource.basicdata.slave.username} + password: ${blade.datasource.basicdata.slave.password} +