API 參考¶
所有端點皆在 /api 前綴下。
互動式文件
伺服器啟動後,可在 http://localhost:8000/docs 查看完整的 Swagger UI 互動式文件。
認證¶
登入¶
請求內容:
回應:
同時會自動設定 refresh_token 的 httpOnly Cookie。
更新 Token¶
使用 httpOnly Cookie 發行新的 Access Token,不需要請求內容。
登出¶
撤銷 Refresh Token 並清除 Cookie。
當前使用者¶
影片¶
影片列表¶
上傳影片¶
POST /api/videos/upload
Authorization: Bearer <access_token>
Content-Type: multipart/form-data
file=<影片檔案>
從 YouTube 匯入¶
POST /api/videos/download
Authorization: Bearer <access_token>
Content-Type: application/json
{
"url": "https://www.youtube.com/watch?v=..."
}
下載進度(WebSocket)¶
即時下載進度事件:
標記¶
取得影片的標記列表¶
建立標記¶
POST /api/marks
Authorization: Bearer <access_token>
Content-Type: application/json
{
"video_id": 1,
"timestamp": 125.5,
"category": "offense",
"players": "7 林書豪, 11 王大明"
}
category 選項:offense(進攻)| defense(防守)| turnover(失誤)
片段¶
擷取片段¶
POST /api/clips
Authorization: Bearer <access_token>
Content-Type: application/json
{
"mark_ids": [1, 2, 3]
}
精華剪輯¶
產生精華剪輯¶
POST /api/highlights/generate
Authorization: Bearer <access_token>
Content-Type: application/json
{
"filter_type": "player",
"filter_value": "7"
}
filter_type 選項:player(依球員)| category(依分類)
分享¶
建立分享連結¶
POST /api/shares
Authorization: Bearer <access_token>
Content-Type: application/json
{
"resource_type": "clip",
"resource_id": 1,
"expires_in": "7d"
}
expires_in 選項:24h | 7d | 30d | permanent
回應:
健康檢查¶
不需要認證。服務正常運作時回傳 200 OK。