merge with my-archive
This commit is contained in:
1 parent
c07a2f6dae
commit
247a9f3322
11 files changed
+67
-37
No files matched your search
@@ -8,11 +8,11 @@ Lyric API Router
|
||||
- POST /lyric/generate: 가사 생성
|
||||
- GET /lyric/status/{task_id}: 가사 생성 상태 조회
|
||||
- GET /lyric/{task_id}: 가사 상세 조회
|
||||
- GET /lyrics: 가사 목록 조회 (페이지네이션)
|
||||
- GET /lyric/list: 가사 목록 조회 (페이지네이션)
|
||||
|
||||
사용 예시:
|
||||
from app.lyric.api.routers.v1.lyric import router
|
||||
app.include_router(router, prefix="/api/v1")
|
||||
app.include_router(router)
|
||||
|
||||
다른 서비스에서 재사용:
|
||||
# 이 파일의 헬퍼 함수들을 import하여 사용 가능
|
||||
@@ -197,7 +197,7 @@ async def get_lyric_by_task_id(
|
||||
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X POST "http://localhost:8000/api/v1/lyric/generate" \\
|
||||
curl -X POST "http://localhost:8000/lyric/generate" \\
|
||||
-H "Authorization: Bearer {access_token}" \\
|
||||
-H "Content-Type: application/json" \\
|
||||
-d '{
|
||||
@@ -223,6 +223,7 @@ curl -X POST "http://localhost:8000/api/v1/lyric/generate" \\
|
||||
response_model=GenerateLyricResponse,
|
||||
responses={
|
||||
200: {"description": "가사 생성 요청 접수 성공"},
|
||||
401: {"description": "인증 실패 (토큰 없음/만료)"},
|
||||
500: {"description": "서버 내부 오류"},
|
||||
},
|
||||
)
|
||||
@@ -392,13 +393,14 @@ task_id로 가사 생성 작업의 현재 상태를 조회합니다.
|
||||
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X GET "http://localhost:8000/api/v1/lyric/status/019123ab-cdef-7890-abcd-ef1234567890" \\
|
||||
curl -X GET "http://localhost:8000/lyric/status/019123ab-cdef-7890-abcd-ef1234567890" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
""",
|
||||
response_model=LyricStatusResponse,
|
||||
responses={
|
||||
200: {"description": "상태 조회 성공"},
|
||||
401: {"description": "인증 실패 (토큰 없음/만료)"},
|
||||
404: {"description": "해당 task_id를 찾을 수 없음"},
|
||||
},
|
||||
)
|
||||
@@ -412,7 +414,7 @@ async def get_lyric_status(
|
||||
|
||||
|
||||
@router.get(
|
||||
"s/",
|
||||
"/list",
|
||||
summary="가사 목록 조회 (페이지네이션)",
|
||||
description="""
|
||||
생성 완료된 가사를 페이지네이션으로 조회합니다.
|
||||
@@ -436,15 +438,15 @@ async def get_lyric_status(
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
# 기본 조회 (1페이지, 20개)
|
||||
curl -X GET "http://localhost:8000/api/v1/lyrics/" \\
|
||||
curl -X GET "http://localhost:8000/lyric/list" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
|
||||
# 2페이지 조회
|
||||
curl -X GET "http://localhost:8000/api/v1/lyrics/?page=2" \\
|
||||
curl -X GET "http://localhost:8000/lyric/list?page=2" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
|
||||
# 50개씩 조회
|
||||
curl -X GET "http://localhost:8000/api/v1/lyrics/?page=1&page_size=50" \\
|
||||
curl -X GET "http://localhost:8000/lyric/list?page=1&page_size=50" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
|
||||
@@ -455,6 +457,7 @@ curl -X GET "http://localhost:8000/api/v1/lyrics/?page=1&page_size=50" \\
|
||||
response_model=PaginatedResponse[LyricListItem],
|
||||
responses={
|
||||
200: {"description": "가사 목록 조회 성공"},
|
||||
401: {"description": "인증 실패 (토큰 없음/만료)"},
|
||||
},
|
||||
)
|
||||
async def list_lyrics(
|
||||
@@ -496,13 +499,14 @@ task_id로 생성된 가사의 상세 정보를 조회합니다.
|
||||
|
||||
## 사용 예시 (cURL)
|
||||
```bash
|
||||
curl -X GET "http://localhost:8000/api/v1/lyric/019123ab-cdef-7890-abcd-ef1234567890" \\
|
||||
curl -X GET "http://localhost:8000/lyric/019123ab-cdef-7890-abcd-ef1234567890" \\
|
||||
-H "Authorization: Bearer {access_token}"
|
||||
```
|
||||
""",
|
||||
response_model=LyricDetailResponse,
|
||||
responses={
|
||||
200: {"description": "가사 조회 성공"},
|
||||
401: {"description": "인증 실패 (토큰 없음/만료)"},
|
||||
404: {"description": "해당 task_id를 찾을 수 없음"},
|
||||
},
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user