chore: formalize dotnet backend repository
This commit is contained in:
24
README.md
24
README.md
@@ -1,6 +1,6 @@
|
||||
# TIKU Backend
|
||||
|
||||
题库 SaaS 新后端。目标是从旧 PocketBase / Supabase / Nest 方案迁到更可控的 ASP.NET Core + PostgreSQL 架构。
|
||||
题库 SaaS 正式后端。项目正在从旧 PocketBase / Supabase / Nest 方案迁到更可控的 ASP.NET Core + PostgreSQL 架构。本仓库是后续开发的唯一目标后端,架构决策见 [`docs/adr/0001-authoritative-dotnet-backend.md`](docs/adr/0001-authoritative-dotnet-backend.md)。
|
||||
|
||||
当前判断很明确:现在团队已经有后端开发,继续把核心认证、权限、多租户隔离、业务一致性交给 BaaS 规则,会让复杂度藏在平台、SQL policy 和前端约定之间。新后端把这些东西收回应用层和数据库约束里,开发、排查、审计都会更直接。
|
||||
|
||||
@@ -92,7 +92,7 @@ Tiku.IntegrationTests # API / EF 模型集成测试
|
||||
Tiku.Infrastructure/Persistence/Migrations/20260725220742_InitialSchema.cs
|
||||
```
|
||||
|
||||
当前 EF 模型包含 124 个 DbSet,覆盖:
|
||||
当前 EF 模型覆盖:
|
||||
|
||||
- 租户、用户、成员、认证、Session、短信验证码
|
||||
- 地区、模块、院校、专业、科目、分类
|
||||
@@ -124,7 +124,7 @@ Tiku.Infrastructure/Persistence/Migrations/20260725220742_InitialSchema.cs
|
||||
|
||||
### 已迁移 API
|
||||
|
||||
当前新后端有 43 个 endpoint,其中 3 个是安全诊断接口。已完成的业务/API 闭环:
|
||||
2026-07-27 运行时 OpenAPI 基线包含 192 个路径、237 个操作。已完成的业务/API 闭环包括:
|
||||
|
||||
- health
|
||||
- tenant resolve / current public
|
||||
@@ -139,17 +139,14 @@ Tiku.Infrastructure/Persistence/Migrations/20260725220742_InitialSchema.cs
|
||||
|
||||
## 还剩多少待迁移
|
||||
|
||||
按旧 Nest API 粗略统计,旧版约 342 个 HTTP endpoint;新后端目前 43 个,其中安全诊断 3 个不算旧业务迁移。按 endpoint 数量估算:
|
||||
运行时契约基线显示,旧 NestJS 有 342 个操作,当前 .NET 有 237 个操作:
|
||||
|
||||
```text
|
||||
旧版 endpoint 总量:约 342
|
||||
新后端已实现:43
|
||||
其中诊断接口:3
|
||||
已覆盖旧业务接口:约 40
|
||||
待迁移旧业务接口:约 302
|
||||
当前 .NET 操作:237
|
||||
```
|
||||
|
||||
这个数字只是迁移工作量参考,不代表 302 个都应该原样照搬。旧版里有不少平台运营、商业化自动化、审计告警、积分、督导、对账等后段能力,应该按新架构重新筛选。
|
||||
两边路径设计并非逐字兼容,不能用 `342 - 237` 推算剩余工作量。详细机械比较和后续取舍入口见 [`docs/migration/contracts/operation-inventory.csv`](docs/migration/contracts/operation-inventory.csv)。旧版里有不少平台运营、商业化自动化、审计告警、积分、督导、对账等后段能力,应按新架构重新筛选。
|
||||
|
||||
优先级建议:
|
||||
|
||||
@@ -166,10 +163,11 @@ Tiku.Infrastructure/Persistence/Migrations/20260725220742_InitialSchema.cs
|
||||
## 常用命令
|
||||
|
||||
```bash
|
||||
dotnet build /home/xiong/Games/Anii/TIKU-BACKEND/TIKU-BACKEND.slnx
|
||||
dotnet test /home/xiong/Games/Anii/TIKU-BACKEND/TIKU-BACKEND.slnx
|
||||
dotnet format /home/xiong/Games/Anii/TIKU-BACKEND/TIKU-BACKEND.slnx --verify-no-changes
|
||||
git -C /home/xiong/Games/Anii/TIKU-BACKEND diff --check
|
||||
dotnet restore TIKU-BACKEND.slnx
|
||||
dotnet build TIKU-BACKEND.slnx --no-restore
|
||||
dotnet test TIKU-BACKEND.slnx --no-build
|
||||
dotnet format TIKU-BACKEND.slnx --verify-no-changes --no-restore
|
||||
git diff --check
|
||||
```
|
||||
|
||||
生成数据库 SQL:
|
||||
|
||||
Reference in New Issue
Block a user