完成节点

This commit is contained in:
2025-12-22 22:08:51 +08:00
parent 694a2ab979
commit 75b32b4bcd
9 changed files with 426 additions and 60 deletions

23
nodes/parse_register.py Normal file
View File

@@ -0,0 +1,23 @@
def check_status(status_code: float, body: str):
'''
检查状态码和约定的返回值
'''
if status_code != 200:
raise Exception(f"注册任务失败,状态码:{status_code}")
if "code" not in body or body["code"] != 1:
raise Exception(f"注册任务失败,返回值:{body}")
def main(status_code: float, body: str):
try:
check_status(status_code, body)
except Exception as e:
raise e
task_id = body["data"]["task_id"]
is_new_task = body["data"]["is_new_task"]
return {
"task_id": task_id,
"is_new_task": is_new_task
}