from pydantic_settings import BaseSettings, SettingsConfigDict

class Settings(BaseSettings):
    ENV: str = "development"
    PROJECT_NAME: str = "DesignerCEP Backend"
    API_V1_STR: str = "/api/v1"
    DATABASE_URL: str = "sqlite:///./designercep.db"
    SECRET_KEY: str = ""  # 必须从 .env 读取
    ACCESS_TOKEN_EXPIRE_MINUTES: int = 10080
    
    ALLOWED_ORIGINS: str = "*"
    ADMIN_TOKEN: str = ""  # 必须从 .env 读取

    # Email Configuration
    SMTP_HOST: str = "smtp.gmail.com"
    SMTP_PORT: int = 587
    SMTP_USER: str = ""
    SMTP_PASSWORD: str = ""  # 必须从 .env 读取
    EMAILS_FROM_EMAIL: str = ""
    EMAILS_FROM_NAME: str = "Designer"
    
    # 七牛云对象存储
    QINIU_ACCESS_KEY: str = ""
    QINIU_SECRET_KEY: str = ""
    QINIU_BUCKET: str = ""
    QINIU_DOMAIN: str = ""
    
    # AI 配置 — 通义千问 Qwen（DashScope）
    AI_API_KEY: str = ""          # LLM API Key（OpenAI / DeepSeek 等）
    AI_BASE_URL: str = ""         # LLM API 地址（留空则用 OpenAI 默认）
    AI_MODEL: str = "qwen3-max-2026-01-23"  # 默认模型（通义千问3深度思考）
    AI_VISION_MODEL: str = "qwen-vl-max-latest"  # 视觉分析模型（看图分析成衣）
    AI_IMAGE_EDIT_MODEL: str = "qwen-image-edit-max-2026-01-16"  # 图片编辑/生成模型

    # AI 配置 — Gemini（第三方代理）
    GEMINI_API_KEY: str = ""
    GEMINI_BASE_URL: str = "https://api.apiqik.online"
    
    model_config = SettingsConfigDict(env_file=".env", extra="ignore")

settings = Settings()
