refactor: rename plugin manager to plugin client and rename path from manager to impl (#18876)
This commit is contained in:
12
api/core/plugin/impl/asset.py
Normal file
12
api/core/plugin/impl/asset.py
Normal 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
|
Reference in New Issue
Block a user