feat(storage): expose a path to access local storage

This commit is contained in:
MingxuanGame
2025-08-12 05:23:16 +00:00
parent 449bda0a84
commit a488257acd
9 changed files with 52 additions and 15 deletions

View File

@@ -2,6 +2,8 @@ from __future__ import annotations
from pathlib import Path
from app.config import settings
from .base import StorageService
import aiofiles
@@ -75,4 +77,4 @@ class LocalStorageService(StorageService):
return full_path.exists() and full_path.is_file()
async def get_file_url(self, file_path: str) -> str:
return str(self.storage_path / file_path)
return f"{settings.server_url}file/{file_path.lstrip('/')}"