清理文档
Some checks failed
ci / release-gate (push) Has been cancelled

This commit is contained in:
2026-08-03 13:41:03 +08:00
parent 7adcb6a3d5
commit 4751e738b1
8 changed files with 20 additions and 103 deletions

View File

@@ -1,32 +1,15 @@
# 模块边界与所有权
后端保持模块化单体、统一 PostgreSQL、独立 API/Worker。目录是团队所有权边界跨模块调用必须经`Tiku.Application` 合同
后端是共享 PostgreSQL 的模块化单体API 与 Worker 是独立运行时。跨模块调用`Tiku.Application` 契约,模块实现由 `Tiku.Infrastructure/Modules` 统一注册
## 依赖方向
```text
Platform Core: Tenancy / Auth / Security
Catalog -> QuestionBanks -> Content / Assets -> Learning
Commerce -> Points / Growth
TenantAdmin / PlatformAdmin -> Application contracts or dedicated read models
Jobs -> queue / processor / operations + module job handlers
```
- API Controller 不得引用 `Tiku.Infrastructure``TikuDbContext`
- 一个模块不得引用另一个模块的 Infrastructure 类型。
- 跨模块查询使用 Application 查询合同;跨模块写入调用目标模块命令合同
- `TikuDbContext` 仍是统一事务入口,但 DbSet 按模块拆在 `Persistence/Modules`
- EF Migration 与模型快照串行合并,由 CODEOWNERS 默认负责人复核
## 子模块目录
- TenantAdminDashboard、Classes、Students、Supervision、StudentEngagement、MembersAndAccess、SiteSettings、DomainsAndEngagement。
- ContentQuestions、Vocabulary、Handbook、EducationCatalog、Scorelines、Videos、OperationContent、Imports。
- LearningAnalytics、Answering、QuestionReview、WordLearning、PracticeSessions、Foundation。
- CommerceOrders、Payments、Coupons、Refunds、Reconciliation、Adjustments、Points。
- PlatformAdminDashboard、TenantProvisioning、TenantDomains、StaffAndAccess、AuditAndAlerts、Dunning、Operations。
Service 文件超过 500 行应在评审中说明原因,超过 800 行由架构测试阻止新增。现有聚合接口应逐步由子模块接口替代,不允许把新能力继续追加到聚合 Service。
- 业务模块通过 Application 查询/命令契约协作,不直接依赖其他模块的 Infrastructure 类型。
- `TikuDbContext` 是统一事务入口DbSet 按领域拆到 `Persistence/Modules`Migration 和模型快照仍全局唯一
- `AddInfrastructure` 组合 Platform Core、Auth、Content、Learning、Tenant Admin、Commerce、Jobs 和 Platform 模块
- 后台任务处理器实现 `IBackgroundJobHandler`在所属模块注册Jobs 模块只负责队列、租约、调度和处理器查找
- 新 Service 聚合超过 800 行会被 `ArchitectureBoundaryTests` 阻止;既有超限服务不得超过记录的债务基线。
## API audience
@@ -37,4 +20,4 @@ Service 文件超过 500 行应在评审中说明原因,超过 800 行由架
- `/api/system/*`:健康与内部诊断。
- `/api/integrations/*`:外部系统回调。
的 platform-admin、backoffice、tenant-admin、tenant-content 和 tenant-commerce 路由不提供兼容入口。后端、OpenAPI 客户端和两个前端必须作为一个发布单元回滚或上线
audience 路由不提供兼容入口。路由变化必须同步更新 OpenAPI 客户端和对应前端