feat: 축제·전시·콘서트·팝업 7일마다 수집, 피드 행사 종류 섞기

- 행사 수집을 화면 요청에서 빼고 worker 가 월 04:00(켤 때 7일 기록 없으면 한 번) 전국 17개 시도를 받는다
- 문화정보원 음악/콘서트(B000) 추가, 쪽·시도 사이 1초 간격으로 초당 요청 제한 회피
- 팝가(popga.co.kr) 팝업스토어 수집: 사이트맵 + 상세 JSON-LD, 바뀐 페이지만 다시 읽음
- 수집이 끝나면 Teams Workflows webhook 으로 종류별 건수 알림 (TEAMS_WEBHOOK_URL)
- event.kind(1=축제 2=전시 3=콘서트 4=팝업) 칸과 종류별 아이콘 추가
- 피드 행사 카드·띠를 축제→팝업→전시→콘서트 차례로 섞음
- 포스트 종류별 내용·피드 기획 문서 갱신

같은 작업 폴더의 다른 작업(외부 API 가드, 노을·달 계산, 각 API, 문서 파일 이름 정리 등)도 함께 담김.
This commit is contained in:
minaChoi committed 2026-10-07 12:03:48 +09:00
1 parent b61ed92c54
commit 997a366e76
70 files changed
+2083 -649

No files matched your search

+9 -1
View File
@@ -5,7 +5,7 @@ from fastapi import APIRouter, Depends, Path, Query
from common.enums import ErrorType, IndexCategory
from common.models.errors import error_info
from router.v1.index.protocol import Factor, IndexSummary, Res_IndexDetail, Res_IndexList, TrendPoint
from router.v1.index.protocol import Factor, IndexSummary, Res_IndexDetail, Res_IndexList, ScoreBand, TrendPoint
from services.calc.index_calc import AXES, axis_label, zero_rules_text
from services.index_service import IndexItem, IndexService, slot_label
@@ -53,4 +53,12 @@ async def get_index(index_id: int = Path(...), region: str = Query(..., descript
if getattr(d, f"weight_{a}")
],
zero_rules=zero_rules_text(d.zero_rules), zero_reason=s.zero_reason, limit=d.limit_description,
bands=_bands(d.sentences or {}, s.score),
)
def _bands(sentences: dict, score: int) -> list[ScoreBand]:
"""seed 의 sentences {"0": ..., "30": ..., "60": ..., "80": ...} 를 구간으로. 키는 구간 시작 점수."""
lows = sorted(int(k) for k in sentences)
highs = [lo - 1 for lo in lows[1:]] + [100]
return [ScoreBand(low=lo, high=hi, text=sentences[str(lo)], current=lo <= score <= hi) for lo, hi in zip(lows, highs)]
+8
View File
@@ -44,6 +44,13 @@ class Factor(WebPacketProtocol):
note: str
class ScoreBand(WebPacketProtocol):
low: int
high: int
text: str = Field(description="이 점수 구간이면 어떤 날인지, 통통 튀는 말투 한 문장")
current: bool = Field(description="오늘 점수가 이 구간에 있음")
class Res_IndexDetail(Res_WebPacketProtocol):
index: Optional[IndexSummary] = None
description: Optional[str] = None
@@ -51,3 +58,4 @@ class Res_IndexDetail(Res_WebPacketProtocol):
zero_rules: Optional[str] = None
zero_reason: Optional[str] = None
limit: Optional[str] = None
bands: list[ScoreBand] = Field(default=[], description="점수 구간별 설명 (0~29, 30~59, 60~79, 80~100)")