Labels
Clear labels
area:activity
活动/统计
area:admin
管理后台
area:admin-api
area:ai
AI/RAG
area:ai-runtime
AI Runtime / AI 分析体系相关
area:analytics
area:api
API 接口
area:auth
认证与授权
area:cos
对象存储
area:database
数据库/Migration
area:import
文件导入/解析
area:knowledge
知识库/知识点
area:learning-info
area:learning-session
area:quiz
测验/自测
area:reading-event
area:reading-progress
area:review
复习系统
area:security
安全相关
audit:api-admin-info
audit:api-info
audit:planned
已完成宏观规划,尚未代码审查
audit:reviewed
blocked-by:api-info-aggregation
blocked-by:api-info-core
blocked-by:api-info-ops
blocked-by:api-info-schema
blocked-by:processor
blocked-by:schema
priority:p0
最高优先级,阻塞发布
priority:p1
高优先级,里程碑必需
priority:p2
中优先级,后续版本
repo:api
API 仓库 Issue
status:blocked
被阻塞
status:done
已完成
status:partial
status:todo
type:aggregation
type:bug
缺陷修复
type:design
设计
type:docs
文档
type:feature
新功能
type:migration
type:refactor
重构
type:test
work:admin-api
work:aggregation
work:api
work:artifact
题目/卡片产物
work:audit
work:circuit-breaker
熔断
work:contract
work:design
架构/协议设计工作
work:docs
work:export
work:extend-existing
work:internal-api
Runtime 内部接口
work:job
Job 调度相关
work:new-module
work:new-table
work:ops
work:query
work:quota
额度/限流
work:schema
Prisma Schema 设计
work:security
work:service
Service 层实现
work:snapshot
Snapshot 构建
work:test
No Label
Milestone
No items
No Milestone
M3:学习复习闭环(P2)
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wangdl/api-server#34
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标
设计知习统一缓存模块,为全系统提供 Redis 缓存策略,覆盖配置缓存、权限缓存、服务状态缓存和 Dashboard 统计缓存。
背景说明
多个模块需要缓存以提高性能:Config 模块的配置数据、Admin Auth 的权限数据、Workspace Experience 的 Dashboard 聚合数据等。如果不统一管理缓存策略(key 命名规范、过期时间、失效策略),后期会出现缓存混乱和脏数据问题。
Cache 模块基于已有 RedisService 封装,提供统一的缓存接口和策略管理。
模块职责
本模块负责:
本模块不负责:
第一阶段重点缓存对象
请判断以下缓存是否合理,并设计过期时间:
需要注意的风险
基础设施依赖
API 设计
Internal Provider(供各模块调用):
AAPI:
交付检查
验收标准
禁止事项
不建议当前阶段实现
✅ M3-06 实施完成
设计决策
基于已有
RedisService封装而非新增@nestjs/cache-manager依赖。理由:workspace:dashboard:userId)新增内容
CacheServiceget/set/del/wrap/flushPattern/flushAll/getStatsAdminCacheControllermodule:entity:id格式,自动添加cache:前缀缓存穿透保护
CacheService.wrap()实现 cache-aside 模式:__CACHE_NULL__哨兵值(较短 TTL ≤ 60s)第一阶段缓存对象 & TTL 策略
cache:config:app:*cache:admin:permission:*cache:ai:routescache:safety:wordscache:workspace:dashboard:*cache:user:info:*cache:kb:meta:*AAPI 端点
/admin-api/cache/stats/admin-api/cache/flush/:module/admin-api/cache/flush-key/admin-api/cache/flush-all/admin-api/cache/reset-statsAdmin 页面
菜单
系统运维 → 缓存管理已添加(/cache路由)。E2E(test/m3.e2e-spec.ts)
6 tests: stats, flush-key, flush module, reset stats, flush-all, and auth check.