backend 와 동일한 프레임워크로 lps/ 폴더를 신설한다. 구체적인 도메인 로직(크롤링/오픈API/최저가 산정)은 미정이라 골격만 구성한다. - FastAPI 부트스트랩(web_main/router) + lifespan·CORS·gzip·로그 미들웨어 + /healthz - TOML 설정 로더(APP_ENV) + pydantic config + DB env override - DB 세션 매니저(논리 DB × R/W, service→람다 위임) — 엔진 lazy 라 DB 없이도 부팅 - 공통 응답 규약(gmodel) + ErrorType/DBType/DBWRType - router→services→crud 계층 컨벤션(services/crud 는 빈 폴더로 자리만) - 포트 9400(backend 9300·agent 9500 회피), Dockerfile/run_local_server.sh/README - tests/test_health.py 스모크(healthz, DB 없이 통과) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 lines
634 B
Python
22 lines
634 B
Python
from datetime import datetime, timezone, timedelta
|
|
|
|
|
|
class GTime:
|
|
"""서버 전역에서 UTC 기준 시간을 사용하기 위한 유틸. (원본 DerbyServer 패턴 축약)"""
|
|
|
|
@staticmethod
|
|
def UTC() -> datetime:
|
|
return datetime.now(timezone.utc).replace(tzinfo=None)
|
|
|
|
@staticmethod
|
|
def UTCStr(fmt: str = "%Y-%m-%d %H:%M:%S") -> str:
|
|
return GTime.UTC().strftime(fmt)
|
|
|
|
@staticmethod
|
|
def AddMinutes(minutes: int) -> datetime:
|
|
return GTime.UTC() + timedelta(minutes=minutes)
|
|
|
|
@staticmethod
|
|
def AddDays(days: int) -> datetime:
|
|
return GTime.UTC() + timedelta(days=days)
|