from pydantic_settings import BaseSettings from functools import lru_cache class Settings(BaseSettings): PROJECT_NAME: str = "债务管理系统" API_V1_PREFIX: str = "/api/v1" DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@db:5432/debt_manager" REDIS_URL: str = "redis://redis:6379/0" SECRET_KEY: str = "562fa55e5e0cea1e00ff645be1da4f7c932439d97de7ffacd3d95156d9ccd7af" ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 REFRESH_TOKEN_EXPIRE_DAYS: int = 7 CORS_ORIGINS: list[str] = ["http://localhost", "http://localhost:80", "http://localhost:806"] ADMIN_EMAIL: str = "admin@example.com" ADMIN_PASSWORD: str = "Adm1n!2026#Str0ng" SMTP_HOST: str = "" SMTP_PORT: int = 465 SMTP_USER: str = "" SMTP_PASSWORD: str = "" SMTP_FROM: str = "" SMTP_USE_TLS: bool = True NOTIFICATION_CHECK_INTERVAL_MINUTES: int = 60 REMINDER_DAYS_BEFORE: int = 7 class Config: env_file = ".env" @lru_cache() def get_settings(): return Settings()