docs: update training docs with cache/unregister APIs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Momentry Core API 教育訓練手冊
|
||||
|
||||
> **對象**: marcom 團隊
|
||||
> **版本**: V1.0 | **日期**: 2026-03-25
|
||||
> **版本**: V1.1 | **日期**: 2026-03-25
|
||||
|
||||
---
|
||||
|
||||
@@ -73,23 +73,6 @@ curl -s -H "X-API-Key: muser_68600856036340bcafc01930eb4bd839_1774418104_97221b6
|
||||
#### GET /api/v1/videos/:uuid
|
||||
取得單一影片詳情
|
||||
|
||||
#### GET /api/v1/videos/:uuid/chunks
|
||||
取得影片的分段資訊
|
||||
|
||||
**回應範例**:
|
||||
```json
|
||||
{
|
||||
"chunks": [
|
||||
{
|
||||
"chunk_id": "time_00001",
|
||||
"start_time": 0.0,
|
||||
"end_time": 10.0,
|
||||
"type": "time_based"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
### 3.2 任務相關
|
||||
|
||||
#### GET /api/v1/jobs/:uuid
|
||||
@@ -122,7 +105,48 @@ curl -s -H "X-API-Key: ..." \
|
||||
"https://api.momentry.ddns.net/api/v1/jobs?status=completed&limit=5"
|
||||
```
|
||||
|
||||
### 3.3 健康檢查
|
||||
### 3.3 系統管理
|
||||
|
||||
#### POST /api/v1/config/cache
|
||||
切換快取功能(管理員專用)
|
||||
|
||||
**請求範例**:
|
||||
```json
|
||||
{
|
||||
"enabled": true
|
||||
}
|
||||
```
|
||||
|
||||
**回應範例**:
|
||||
```json
|
||||
{
|
||||
"cache_enabled": true,
|
||||
"message": "Cache toggled successfully"
|
||||
}
|
||||
```
|
||||
|
||||
#### POST /api/v1/unregister
|
||||
刪除影片及其所有關聯資料(管理員專用)
|
||||
|
||||
**請求範例**:
|
||||
```json
|
||||
{
|
||||
"uuid": "5dea6618a606e7c7"
|
||||
}
|
||||
```
|
||||
|
||||
**回應範例**:
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"message": "Video unregistered successfully",
|
||||
"uuid": "5dea6618a606e7c7"
|
||||
}
|
||||
```
|
||||
|
||||
**注意**: 此操作會刪除影片及其所有分段、處理結果、縮圖等關聯資料,**無法復原**。
|
||||
|
||||
### 3.4 健康檢查
|
||||
|
||||
#### GET /health
|
||||
服務健康狀態(**無需認證**)
|
||||
@@ -177,22 +201,6 @@ return [{
|
||||
}];
|
||||
```
|
||||
|
||||
### 4.3 範例:擷取影片分段
|
||||
|
||||
```javascript
|
||||
const videoUuid = $input.item.json.uuid;
|
||||
|
||||
return [{
|
||||
json: {
|
||||
method: "GET",
|
||||
url: `https://api.momentry.ddns.net/api/v1/videos/${videoUuid}/chunks`,
|
||||
headers: {
|
||||
"X-API-Key": "YOUR_API_KEY"
|
||||
}
|
||||
}
|
||||
}];
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 5. 常見問題
|
||||
@@ -219,9 +227,10 @@ GET /api/v1/jobs/{uuid}
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ 查詢所有影片 GET /api/v1/videos │
|
||||
│ 查詢單一影片 GET /api/v1/videos/:uuid │
|
||||
│ 查詢影片分段 GET /api/v1/videos/:uuid/chunks │
|
||||
│ 查詢任務狀態 GET /api/v1/jobs/:uuid │
|
||||
│ 查詢所有任務 GET /api/v1/jobs │
|
||||
│ 快取設定 POST /api/v1/config/cache (管理員) │
|
||||
│ 刪除影片 POST /api/v1/unregister (管理員) │
|
||||
│ 健康檢查 GET /health (免認證) │
|
||||
├─────────────────────────────────────────────────────────────┤
|
||||
│ Header: X-API-Key: [YOUR_KEY] │
|
||||
@@ -254,5 +263,5 @@ GET /api/v1/jobs/{uuid}
|
||||
|
||||
---
|
||||
|
||||
**文件版本**: V1.0
|
||||
**文件版本**: V1.1
|
||||
**最後更新**: 2026-03-25
|
||||
|
||||
Reference in New Issue
Block a user