From 6e28214a4ef19ef03e40345acdcc6db10927ce8c Mon Sep 17 00:00:00 2001 From: ymq Date: Tue, 25 Aug 2026 14:17:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(my=5Ftodos):=20=E5=BE=85=E5=8A=9E=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=A1=A5=E9=A1=B9=E7=9B=AE=E5=90=8D(project=5Fname)?= =?UTF-8?q?=EF=BC=8C=E5=89=8D=E7=AB=AF=E5=8D=A1=E7=89=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=89=80=E5=B1=9E=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/my_todos.dspy | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/wwwroot/api/my_todos.dspy b/wwwroot/api/my_todos.dspy index a006321..af29a04 100644 --- a/wwwroot/api/my_todos.dspy +++ b/wwwroot/api/my_todos.dspy @@ -1,4 +1,4 @@ -# my_todos.dspy - 我的待办(跨项目:人类任务 + bug 验收 + 冒泡问题) +# my_todos.dspy - 我的待办(跨项目:人类任务 + bug 验收 + 冒泡问题)→ JSON user_id = await get_user() if not user_id: @@ -6,4 +6,23 @@ if not user_id: todos = await list_my_human_todos(user_id) +# 补项目名 +dbname = get_module_dbname('pipeline-sdlc') +proj_names = {} +for t in todos: + pid = t.get('project_id', '') + if pid and pid not in proj_names: + proj_names[pid] = pid + try: + async with DBPools().sqlorContext(dbname) as sor: + _pr = await sor.sqlExe("SELECT name FROM sd_projects WHERE id=${pid}$", {"pid": pid}) + await sor.sqlExe("COMMIT", {}) + if _pr: + proj_names[pid] = getattr(_pr[0], 'name', '') or pid + except Exception: + pass + t['project_name'] = proj_names.get(pid, pid) + else: + t['project_name'] = proj_names.get(pid, pid) + return json.dumps({"success": True, "todos": todos}, ensure_ascii=False, default=str)