平行类型
由于底层模块之间保持解耦(例如 kxed-livecell 不直接依赖 kxed-core、kxed-runtime 或 kxed-plugins),少数相同概念在两个独立模块中各有自己的同名或对应类型。同时通配导入时请带模块路径区分。
1. 两步验证密钥重加密结果(字段完全一致):
| 类型名 | kxed::plugins::auth | kxed::plugins::livecell::fly::account |
|---|---|---|
TotpRekey | SeaOrmAccounts::rekey_totp 返回值(auth totp rekey 命令输出) | AccountAdmin::rekey_totp 返回值(fly totp rekey 命令输出) |
注:JSON 两步登录统一返回 auth 的 LoginStep(Authenticated(AuthPrincipal) 或 Challenge(String));Fly 原生页面登录则使用返回 AccountPrincipal 的 AccountLogin(两套账户表完整对照见 LAYOUT)。
2. 死信与后台异步投递报告(Task、Notify 与 Search 各自独立落盘):
| 类型名 | 共用字段 | Task(kxed::task) | Notify(kxed::plugins::notify) | Search(kxed::plugins::search::sync) |
|---|---|---|---|---|
DeadLetter | id、failed_at(JSON 为 failed_at_ms) | 任务 TaskId、name 与 failure | 通知 outbox_id、渠道、收件人与重试次数 | 索引名、主键 key、序号 seq 与原因 |
DeadLetterReplay | replayed、next、interrupted | 重放出的 (旧 ID, 新 TaskId) 列表及 failed(实现 Serialize) | 重新放回待发箱的条数 | 重新入队的文档主键数 |
RelayReport | claimed、retried、dead_lettered、unavailable | 无后台转发器 | 另含 delivered、offline、unconfirmed、released | 另含 keys、applied、ignored、reissued、abandoned、written |
另注:Fly 运维面板 kxed::plugins::livecell::fly::ops 下也有供页面渲染的只读副本 DeadLetter、DeadLetterPage(由 QueueAdmin 从 Task 转换)以及 InspectedRequest、InspectedStatement、InspectedLog(由 RequestLog 从 kxed::plugins::inspect 转换)。
3. 容易混淆的相近身份与展示类型对照:
| 类型对 | 各自所在模块 | 一句话区分该用哪一个 |
|---|---|---|
AccountProfile vs ViewerProfile | fly::account vs livecell | AccountProfile 是个人设置页读写数据库的账号记录(用户名、昵称、是否绑了 TOTP);ViewerProfile 是顶栏菜单渲染用的只读展示资料(含头像与最多 MENU_TENANT_LIMIT 个常用切换租户 menu_tenants) |
ViewerTenant vs TenantChoice | livecell vs livecell::sdui | 两者都表示租户切换下拉框里的一行(id、name、with_current),ViewerTenant 是宿主提供的身份数据,TenantChoice 是 SDUI 下拉组件内部的渲染副本 |
Identity vs RequestViewer | kxed::identity vs kxed::plugins::livecell | Identity 给后端接口鉴权、查库(CurrentTenant)和发后台任务(TaskIdentity)用;RequestViewer 解引用为 Viewer,专供普通 HTTP 接口调用需要 &Viewer 的 Fly / Livecell 服务方法 |
两个 TopicMessage | kxed::presence vs kxed::plugins::livecell | 前者是 ctx.subscribe_topic 收到的 WebSocket 广播流元素(解码错返 AppErr);后者是 LivecellRuntime::publish 推给实时网页组件的内部消息(解码错返 LiveError) |
AppCtxLivecell vs LivecellAppCtx | kxed vs kxed::plugins::livecell | AppCtxLivecell 让后端通过 ctx.livecell()? 向网页推通知;LivecellAppCtx 让网页按钮事件反向调后端的 Task、Event 与 Resident |