from pydantic_settings import BaseSettings, SettingsConfigDict from typing import Optional class Settings(BaseSettings): # 项目基础配置 PROJECT_NAME: str = "海关数据项目 MVP" VERSION: str = "0.1.0" # 数据库配置 (PostgreSQL) DATABASE_URL: str = "postgresql+asyncpg://postgres:postgres@localhost:5434/customs_data" # ClickHouse 配置 CLICKHOUSE_URL: str = "http://default:password@localhost:8123" # Elasticsearch 配置 ELASTICSEARCH_URL: str = "http://localhost:9200" # Redis 配置 REDIS_URL: str = "redis://localhost:6379/0" # 代理池配置 PROXY_POOL_URL: Optional[str] = None # S3 / 对象存储配置 (用于原始文件留存) S3_ENDPOINT: Optional[str] = None S3_ACCESS_KEY: Optional[str] = None S3_SECRET_KEY: Optional[str] = None S3_BUCKET_NAME: str = "customs-raw-data" model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore") settings = Settings()