From ffa123d2cd38c29f7995bf52e6e1a3c5541f33cb Mon Sep 17 00:00:00 2001 From: CNWei Date: Tue, 3 Nov 2026 19:34:07 +0800 Subject: [PATCH] =?UTF-8?q?docs(api):=20=E5=90=8C=E6=AD=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=B8=80=E8=A7=88=E5=88=B0=E6=B8=85=E7=90=86=E5=90=8E?= =?UTF-8?q?=E7=9A=84=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除已删除的 /api/catalog 与 /api/categories、旧 /api/groups/{id} - 内容库描述改为分组树 / 条目 / 卡片,节点接口改为根分组 / 子分组 - 「需登录」说明不再等同于写操作 --- stash-web/src/components/api/ApiDocs.tsx | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/stash-web/src/components/api/ApiDocs.tsx b/stash-web/src/components/api/ApiDocs.tsx index 168d7f2..014baa4 100644 --- a/stash-web/src/components/api/ApiDocs.tsx +++ b/stash-web/src/components/api/ApiDocs.tsx @@ -26,14 +26,13 @@ const GROUPS: { title: string; desc: string; items: Endpoint[] }[] = [ }, { title: '内容库', - desc: '分区 / 分组 / 条目 / 卡片。写操作都需要登录会话与同源 Origin。', + desc: '分组树 / 条目 / 卡片。写操作都需要登录会话与同源 Origin。', items: [ - { method: 'GET', path: '/api/catalog', summary: '旧版完整目录(兼容保留)' }, - { method: 'GET', path: '/api/catalog2', summary: '分组树 + 卡片,后台配置用' }, + { method: 'GET', path: '/api/catalog2', summary: '分组树 + 卡片,前台与后台共用' }, { method: 'GET', path: '/api/catalog/events', summary: 'SSE:内容库变更时推送「该重拉」' }, - { method: 'POST', path: '/api/nodes', summary: '新建分区 / 分组', auth: true }, + { method: 'POST', path: '/api/nodes', summary: '新建根分组 / 子分组', auth: true }, { method: 'PATCH', path: '/api/nodes/{key}', summary: '改标题、所属、图标、排序、启停', auth: true }, - { method: 'DELETE', path: '/api/nodes/{key}', summary: '删除分区 / 分组(级联子节点)', auth: true }, + { method: 'DELETE', path: '/api/nodes/{key}', summary: '删除分组(级联子分组与条目)', auth: true }, { method: 'GET', path: '/api/items/{key}', summary: '条目详情' }, { method: 'POST', path: '/api/items', summary: '新建条目', auth: true }, { method: 'PATCH', path: '/api/items/{key}', summary: '就地编辑(带 updatedAt 乐观锁)', auth: true }, @@ -44,12 +43,6 @@ const GROUPS: { title: string; desc: string; items: Endpoint[] }[] = [ { method: 'PATCH', path: '/api/cards/{id}', summary: '改卡片标题 / 顺序', auth: true }, { method: 'DELETE', path: '/api/cards/{id}', summary: '删除卡片', auth: true }, { method: 'PUT', path: '/api/cards/{id}/groups', summary: '整组替换卡片包含的分组与顺序', auth: true }, - { method: 'POST', path: '/api/categories', summary: '旧版:新建分类', auth: true }, - { method: 'PATCH', path: '/api/categories/{id}', summary: '旧版:改分类', auth: true }, - { method: 'DELETE', path: '/api/categories/{id}', summary: '旧版:删分类', auth: true }, - { method: 'POST', path: '/api/categories/{id}/groups', summary: '旧版:新建分组', auth: true }, - { method: 'PATCH', path: '/api/groups/{id}', summary: '旧版:改分组', auth: true }, - { method: 'DELETE', path: '/api/groups/{id}', summary: '旧版:删分组', auth: true }, ], }, { @@ -89,7 +82,7 @@ export function ApiDocs() { 接口一览 说明:这是 Stash 自带的 HTTP 接口清单,全部挂在同一个端口上。读接口公开,写接口需要登录会话并校验同源 - Origin;带 需登录 标记的即为写操作。 + Origin;带 需登录 标记的需要登录。