refactor(config): 将数据源配置移至环境特定文件
All checks were successful
Auto-build / Automatic-Packaging (push) Successful in 13s

- 从 application.yml 中移除数据源配置
- 在 application-dev.yml 中添加开发环境数据源配置
- 在 application-prod.yml 中添加生产环境数据源配置
- 保持 MyBatis-Plus 配置不变
- 确保不同环境使用正确的数据库连接信息
This commit is contained in:
Grand-cocoa 2025-11-12 15:45:38 +08:00
parent e5c8966445
commit 1aabc49521
3 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
spring:
datasource:
url: jdbc:mysql://localhost:3306/animo?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false
username: animo
password: WS6PCwksRpEYNpNt
passkey: passkey:
id: "localhost" id: "localhost"
name: "Animo" name: "Animo"

View File

@ -1,3 +1,8 @@
spring:
datasource:
url: jdbc:mysql://10.0.16.3:3306/animo?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false
username: animo
password: WS6PCwksRpEYNpNt
passkey: passkey:
id: "animo.alina-dace.info" id: "animo.alina-dace.info"
name: "Animo" name: "Animo"

View File

@ -9,9 +9,6 @@ spring:
datasource: datasource:
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/animo?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false
username: animo
password: WS6PCwksRpEYNpNt
mybatis-plus: mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml mapper-locations: classpath*:/mapper/**/*.xml