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

14 lines
358 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
2024-04-16 04:48:10 +03:00
def __call__(self, request: KeyDTO) -> KeyDTO | None:
2024-04-15 09:32:17 +03:00
return self.__repository.add_key(obj=request)