后端重写提交

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

@@ -3,12 +3,12 @@
## 1. SpacetimeDB 运行时主表
- [ ] 设计 `runtime_snapshot`
- [ ] 设计 `runtime_setting`
- [ ] 设计 `profile_dashboard_state`
- [ ] 设计 `profile_wallet_ledger`
- [ ] 设计 `profile_played_world`
- [x] 设计 `runtime_setting`
- [x] 设计 `profile_dashboard_state`
- [x] 设计 `profile_wallet_ledger`
- [x] 设计 `profile_played_world`
- [ ] 设计 `profile_save_archive`
- [ ] 设计 `user_browse_history`
- [x] 设计 `user_browse_history`
## 2. 兼容快照策略
@@ -16,31 +16,31 @@
- [ ] 设计 snapshot projection 刷新机制
- [ ] 迁移当前 snapshot hydration / normalize 规则
- [ ] 迁移当前 save archive 聚合逻辑
- [ ] 迁移当前 browse history 去重与排序逻辑
- [x] 迁移当前 browse history 去重与排序逻辑
## 3. Axum facade
- [ ] 兼容 `GET /api/runtime/save/snapshot`
- [ ] 兼容 `PUT /api/runtime/save/snapshot`
- [ ] 兼容 `DELETE /api/runtime/save/snapshot`
- [ ] 兼容 `GET /api/runtime/settings`
- [ ] 兼容 `PUT /api/runtime/settings`
- [ ] 兼容 `GET /api/runtime/profile/dashboard`
- [ ] 兼容 `GET /api/profile/dashboard`
- [ ] 兼容 `GET /api/runtime/profile/wallet-ledger`
- [ ] 兼容 `GET /api/profile/wallet-ledger`
- [ ] 兼容 `GET /api/runtime/profile/play-stats`
- [ ] 兼容 `GET /api/profile/play-stats`
- [x] 兼容 `GET /api/runtime/settings`
- [x] 兼容 `PUT /api/runtime/settings`
- [x] 兼容 `GET /api/runtime/profile/dashboard`
- [x] 兼容 `GET /api/profile/dashboard`
- [x] 兼容 `GET /api/runtime/profile/wallet-ledger`
- [x] 兼容 `GET /api/profile/wallet-ledger`
- [x] 兼容 `GET /api/runtime/profile/play-stats`
- [x] 兼容 `GET /api/profile/play-stats`
- [ ] 兼容 `GET /api/runtime/profile/save-archives`
- [ ] 兼容 `GET /api/profile/save-archives`
- [ ] 兼容 `POST /api/runtime/profile/save-archives/:worldKey`
- [ ] 兼容 `POST /api/profile/save-archives/:worldKey`
- [ ] 兼容 `GET /api/runtime/profile/browse-history`
- [ ] 兼容 `POST /api/runtime/profile/browse-history`
- [ ] 兼容 `DELETE /api/runtime/profile/browse-history`
- [ ] 兼容 `GET /api/profile/browse-history`
- [ ] 兼容 `POST /api/profile/browse-history`
- [ ] 兼容 `DELETE /api/profile/browse-history`
- [x] 兼容 `GET /api/runtime/profile/browse-history`
- [x] 兼容 `POST /api/runtime/profile/browse-history`
- [x] 兼容 `DELETE /api/runtime/profile/browse-history`
- [x] 兼容 `GET /api/profile/browse-history`
- [x] 兼容 `POST /api/profile/browse-history`
- [x] 兼容 `DELETE /api/profile/browse-history`
## 4. 阶段验收
@@ -48,3 +48,18 @@
- [ ] 兼容路径与主路径返回一致
- [ ] profile dashboard / browse history / save archive 行为一致
- [ ] 前端当前恢复流程可在不改 UI 的前提下跑通
## 5. 本轮进展记录
- `2026-04-21`:已完成 `runtime_setting` 首版设计与 `GET/PUT /api/runtime/settings` 的 Rust 主链迁移。
- 本轮已落地 `module-runtime``spacetime-module``spacetime-client``api-server` 四层串联,并补齐定向测试。
- 详细设计与字段冻结见:
- [../docs/technical/M3_RUNTIME_SETTINGS_AXUM_SPACETIMEDB_DESIGN_2026-04-21.md](../docs/technical/M3_RUNTIME_SETTINGS_AXUM_SPACETIMEDB_DESIGN_2026-04-21.md)
- `2026-04-22`:已完成 `user_browse_history` 表设计冻结、去重与排序规则迁移,以及 `/api/runtime/profile/browse-history``/api/profile/browse-history` 双路径 facade 落地。
- `2026-04-22`:已补 `browse history` 的 API 入口必填字段校验、批量 shape 兼容与定向测试,详细设计见:
- [../docs/technical/M3_BROWSE_HISTORY_AXUM_SPACETIMEDB_DESIGN_2026-04-21.md](../docs/technical/M3_BROWSE_HISTORY_AXUM_SPACETIMEDB_DESIGN_2026-04-21.md)
- `2026-04-22`:已冻结 `profile_dashboard_state``profile_wallet_ledger``profile_played_world` 三张 projection 表,以及 `dashboard / wallet-ledger / play-stats` 的 Axum + SpacetimeDB 读链设计。
- `2026-04-22`:已完成 `api-server``runtime_profile` facade 编译与定向测试收口,`/api/runtime/profile/*``/api/profile/*` 六条只读路由均已接通。
- `2026-04-22`:已通过 `cargo check -p api-server --tests --message-format short``cargo test -p shared-contracts --lib``cargo test -p api-server runtime_profile::tests:: -- --nocapture` 验证本轮 profile projection 读链。
- 详细设计见:
- [../docs/technical/M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md](../docs/technical/M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md)