refactor: rename plugin manager to plugin client and rename path from manager to impl (#18876)

This commit is contained in:
Yeuoly
2025-04-27 14:22:25 +08:00
committed by GitHub
parent d91828dd90
commit abafa68647
38 changed files with 116 additions and 103 deletions

View File

@@ -0,0 +1,12 @@
from core.plugin.impl.base import BasePluginClient
class PluginAssetManager(BasePluginClient):
def fetch_asset(self, tenant_id: str, id: str) -> bytes:
"""
Fetch an asset by id.
"""
response = self._request(method="GET", path=f"plugin/{tenant_id}/asset/{id}")
if response.status_code != 200:
raise ValueError(f"can not found asset {id}")
return response.content