2023-02-17 07:02:21 +01:00
|
|
|
from typing import Dict, List
|
2023-03-02 03:48:43 +01:00
|
|
|
from titles.wacca.handlers.helpers import Version
|
2023-02-17 07:02:21 +01:00
|
|
|
from datetime import datetime
|
|
|
|
|
2023-03-09 17:38:58 +01:00
|
|
|
|
|
|
|
class BaseRequest:
|
2023-02-17 07:02:21 +01:00
|
|
|
def __init__(self, data: Dict) -> None:
|
|
|
|
self.requestNo: int = data["requestNo"]
|
2023-03-02 03:48:43 +01:00
|
|
|
self.appVersion: Version = Version(data["appVersion"])
|
2023-02-17 07:02:21 +01:00
|
|
|
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:
|
2023-02-17 07:02:21 +01:00
|
|
|
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,
|
2023-02-17 07:02:21 +01:00
|
|
|
}
|