feat: 新增设备互相通讯功能

feat: 新增通讯录页面
This commit is contained in:
Sakura-RanChen
2026-05-26 16:37:39 +08:00
parent 7f73dae1bf
commit ce68c83eea
48 changed files with 2361 additions and 7 deletions
@@ -7,6 +7,7 @@ from config.manage_api_client import (
get_server_config,
get_agent_models,
get_correct_words,
lookup_address_book,
DeviceNotFoundException,
DeviceBindException,
)
@@ -245,6 +245,20 @@ async def report(
return None
async def lookup_address_book(caller_mac: str, nickname: str) -> Optional[Dict]:
"""根据昵称查找目标设备"""
if not ManageApiClient._instance:
return None
try:
return await ManageApiClient._instance._execute_async_request(
"GET",
f"/device/address-book/lookup?callerMac={caller_mac}&nickname={nickname}",
)
except Exception as e:
print(f"通讯录查找失败: {e}")
return None
def init_service(config):
ManageApiClient(config)