文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit 2a21b6c8 by 李景熙

终止任务后端

parent 87f96f36
......@@ -270,3 +270,27 @@ def finish_task():
'data': ret.data
}
return json.dumps(res)
# 终止任务
@task.route("/terminateTask", methods=["Post"])
def terminate_task():
userId = int(request.args['userId'])
taskId = request.args['taskId']
task = Task.find_task_by_id(taskId)
if task.publish_id == userId:
Task.set_state(taskId, 'terminate')
res = {
'code': 1,
'message': "terminate success",
'data': {}
}
return json.dumps(res)
else:
res = {
'code': 0,
'message': "terminate failed",
'data': {}
}
return json.dumps(res)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment