Merge branch 'feature/social-post'

This commit is contained in:
skkim committed 2026-09-18 09:00:07 +09:00
commit 46171b4f24
55 files changed
+2872 -7

No files matched your search

+10 -2
View File
@@ -162,6 +162,7 @@ _DEFAULT_THEME = {
("festival", "계절별 축제", False), ("local", "지역 정보", False),
("itinerary", "추천 일정", False), ("story", "지역 이야기", False),
("faq", "자주 묻는 질문", False), ("weather", "날씨", False),
("social", "SNS 게시글", False),
],
},
PlaceCategory.CAFE.value: {
@@ -174,6 +175,7 @@ _DEFAULT_THEME = {
("info", "기본 정보", True), ("space", "공간 · 좌석 안내", False), ("photos", "사진 갤러리", False),
("inquiry", "대관 및 단체 문의", False), ("map", "오시는 길", True), ("weather", "날씨", False),
("local", "주변 나들이", False), ("faq", "자주 묻는 질문", False),
("social", "SNS 게시글", False),
],
},
PlaceCategory.RESTAURANT.value: {
@@ -186,6 +188,7 @@ _DEFAULT_THEME = {
("info", "기본 정보", True), ("booking", "예약 · 포장 안내", False), ("photos", "사진 갤러리", False),
("inquiry", "단체 행사 문의", False), ("map", "오시는 길", True), ("weather", "날씨", False),
("local", "주변 안내", False), ("faq", "자주 묻는 질문", False),
("social", "SNS 게시글", False),
],
},
PlaceCategory.CLINIC.value: {
@@ -198,6 +201,7 @@ _DEFAULT_THEME = {
("info", "기본 정보", True), ("exhibition", "진료 안내", False), ("photos", "사진 갤러리", False),
("inquiry", "상담 문의", False), ("map", "오시는 길", True), ("weather", "날씨", False),
("local", "주변 정보", False), ("faq", "자주 묻는 질문", False),
("social", "SNS 게시글", False),
],
},
}
@@ -443,7 +447,7 @@ def _sections(saved_sections, default_spec) -> list:
# 저장값이 없으면(아직 아무것도 고르지 않았다) 업종 기본을 전부 켜서 내보낸다.
if not isinstance(saved_sections, list) or not saved_sections:
return [
{"id": sid, "name": label, "enabled": True, "locked": locked}
{"id": sid, "name": label, "enabled": sid != "social", "locked": locked}
for sid, label, locked in default_spec
]
@@ -493,7 +497,7 @@ def _sections(saved_sections, default_spec) -> list:
if sid in used:
continue
# ★ 켜서 붙인다. 저장값에 없는 건 사장님이 뺀 게 아니라 저장 당시 없던 섹션이다(위 주석).
out.append({"id": sid, "name": label, "enabled": True, "locked": bool(locked)})
out.append({"id": sid, "name": label, "enabled": sid != "social", "locked": bool(locked)})
return out
@@ -742,6 +746,7 @@ def _publish_target(site, place_id: str, name: str) -> dict:
★ sites.domain 이 있으면 그게 사장님이 고른 주소다. 없으면 **임시값**이다 —
상호명은 유일하지 않으므로 place_id 앞자리를 붙여 사이트끼리 겹치지 않게 한다.
이 임시값이 SNS 같은 외부로 새면 되돌릴 수 없다 — SNS는 domain 확정을 요구한다.
★ **언제나 경로형**(`https://<host>/s/<slug>`)이다. 서브도메인을 쓰지 않는 이유는
사이트가 하나 늘 때마다 DNS 레코드와 TLS 인증서를 새로 만들어야 해서다 —
@@ -1007,6 +1012,9 @@ def to_site_payload(place, snapshot: dict, site, version, links, publish: bool =
for row in (snapshot.get("songs") or [])
if (row.get("file_name") or "").strip()
],
"socialPosts": [{"postId": r["post_id"], "provider": r["provider"], "body": r["body"],
"postedAt": r["posted_at"], "permalink": r.get("permalink")}
for r in snapshot.get("social_posts", [])],
"narrative": narrative,
"theme": theme,
# ★ 검색 키워드(SiteOntology). 스냅샷에 있을 때만 싣는다 — 옛 스냅샷·SiteOntology 가 꺼진 빌드에는 없고,