#!/usr/bin/env python3
"""
考培练系统后端启动脚本
"""
import os
import sys
import uvicorn
from app.core.config import get_settings

def main():
    """启动后端服务"""
    settings = get_settings()
    
    print("🚀 启动考培练系统后端服务...")
    print(f"📍 服务地址: http://{settings.HOST}:{settings.PORT}")
    print(f"📚 API文档: http://{settings.HOST}:{settings.PORT}/docs")
    print(f"🔧 调试模式: {'开启' if settings.DEBUG else '关闭'}")
    print("-" * 50)
    
    # 启动 uvicorn
    uvicorn.run(
        "app.main:app",
        host=settings.HOST,
        port=settings.PORT,
        reload=settings.DEBUG,
        log_level=settings.LOG_LEVEL.lower()
    )

if __name__ == "__main__":
    main()
