rogerxavier commited on
Commit
582ad23
1 Parent(s): 49567b1

Update api.py

Browse files
Files changed (1) hide show
  1. api.py +3 -6
api.py CHANGED
@@ -39,15 +39,12 @@ async def getOriginalMangaList(images: List[UploadFile] = File(...)):
39
  return "获取图片保存成功"
40
 
41
 
42
- @app.delete("/deleteAllMangaFiles")
43
- async def delete_all_manga_files():
44
- directory = "manga"
45
  for filename in os.listdir(directory):
46
  file_path = os.path.join(directory, filename)
47
  if os.path.isfile(file_path):
48
  os.remove(file_path)
49
-
50
- return {"message": "成功删除manga目录下的所有文件"}
51
-
52
 
53
 
 
39
  return "获取图片保存成功"
40
 
41
 
42
+ @app.delete("/deleteFiles")
43
+ async def delete_files(directory: str):
 
44
  for filename in os.listdir(directory):
45
  file_path = os.path.join(directory, filename)
46
  if os.path.isfile(file_path):
47
  os.remove(file_path)
48
+ return {"message": f"成功删除{directory}目录下的所有文件"}
 
 
49
 
50