From f5ba4595865428f30fc7615b3fa0f8ecf5612bac Mon Sep 17 00:00:00 2001 From: xiaowang <2161656029@qq.com> Date: Tue, 30 Jun 2026 19:44:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85Nacos=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90=E9=85=8D=E7=BD=AE=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JY-Core/src/main/resources/bootstrap.yaml | 3 +++ JY-Gateway/src/main/resources/bootstrap.yaml | 3 +++ scripts/应用配置迁移到Nacos说明_20260630.md | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/JY-Core/src/main/resources/bootstrap.yaml b/JY-Core/src/main/resources/bootstrap.yaml index a52539b8..e9deddd7 100644 --- a/JY-Core/src/main/resources/bootstrap.yaml +++ b/JY-Core/src/main/resources/bootstrap.yaml @@ -40,6 +40,9 @@ spring: password: ${NACOS_PASSWORD:} # Core 与 Gateway 共享的公共配置文件。 shared-configs: + - data-id: datasource.yaml + group: ${NACOS_GROUP:DEFAULT_GROUP} + refresh: true - data-id: infra.yaml group: ${NACOS_GROUP:DEFAULT_GROUP} refresh: true diff --git a/JY-Gateway/src/main/resources/bootstrap.yaml b/JY-Gateway/src/main/resources/bootstrap.yaml index a7cb27e4..31a4fed1 100644 --- a/JY-Gateway/src/main/resources/bootstrap.yaml +++ b/JY-Gateway/src/main/resources/bootstrap.yaml @@ -34,6 +34,9 @@ spring: password: ${NACOS_PASSWORD:} # Core 与 Gateway 共享的公共配置文件。 shared-configs: + - data-id: datasource.yaml + group: ${NACOS_GROUP:DEFAULT_GROUP} + refresh: true - data-id: infra.yaml group: ${NACOS_GROUP:DEFAULT_GROUP} refresh: true diff --git a/scripts/应用配置迁移到Nacos说明_20260630.md b/scripts/应用配置迁移到Nacos说明_20260630.md index 5ff12e02..58ca899c 100644 --- a/scripts/应用配置迁移到Nacos说明_20260630.md +++ b/scripts/应用配置迁移到Nacos说明_20260630.md @@ -44,10 +44,18 @@ NACOS_PASSWORD=通过受控渠道保存 - `core.yaml` - `gateway.yaml` +- `datasource.yaml` - `infra.yaml` - `secret.yaml` - `logging.yaml` +数据库连接配置应放在 `datasource.yaml`: + +- `spring.datasource.url` +- `spring.datasource.username` +- `spring.datasource.password` +- `spring.datasource.driver-class-name` + 七牛 Kodo 必填配置应放在 `infra.yaml` 和 `secret.yaml`: - `qiniu.kodo.bucket-name`