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

Commit 04bbbd2b by 李景熙

添加后端删除任务的相关接口

parent 20524ed2
...@@ -114,7 +114,7 @@ def find_task_by_creator(creator, start, num): ...@@ -114,7 +114,7 @@ def find_task_by_creator(creator, start, num):
# 删除任务 # 删除任务
def delete_task(task_id): def delete_task(task_id):
try: try:
Task.delete().where(Task.id == task_id) Task.delete().where(Task.task_id == task_id).execute()
except: except:
return Result(0, "delete failed", {}, 0) return Result(0, "delete failed", {}, 0)
else: else:
......
...@@ -60,3 +60,15 @@ def create_task(): ...@@ -60,3 +60,15 @@ def create_task():
} }
return json.dumps(res) return json.dumps(res)
@task.route("/deleteTask", methods=["GET"])
def delete_task():
taskId = request.args['taskId']
print(taskId)
ret = Task.delete_task(taskId)
res = {
'code': ret.code,
'message': ret.message,
'data': ret.data
}
return json.dumps(res)
\ No newline at end of file
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