feat(cache): 通用缓存按区统计与清空接口

GET /cache/regions 列出 kv_cache 各区的未过期条数、已过期条数、占用字节、最近写入;
POST /cache/regions/{region}/clear 清空一个区(admin)。contracts 加区名中文映射
cacheRegionLabel,web 加对应 hooks。

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-10-06 18:01:19 +08:00
1 parent ad3bf8926b
commit b7460d5d0a
5 files changed
+190 -6

No files matched your search

+15
View File
@@ -95,6 +95,21 @@ export const platformApi = {
summary: "清空图片代理缓存",
response: cache.CacheClearResult,
}),
regions: ep({
method: "get",
path: "/cache/regions",
scope: "admin",
summary: "通用缓存(kv_cache)按区统计:条目数、已过期数、占用字节、最近写入",
response: cache.CacheRegionList,
}),
regionClear: ep({
method: "post",
path: "/cache/regions/{region}/clear",
scope: "admin",
summary: "清空通用缓存的一个区",
params: cache.CacheRegionParam,
response: cache.CacheClearResult,
}),
},
// ── 网页搜索(WEB-1,docs/runbook/websearch.md) ──