forked from EduCraft/curriculum-project-hub
feat(filelib): 老师端左栏导航:回收站 + 最近打开(ADR-0031)
- 回收站:listBin(祖先全活跃的已删顶点;管理员/直连 MANAGE 可见)、 restore(与 D15 对称只清本节点,落审计)、purge(仅管理员,pathIds 枚举 子树按深度降序分批硬删,绕过 self-FK RESTRICT) - 最近打开:FileLibRecentVisit 表(filePath='' 兜底 PG 唯一索引),客户端 成功打开后上报(VIEW 门禁,upsert 刷新),列表 20 条,D8/D15 可见性过滤 - 前端:/app 左栏(文件库/最近打开/回收站);RecentView/BinView; GridLibraryView 埋点 + navTarget 跳转(breadcrumb 建栈,role 已捎带) - 测试:filelib-nav 集成 4 例;全套 79 例绿
This commit is contained in:
@@ -1110,3 +1110,18 @@ model FileLibExportJob {
|
||||
|
||||
@@index([organizationId, status])
|
||||
}
|
||||
|
||||
/// ADR-0031:最近打开。客户端在成功打开后上报;filePath="" 表示节点本身
|
||||
/// (文件夹/项目),非空表示项目内文件预览(PG 唯一索引视 NULL 互不相同,
|
||||
/// 故用空串而非 null)。名称读取时 join FileLibNode 实时取,不做冗余。
|
||||
model FileLibRecentVisit {
|
||||
id String @id @default(cuid())
|
||||
organizationId String
|
||||
userId String
|
||||
nodeId String
|
||||
filePath String @default("")
|
||||
openedAt DateTime
|
||||
|
||||
@@unique([organizationId, userId, nodeId, filePath])
|
||||
@@index([organizationId, userId, openedAt])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user