o2o-castad-backend/app/social/schemas/seo_schema.py

45 lines
1.4 KiB
Python

"""
소셜 SEO 관련 Pydantic 스키마
"""
from typing import Literal
from pydantic import BaseModel, ConfigDict, Field
class YoutubeDescriptionRequest(BaseModel):
"""유튜브 SEO Description 제안 요청"""
# 썰박스 콘텐츠의 SEO 를 요청할 때는 "ssul" + task_id 자리에 ssul_content.id.
# 종류를 안 밝히면 video 로 간주된다 (기존 호출 호환).
content_type: Literal["video", "ssul"] = Field(
default="video", description="콘텐츠 종류"
)
task_id: str = Field(..., description="작업 고유 식별자 (ssul 이면 ssul_content.id)")
model_config = ConfigDict(
json_schema_extra={
"example": {
"task_id": "019c739f-65fc-7d15-8c88-b31be00e588e"
}
}
)
class YoutubeDescriptionResponse(BaseModel):
"""유튜브 SEO Description 제안 응답"""
title: str = Field(..., description="유튜브 영상 제목 - SEO/AEO 최적화")
description: str = Field(..., description="제안된 유튜브 SEO Description")
keywords: list[str] = Field(..., description="해시태그 리스트")
model_config = ConfigDict(
json_schema_extra={
"example": {
"title": "여기에 더미 타이틀",
"description": "여기에 더미 텍스트",
"keywords": ["여기에", "더미", "해시태그"]
}
}
)