添加保存文件
This commit is contained in:
parent
58bfea9c63
commit
d628de2e5d
@ -11,31 +11,43 @@ import base64
|
|||||||
async def get_door_list_service(pageNo: int = 1, pageSize: int = 10):
|
async def get_door_list_service(pageNo: int = 1, pageSize: int = 10):
|
||||||
result = await HaikangUtil.get_door_list_v2(pageNo, pageSize)
|
result = await HaikangUtil.get_door_list_v2(pageNo, pageSize)
|
||||||
print(result)
|
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):
|
async def get_door_status_service(door_index_codes):
|
||||||
result = await HaikangUtil.get_door_status(door_index_codes)
|
result = await HaikangUtil.get_door_status(door_index_codes)
|
||||||
print(result)
|
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):
|
async def door_do_control_service(door_index_codes, control_type):
|
||||||
result = await HaikangUtil.door_do_control(door_index_codes, control_type)
|
result = await HaikangUtil.door_do_control(door_index_codes, control_type)
|
||||||
print(result)
|
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):
|
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)
|
result = await HaikangUtil.query_door_events_v2(door_index_code, pageNo=pageNo, pageSize=pageSize ,startTime=startTime, endTime=endTime)
|
||||||
print(result)
|
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):
|
async def door_online_status_service(door_index_codes):
|
||||||
result = await HaikangUtil.door_online_status(door_index_codes)
|
result = await HaikangUtil.door_online_status(door_index_codes)
|
||||||
print(result)
|
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():
|
async def get_face_group_service():
|
||||||
result = await HaikangUtil.get_face_group()
|
result = await HaikangUtil.get_face_group()
|
||||||
print(result)
|
print(result)
|
||||||
|
with open("get_face_group_service.json", "w", encoding="utf-8") as f:
|
||||||
|
f.write(result[1])
|
||||||
|
|
||||||
# 人脸分组1vN搜索
|
# 人脸分组1vN搜索
|
||||||
async def face_group_1vN_search_service(image_path):
|
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']
|
faceGroupIndexCodes=['5dc82633-a4cb-4107-b55e-f21bf952f9']
|
||||||
)
|
)
|
||||||
print(result)
|
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):
|
async def face_picture_check(image_path):
|
||||||
@ -68,11 +82,15 @@ async def face_picture_check(image_path):
|
|||||||
facePicBinaryData=encoded_image
|
facePicBinaryData=encoded_image
|
||||||
)
|
)
|
||||||
print(result)
|
print(result)
|
||||||
|
with open("face_picture_check.json", "w", encoding="utf-8") as f:
|
||||||
|
f.write(result[1])
|
||||||
|
|
||||||
# 查询访客预约记录
|
# 查询访客预约记录
|
||||||
async def query_visitor_record():
|
async def query_visitor_record():
|
||||||
result = await HaikangUtil.query_visitor_record()
|
result = await HaikangUtil.query_visitor_record()
|
||||||
print(result)
|
print(result)
|
||||||
|
with open("query_visitor_record.json", "w", encoding="utf-8") as f:
|
||||||
|
f.write(result[1])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# asyncio.run(get_door_list_service())
|
# asyncio.run(get_door_list_service())
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user