From f247cc15feb8cbfe1a9c3232ced1f0d7dd32c994 Mon Sep 17 00:00:00 2001 From: mediabot-pt <295750538+mediabot-pt@users.noreply.github.com> Date: Mon, 29 Jun 2026 17:22:04 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=20API.md=20=E2=80=94?= =?UTF-8?q?=20Manifest=20ETag=20+=20/time=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/API.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/API.md b/docs/API.md index 98bf8a1..639846e 100644 --- a/docs/API.md +++ b/docs/API.md @@ -63,7 +63,14 @@ Token 通过 `POST /api/v1/auth/login` 获取,24 小时有效。 | 方法 | 路径 | 认证 | 说明 | |------|------|------|------| | GET | `/health` | 无 | 健康检查 | -| GET | `/api/v1/time` | 无 | 服务端时间戳(秒) | +| GET | `/api/v1/time` | 无 | 服务端时间戳,签名前获取避免时钟偏差 | + +#### GET /api/v1/time + +```json +// Response 200 +{ "timestamp": 1782800000, "unit": "seconds" } +``` ### 2.2 认证 @@ -115,8 +122,17 @@ Token 通过 `POST /api/v1/auth/login` 获取,24 小时有效。 #### GET /api/v1/manifest +支持 `If-None-Match` 条件请求(ETag = 所有站点+配置哈希的 SHA-256)。 +无变化时返回 `304 Not Modified`,无数据传输。 + +```bash +# 轮询示例 +curl -H "If-None-Match: a1b2c3d4..." http://par:9012/api/v1/manifest +# → 304 Not Modified (内容未变) +``` + ```json -// Response 200 +// Response 200 ETag: "a1b2c3d4..." { "code": 200, "data": {