Files
eip4-platform/README.md
zhengwr d137577759 eip4dev: 构建本地开发库,日常开发完全脱离 5435
- tools/local-devdb/build_devdb.sh: 幂等构建脚本,分层 dump/restore
  (ACT_* schema-only / 超500MB巨表 schema-only / 其余全量),
  内置 5435/ceshi 库安全守门,参数化源/目标/阈值/巨表清单
- tools/local-devdb/sql/data-tables.txt: 必须全量的引擎元数据/组织表清单
- tools/local-devdb/本地开发库构建报告.md: 实跑报告(2738MB/345s/94.1%对拍通过)
- application-dev.yml: dev profile 指向 localhost:5433/eip4dev,端口 8093
- README.md: 补三套 profile 说明(dev/local/默认)及常用命令
- SysUserService.java: 修复 MASTERDEPART 列不存在导致登录 500 的 bug
- docs/迁移手册.md: 追加三条新坑位(MASTERDEPART/sys_page_schema/shell 中文变量名)

验证: 登录 OK / list(1079行) / picker(5条) / ParityCli 1166实体 803 OK_FULL+294 OK_SAMPLE
完全本地: pg_stat_activity 全部连接来自 127.0.0.1:eip4dev,无 5435 连接

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 18:19:01 +08:00

68 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# eip4-platform
EIP4 平台正式工程(路线 A'):双层制模块化单体——**保真层供奉,现代层生长**。
架构依据:`docs/架构设计.md`(必读);坑位台账:`docs/迁移手册.md`。
## 模块
| 模块 | 职责 | 纪律 |
|------|------|------|
| platform-legacy-core | 保真层:移植引擎原样,包名 `com.dsasp.*` 不动 | **不重写、不改包名,与 framework 源码 diff 最小;对拍=完成定义** |
| platform-metadata | 现代层 REST API/DTO/OpenAPI(`com.eip4.*`) | 新代码须评审+单测 |
| platform-auth | 数据权限真实现(C2 已替换桩)+ P2 组织/权限 | |
| platform-converter | 模板转换器(P4) | 可独立 CLI 跑批 |
| platform-flow-gateway | P3 占位:Flowable 网关 | |
| platform-ai | P5 占位:MCP Server | |
| platform-parity | C1 对拍框架:录制/重放/RowDiff/自对拍 CLI | P1 一级交付物 |
| platform-app | Boot 启动器,组装全部模块 | ArchUnit 规则在此模块测试里 |
**边界纪律(ArchUnit 强制)**:`com.eip4.*` 可调 `com.dsasp.*`,反向禁止。
## 三套 profile
| profile | 数据源 | 端口 | 用途 |
|---------|--------|------|------|
| **dev**(日常开发) | localhost:5433/eip4dev(真实数据副本) | 8093 | **日常功能开发/联调,完全本地,无需网络** |
| **local**(自举) | localhost:5433/eip4m0(极简自举集) | 8084 | CI/对拍/单元测试 |
| 默认(验证) | 192.168.20.68:5435/eip3(客户库副本) | 8084 | 验收验证/性能基线,5435 收敛为只读基线 |
> eip4dev 刷新:`bash tools/local-devdb/build_devdb.sh --drop-target`(约 6 分钟)
> 详见:`tools/local-devdb/本地开发库构建报告.md`
## 常用命令
```bash
export JAVA_HOME=/opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home
mvn test # 全模块测试(含 ArchUnit)
# dev profile — 日常开发(真实数据副本 eip4dev,端口 8093)
mvn spring-boot:run -pl platform-app -Dspring-boot.run.profiles=dev
# local profile — 自举最小集(CI/对拍,端口 8084)
mvn spring-boot:run -pl platform-app -Dspring-boot.run.profiles=local
# 默认 profile — 客户库副本 5435(验证用)
mvn spring-boot:run -pl platform-app
# 构建/刷新本地开发库 eip4dev(幂等,约 6 分钟)
bash tools/local-devdb/build_devdb.sh --drop-target
# 对拍(详见 platform-parity/C1实测报告.md)
CP="platform-parity/target/classes:$(mvn -q org.apache.maven.plugins:maven-dependency-plugin:build-classpath -pl platform-parity -Dmdep.outputFile=/dev/stdout -o | tail -1)"
java -cp "$CP" com.eip4.platform.parity.selfcheck.ParityCli --all # 本地全量
java -cp "$CP" com.eip4.platform.parity.selfcheck.ParityCli --privilege # C2 数据权限样本
# 指向 eip4dev 自对拍:
mvn -pl platform-parity exec:java -Dexec.mainClass="com.eip4.platform.parity.selfcheck.ParityCli" \
"-Dexec.args=--discover --jdbc=jdbc:postgresql://localhost:5433/eip4dev?currentSchema=eip3 --engine=http://localhost:8093 --out=parity-reports/eip4dev"
```
## tools/
- `tools/s3_rewriter/` — C4 S3 脚本正则改写器(真实库自动化率 81.2%,P4 facade 扩容种子);`run_eval.py --from-db` 连客户库复测
- `tools/loadtest/load_p95.py` — C3 压测 harness(零依赖)
## 本地自举
空库重建:`platform-parity/src/main/resources/bootstrap/bootstrap-sys.sql` + `bootstrap-privilege.sql`,
再 `ParityCli --seed --all` 建 21 个测试实体并灌数。