Files
starRiverProperty/maven-cw-elevator-application/docs/elevator-api-parity/PLAN.md
T
反编译工作区 038f846dad docs+test: 发布包对拍计划、pytest 双端 API 对拍与 run_elevator_parity 脚本
- docs/elevator-api-parity: 计划/报告模板/示例
- tools/elevator_api_parity: 端点目录、fixtures、对拍 client/compare、报告生成
- scripts/run_elevator_parity: JDK8 构建 + 单测/对拍(无服务时跳过对拍用例)

Made-with: Cursor

Former-commit-id: 3d54a40e1a7ae0b1724261d4f18910a6f415f853
2026-04-25 09:50:32 +08:00

45 lines
2.5 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.
# 新旧版本发布包:接口同构验证计划
## 1. 目标
- **新构建物**`cw-elevator-application-starter``mvn package` 产出的 `cw-elevator-application-2.0.0.jar`
- **历史基线**(约定路径,若不存在需单独拷贝):
`.../cw-elevator-application-V1.0.0.20211103/cw-elevator-application-V1.0.0.20211103.jar`
- **成功标准**:在**相同运行配置与依赖环境**下,对同一批 HTTP 请求,两实例返回的 **HTTP 状态码、JSON 结构、业务 `code``CloudwalkResult`** 一致;可约定忽略字段(时间戳、随机 `requestId` 等)在报告中注明。
## 2. 约束与先决条件
1. **双进程**:旧版默认端口 `18080`,新版 `18081`;均通过**同一套**外置或环境变量 `spring.config` 指向上游/库(与现网联调一致时才有可比性)。
2. **无历史 JAR**:本仓库中若不存在上述 `*.jar`,仅完成构建与**框架/离线用例**;等效性验证需在拿到 JAR 后执行 `scripts/run_elevator_parity.sh`
3. **健康检查**:优先 `GET /actuator/health`;若基线为 Spring Boot 1.5 且 `management` 基路径不同,由脚本 `tools/elevator_api_parity/parity/health.py` 自动探测回退。
## 3. 子任务分解
| 序号 | 任务 | 产出 |
|------|------|------|
| T1 | Maven 发布包构建 | `target/cw-elevator-application-2.0.0.jar` |
| T2 | 端点目录与用例体 | `tools/elevator_api_parity/api_catalog.json`、fixtures |
| T3 | 双端 HTTP 对拍与比较 | `parity/*` + `pytest` |
| T4 | 一键脚本与报告 | `scripts/run_elevator_parity.sh``report/parity-*.md` |
| T5 | 在联调环境实跑、签字发布 | 人工/运维 |
## 4. 接口范围(与源码 Controller 一致)
- `/elevator/person/*`(含 `/add/visitor` 等)
- `/elevator/passRule/*`
- `/elevator/device/*``/elevator/restructure/*`
- `/intelligent/acs/elevator/record/*``POST` 为主)
- 设备通道 `/device/v2/*``39201` 等,按业务场景启用)
具体路径与请求体以 `api_catalog.json` 为准,可按现网场景追加 `fixtures/*.json`
## 5. 非目标
- 不替代集成环境全链路压测、安全扫描。
- 不强制在一台空库机子上与线上一致(需**相同数据与上游**才可比)。
## 6. 与本文档配套脚本
-`maven-cw-elevator-application/tools/elevator_api_parity/README.md`
- 报告模板:`docs/elevator-api-parity/REPORT-TEMPLATE.md`(实跑时由 `generate_report.py` 自动填充为 `tools/elevator_api_parity/report/parity-*.md`)。