Fastapi refactor update
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from .file_storage import IFileStorage
|
||||
from .document_store import IDocumentStore
|
||||
|
||||
__all__ = [
|
||||
"IFileStorage",
|
||||
"IDocumentStore"
|
||||
from .file_storage import IFileStorage
|
||||
from .document_store import IDocumentStore
|
||||
|
||||
__all__ = [
|
||||
"IFileStorage",
|
||||
"IDocumentStore"
|
||||
]
|
||||
@@ -1,16 +1,15 @@
|
||||
from abc import ABC
|
||||
|
||||
|
||||
class IDocumentStore(ABC):
|
||||
|
||||
async def save_to_db(self, collection: str, item):
|
||||
pass
|
||||
|
||||
async def save_to_db_with_id(self, collection: str, item, id: str):
|
||||
pass
|
||||
|
||||
async def get_all(self, collection: str):
|
||||
pass
|
||||
|
||||
async def get_doc_by_id(self, collection: str, doc_id: str):
|
||||
pass
|
||||
from abc import ABC
|
||||
|
||||
from typing import Dict, Optional, List
|
||||
|
||||
|
||||
class IDocumentStore(ABC):
|
||||
|
||||
async def save_to_db(self, collection: str, item: Dict, doc_id: Optional[str]) -> Optional[str]:
|
||||
pass
|
||||
|
||||
async def get_all(self, collection: str) -> List[Dict]:
|
||||
pass
|
||||
|
||||
async def get_doc_by_id(self, collection: str, doc_id: str) -> Optional[Dict]:
|
||||
pass
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class IFileStorage(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def download_firebase_file(self, source_blob_name, destination_file_name):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def upload_file_firebase_get_url(self, destination_blob_name, source_file_name):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def make_public(self, blob_name: str):
|
||||
pass
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
|
||||
class IFileStorage(ABC):
|
||||
|
||||
@abstractmethod
|
||||
async def download_firebase_file(self, source_blob_name, destination_file_name):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def upload_file_firebase_get_url(self, destination_blob_name, source_file_name):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def make_public(self, blob_name: str):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user