refactor(feishu): promote download helper methods to public, update call sites and tests

This commit is contained in:
jxxghp
2026-05-13 08:19:16 +08:00
parent b6062a9ce2
commit 7b4cb2097b
4 changed files with 123 additions and 115 deletions

View File

@@ -243,13 +243,13 @@ class FeishuModule(_ModuleBase, _MessageBase[Feishu]):
image_key = image_key.strip()
downloaded = None
if message_id:
downloaded = client._download_message_resource_bytes(
downloaded = client.download_message_resource_bytes(
message_id=message_id,
file_key=image_key,
resource_type="image",
)
if not downloaded:
downloaded = client._download_image_bytes(image_key)
downloaded = client.download_image_bytes(image_key)
if not downloaded:
return None
content, _, content_type = downloaded
@@ -271,7 +271,7 @@ class FeishuModule(_ModuleBase, _MessageBase[Feishu]):
file_key = parts[0].strip() if parts else ""
if not file_key:
return None
downloaded = client._download_file_bytes(file_key)
downloaded = client.download_file_bytes(file_key)
if not downloaded:
return None
content, _, _ = downloaded