Files
wecom-ai-assistant/backend/app/config.py
bujie9527 b715755b76
Some checks failed
Build and Deploy / test-backend (push) Has been cancelled
Build and Deploy / build-backend (push) Has been cancelled
Build and Deploy / build-admin (push) Has been cancelled
Deploy to Production / build-backend (push) Has been cancelled
Deploy to Production / deploy (push) Has been cancelled
feat: backend env config upgrade - multi-env (dev/prod), DB_* support, Docker compatible
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 12:07:02 +08:00

32 lines
943 B
Python

from pydantic_settings import BaseSettings, SettingsConfigDict
# 数据库 URL 由 config.settings 提供(环境变量优先,支持 DB_* 拼接,容器兼容)
from config.settings import DATABASE_URL, DATABASE_URL_SYNC
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
api_host: str = "0.0.0.0"
api_port: int = 8000
database_url: str = DATABASE_URL
database_url_sync: str = DATABASE_URL_SYNC
jwt_secret: str = "change-me"
jwt_algorithm: str = "HS256"
jwt_expire_minutes: int = 60
wecom_corp_id: str = ""
wecom_agent_id: str = ""
wecom_secret: str = ""
wecom_token: str = ""
wecom_encoding_aes_key: str = ""
wecom_api_base: str = "https://qyapi.weixin.qq.com"
wecom_api_timeout: int = 10
wecom_api_retries: int = 2
log_level: str = "INFO"
log_json: bool = True
settings = Settings()