This commit is contained in:
2024-04-16 04:48:10 +03:00
parent 9b4184994f
commit 903c216966
17 changed files with 363 additions and 33 deletions

View File

@@ -1,8 +1,7 @@
from dataclasses import dataclass
from typing import Any
@dataclass(frozen=True)
class KeyDTO:
key: str
val: Any | None = None
val: str = ""

View File

@@ -10,11 +10,11 @@ class Repository(Protocol):
raise NotImplementedError
@abstractmethod
def add_key(self, obj: KeyDTO) -> KeyDTO:
def add_key(self, obj: KeyDTO) -> KeyDTO | None:
raise NotImplementedError
@abstractmethod
def put_key(self, obj: KeyDTO) -> KeyDTO:
def put_key(self, obj: KeyDTO) -> KeyDTO | None:
raise NotImplementedError
@abstractmethod