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

14 lines
353 B
Python
Raw Normal View History

2024-04-15 02:16:07 +03:00
from flask_demo_api.protocols.models import KeyDTO
from flask_demo_api.protocols.repository import Repository
class GetKey:
def __init__(
self,
repository: Repository,
) -> None:
self.repository = repository
def __call__(self, request: KeyDTO) -> KeyDTO | None:
return self.repository.get_key(obj=request)