mirror of
https://github.com/ijaric/voice_assistant.git
synced 2025-05-24 14:33:26 +00:00
17 lines
389 B
Python
17 lines
389 B
Python
import typing
|
|
|
|
import backend.user.models as models
|
|
|
|
|
|
class UserClientProtocol(typing.Protocol):
|
|
def get_name(self) -> str:
|
|
...
|
|
|
|
|
|
class UserService:
|
|
def __init__(self, user_client: UserClientProtocol):
|
|
self._user_client = user_client
|
|
|
|
def get_one(self, entity_id: int) -> models.User:
|
|
return models.User(id=entity_id, name=self._user_client.get_name())
|