Просмотр исходного кода

增加获取拼图状态接口

AnlaAnla 5 месяцев назад
Родитель
Сommit
39f0dbc996
2 измененных файлов с 6 добавлено и 13 удалено
  1. 0 13
      Test/test01.py
  2. 6 0
      app/api/stitch.py

+ 0 - 13
Test/test01.py

@@ -1,13 +0,0 @@
-import shutil
-import time
-from pathlib import Path
-
-path = Path(__file__).parent.absolute()
-save_path = path.joinpath('123.zip')
-print(path)
-
-t1 = time.time()
-shutil.make_archive(str(save_path.with_suffix('')), 'zip', r"C:\Code\ML\Project\StitchImageServer\temp\Input\_250801_1043_0001")
-t2 = time.time()
-print(t2-t1)
-print('end')

+ 6 - 0
app/api/stitch.py

@@ -20,6 +20,12 @@ TEMP_DIR = Path("_temp_work")
 TEMP_DIR.mkdir(exist_ok=True)
 logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
 
+@router.get("/stitch", summary="获取拼图程序状态")
+async def state():
+    data = {
+        "stitch_server_on": True
+    }
+    return data
 
 @router.post("/", summary="通用拼图接口")
 async def stitch_puzzle(