From e5a0a6b18b0a1120750f6c990cf83e24b95b8a67 Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Thu, 25 Jan 2024 17:10:40 +0800 Subject: [PATCH] update --- config.py | 7 +++++++ xumu.py | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/config.py b/config.py index beffed6..71b20ee 100644 --- a/config.py +++ b/config.py @@ -26,6 +26,8 @@ headers = { 'ContentType': 'application/json', 'Authorization': "Basic " + token } + +# example # RFID send1 = { "m": ["cid", "r", "v"], @@ -90,3 +92,8 @@ def get_sql(deviceId, type): return air_template(deviceId) case _: return common_template(deviceId) + + +# 监控视频接口 +def get_video_url(username): + return f"http://192.168.1.27:8888/live/xumu_{username}.live.mp4" diff --git a/xumu.py b/xumu.py index 9e35c3e..8a9ad1f 100644 --- a/xumu.py +++ b/xumu.py @@ -26,6 +26,11 @@ class Device(BaseModel): type: int = None +@app.get("/api/xumu/video") +async def data_query(username): + return BaseResponse(data=get_video_url(username)) + + # 数据查询接口 @app.get("/api/xumu/data/query") async def data_query(deviceId):