2023-03-14 01:27:22 +00:00
|
|
|
from core.base_service import BaseService
|
|
|
|
from core.services.sign.models import Sign
|
|
|
|
from core.services.sign.repositories import SignRepository
|
2022-08-06 06:36:44 +00:00
|
|
|
|
2023-03-14 01:27:22 +00:00
|
|
|
__all__ = ["SignServices"]
|
2022-08-06 06:36:44 +00:00
|
|
|
|
2023-03-14 01:27:22 +00:00
|
|
|
|
|
|
|
class SignServices(BaseService):
|
2022-08-06 06:36:44 +00:00
|
|
|
def __init__(self, sign_repository: SignRepository) -> None:
|
|
|
|
self._repository: SignRepository = sign_repository
|
|
|
|
|
|
|
|
async def get_all(self):
|
|
|
|
return await self._repository.get_all()
|
|
|
|
|
|
|
|
async def add(self, sign: Sign):
|
|
|
|
return await self._repository.add(sign)
|
|
|
|
|
2022-08-06 07:21:18 +00:00
|
|
|
async def remove(self, sign: Sign):
|
|
|
|
return await self._repository.remove(sign)
|
|
|
|
|
2022-08-06 06:36:44 +00:00
|
|
|
async def update(self, sign: Sign):
|
|
|
|
return await self._repository.update(sign)
|
|
|
|
|
|
|
|
async def get_by_user_id(self, user_id: int):
|
|
|
|
return await self._repository.get_by_user_id(user_id)
|
2022-10-12 12:11:54 +00:00
|
|
|
|
|
|
|
async def get_by_chat_id(self, chat_id: int):
|
|
|
|
return await self._repository.get_by_chat_id(chat_id)
|