docs(architecture): sync runtime diagram and guidance
Some checks failed
ci / release-gate (push) Has been cancelled
Some checks failed
ci / release-gate (push) Has been cancelled
This commit is contained in:
@@ -65,7 +65,7 @@ API 不自动迁移数据库。
|
||||
|
||||
### Worker 后台处理
|
||||
|
||||
`Tiku.Worker` 独立注册六个 Hosted Service。API 不承载这些生产后台循环;仅 Development 会额外注册 `.localhost` 域名生命周期旁路,方便本地建站验收。
|
||||
`Tiku.Worker` 独立注册七个 Hosted Service。API 不承载这些生产后台循环;仅 Development 会额外注册 `.localhost` 域名生命周期旁路,方便本地建站验收。
|
||||
|
||||
| Worker | 周期 | 当前职责 |
|
||||
| --- | --- | --- |
|
||||
@@ -75,10 +75,11 @@ API 不自动迁移数据库。
|
||||
| `BackgroundJobsWorker` | 默认 2 秒、4 个分区 | 使用租约处理 PostgreSQL 中的即时、延时和待重试任务 |
|
||||
| `AuthorizationCacheInvalidationWorker` | 默认 2 秒 | 重试 PostgreSQL 中待处理的 Redis 授权缓存失效事件 |
|
||||
| `CommercialBillingWorker` | 60 秒 | 生成续费应收与催缴提醒、投递启用渠道并执行已审批退款 |
|
||||
| `PlatformApprovalWorker` | 默认 2 秒 | 异步执行已经满足审批策略的平台命令 |
|
||||
|
||||
后台任务处理器由所属 Infrastructure 模块实现并注册,Jobs 模块按 `JobType` 调度。当前类型包括 `content_import`、`content_export`、`asset_security_scan`、`tenant_export`、`statistics_aggregation`、`commerce_reconciliation` 和 `tenant_domain_recheck`;架构测试校验处理器数量、类型和模块注册。安全扫描通过 ClamAV `INSTREAM` 流式处理对象,未通过扫描或扫描不可用时不签发资源访问地址。
|
||||
|
||||
即时任务与 `RunAfter` 延时任务统一写入 `background_jobs`。后台任务用 `FOR UPDATE SKIP LOCKED` 和五分钟租约协调;六个周期处理器使用 PostgreSQL advisory lock,允许部署多个 Worker 实例而不重复执行同一周期循环。商业续费、应收、退款和催缴投递仍以 PostgreSQL 表为权威,不引入消息代理。
|
||||
即时任务与 `RunAfter` 延时任务统一写入 `background_jobs`。`BackgroundJobsWorker` 使用 `FOR UPDATE SKIP LOCKED` 和五分钟租约,允许多个 Worker 实例并行消费;其余六个周期处理器使用 PostgreSQL advisory lock 保持集群单例执行。商业续费、应收、退款和催缴投递仍以 PostgreSQL 表为权威,不引入消息代理。
|
||||
|
||||
## 数据与持久化
|
||||
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
|
||||
## 认证入口
|
||||
|
||||
API 支持两组认证接口:
|
||||
API 按客户端边界提供四组认证接口:
|
||||
|
||||
- `/api/tenant/auth/**` 返回 access token 与 refresh token,适合 Bearer 客户端。
|
||||
- `/api/tenant/auth/browser/**` 把 token 写入 HttpOnly Cookie,适合同源浏览器客户端。
|
||||
- `/api/platform/auth/**`:平台授权域的 Bearer 客户端入口。
|
||||
- `/api/tenant/auth/**`:租户员工授权域的 Bearer 客户端入口。
|
||||
- `/api/student/auth/**`:学生客户端入口;与租户端共享本地账号能力,但必须使用租户授权域且匹配当前租户上下文。
|
||||
- `/api/tenant/auth/browser/**`:租户同源浏览器入口,把 token 写入 HttpOnly Cookie。
|
||||
|
||||
前三组 Bearer 路径共享认证实现,但路由与请求中的 Realm 必须一致;平台路径只接受 Platform Realm,租户端和学生端路径不接受 Platform Realm。
|
||||
|
||||
当前登录方式:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user