mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-26 07:55:41 +00:00
233e7ab58d
Co-authored-by: luoshuijs <luoshuijs@outlook.com> Co-authored-by: Karako <karakohear@gmail.com> Co-authored-by: xtaodada <xtao@xtaolink.cn>
29 lines
905 B
Python
29 lines
905 B
Python
from core.base_service import BaseService
|
|
from core.services.sign.models import Sign
|
|
from core.services.sign.repositories import SignRepository
|
|
|
|
__all__ = ["SignServices"]
|
|
|
|
|
|
class SignServices(BaseService):
|
|
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)
|
|
|
|
async def remove(self, sign: Sign):
|
|
return await self._repository.remove(sign)
|
|
|
|
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)
|
|
|
|
async def get_by_chat_id(self, chat_id: int):
|
|
return await self._repository.get_by_chat_id(chat_id)
|