ticket/wwwroot/api/ticket_followup.dspy

25 lines
1.2 KiB
Plaintext
Raw 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.

# ticket_followup.dspy - 客户追问(T6/T10: agent_replied→agent处理; staff_replied→回受理人)
# 入参: ticket_id, content, attachments?(multipart 文件字段,可多个)
user_id = await get_user()
if not user_id:
return json.dumps({"success": False, "error": "请先登录"}, ensure_ascii=False)
ticket_id = (params_kw.get('ticket_id') or '').strip()
content = (params_kw.get('content') or '').strip()
if not ticket_id:
return json.dumps({"success": False, "error": "缺少 ticket_id"}, ensure_ascii=False)
# 附件:multipart 上传时 ahserver 已落 FileStorage,params_kw['attachments']
# 为 webpath 字符串(单文件)或 list(多文件同名字段);JSON 通道传数组字符串也兼容
attachments = params_kw.get('attachments')
org_id = await get_userorgid()
ok, result = await ticket_followup(ticket_id, user_id, org_id, content,
attachments=attachments)
if ok:
return json.dumps({"success": True, "message": result.get('message', ''),
"data": result}, ensure_ascii=False)
code, msg = result
return json.dumps({"success": False, "error": msg, "code": code}, ensure_ascii=False)