From 35845a86af76d2bce7e1a407417b5113265eb0e2 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Fri, 25 Sep 2026 01:02:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(api):=20=E4=B8=BA=20clips/drafts/health=20?= =?UTF-8?q?=E5=8A=A0=E6=97=A7=E8=B7=AF=E5=BE=84=E5=88=AB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - clips_standalone 额外挂到 /api/v1/editor/clips/from-assets,兼容前端 Step2 智能选片 - drafts_standalone 挂到 /api/v1/editor/drafts(GET/PUT),兼容 auto-save 10s 超时 - health_check_router 额外挂 /api/health,兼容把 health 放在 /api 前缀下的探针 --- apps/api/app/api/router.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/api/app/api/router.py b/apps/api/app/api/router.py index 0a9d7e857..c2037b8f2 100755 --- a/apps/api/app/api/router.py +++ b/apps/api/app/api/router.py @@ -8,6 +8,7 @@ from app.api.routes.chunked_upload import router as chunked_upload_router from app.api.routes.classification_jobs import router as classification_jobs_router from app.api.routes.clips_standalone import router as clips_standalone_router from app.api.routes.cover_templates import router as cover_templates_router +from app.api.routes.drafts_standalone import router as drafts_standalone_router from app.api.routes.duplication import router as duplication_router from app.api.routes.feature_flags import router as feature_flags_router from app.api.routes.generation_cover import router as generation_cover_router @@ -19,7 +20,7 @@ from app.api.routes.health import router as health_check_router from app.api.routes.ingest_jobs import router as ingest_jobs_router from app.api.routes.internal_render import router as internal_render_router from app.api.routes.lipsync import router as lipsync_router -from app.api.routes.points import points_router, usage_router +from app.api.routes.points import router as points_router, usage_router from app.api.routes.projects import router as projects_router from app.api.routes.scripts import router as scripts_router from app.api.routes.scripts_ai import router as scripts_ai_router @@ -41,6 +42,19 @@ api_router = APIRouter(prefix="/api/v1") health_router = APIRouter() health_router.include_router(health_check_router) +# ── /api/health 别名:部分前端/探针把 health 放在 /api 前缀下 ────────────── +# 原来 /health 在根路径;额外加一个 /api/health 别名避免 404。 +api_health_router = APIRouter(prefix="/api") +api_health_router.include_router(health_check_router) +health_router.include_router(api_health_router) + +# ── 旧前端路径别名(无需 template_id 路径参数)──────────────────────────── +# /api/v1/clips/from-assets 已有 clips_standalone;此处额外挂 /api/v1/editor/*, +# 解决前端调 /api/v1/editor/clips/from-assets 和 /api/v1/editor/drafts 的 404。 +editor_legacy_router = APIRouter(prefix="/editor", tags=["Editor Legacy Alias"]) +editor_legacy_router.include_router(clips_standalone_router) +editor_legacy_router.include_router(drafts_standalone_router) + api_router.include_router( auth_router, tags=["Auth"], @@ -169,6 +183,9 @@ api_router.include_router( prefix="/templates/{template_id}/editor", tags=["TemplateEditor"], ) +api_router.include_router( + editor_legacy_router, +) api_router.include_router( tts_router, prefix="/tts",