From d628de2e5d4ed7be90ca9d9293592673b15dc2b5 Mon Sep 17 00:00:00 2001 From: haotianmingyue <2421912570@qq.com> Date: Tue, 16 Sep 2025 09:55:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BF=9D=E5=AD=98=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 001测试海康api.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/001测试海康api.py b/001测试海康api.py index 234cae4..fd24344 100644 --- a/001测试海康api.py +++ b/001测试海康api.py @@ -11,31 +11,43 @@ import base64 async def get_door_list_service(pageNo: int = 1, pageSize: int = 10): result = await HaikangUtil.get_door_list_v2(pageNo, pageSize) print(result) + with open("get_door_list_service.json", "w", encoding="utf-8") as f: + f.write(result[1]) # 查询门禁状态 async def get_door_status_service(door_index_codes): result = await HaikangUtil.get_door_status(door_index_codes) print(result) + with open("get_door_status_service.json", "w", encoding="utf-8") as f: + f.write(result[1]) # 门禁控制 async def door_do_control_service(door_index_codes, control_type): result = await HaikangUtil.door_do_control(door_index_codes, control_type) print(result) + with open("door_do_control_service.json", "w", encoding="utf-8") as f: + f.write(result[1]) # 查询门禁点事件 async def query_door_events_service(door_index_code,pageNo, pageSize, startTime, endTime): result = await HaikangUtil.query_door_events_v2(door_index_code, pageNo=pageNo, pageSize=pageSize ,startTime=startTime, endTime=endTime) print(result) + with open("query_door_events_service.json", "w", encoding="utf-8") as f: + f.write(result[1]) # 查看门禁点在线状态 async def door_online_status_service(door_index_codes): result = await HaikangUtil.door_online_status(door_index_codes) print(result) + with open("door_online_status_service.json", "w", encoding="utf-8") as f: + f.write(result[1]) # 按条件查询人脸分组, 很重要 async def get_face_group_service(): result = await HaikangUtil.get_face_group() print(result) + with open("get_face_group_service.json", "w", encoding="utf-8") as f: + f.write(result[1]) # 人脸分组1vN搜索 async def face_group_1vN_search_service(image_path): @@ -54,6 +66,8 @@ async def face_group_1vN_search_service(image_path): faceGroupIndexCodes=['5dc82633-a4cb-4107-b55e-f21bf952f9'] ) print(result) + with open("face_group_1vN_search_service.json", "w", encoding="utf-8") as f: + f.write(result[1]) # 人脸评分 async def face_picture_check(image_path): @@ -68,11 +82,15 @@ async def face_picture_check(image_path): facePicBinaryData=encoded_image ) print(result) + with open("face_picture_check.json", "w", encoding="utf-8") as f: + f.write(result[1]) # 查询访客预约记录 async def query_visitor_record(): result = await HaikangUtil.query_visitor_record() print(result) + with open("query_visitor_record.json", "w", encoding="utf-8") as f: + f.write(result[1]) if __name__ == '__main__': # asyncio.run(get_door_list_service())