Merge commit '46171b4f24f2ddc3b9212b9ad6769925bcaceb03' into feature/site-features-and-mockup
# Conflicts: # .env.example # solution/backend/common/enums.py # solution/backend/requirements.txt # solution/backend/services/site_payload.py # solution/backend/services/snapshot.py # solution/backend/services/weather_notes.json # solution/shared/src/types/site-payload.ts # solution/site/src/layouts/editorial/Shell.tsx # solution/site/src/lib/use-live-weather.ts # solution/site/src/pages/HomePage.tsx # solution/site/src/sections/SiteFooter.tsx # solution/site/src/sections/WeatherSection.tsx # solution/site/src/sections/index.ts
This commit is contained in:
commit
b78486b845
74 files changed
+3266
-193
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_posts, place_reviews, place_songs, place_units,
|
||||
site_sections, sites,
|
||||
site_sections, sites, place_social_posts,
|
||||
)
|
||||
from common.enums import (
|
||||
PUBLISHABLE_FACT_STATUSES,
|
||||
@@ -121,6 +121,10 @@ async def build_snapshot(place) -> dict:
|
||||
).order_by(place_reviews.published_at.desc()).limit(200)
|
||||
)
|
||||
|
||||
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 = {
|
||||
@@ -193,6 +197,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 주소)은 싣지 않는다 — 만료되는 주소라 발행본에 나가면 안 된다.
|
||||
@@ -242,15 +250,17 @@ async def _local_contents(place) -> dict:
|
||||
|
||||
두 캐시를 합친다 —
|
||||
area_contents (region_code) 날씨 + 운영자가 수기로 발행한 항목
|
||||
place_area_refs (place_id) TourAPI 반경 수집분(맛집·관광지·축제·여행코스). 숨김·종료된 것 제외
|
||||
place_area_refs (place_id) TourAPI 반경 수집분(맛집·관광지·축제·여행코스). 숨김만 제외
|
||||
(축제는 종료 여부와 무관하게 노출, 2026-09-17 결정)
|
||||
|
||||
★ 노출 가능 = PUBLISHED + 노출 기간 안.
|
||||
area_contents.status 는 운영 관리자의 검수 결과다(REVIEW=1 · PUBLISHED=2 · ENDED=3).
|
||||
REVIEW 는 아직 사람이 확인하지 않은 외부 API 원문이고, ENDED 는 내린 것이다.
|
||||
둘 중 하나라도 사이트로 새면 '미검증 값 노출 금지'가 깨진다 — fact 를 VERIFIED/CORRECTED 로,
|
||||
사진을 APPROVED 로 거르는 것과 같은 규칙을 같은 이유로 적용한다.
|
||||
display_start_at/display_end_at 은 운영자가 정한 노출 창이다. 기간이 지난 축제를
|
||||
"이번 주말 행사"로 걸어두는 것도 틀린 정보라 여기서 함께 막는다.
|
||||
display_start_at/display_end_at 은 운영자가 수기로 정한 노출 창이다(운영자가 걸어 둔 항목에만
|
||||
쓰인다 — TourAPI 로 긁은 축제는 종료 여부와 무관하게 둘 다 NULL, 2026-09-17 결정:
|
||||
services/external/tour_api.py, local_content_service.py 참고).
|
||||
|
||||
★ expires_at 은 보지 않는다. 모델 주석대로 그건 '갱신 대상'이라는 표시지 '못 쓰는 값'이 아니다
|
||||
(외부 API 가 죽어도 직전 값을 유지하는 게 이 캐시의 규약이다). 게다가 날씨는 렌더러가
|
||||
|
||||
Reference in new issue
Block a user