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

14 lines
351 B
Python
Raw Normal View History

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