from pydantic_settings import BaseSettings from typing import Optional class Settings(BaseSettings): # App APP_NAME: str = "企迹-政企周报管理系统" DEBUG: bool = True SECRET_KEY: str = "change-me-in-production" # Database DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/qiji" # JWT JWT_ALGORITHM: str = "HS256" JWT_EXPIRE_MINUTES: int = 480 # Casdoor CASDOOR_ENDPOINT: str = "http://localhost:8001" CASDOOR_CLIENT_ID: str = "" CASDOOR_CLIENT_SECRET: str = "" CASDOOR_CERTIFICATE: Optional[str] = None CASDOOR_ORG_NAME: str = "qiji" CASDOOR_APPLICATION: str = "qiji-weekly-report" # MinIO MINIO_ENDPOINT: str = "localhost:9000" MINIO_ACCESS_KEY: str = "minioadmin" MINIO_SECRET_KEY: str = "minioadmin" MINIO_BUCKET: str = "qiji-photos" MINIO_SECURE: bool = False # WeChat Work WECOM_CORP_ID: str = "" WECOM_AGENT_ID: str = "" WECOM_SECRET: str = "" WECOM_TOKEN: str = "" WECOM_ENCODING_AES_KEY: str = "" # AI / LLM (OpenAI-compatible) AI_API_URL: str = "" AI_API_KEY: str = "" AI_MODEL: str = "gpt-4o" AI_MAX_TOKENS: int = 2000 # CORS CORS_ORIGINS: list[str] = ["http://localhost:5173", "http://localhost:3000"] class Config: env_file = ".env" env_file_encoding = "utf-8" settings = Settings()