From 31aa3fbb86afd838160cb3f93ab3d292d2ad1d89 Mon Sep 17 00:00:00 2001 From: XiaoXia Bot Date: Thu, 16 Jul 2026 15:35:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=A4=8Ddevelop=E5=88=86?= =?UTF-8?q?=E6=94=AF=E9=81=97=E7=95=99=E7=9A=84isort=20import=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复edit_plans_clips.py和edit_plans_clips_batch.py的import排序, 确保全量isort扫描通过。 --- apps/api/app/api/routes/edit_plans_clips.py | 7 +++++-- apps/api/app/api/routes/edit_plans_clips_batch.py | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/api/app/api/routes/edit_plans_clips.py b/apps/api/app/api/routes/edit_plans_clips.py index 544ec6d46..81342a132 100755 --- a/apps/api/app/api/routes/edit_plans_clips.py +++ b/apps/api/app/api/routes/edit_plans_clips.py @@ -52,7 +52,9 @@ class EditPlanClipListResponse(BaseModel): class EditPlanClipCreateRequest(BaseModel): """创建剪辑片段请求体""" - clip_type: str = Field(..., min_length=1, max_length=50, description="片段类型: main/intro/outro/overlay/background/b_roll 等") + clip_type: str = Field( + ..., min_length=1, max_length=50, description="片段类型: main/intro/outro/overlay/background/b_roll 等" + ) order: int = Field(..., ge=0, description="排序序号") asset_id: str = Field(default="", max_length=64, description="关联素材 ID") text_content: str = Field(default="", max_length=5000, description="文本内容(字幕/配音等)") @@ -86,9 +88,10 @@ def _check_plan_access(plan_id: str, user_id: str, project_repository: Any, db: """验证用户是否有权限访问该剪辑计划(通过项目关联)。 返回 plan 对象供后续使用,避免重复查询。 """ - from ._helpers import check_project_access from app.services.edit_plan_service import EditPlanService + from ._helpers import check_project_access + svc = EditPlanService(db) plan = svc.get_plan(plan_id) if plan is None: diff --git a/apps/api/app/api/routes/edit_plans_clips_batch.py b/apps/api/app/api/routes/edit_plans_clips_batch.py index 29af9cf20..bb4a1fb7b 100755 --- a/apps/api/app/api/routes/edit_plans_clips_batch.py +++ b/apps/api/app/api/routes/edit_plans_clips_batch.py @@ -75,9 +75,10 @@ class ClipsFromAssetsResponse(BaseModel): def _check_plan_access(plan_id: str, user_id: str, project_repository: Any, db: Session) -> Any: """验证用户是否有权限访问该剪辑计划,返回 plan 对象。""" - from ._helpers import check_project_access from app.services.edit_plan_service import EditPlanService + from ._helpers import check_project_access + svc = EditPlanService(db) plan = svc.get_plan(plan_id) if plan is None: