|
@@ -117,26 +117,26 @@ def update_topic_result(param: DecodeWorkflowParam):
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-@app.post("/decodeWorkflow/result")
|
|
|
|
|
-def get_topic_result(param: TaskStatusParam):
|
|
|
|
|
- db_res = get_topic_result_by_id_db(param.task_id)
|
|
|
|
|
- logger.info(f"\n查询结构结果的task_id = {param.task_id}")
|
|
|
|
|
|
|
|
|
|
- if not db_res:
|
|
|
|
|
|
|
+
|
|
|
|
|
+@app.get("/decodeWorkflow/result")
|
|
|
|
|
+def get_topic_result(task_id: str):
|
|
|
|
|
+ result = get_topic_result_by_id_db(task_id)
|
|
|
|
|
+ logger.info(f"\n查询结构结果的task_id = {task_id}")
|
|
|
|
|
+
|
|
|
|
|
+ if not result:
|
|
|
return {
|
|
return {
|
|
|
"code": -1,
|
|
"code": -1,
|
|
|
"message": '任务不存在',
|
|
"message": '任务不存在',
|
|
|
"data": None
|
|
"data": None
|
|
|
}
|
|
}
|
|
|
- result, status,error_reason = db_res
|
|
|
|
|
|
|
+
|
|
|
|
|
+ status = result["task_status"]
|
|
|
|
|
+ error_reason = result["error_reason"]
|
|
|
return {
|
|
return {
|
|
|
- "code": 0,
|
|
|
|
|
|
|
+ "code": status,
|
|
|
"message": status == 2 and "success" or error_reason,
|
|
"message": status == 2 and "success" or error_reason,
|
|
|
- "data": {
|
|
|
|
|
- "result": result,
|
|
|
|
|
- "status": status,
|
|
|
|
|
- "error":error_reason,
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ "data": result
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|