全栈: 接收任务写入remark — 后端receive接口+Body参数+前端接收弹窗备注输入

This commit is contained in:
2026-08-05 16:16:35 +08:00
parent 353633f061
commit 62422e7558
3 changed files with 15 additions and 7 deletions

View File

@ -1,7 +1,7 @@
"""任务 API 端点 — 核心业务:接收、驳回返工、裂变转交、无限嵌套子任务"""
from __future__ import annotations
import uuid
from fastapi import APIRouter, Depends, Query
from fastapi import APIRouter, Depends, Query, Body
from sqlalchemy.ext.asyncio import AsyncSession
from app.core.database import get_db
@ -110,16 +110,17 @@ async def complete_task_endpoint(
async def receive_task_endpoint(
task_id: str,
operator_id: str | None = Query(None, description="操作人ID"),
remark: str | None = Body(None, description="接收备注", embed=True),
db: AsyncSession = Depends(get_db),
):
"""
**确认接收任务。**
校验:只有状态为 PENDING 的任务可接收。
动作:将状态改为 WIP记录 received_at 为当前时间。
动作:将状态改为 WIP记录 received_at 为当前时间,写入 remark
"""
return await task_service.receive_task(
db, uuid.UUID(task_id), operator_id
db, uuid.UUID(task_id), operator_id, remark
)