sp-hydra-veil-core/core/controllers/SessionStateController.py
2024-09-11 19:39:33 +02:00

26 lines
563 B
Python

from core.models.session.SessionState import SessionState
class SessionStateController:
@staticmethod
def get(id: int):
return SessionState.find_by_id(id)
@staticmethod
def get_or_new(id: int):
session_state = SessionStateController.get(id)
if session_state is None:
return SessionState(id)
return session_state
@staticmethod
def exists(id: int):
return SessionState.exists(id)
@staticmethod
def update_or_create(session_state):
SessionState.save(session_state)