From c81f7206397c1098fd07a3d61f0a54ae863e8ad1 Mon Sep 17 00:00:00 2001
From: bunny <1319900154@qq.com>
Date: Fri, 26 Jul 2024 08:39:20 +0800
Subject: [PATCH] =?UTF-8?q?feat(=E6=96=B0=E5=A2=9E):=20:rocket:=20?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=95=B0=E6=8D=AE=E5=BA=93=E6=BA=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
service/pom.xml | 6 ++++++
service/src/main/resources/application.yml | 17 +++++++++++++++++
2 files changed, 23 insertions(+)
diff --git a/service/pom.xml b/service/pom.xml
index f738218..9234c70 100644
--- a/service/pom.xml
+++ b/service/pom.xml
@@ -60,6 +60,12 @@
org.aspectj
aspectjweaver
+
+
+ com.baomidou
+ dynamic-datasource-spring-boot3-starter
+ 4.3.1
+
diff --git a/service/src/main/resources/application.yml b/service/src/main/resources/application.yml
index 60bc9fa..35e44de 100644
--- a/service/src/main/resources/application.yml
+++ b/service/src/main/resources/application.yml
@@ -13,6 +13,23 @@ spring:
url: jdbc:mysql://${bunny.datasource.host}:${bunny.datasource.port}/${bunny.datasource.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
username: ${bunny.datasource.username}
password: ${bunny.datasource.password}
+ # dynamic:
+ # primary: master #设置默认的数据源或者数据源组,默认值即为master
+ # strict: false #严格匹配数据源,默认false. true未匹配到指定数据源时抛异常,false使用默认数据源
+ # grace-destroy: false #是否优雅关闭数据源,默认为false,设置为true时,关闭数据源时如果数据源中还存在活跃连接,至多等待10s后强制关闭
+ # datasource:
+ # master:
+ # driver-class-name: com.zaxxer.hikari.HikariDataSource
+ # url: jdbc:mysql://${bunny.datasource.host}:${bunny.datasource.port}/${bunny.datasource.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
+ # username: ${bunny.datasource.username}
+ # password: ${bunny.datasource.password}
+ # i18n:
+ # url: jdbc:mysql://${bunny.datasource2.host}:${bunny.datasource2.port}/${bunny.datasource2.sqlData}?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true
+ # username: ${bunny.datasource2.username}
+ # password: ${bunny.datasource2.password}
+ # driver-class-name: com.zaxxer.hikari.HikariDataSource
+ # aop:
+ # enabled: true
data:
redis: