feat(ssulbox): SNS 제목·설명·태그를 ssul_content에 저장

영상과 같이 업로드·SEO 결과를 행에 남기고, 다음 요청부터는 DB 값을 쓴다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
skkimandCursor committed 2026-08-19 15:31:44 +09:00
1 parent fde48e8674
commit e47a97476d
9 files changed
+108 -36

No files matched your search

+3
View File
@@ -244,6 +244,9 @@ async def get_content_detail(
content_id=row.id,
scenario=row.scenario,
video_url=row.video_url,
poster_url=row.poster_url,
title=row.title,
description=row.description,
store_name=row.store_name or None,
region=row.region,
created_at=row.created_at,
+26 -9
View File
@@ -31,6 +31,7 @@ from sqlalchemy import (
Text,
func,
)
from sqlalchemy.dialects.mysql import JSON
from sqlalchemy.orm import Mapped, mapped_column
from app.database.session import Base
@@ -164,9 +165,27 @@ class SsulContent(Base):
)
poster_url: Mapped[Optional[str]] = mapped_column(
String(500),
String(2048),
nullable=True,
comment="포스터 URL (없으면 프론트가 시나리오 표지로 대체)",
comment="포스터 URL (SNS 공유 og:image. 없으면 프론트가 시나리오 표지로 대체)",
)
title: Mapped[Optional[str]] = mapped_column(
String(100),
nullable=True,
comment="SNS 업로드 제목",
)
description: Mapped[Optional[str]] = mapped_column(
Text,
nullable=True,
comment="SNS 업로드 설명",
)
hashtags: Mapped[Optional[list]] = mapped_column(
JSON,
nullable=True,
comment="SNS 해시태그 목록",
)
# ==========================================================================
@@ -205,13 +224,11 @@ class SsulContent(Base):
comment="상세 지역 정보 (도로명 우선, 없으면 지번). 지역 필터 별칭 매칭용",
)
# title / caption / views / like_count / comment_count 는 두지 않는다.
# - castad `video` 도 제목을 갖지 않고 목록 표시는 store_name 으로 한다.
# SNS 업로드 제목·설명은 업로드 시점에 작성해 social_upload 에 담고,
# 다운로드 파일명은 프론트가 정한다.
# - 좋아요/댓글 수는 castad `video_reaction` / `comment` 상관 서브쿼리로 집계한다
# (2026-07-30 병합. 썰박스 행은 content_id 가 채워진다).
# 카운터를 들면 쓰기 경로마다 갱신해야 하고 드리프트가 생긴다.
# views / like_count / comment_count 는 두지 않는다.
# 좋아요/댓글 수는 castad `video_reaction` / `comment` 상관 서브쿼리로 집계한다
# (2026-07-30 병합. 썰박스 행은 content_id 가 채워진다).
# 카운터를 들면 쓰기 경로마다 갱신해야 하고 드리프트가 생긴다.
# SNS 제목·설명·태그는 video 와 같이 이 테이블에 저장한다.
is_deleted: Mapped[bool] = mapped_column(
Boolean,
+3
View File
@@ -114,6 +114,9 @@ class SsulDetailResponse(BaseModel):
content_id: int = Field(..., description="콘텐츠 고유 ID")
scenario: str = Field(..., description="시나리오 코드")
video_url: str = Field(..., description="완성 영상 URL")
poster_url: Optional[str] = Field(None, description="포스터 이미지 URL")
title: Optional[str] = Field(None, description="SNS 업로드 제목")
description: Optional[str] = Field(None, description="SNS 업로드 설명")
store_name: Optional[str] = Field(None, description="업장명")
region: Optional[str] = Field(None, description="지역명")
created_at: datetime = Field(..., description="생성 일시")