"""
API v1 版本模块
整合所有 v1 版本的路由
"""

from fastapi import APIRouter

# 先只导入必要的路由
from .coze_gateway import router as coze_router

# 创建 v1 版本的主路由
api_router = APIRouter()

# 包含各个子路由
api_router.include_router(coze_router, tags=["coze"])

# TODO: 逐步添加其他路由
from .auth import router as auth_router
from .courses import router as courses_router
from .users import router as users_router
from .training import router as training_router
from .admin import router as admin_router
from .positions import router as positions_router
from .upload import router as upload_router
from .teams import router as teams_router
from .knowledge_analysis import router as knowledge_analysis_router
from .system import router as system_router
from .sql_executor import router as sql_executor_router

from .exam import router as exam_router
from .practice import router as practice_router
from .course_chat import router as course_chat_router
from .broadcast import router as broadcast_router
from .preview import router as preview_router
from .yanji import router as yanji_router
from .ability import router as ability_router
from .statistics import router as statistics_router
from .team_dashboard import router as team_dashboard_router
from .team_management import router as team_management_router
# Manager 模块路由
from .manager import student_scores_router, student_practice_router
from .system_logs import router as system_logs_router
from .tasks import router as tasks_router
from .endpoints.employee_sync import router as employee_sync_router
from .notifications import router as notifications_router
from .scrm import router as scrm_router
# 管理后台路由
from .admin_portal import router as admin_portal_router

api_router.include_router(auth_router, prefix="/auth", tags=["auth"])
# courses_router 已在内部定义了 prefix="/courses"，此处不再额外添加前缀
api_router.include_router(courses_router, tags=["courses"])
api_router.include_router(users_router, prefix="/users", tags=["users"])
# training_router 已在内部定义了 prefix="/training"，此处不再额外添加前缀
api_router.include_router(training_router, tags=["training"])
# admin_router 已在内部定义了 prefix="/admin"，此处不再额外添加前缀
api_router.include_router(admin_router, tags=["admin"])
api_router.include_router(positions_router, tags=["positions"])
# upload_router 已在内部定义了 prefix="/upload"，此处不再额外添加前缀
api_router.include_router(upload_router, tags=["upload"])
api_router.include_router(teams_router, tags=["teams"])
# knowledge_analysis_router 不需要额外前缀，路径已在路由中定义
api_router.include_router(knowledge_analysis_router, tags=["knowledge-analysis"])
# system_router 已在内部定义了 prefix="/system"，此处不再额外添加前缀
api_router.include_router(system_router, tags=["system"])
# sql_executor_router SQL 执行器
api_router.include_router(sql_executor_router, prefix="/sql", tags=["sql-executor"])
# exam_router 已在内部定义了 prefix="/exams"，此处不再额外添加前缀
api_router.include_router(exam_router, tags=["exams"])
# practice_router 陪练功能路由
api_router.include_router(practice_router, prefix="/practice", tags=["practice"])
# course_chat_router 与课程对话路由
api_router.include_router(course_chat_router, prefix="/course", tags=["course-chat"])
# broadcast_router 播课功能路由（不添加prefix，路径在router内部定义）
api_router.include_router(broadcast_router, tags=["broadcast"])
# preview_router 文件预览路由
api_router.include_router(preview_router, prefix="/preview", tags=["preview"])
# yanji_router 言迹智能工牌路由
api_router.include_router(yanji_router, prefix="/yanji", tags=["yanji"])
# ability_router 能力评估路由
api_router.include_router(ability_router, prefix="/ability", tags=["ability"])
# statistics_router 统计分析路由（不添加prefix，路径在router内部定义）
api_router.include_router(statistics_router, tags=["statistics"])
# team_dashboard_router 团队看板路由（不添加prefix，路径在router内部定义为/team/dashboard）
api_router.include_router(team_dashboard_router, tags=["team-dashboard"])
# team_management_router 团队成员管理路由（不添加prefix，路径在router内部定义为/team/management）
api_router.include_router(team_management_router, tags=["team-management"])
# student_scores_router 学员考试成绩管理路由（不添加prefix，路径在router内部定义为/manager/student-scores）
api_router.include_router(student_scores_router, tags=["manager-student-scores"])
# student_practice_router 学员陪练记录管理路由（不添加prefix，路径在router内部定义为/manager/student-practice）
api_router.include_router(student_practice_router, tags=["manager-student-practice"])
# system_logs_router 系统日志路由（不添加prefix，路径在router内部定义为/admin/logs）
api_router.include_router(system_logs_router, tags=["system-logs"])
# tasks_router 任务管理路由（不添加prefix，路径在router内部定义为/manager/tasks）
api_router.include_router(tasks_router, tags=["tasks"])
# employee_sync_router 员工同步路由
api_router.include_router(employee_sync_router, prefix="/employee-sync", tags=["employee-sync"])
# notifications_router 站内消息通知路由（不添加prefix，路径在router内部定义为/notifications）
api_router.include_router(notifications_router, tags=["notifications"])
# scrm_router SCRM系统对接路由（prefix在router内部定义为/scrm）
api_router.include_router(scrm_router, tags=["scrm"])
# admin_portal_router SaaS超级管理后台路由（prefix在router内部定义为/admin）
api_router.include_router(admin_portal_router, tags=["admin-portal"])

__all__ = ["api_router"]
