feat(ref): 21 类静态主数据独立 PostgreSQL 参考库边界就位(ACM2-11 落地)

按 ACM2-11 定案调整(业务事务库 MySQL + 航班动态 Redis 不变):
- 接口拆分:RefDataRepository 收为 gen-only(SCHD_GEN/流程 4 CAS,留守业务库);
  新增 StaticRefRepository + RefUpsert 对齐 SOURCE 审计(N19)。
- 调用点:RequestCoordinator 应答落库、ReferenceService(21 类同步 TODO) 指向
  StaticRefRepository;Decision.refUpserts 与 Pump 事务 2 注释同步
  (静态写为弱事务,不入主泵事务 2)。
- Stub:StubRefData 仅 gen;新增 StubStaticRef(内存,保留 source)。
- 配置:datasources.reference / flyway.datasources.reference 占位
  (PostgreSQL,enabled=false 不建连;驱动 org.postgresql 随阶段 6 实装引入,
  版本由 platform BOM 约束 ~42.7);catalog 补 postgresql。
- 文档:README / docs/architecture.md §2/§6 / docs/design.md §2/§6/§9 数据边界
  全部按"21 类 → PG 参考库、gen 留守 MySQL、Redis 动态不变"更新。

验证:37 测试全绿(./gradlew test,接口拆分后无破坏)。
表结构/迁移/ReferenceService 实装/应答接线属阶段 6(U05 批次后)。
This commit is contained in:
windyboy
2026-09-07 07:56:54 +08:00
parent 7e3bf383a5
commit a3f1da4bcc
13 changed files with 100 additions and 24 deletions
+13
View File
@@ -38,6 +38,15 @@ datasources:
username: ${MSGX_DB_USER}
password: ${MSGX_DB_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver
# ACM2-1121 类静态主数据独立 PostgreSQL 参考库(reference datasource)。
# 数据层实装(阶段 6 / U05 批次)前默认 disabled——不建连不解析占位符;
# 接入时置 enabled=true 并设 MSGX_REF_DB_URL(或 host/port/name)等环境变量。
reference:
enabled: false
url: ${MSGX_REF_DB_URL}
username: ${MSGX_REF_DB_USER:reference}
password: ${MSGX_REF_DB_PASSWORD:}
driver-class-name: org.postgresql.Driver
flyway:
datasources:
@@ -46,6 +55,10 @@ flyway:
locations: classpath:db/migration
# U04R01):V2.0.0 只建六张辅助表,假定 CMINMSGS/CMINMSGS_HST 等 legacy 旧表已存在;
# 全新库请按 README「数据库初始化」先落 legacy schema(或 baseline),否则收报首句 SQL 会报表不存在。
reference:
# ACM2-11:21 类静态主数据 PG 库迁移(类表 DDL 草案见 ACM2-11 Checks,阶段 6 落库)
enabled: false
locations: classpath:db/ref-migration
redis:
uri: ${MSGX_REDIS_URI} # 阶段 A 权威存储;仅主泵线程写(I5)