包含多个会话的累积代码变更: - backend: AI 聊天服务、触发器调度、认证增强、WebSocket、调度器最小间隔 - admin-web: ETL 状态页、任务管理、调度配置、登录优化 - miniprogram: 看板页面、聊天集成、UI 组件、导航更新 - etl: DWS 新任务(finance_area_daily/board_cache)、连接器增强 - tenant-admin: 项目初始化 - db: 19 个迁移脚本(etl_feiqiu 11 + zqyy_app 8) - packages/shared: 枚举和工具函数更新 - tools: 数据库工具、报表生成、健康检查 - docs: PRD/架构/部署/合约文档更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
||
"""
|
||
小程序助教路由 —— 助教详情(COACH-1)。
|
||
|
||
端点清单:
|
||
- GET /api/xcx/coaches/{coach_id} — 助教详情(COACH-1)
|
||
|
||
所有端点均需 JWT(approved 状态)。
|
||
"""
|
||
|
||
from __future__ import annotations
|
||
|
||
from fastapi import APIRouter, Depends
|
||
|
||
from app.auth.dependencies import CurrentUser
|
||
from app.middleware.permission import require_permission
|
||
from app.schemas.xcx_coaches import CoachDetailResponse
|
||
from app.services import coach_service
|
||
from app.trace.decorators import trace_service
|
||
|
||
router = APIRouter(prefix="/api/xcx/coaches", tags=["小程序助教"])
|
||
|
||
|
||
@router.get("/{coach_id}", response_model=CoachDetailResponse)
|
||
@trace_service("获取助教详情", "Get coach detail")
|
||
async def get_coach_detail(
|
||
coach_id: int,
|
||
# CHANGE 2026-03-27 | 权限改造 W4:助教详情跟助教看板走
|
||
user: CurrentUser = Depends(require_permission("view_board_coach")),
|
||
):
|
||
"""助教详情(COACH-1)。"""
|
||
return await coach_service.get_coach_detail(
|
||
coach_id, user.site_id
|
||
)
|