Merge branch 'feature/social-post'
This commit is contained in:
commit
46171b4f24
55 files changed
+2872
-7
No files matched your search
@@ -24,7 +24,7 @@ from common.category_schema import get_schema
|
||||
from common.database.db_session_manager import DB_SESSION_MNG
|
||||
from common.database.model.models import (
|
||||
place_facts, place_faqs, area_contents, place_photos, place_area_refs, place_songs, place_units,
|
||||
site_sections, sites,
|
||||
site_sections, sites, place_social_posts,
|
||||
)
|
||||
from common.enums import (
|
||||
PUBLISHABLE_FACT_STATUSES,
|
||||
@@ -101,6 +101,10 @@ async def build_snapshot(place) -> dict:
|
||||
).order_by(place_songs.created_at.desc()).limit(1)
|
||||
)
|
||||
|
||||
social_rows = await _select(select(place_social_posts).where(
|
||||
place_social_posts.place_id == pid, place_social_posts.deleted == False, # noqa: E712
|
||||
place_social_posts.status == 'POSTED', place_social_posts.posted_at.is_not(None),
|
||||
).order_by(place_social_posts.posted_at.desc()).limit(3))
|
||||
local_rows = await _local_contents(place)
|
||||
|
||||
snapshot = {
|
||||
@@ -173,6 +177,10 @@ async def build_snapshot(place) -> dict:
|
||||
# ★ 원문(body)을 거의 그대로 싣는다. 렌더러 타입으로의 변환은 site_payload 가 한다 —
|
||||
# fact·사진과 같은 분업이다(여기는 '무엇이 나갈 수 있는가', 거기는 '어떤 모양으로 나가는가').
|
||||
"local": local_rows,
|
||||
# 승인 토큰·계정 자격증명·근거 원문은 공개 스냅샷으로 보내지 않는다.
|
||||
"social_posts": [{"post_id": str(r.post_id), "provider": r.provider, "body": r.body,
|
||||
"permalink": r.permalink, "posted_at": r.posted_at.isoformat()}
|
||||
for r in social_rows],
|
||||
# ★ 이 숙소의 노래. 파일은 DB 가 아니라 `solution/site/songs/<file_name>` 에 있고,
|
||||
# 프리렌더가 그걸 사이트 디렉토리로 복사한다(services/song_service 머리주석).
|
||||
# ★ origin_url(Suno 주소)은 싣지 않는다 — 만료되는 주소라 발행본에 나가면 안 된다.
|
||||
|
||||
Reference in new issue
Block a user