from pydantic_settings import BaseSettings class Settings(BaseSettings): ENVIRONMENT: str LOG_LEVEL: str DB_HOST: str DB_PASSWORD: str ES_HOST: str FLUENTD_HOST: str RUSTFS_HOST:str RUSTFS_PORT: str class Config: env_file = ".env" # 指定.env文件路径 case_sensitive = False # 忽略变量名大小写 # 全局配置实例 settings = Settings()