libushang 5 miesięcy temu
rodzic
commit
00ee5653e6
2 zmienionych plików z 5 dodań i 5 usunięć
  1. 3 3
      routers/api/videoResource/hkvideo.py
  2. 2 2
      utils/hk_video_api.py

+ 3 - 3
routers/api/videoResource/hkvideo.py

@@ -44,14 +44,14 @@ async def get_ptz_info(
         }
     
 
-@router.get("/getDeviceByIndexCode")
-async def getDeviceByIndexCode(
+@router.get("/indexCode")
+async def indexCode(
     request: Request, 
     code: str,
     db: Session = Depends(get_db)
 ):
     try:
-        data = hk_video_api.getDeviceByIndexCode(code)
+        data = hk_video_api.indexCode(code)
         return {
             "code": 200,
             "msg": "操作成功",

+ 2 - 2
utils/hk_video_api.py

@@ -19,8 +19,8 @@ def get_video_url(id: str, protocol: str):
             video_url = result['data']
     return video_url
 
-def getDeviceByIndexCode(id: str):
-    api_url = "http://10.181.7.236:8081/getDeviceByIndexCode"
+def indexCode(id: str):
+    api_url = "http://10.181.7.236:8081/indexCode"
     params = {
         "cameraIndexCode": id
     }