refactor: rename plugin manager to plugin client and rename path from manager to impl (#18876)
This commit is contained in:
parent
d91828dd90
commit
abafa68647
38 changed files with 116 additions and 103 deletions
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue