feat: 지역 검색 페이지에 오늘 날씨·각을 서버가 채워 준다 (nginx → /v1/seo/today, 실패하면 정적 HTML)

This commit is contained in:
minaChoi committed 2026-10-14 09:32:23 +09:00
1 parent 2ca060b626
commit a68268234d
8 files changed
+183 -1

No files matched your search

+2
View File
@@ -14,6 +14,7 @@ from router.v1.index.index import router as index_router
from router.v1.reaction.reaction import router as reaction_router
from router.v1.region.region import router as region_router
from router.v1.season.season import router as season_router
from router.v1.seo.seo import router as seo_router
from router.v1.sky.sky import router as sky_router
from router.v1.watch.watch import router as watch_router
from router.v1.weather.weather import router as weather_router
@@ -43,6 +44,7 @@ app.include_router(auth_router)
app.include_router(reaction_router)
app.include_router(watch_router)
app.include_router(image_router)
app.include_router(seo_router)
class Res_Health(Res_WebPacketProtocol):
View File
Whitespace-only changes.
+17
View File
@@ -0,0 +1,17 @@
from fastapi import APIRouter, Depends, Path
from fastapi.responses import HTMLResponse
from common.enums import ErrorType
from services.seo_service import SeoService
router = APIRouter(prefix="/v1/seo", tags=["seo"])
_SLUG = r"^[a-z]+$"
@router.get("/today/{sido}/{place}", response_class=HTMLResponse, summary="지역 검색 페이지: 정적 HTML 에 오늘 날씨·각을 채워 돌려준다 (nginx 가 /today/... 를 넘김)")
async def get_today_page(sido: str = Path(..., pattern=_SLUG), place: str = Path(..., pattern=_SLUG), service: SeoService = Depends()) -> HTMLResponse:
err, html = await service.page(f"today/{sido}/{place}")
if err is not ErrorType.SUCCESS:
return HTMLResponse("not found", status_code=404)
return HTMLResponse(html, headers={"Cache-Control": "no-cache"})