28 lines
874 B
Python
28 lines
874 B
Python
from backend.business.document_manager import (
|
|
DocumentManager,
|
|
)
|
|
|
|
|
|
class DocumentHub:
|
|
def __init__(self, ):
|
|
self.document_manager = DocumentManager()
|
|
return
|
|
|
|
async def retrieve_document_info(self, document_id: str):
|
|
return await self.document_manager.retrieve_document_info(document_id)
|
|
|
|
async def read_document_file_as_http_media_data(self, document_id: str):
|
|
return await self.document_manager.read_document_file_as_http_media_data(document_id)
|
|
|
|
async def upload_document(
|
|
self, associated_with: str, file_name: str, file_data: bytes
|
|
) -> bool:
|
|
"""Upload a file
|
|
Args:
|
|
file_name: the name of the file
|
|
file (bytes): the file to be uploaded
|
|
"""
|
|
return await self.document_manager.upload_file(
|
|
associated_with, file_name, file_data
|
|
)
|