refacto: reorganize files to easily add an API service
This commit is contained in:
parent
5c480db410
commit
9c883a8eca
22 changed files with 26 additions and 23 deletions
0
server/app/domain/__init__.py
Normal file
0
server/app/domain/__init__.py
Normal file
3
server/app/domain/entities/__init__.py
Normal file
3
server/app/domain/entities/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from .uplink_event import UplinkEvent
|
||||
|
||||
__all__ = ["UplinkEvent"]
|
||||
6
server/app/domain/entities/uplink_event.py
Normal file
6
server/app/domain/entities/uplink_event.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
from dataclasses import dataclass
|
||||
|
||||
@dataclass
|
||||
class UplinkEvent:
|
||||
dev_eui: str
|
||||
pulse_count: int
|
||||
13
server/app/domain/exceptions.py
Normal file
13
server/app/domain/exceptions.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# domain/exceptions.py (ou dans domain.py directement)
|
||||
|
||||
class InfrastructureError(Exception):
|
||||
"""Erreur technique levée par un adapter"""
|
||||
|
||||
class DatabaseConnectionError(InfrastructureError):
|
||||
"""Impossible de se connecter à la db"""
|
||||
|
||||
class DatabaseError(InfrastructureError):
|
||||
"""Erreur lors d'une opération en base de données."""
|
||||
|
||||
class MessageBrokerError(InfrastructureError):
|
||||
"""Impossible de se connecter au broker MQTT"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue