freeleaps-service-hub/app/central_storage/backend/business/document_manager.py

20 lines
664 B
Python

from app.central_storage.backend.services.document_service import DocumentService
class DocumentBusinessManager:
def __init__(self, user_id) -> None:
self.user_id = user_id
self.document_service = DocumentService()
async def get_document_details_by_id(self, document_id: str):
await self.document_service.load_document(document_id=document_id)
download_link = (
await self.document_service.fetch_document_file_as_http_download()
)
file_name = self.document_service.get_file_name()
return {
"file_name": file_name,
"file_download_url": download_link,
}