- FastAPI + PostgreSQL + Redis, web·worker 분리, compose 에 backend·worker·postgres·redis 추가 - 기상청 단기·초단기·중기·특보, 에어코리아, Open-Meteo, TourAPI, 특일정보 연동 (첫 조회 때 받고 캐시) - 매일 03:00 worker 가 전국 공통 피드 칸을 정하고 지난 데이터를 정리 - 시드: 시군구 256곳, 지수 23개, 노을 대표 지점·명소, 데이트 명소, 읽을거리 - pytest 66개 (테스트 전용 DB·Redis 사용) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
780 B
Python
28 lines
780 B
Python
import argparse
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
DEFAULT_OUT = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "openapi.json")
|
|
|
|
|
|
def main() -> None:
|
|
"""서버를 띄우지 않고 OpenAPI 스펙을 파일로 뽑는다 (프론트 orval 입력)."""
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("-o", "--out", default=DEFAULT_OUT)
|
|
args = parser.parse_args()
|
|
|
|
import router.router
|
|
|
|
spec = router.router.app.openapi()
|
|
with open(args.out, "w", encoding="utf-8") as f:
|
|
json.dump(spec, f, ensure_ascii=False, indent=2)
|
|
f.write("\n")
|
|
print(f"{args.out} ({len(spec['paths'])} paths)")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|