docs: update API docs with cache/unregister endpoints and marcom training refs
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|------|------|------|--------|-----------|
|
||||
| V1.0 | 2026-03-18 | 創建文件 | Warren | OpenCode / MiniMax M2.5 |
|
||||
| V1.1 | 2026-03-23 | 更新端點與實際一致 | OpenCode | - |
|
||||
| V1.2 | 2026-03-25 | 新增快取/刪除 API | OpenCode | - |
|
||||
|
||||
---
|
||||
|
||||
@@ -384,6 +385,63 @@ curl http://localhost:3002/api/v1/videos
|
||||
|
||||
---
|
||||
|
||||
## Cache Toggle
|
||||
|
||||
Toggle caching at runtime.
|
||||
|
||||
**Endpoint:** `POST /api/v1/config/cache`
|
||||
|
||||
**Request Body:**
|
||||
```json
|
||||
{
|
||||
"enabled": true
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `enabled` | boolean | Yes | Enable (true) or disable (false) cache |
|
||||
|
||||
**Response (200):**
|
||||
```json
|
||||
{
|
||||
"cache_enabled": true,
|
||||
"message": "Cache toggled successfully"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Unregister Video
|
||||
|
||||
Delete a video and all associated data (chunks, processor results, thumbnails).
|
||||
|
||||
**Endpoint:** `POST /api/v1/unregister`
|
||||
|
||||
**Request Body:**
|
||||
```json
|
||||
{
|
||||
"uuid": "5dea6618a606e7c7"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
|-------|------|----------|-------------|
|
||||
| `uuid` | string | Yes | Video UUID (16 character hex) |
|
||||
|
||||
**Response (200):**
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "Video unregistered successfully",
|
||||
"uuid": "5dea6618a606e7c7"
|
||||
}
|
||||
```
|
||||
|
||||
**Warning:** This operation is irreversible and will delete all associated chunks, processor results, and thumbnails.
|
||||
|
||||
---
|
||||
|
||||
## Error Responses
|
||||
|
||||
**400 Bad Request**
|
||||
@@ -445,3 +503,5 @@ cargo run --bin momentry -- server --host 127.0.0.1 --port 3002
|
||||
| Search | `POST /api/v1/search` |
|
||||
| List videos | `GET /api/v1/videos` |
|
||||
| Lookup | `GET /api/v1/lookup?uuid=<uuid>` |
|
||||
| Toggle cache | `POST /api/v1/config/cache` |
|
||||
| Delete video | `POST /api/v1/unregister` |
|
||||
|
||||
Reference in New Issue
Block a user