1
0
mirror of synced 2024-12-22 09:45:53 +01:00
artemis/titles/wacca/handlers/base.py

35 lines
1.1 KiB
Python
Raw Normal View History

from typing import Dict, List
from titles.wacca.handlers.helpers import Version
from datetime import datetime
2023-03-09 17:38:58 +01:00
class BaseRequest:
def __init__(self, data: Dict) -> None:
self.requestNo: int = data["requestNo"]
self.appVersion: Version = Version(data["appVersion"])
self.boardId: str = data["boardId"]
self.chipId: str = data["chipId"]
self.params: List = data["params"]
2023-03-09 17:38:58 +01:00
class BaseResponse:
def __init__(self) -> None:
self.status: int = 0
self.message: str = ""
self.serverTime: int = int(datetime.now().timestamp())
self.maintNoticeTime: int = 0
self.maintNotPlayableTime: int = 0
self.maintStartTime: int = 0
self.params: List = []
def make(self) -> Dict:
return {
"status": self.status,
"message": self.message,
"serverTime": self.serverTime,
"maintNoticeTime": self.maintNoticeTime,
"maintNotPlayableTime": self.maintNotPlayableTime,
"maintStartTime": self.maintStartTime,
2023-03-09 17:38:58 +01:00
"params": self.params,
}