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

+5
View File
@@ -6,10 +6,12 @@ from sqlalchemy import text
from common.database.db_session_manager import DB_SESSION_MNG
from common.enums import PostType
from common.utils.kma_time import now_kst
from crud.feed_crud import FeedCRUD
from crud.season_crud import SeasonCRUD
from router.router import app
from services.feed_service import build_feed_day
from services.week_service import collect_events
REGION = "1114000000"
@@ -51,6 +53,7 @@ def test_weekends_groups_this_and_next_weekend():
@pytest.mark.anyio
async def test_feed_assembles_hero_stories_posts_and_bands(offline):
await collect_events("11", now_kst().date())
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
body = (await client.get("/v1/feed", params={"region": REGION})).json()
assert body["result"]["success"] is True
@@ -160,6 +163,7 @@ async def test_build_day_makes_every_card_at_three():
@pytest.mark.anyio
async def test_feed_has_quote_and_no_adjacent_same_type(offline):
await collect_events("11", now_kst().date())
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
body = (await client.get("/v1/feed", params={"region": REGION})).json()
articles = (await client.get("/v1/season/article/list")).json()
@@ -324,6 +328,7 @@ async def test_feed_has_day_trip_card_with_city_event(offline, monkeypatch):
"firstimage": "http://tong.visitkorea.or.kr/c.jpg"}] if sido == "51" else []
monkeypatch.setattr(week_service, "fetch_festivals", festivals)
await week_service.collect_events("51", today)
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
body = (await client.get("/v1/feed", params={"region": "4113500000"})).json()
trip = next(p for p in body["posts"] if p["post_type"] == PostType.DAY_TRIP.value)