finish
This commit is contained in:
1 parent
32ae5530b6
commit
c07a2f6dae
20 files changed
+995
-61
No files matched your search
@@ -52,6 +52,9 @@ router = APIRouter(prefix="/video", tags=["Video"])
|
||||
description="""
|
||||
Creatomate API를 통해 영상 생성을 요청합니다.
|
||||
|
||||
## 인증
|
||||
**Bearer 토큰 필수** - `Authorization: Bearer {access_token}` 헤더를 포함해야 합니다.
|
||||
|
||||
## 경로 파라미터
|
||||
- **task_id**: Project/Lyric/Song/Image의 task_id (필수) - 연관된 프로젝트, 가사, 노래, 이미지를 조회하는 데 사용
|
||||
|
||||
@@ -70,10 +73,15 @@ Creatomate API를 통해 영상 생성을 요청합니다.
|
||||
- **creatomate_render_id**: Creatomate 렌더 ID (상태 조회에 사용)
|
||||
- **message**: 응답 메시지
|
||||
|
||||
## 사용 예시
|
||||
```
|
||||
GET /video/generate/0694b716-dbff-7219-8000-d08cb5fce431
|
||||
GET /video/generate/0694b716-dbff-7219-8000-d08cb5fce431?orientation=horizontal
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
# 세로형 영상 생성 (기본값)
|
||||
curl -X GET "http://localhost:8000/api/v1/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" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
## 참고
|
||||
@@ -350,9 +358,9 @@ async def generate_video(
|
||||
)
|
||||
final_template["source"]["elements"].append(caption)
|
||||
|
||||
logger.debug(
|
||||
f"[generate_video] final_template: {json.dumps(final_template, indent=2, ensure_ascii=False)}"
|
||||
)
|
||||
# logger.debug(
|
||||
# f"[generate_video] final_template: {json.dumps(final_template, indent=2, ensure_ascii=False)}"
|
||||
# )
|
||||
|
||||
# 6-5. 커스텀 렌더링 요청 (비동기)
|
||||
render_response = await creatomate_service.make_creatomate_custom_call_async(
|
||||
@@ -457,6 +465,9 @@ async def generate_video(
|
||||
Creatomate API를 통해 영상 생성 작업의 상태를 조회합니다.
|
||||
succeeded 상태인 경우 백그라운드에서 MP4 파일을 다운로드하고 Video 테이블을 업데이트합니다.
|
||||
|
||||
## 인증
|
||||
**Bearer 토큰 필수** - `Authorization: Bearer {access_token}` 헤더를 포함해야 합니다.
|
||||
|
||||
## 경로 파라미터
|
||||
- **creatomate_render_id**: 영상 생성 시 반환된 Creatomate 렌더 ID (필수)
|
||||
|
||||
@@ -467,9 +478,10 @@ succeeded 상태인 경우 백그라운드에서 MP4 파일을 다운로드하
|
||||
- **render_data**: 렌더링 결과 데이터 (완료 시)
|
||||
- **raw_response**: Creatomate API 원본 응답
|
||||
|
||||
## 사용 예시
|
||||
```
|
||||
GET /video/status/render-id-123...
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X GET "http://localhost:8000/api/v1/video/status/{creatomate_render_id}" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
## 상태 값
|
||||
@@ -554,6 +566,7 @@ async def get_video_status(
|
||||
task_id=video.task_id,
|
||||
video_url=video_url,
|
||||
store_name=store_name,
|
||||
user_uuid=current_user.user_uuid,
|
||||
)
|
||||
elif video and video.status == "completed":
|
||||
logger.debug(
|
||||
@@ -602,6 +615,9 @@ async def get_video_status(
|
||||
task_id를 기반으로 Video 테이블의 상태를 polling하고,
|
||||
completed인 경우 Project 정보와 영상 URL을 반환합니다.
|
||||
|
||||
## 인증
|
||||
**Bearer 토큰 필수** - `Authorization: Bearer {access_token}` 헤더를 포함해야 합니다.
|
||||
|
||||
## 경로 파라미터
|
||||
- **task_id**: 프로젝트 task_id (필수)
|
||||
|
||||
@@ -615,9 +631,10 @@ completed인 경우 Project 정보와 영상 URL을 반환합니다.
|
||||
- **result_movie_url**: 영상 결과 URL (completed 시)
|
||||
- **created_at**: 생성 일시
|
||||
|
||||
## 사용 예시
|
||||
```
|
||||
GET /video/download/019123ab-cdef-7890-abcd-ef1234567890
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X GET "http://localhost:8000/api/v1/video/download/019123ab-cdef-7890-abcd-ef1234567890" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
## 참고
|
||||
@@ -718,6 +735,9 @@ async def download_video(
|
||||
description="""
|
||||
완료된 영상 목록을 페이지네이션하여 조회합니다.
|
||||
|
||||
## 인증
|
||||
**Bearer 토큰 필수** - `Authorization: Bearer {access_token}` 헤더를 포함해야 합니다.
|
||||
|
||||
## 쿼리 파라미터
|
||||
- **page**: 페이지 번호 (1부터 시작, 기본값: 1)
|
||||
- **page_size**: 페이지당 데이터 수 (기본값: 10, 최대: 100)
|
||||
@@ -731,9 +751,10 @@ async def download_video(
|
||||
- **has_next**: 다음 페이지 존재 여부
|
||||
- **has_prev**: 이전 페이지 존재 여부
|
||||
|
||||
## 사용 예시
|
||||
```
|
||||
GET /videos/?page=1&page_size=10
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X GET "http://localhost:8000/api/v1/videos/?page=1&page_size=10" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
## 참고
|
||||
|
||||
Reference in new issue
Block a user