Spaces:
Sleeping
Sleeping
| from src.utils import logger, SharepointClient | |
| class FileService: | |
| def __init__(self): | |
| pass | |
| async def __aenter__(self): | |
| return self | |
| async def __aexit__(self, exc_type, exc_val, exc_tb): | |
| pass | |
| async def upload_file(self, file_path: str): | |
| async with SharepointClient() as sharepoint_client: | |
| web_url = await sharepoint_client.upload_file(file_path) | |
| logger.info(f"File uploaded to Sharepoint. Web URL: {web_url}") | |
| return web_url |