Merge branch 'editor_next' into lsf

This commit is contained in:
2026-01-21 13:28:01 +08:00
6 changed files with 395 additions and 41 deletions

View File

@@ -9,6 +9,8 @@ Label Studio Editor(前端嵌入式)接口
from __future__ import annotations
from typing import Optional
from fastapi import APIRouter, Depends, Query, Path
from sqlalchemy.ext.asyncio import AsyncSession
@@ -67,10 +69,11 @@ async def list_editor_tasks(
async def get_editor_task(
project_id: str = Path(..., description="标注项目ID(t_dm_labeling_projects.id)"),
file_id: str = Path(..., description="文件ID(t_dm_dataset_files.id)"),
segment_index: Optional[int] = Query(None, alias="segmentIndex", description="段落索引(分段模式下使用)"),
db: AsyncSession = Depends(get_db),
):
service = AnnotationEditorService(db)
task = await service.get_task(project_id, file_id)
task = await service.get_task(project_id, file_id, segment_index=segment_index)
return StandardResponse(code=200, message="success", data=task)