mongodb wrapper for managing News objects

This commit is contained in:
TrisNol
2023-06-16 18:50:19 +02:00
parent 5b96bb7e3e
commit 6e31bc62bd
7 changed files with 189 additions and 0 deletions

View File

@ -0,0 +1,17 @@
from abc import ABC
from models.News import News
class NewsServiceInterface(ABC):
def get_all(self) -> list[News]:
raise NotImplementedError
def get_by_id(self, id: str) -> News | None:
raise NotImplementedError
def insert(self, news: News):
raise NotImplementedError
def insert_many(self, news: list[News]):
raise NotImplementedError