mirror of
https://github.com/PaiGramTeam/GramCore.git
synced 2024-11-23 23:04:30 +00:00
26 lines
824 B
Python
26 lines
824 B
Python
from typing import Optional
|
|
|
|
from gram_core.base_service import BaseService
|
|
from gram_core.services.devices.repositories import DevicesRepository
|
|
from gram_core.services.devices.models import DevicesDataBase as Devices
|
|
|
|
|
|
class DevicesService(BaseService):
|
|
def __init__(self, devices_repository: DevicesRepository) -> None:
|
|
self._repository: DevicesRepository = devices_repository
|
|
|
|
async def update(self, devices: Devices):
|
|
await self._repository.update(devices)
|
|
|
|
async def add(self, devices: Devices):
|
|
await self._repository.add(devices)
|
|
|
|
async def get(
|
|
self,
|
|
account_id: int,
|
|
) -> Optional[Devices]:
|
|
return await self._repository.get(account_id)
|
|
|
|
async def delete(self, devices: Devices) -> None:
|
|
return await self._repository.delete(devices)
|