后端重写提交

This commit is contained in:
2026-04-22 12:34:49 +08:00
parent cf8da3f50f
commit 997a8daada
438 changed files with 53355 additions and 865 deletions

View File

@@ -1,6 +1,6 @@
# shared-contracts 共享 crate 占位说明
# shared-contracts 共享 crate 说明
日期:`2026-04-20`
日期:`2026-04-21`
## 1. crate 职责
@@ -13,14 +13,55 @@
## 2. 当前阶段说明
当前提交仅完成目录占位,不提前进入 DTO、事件与兼容结构实现。
当前阶段已完成 Stage1 最小真实落地:
后续与本 crate 直接相关的任务包括:
1. 统一 response envelope / 头部常量
2. `auth/login-options`
3. `auth/me`
4. `auth/sessions`
5. `runtime/settings`
1. 对齐现有前端直接依赖的响应头与 envelope
2. 对齐 story、custom world、chat 等 SSE 事件结构
3. 对齐 auth、runtime、assets 等兼容 DTO
4. 为 breaking change 建立显式变更边界
当前阶段继续补齐的 Stage2 鉴权 DTO
1. `auth/entry`
2. `auth/refresh`
3. `auth/logout`
4. `auth/logout-all`
5. `auth/phone/send-code`
6. `auth/phone/login`
7. `auth/wechat/start`
8. `auth/wechat/callback`
9. `auth/wechat/bind-phone`
当前阶段继续补齐的 Stage3 公开请求 DTO
1. `assets/direct-upload-tickets`
2. `assets/read-url`
3. `assets/objects/confirm`
4. `assets/objects/bind`
5. `story-sessions/begin`
6. `story-sessions/continue`
当前阶段继续补齐的 Stage4 显式成功响应 DTO
1. `assets/direct-upload-tickets`
2. `assets/read-url`
3. `assets/objects/confirm`
4. `assets/objects/bind`
5. `story-sessions/begin`
6. `story-sessions/continue`
当前阶段新增 Stage5 `runtime story` 兼容桥 DTO 基线:
1. `runtime/story/state/resolve` 请求 DTO
2. `RuntimeStoryActionResponse` 兼容响应 DTO
3. `RuntimeStoryViewModel / presentation / patches / snapshot` 显式结构
当前仍刻意未做:
1. SSE 事件结构
2. 自动代码生成或跨语言 contract 同步
3. 其他尚未收口模块的 handler 响应体显式 DTO 化
## 3. 边界约束