51feae55ba
- 后端:FastAPI + SQLAlchemy + Alembic,7 张核心表迁移成功 - 前端:Next.js 16 + TailwindCSS 4 + 三端布局(投资人/创始人/Admin) - 数据库:PostgreSQL 16,7 张核心实体表(tenants/users/companies/monthly_reports/health_scores/risk_events/audit_logs) - Docker:docker-compose.yml + 前后端 Dockerfile - 测试:健康检查 4 个测试全部 GREEN - 文档:README/run.md/AGENTS.md/docs 体系完整
37 lines
861 B
Python
37 lines
861 B
Python
"""应用配置。
|
|
|
|
从环境变量读取配置,支持 .env 文件。
|
|
"""
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""应用配置,从环境变量读取。"""
|
|
|
|
# 应用
|
|
app_env: str = "development"
|
|
app_debug: bool = True
|
|
app_log_level: str = "info"
|
|
|
|
# 数据库
|
|
database_url: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/aiportpilot"
|
|
|
|
# Redis
|
|
redis_url: str = "redis://localhost:6379/0"
|
|
|
|
# JWT
|
|
jwt_secret_key: str = "change-me-in-production"
|
|
jwt_algorithm: str = "HS256"
|
|
jwt_access_token_ttl_minutes: int = 120
|
|
jwt_refresh_token_ttl_days: int = 7
|
|
|
|
# AI / Ollama
|
|
ollama_base_url: str = "http://localhost:11434"
|
|
ollama_model: str = "qwen2.5:7b"
|
|
|
|
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
|
|
|
|
|
|
settings = Settings()
|