重构 API 为 8 领域 + 应用层架构

将后端模块拆分为 domains、applications、shared 三层,结算计算器移入 domain 纯函数目录,API 路径与测试保持不变。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-02 14:48:41 +08:00
parent 14e49374ac
commit 4c92157299
47 changed files with 169 additions and 138 deletions

View File

@@ -61,8 +61,27 @@ API 文档http://localhost:3000/api/docs
## 项目结构
```
apps/api/src/
├── domains/ # 8 个业务领域
│ ├── identity/ # 身份与权限auth + users
│ ├── agent/ # 代理网络
│ ├── ledger/ # 账务账本wallet
│ ├── catalog/ # 赛事目录matches
│ ├── odds/ # 盘口赔率markets
│ ├── betting/ # 注单引擎
│ ├── settlement/ # 结算引擎(含 domain/ 纯函数)
│ └── operations/ # 运营支撑audit/cashback/content/i18n
├── applications/ # 三端应用层(编排,不含领域规则)
│ ├── player/
│ ├── admin/
│ └── agent/
├── shared/ # 基础设施
│ ├── prisma/
│ └── common/
├── app.module.ts
└── main.ts
apps/
api/ NestJS 单体后端
player/ 玩家 H5 前台
admin/ 平台后台
agent/ 代理后台