freeleaps-service-hub/app/central_storage/backend/application/document_hub.py

26 lines
787 B
Python

from app.central_storage.backend.business.document_manager import (
DocumentManager,
)
class DocumentHub:
def __init__(self, user_id: str):
self.user_id = user_id
self.document_manager = DocumentManager(self.user_id)
return
async def get_document_by_id(self, document_id: str):
return await self.document_manager.get_document_details_by_id(document_id)
async def upload_document_for_object(
self, object_id: 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_for_object(
object_id, file_name, file_data
)