# config.py
from pydantic_settings import BaseSettings
import os
from dotenv import load_dotenv


# 加载环境变量
load_dotenv()


class Settings(BaseSettings):
    DATABASE_URL: str = os.getenv("DATABASE_URL", "postgresql://postgres:password@localhost:5432/postgres")
    TITLE: str = os.getenv("TITLE", "Note")
    VERSION: str = os.getenv("VERSION", "1.0.0")

    DEBUG: bool = os.getenv("DEBUG", "false").lower()


# 创建全局配置实例
settings = Settings()
