fix: blackboard_routes mention_queue linkage (missed by auto-sync)

This commit is contained in:
cfdaily
2026-05-29 08:38:03 +08:00
parent 3920aa4fe1
commit e3f0965b2a
+16 -1
View File
@@ -261,9 +261,24 @@ async def get_comments(project_id: str, task_id: str,
@router.post("/tasks/{task_id}/comments")
async def add_comment(project_id: str, task_id: str, body: Dict[str, Any]):
bb = _bb(project_id)
mentions_raw = body.get("mentions")
cid = bb.add_comment(task_id, body["author"], body["body"],
comment_type=body.get("comment_type", "general"),
mentions=body.get("mentions"))
mentions=mentions_raw)
# v2.9 #01: 写入 mention_queue
if mentions_raw:
if isinstance(mentions_raw, str):
import json as _json
try:
mentions_list = _json.loads(mentions_raw)
except Exception:
mentions_list = []
elif isinstance(mentions_raw, list):
mentions_list = mentions_raw
else:
mentions_list = []
if mentions_list:
bb.record_mentions(cid, task_id, mentions_list)
return {"ok": True, "comment_id": cid}