merge with my-archive
This commit is contained in:
1 parent
c07a2f6dae
commit
247a9f3322
11 files changed
+67
-37
No files matched your search
@@ -7,11 +7,11 @@ Video API Router
|
||||
- POST /video/generate/{task_id}: 영상 생성 요청 (task_id로 Project/Lyric/Song 연결)
|
||||
- GET /video/status/{creatomate_render_id}: Creatomate API 영상 생성 상태 조회
|
||||
- GET /video/download/{task_id}: 영상 다운로드 상태 조회 (DB polling)
|
||||
- GET /videos/: 완료된 영상 목록 조회 (페이지네이션)
|
||||
- GET /video/list: 완료된 영상 목록 조회 (페이지네이션)
|
||||
|
||||
사용 예시:
|
||||
from app.video.api.routers.v1.video import router
|
||||
app.include_router(router, prefix="/api/v1")
|
||||
app.include_router(router)
|
||||
"""
|
||||
|
||||
import json
|
||||
@@ -76,11 +76,11 @@ Creatomate API를 통해 영상 생성을 요청합니다.
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
# 세로형 영상 생성 (기본값)
|
||||
curl -X GET "http://localhost:8000/api/v1/video/generate/0694b716-dbff-7219-8000-d08cb5fce431" \\
|
||||
curl -X GET "http://localhost:8000/video/generate/0694b716-dbff-7219-8000-d08cb5fce431" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
|
||||
# 가로형 영상 생성
|
||||
curl -X GET "http://localhost:8000/api/v1/video/generate/0694b716-dbff-7219-8000-d08cb5fce431?orientation=horizontal" \\
|
||||
curl -X GET "http://localhost:8000/video/generate/0694b716-dbff-7219-8000-d08cb5fce431?orientation=horizontal" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
@@ -96,6 +96,7 @@ curl -X GET "http://localhost:8000/api/v1/video/generate/0694b716-dbff-7219-8000
|
||||
responses={
|
||||
200: {"description": "영상 생성 요청 성공"},
|
||||
400: {"description": "Song의 음악 URL, 가사(song_prompt) 또는 이미지가 없음"},
|
||||
401: {"description": "인증 실패 (토큰 없음/만료)"},
|
||||
404: {"description": "Project, Lyric, Song 또는 Image를 찾을 수 없음"},
|
||||
500: {"description": "영상 생성 요청 실패"},
|
||||
},
|
||||
@@ -480,7 +481,7 @@ succeeded 상태인 경우 백그라운드에서 MP4 파일을 다운로드하
|
||||
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X GET "http://localhost:8000/api/v1/video/status/{creatomate_render_id}" \\
|
||||
curl -X GET "http://localhost:8000/video/status/{creatomate_render_id}" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
@@ -498,6 +499,7 @@ curl -X GET "http://localhost:8000/api/v1/video/status/{creatomate_render_id}" \
|
||||
response_model=PollingVideoResponse,
|
||||
responses={
|
||||
200: {"description": "상태 조회 성공"},
|
||||
401: {"description": "인증 실패 (토큰 없음/만료)"},
|
||||
500: {"description": "상태 조회 실패"},
|
||||
},
|
||||
)
|
||||
@@ -633,7 +635,7 @@ completed인 경우 Project 정보와 영상 URL을 반환합니다.
|
||||
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X GET "http://localhost:8000/api/v1/video/download/019123ab-cdef-7890-abcd-ef1234567890" \\
|
||||
curl -X GET "http://localhost:8000/video/download/019123ab-cdef-7890-abcd-ef1234567890" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
@@ -644,6 +646,7 @@ curl -X GET "http://localhost:8000/api/v1/video/download/019123ab-cdef-7890-abcd
|
||||
response_model=DownloadVideoResponse,
|
||||
responses={
|
||||
200: {"description": "조회 성공"},
|
||||
401: {"description": "인증 실패 (토큰 없음/만료)"},
|
||||
404: {"description": "Video를 찾을 수 없음"},
|
||||
500: {"description": "조회 실패"},
|
||||
},
|
||||
@@ -730,7 +733,7 @@ async def download_video(
|
||||
|
||||
|
||||
@router.get(
|
||||
"s/",
|
||||
"/list",
|
||||
summary="생성된 영상 목록 조회",
|
||||
description="""
|
||||
완료된 영상 목록을 페이지네이션하여 조회합니다.
|
||||
@@ -753,7 +756,7 @@ async def download_video(
|
||||
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X GET "http://localhost:8000/api/v1/videos/?page=1&page_size=10" \\
|
||||
curl -X GET "http://localhost:8000/video/list?page=1&page_size=10" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
@@ -765,6 +768,7 @@ curl -X GET "http://localhost:8000/api/v1/videos/?page=1&page_size=10" \\
|
||||
response_model=PaginatedResponse[VideoListItem],
|
||||
responses={
|
||||
200: {"description": "영상 목록 조회 성공"},
|
||||
401: {"description": "인증 실패 (토큰 없음/만료)"},
|
||||
500: {"description": "조회 실패"},
|
||||
},
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user