From b2af30448d4031c4e4c1b42ef630f4ef56f10634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A6=82=E5=A8=81?= Date: Mon, 22 Sep 2025 17:51:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/app/main.py b/backend/app/main.py index 748bdc3..3e61ca9 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -386,6 +386,22 @@ def create_app(): return StreamingResponse(_event(), media_type="text/event-stream") + @app.delete("/api/flows/status", tags=["Flow"], description="任务删除", response_model=BaseResponse) + async def del_client(work_uuid: str, user: DB.User = Depends(get_current_user)): + work = await DB.Work.filter(uuid=work_uuid).first() + if not work: + return BaseResponse() + work_content = await DB.WorkContent.filter(work_id=work.id).first() + async with in_transaction(): + work.is_deleted = 1 + work.update_time = datetime.datetime.now() + await work.save() + if work_content: + work_content.is_deleted = 1 + work_content.update_time = datetime.datetime.now() + await work_content.save() + return BaseResponse() + @app.get("/api/clients", tags=["Client"], description="终端列表", response_model=TableResponse) async def clients_list(user: DB.User = Depends(get_current_user)): res = await DB.Client.filter(user_id=user.id).all()