auto-sync: 2026-05-18 23:26:12
This commit is contained in:
@@ -66,8 +66,13 @@ async def get_task(project_id: str, task_id: str,
|
||||
@router.post("/tasks")
|
||||
async def create_task(project_id: str, body: Dict[str, Any]):
|
||||
bb = _bb(project_id)
|
||||
# v2.8: title 为空时自动生成
|
||||
title = body.get("title", "")
|
||||
if not title or not title.strip():
|
||||
desc = body.get("description", "") or ""
|
||||
title = (desc[:30] + "…") if len(desc) > 30 else (desc or "新军令")
|
||||
task = Task(
|
||||
id=body["id"], title=body["title"],
|
||||
id=body["id"], title=title,
|
||||
description=body.get("description"),
|
||||
task_type=body.get("task_type", "coding"),
|
||||
priority=body.get("priority", 5),
|
||||
@@ -80,7 +85,7 @@ async def create_task(project_id: str, body: Dict[str, Any]):
|
||||
stages_json=body.get("stages_json", "[]"),
|
||||
)
|
||||
bb.create_task(task)
|
||||
return {"ok": True, "task_id": task.id}
|
||||
return {"ok": True, "task_id": task.id, "title": task.title}
|
||||
|
||||
|
||||
@router.get("/tasks/{task_id}/progress")
|
||||
|
||||
Reference in New Issue
Block a user