pbl_evidence/wwwroot/api/pbl_evidence_update.dspy

17 lines
1.0 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.

debug(f'pbl_evidence_update.dspy: START params_kw={dict(params_kw)}')
# 证据人工修订端点(json/pbl_evidence.json -> params.editable.update_data_url,
# 注意:new/update/delete_data_url 在 CRUD JSON 中位于 params 顶层语义,由 xls2ui 读取)。
# 薄包装:无 import、无业务逻辑,直接委托 init.py 注册的 pbl_evidence_update
# (强制 tenant_id 打头校验归属;改唯一索引三元组时同步重算 dedup_key)。
try:
_data = await pbl_evidence_update(**dict(params_kw))
_msg = (_data or {}).get('message', '证据已更新')
debug(f'pbl_evidence_update.dspy: OK id={(_data or {}).get("id")}')
return json.dumps({'status': 'OK', 'ok': True, 'data': _data,
'message': _msg}, ensure_ascii=False)
except Exception as e:
debug(f'pbl_evidence_update.dspy: FAIL {e}')
debug(f'pbl_evidence_update.dspy: TRACE {format_exc()}')
return json.dumps({'status': 'ERROR', 'ok': False, 'data': None,
'message': f'证据更新失败:{e}'}, ensure_ascii=False)