from pydantic_settings import BaseSettings, SettingsConfigDict from typing import List class Settings(BaseSettings): """Application settings.""" model_config = SettingsConfigDict( env_file=".env", env_file_encoding="utf-8", extra="ignore", # 忽略额外的环境变量 ) # Database DATABASE_URL: str = "postgresql+asyncpg://user:password@localhost:5432/yuntu_kol" # CORS CORS_ORIGINS: List[str] = ["http://localhost:3000"] # Brand API BRAND_API_BASE_URL: str = "https://api.internal.intelligrow.cn" BRAND_API_TOKEN: str = "" # Bearer Token for Brand API authentication # Yuntu API (for SessionID pool) YUNTU_API_TOKEN: str = "" # Bearer Token for Yuntu Cookie API YUNTU_AADVID: str = "1648829117232140" # 广告主ID,用于巨量云图API调用 # API Settings MAX_QUERY_LIMIT: int = 1000 BRAND_API_TIMEOUT: float = 3.0 BRAND_API_CONCURRENCY: int = 10 YUNTU_API_TIMEOUT: float = 10.0 # 巨量云图API超时 settings = Settings()