uuid7으로 필드 및 처리관련 수정
This commit is contained in:
1 parent
aa8d9d7c14
commit
32ae5530b6
26 files changed
+2346
-901
No files matched your search
@@ -31,6 +31,8 @@ from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.database.session import get_session
|
||||
from app.home.models import Project
|
||||
from app.user.dependencies.auth import get_current_user
|
||||
from app.user.models import User
|
||||
from app.lyric.models import Lyric
|
||||
from app.lyric.schemas.lyric import (
|
||||
GenerateLyricRequest,
|
||||
@@ -222,6 +224,7 @@ POST /lyric/generate
|
||||
async def generate_lyric(
|
||||
request_body: GenerateLyricRequest,
|
||||
background_tasks: BackgroundTasks,
|
||||
current_user: User = Depends(get_current_user),
|
||||
session: AsyncSession = Depends(get_session),
|
||||
) -> GenerateLyricResponse:
|
||||
"""고객 정보를 기반으로 가사를 생성합니다. (백그라운드 처리)"""
|
||||
@@ -391,6 +394,7 @@ GET /lyric/status/019123ab-cdef-7890-abcd-ef1234567890
|
||||
)
|
||||
async def get_lyric_status(
|
||||
task_id: str,
|
||||
current_user: User = Depends(get_current_user),
|
||||
session: AsyncSession = Depends(get_session),
|
||||
) -> LyricStatusResponse:
|
||||
"""task_id로 가사 생성 작업 상태를 조회합니다."""
|
||||
@@ -435,6 +439,7 @@ GET /lyrics/?page=1&page_size=50 # 50개씩 조회
|
||||
async def list_lyrics(
|
||||
page: int = Query(1, ge=1, description="페이지 번호 (1부터 시작)"),
|
||||
page_size: int = Query(20, ge=1, le=100, description="페이지당 데이터 수"),
|
||||
current_user: User = Depends(get_current_user),
|
||||
session: AsyncSession = Depends(get_session),
|
||||
) -> PaginatedResponse[LyricListItem]:
|
||||
"""페이지네이션으로 완료된 가사 목록을 조회합니다."""
|
||||
@@ -478,6 +483,7 @@ GET /lyric/019123ab-cdef-7890-abcd-ef1234567890
|
||||
)
|
||||
async def get_lyric_detail(
|
||||
task_id: str,
|
||||
current_user: User = Depends(get_current_user),
|
||||
session: AsyncSession = Depends(get_session),
|
||||
) -> LyricDetailResponse:
|
||||
"""task_id로 생성된 가사를 조회합니다."""
|
||||
|
||||
+3
-3
@@ -23,7 +23,7 @@ class Lyric(Base):
|
||||
Attributes:
|
||||
id: 고유 식별자 (자동 증가)
|
||||
project_id: 연결된 Project의 id (외래키)
|
||||
task_id: 가사 생성 작업의 고유 식별자 (KSUID 형식)
|
||||
task_id: 가사 생성 작업의 고유 식별자 (UUID7 형식)
|
||||
status: 처리 상태 (pending, processing, completed, failed 등)
|
||||
lyric_prompt: 가사 생성에 사용된 프롬프트
|
||||
lyric_result: 생성된 가사 결과 (LONGTEXT로 긴 가사 지원)
|
||||
@@ -62,10 +62,10 @@ class Lyric(Base):
|
||||
)
|
||||
|
||||
task_id: Mapped[str] = mapped_column(
|
||||
String(27),
|
||||
String(36),
|
||||
nullable=False,
|
||||
unique=True,
|
||||
comment="가사 생성 작업 고유 식별자 (KSUID)",
|
||||
comment="가사 생성 작업 고유 식별자 (UUID7)",
|
||||
)
|
||||
|
||||
status: Mapped[str] = mapped_column(
|
||||
|
||||
Reference in new issue
Block a user