pipeline-sdlc/wwwroot/api/bug_accept.dspy

18 lines
718 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# bug_accept.dspy - Bug 验收仅报告人通过→closed不通过→reopen
user_id = await get_user()
if not user_id:
return json.dumps({"success": False, "error": "未登录"}, ensure_ascii=False)
bug_id = params_kw.get('bug_id', '').strip()
accept = params_kw.get('accept', '').strip().lower() in ('1', 'true', 'yes', '通过')
comment = params_kw.get('comment', '')
if not bug_id:
return json.dumps({"success": False, "error": "缺少 bug_id"}, ensure_ascii=False)
ok, msg = await bug_accept(bug_id, accept, user_id, comment=comment)
if ok:
return json.dumps({"success": True, "message": msg}, ensure_ascii=False)
return json.dumps({"success": False, "error": msg}, ensure_ascii=False)