flask-demo-api/flask_demo_api/usecase/add.py

14 lines
321 B
Python
Raw Normal View History

2024-04-15 09:32:17 +03:00
from protocols.models import KeyDTO
from protocols.repository import Repository
class PostKey:
def __init__(
self,
repository: Repository,
) -> None:
self.__repository = repository
def __call__(self, request: KeyDTO) -> KeyDTO:
return self.__repository.add_key(obj=request)