Fixed error and dto handling #70
This commit is contained in:
parent
e0844a7f92
commit
5cd91d8341
@ -82,21 +82,21 @@ class AuthUserDTO(DtoABC):
|
|||||||
self.auth_role = value
|
self.auth_role = value
|
||||||
|
|
||||||
def from_dict(self, values: dict):
|
def from_dict(self, values: dict):
|
||||||
self._id = values['Id']
|
self._id = values['id']
|
||||||
self._first_name = values['FirstName']
|
self._first_name = values['firstName']
|
||||||
self._last_name = values['LastName']
|
self._last_name = values['lastName']
|
||||||
self._email = values['EMail']
|
self._email = values['email']
|
||||||
self._password = values['Password']
|
self._password = values['password']
|
||||||
self._is_confirmed = values['IsConfirmed']
|
self._is_confirmed = values['isConfirmed']
|
||||||
self._auth_role = values['AuthRole']
|
self._auth_role = values['authRole']
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
"Id": self._id,
|
'id': self._id,
|
||||||
"FirstName": self._first_name,
|
'firstName': self._first_name,
|
||||||
"LastName": self._last_name,
|
'lastName': self._last_name,
|
||||||
"EMail": self._email,
|
'email': self._email,
|
||||||
"Password": self._password,
|
'password': self._password,
|
||||||
"IsConfirmed": self._is_confirmed,
|
'isConfirmed': self._is_confirmed,
|
||||||
"AuthRole": self._auth_role,
|
'authRole': self._auth_role,
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,11 @@ class AuthUserFilteredResultDTO(DtoABC, FilteredResult):
|
|||||||
FilteredResult.__init__(self, result, total_count)
|
FilteredResult.__init__(self, result, total_count)
|
||||||
|
|
||||||
def from_dict(self, values: dict):
|
def from_dict(self, values: dict):
|
||||||
self._result = values['Users']
|
self._result = values['users']
|
||||||
self._total_count = values['TotalCount']
|
self._total_count = values['totalCount']
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'Users': self.result,
|
'users': self.result,
|
||||||
'TotalCount': self.total_count
|
'totalCount': self.total_count
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,9 @@ class EMailStringDTO(DtoABC):
|
|||||||
self._email = email
|
self._email = email
|
||||||
|
|
||||||
def from_dict(self, values: dict):
|
def from_dict(self, values: dict):
|
||||||
self._email = values['EMail']
|
self._email = values['email']
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'EMail': self._email
|
'email': self._email
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,6 @@ class ErrorDTO(DtoABC):
|
|||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'ErrorCode': int(self._error_code.value),
|
'errorCode': int(self._error_code.value),
|
||||||
'Message': self._message
|
'message': self._message
|
||||||
}
|
}
|
||||||
|
@ -22,11 +22,11 @@ class ResetPasswordDTO(DtoABC):
|
|||||||
return self._password
|
return self._password
|
||||||
|
|
||||||
def from_dict(self, values: dict):
|
def from_dict(self, values: dict):
|
||||||
self._id = values['Id']
|
self._id = values['id']
|
||||||
self._password = values['Password']
|
self._password = values['password']
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'Id': self._id,
|
'id': self._id,
|
||||||
'Password': self._password
|
'password': self._password
|
||||||
}
|
}
|
||||||
|
@ -37,31 +37,31 @@ class SettingsDTO(DtoABC):
|
|||||||
self._mail_transceiver_address = mail_transceiver_address
|
self._mail_transceiver_address = mail_transceiver_address
|
||||||
|
|
||||||
def from_dict(self, values: dict):
|
def from_dict(self, values: dict):
|
||||||
self._web_version = values['WebVersion']
|
self._web_version = values['webVersion']
|
||||||
self._api_version.from_dict(values['ApiVersion'])
|
self._api_version.from_dict(values['apiVersion'])
|
||||||
self._config_path = values['ConfigPath']
|
self._config_path = values['configPath']
|
||||||
self._web_base_url = values['WebBaseURL']
|
self._web_base_url = values['webBaseURL']
|
||||||
self._api_base_url = values['ApiBaseURL']
|
self._api_base_url = values['apiBaseURL']
|
||||||
self._token_expire_time = values['TokenExpireTime']
|
self._token_expire_time = values['tokenExpireTime']
|
||||||
self._refresh_token_expire_time = values['RefreshTokenExpireTime']
|
self._refresh_token_expire_time = values['refreshTokenExpireTime']
|
||||||
self._mail_user = values['MailUser']
|
self._mail_user = values['mailUser']
|
||||||
self._mail_port = values['MailPort']
|
self._mail_port = values['mailPort']
|
||||||
self._mail_host = values['MailHost']
|
self._mail_host = values['mailHost']
|
||||||
self._mail_transceiver = values['MailTransceiver']
|
self._mail_transceiver = values['mailTransceiver']
|
||||||
self._mail_transceiver_address = values['MailTransceiverAddress']
|
self._mail_transceiver_address = values['mailTransceiverAddress']
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'WebVersion': self._web_version,
|
'webVersion': self._web_version,
|
||||||
'ApiVersion': self._api_version.to_dict(),
|
'apiVersion': self._api_version.to_dict(),
|
||||||
'ConfigPath': self._config_path,
|
'configPath': self._config_path,
|
||||||
'WebBaseURL': self._web_base_url,
|
'webBaseURL': self._web_base_url,
|
||||||
'ApiBaseURL': self._api_base_url,
|
'apiBaseURL': self._api_base_url,
|
||||||
'TokenExpireTime': self._token_expire_time,
|
'tokenExpireTime': self._token_expire_time,
|
||||||
'RefreshTokenExpireTime': self._refresh_token_expire_time,
|
'refreshTokenExpireTime': self._refresh_token_expire_time,
|
||||||
'MailUser': self._mail_user,
|
'mailUser': self._mail_user,
|
||||||
'MailPort': self._mail_port,
|
'mailPort': self._mail_port,
|
||||||
'MailHost': self._mail_host,
|
'mailHost': self._mail_host,
|
||||||
'MailTransceiver': self._mail_transceiver,
|
'mailTransceiver': self._mail_transceiver,
|
||||||
'MailTransceiverAddress': self._mail_transceiver_address,
|
'mailTransceiverAddress': self._mail_transceiver_address,
|
||||||
}
|
}
|
||||||
|
@ -22,11 +22,11 @@ class TokenDTO(DtoABC):
|
|||||||
return self._refresh_token
|
return self._refresh_token
|
||||||
|
|
||||||
def from_dict(self, values: dict):
|
def from_dict(self, values: dict):
|
||||||
self._token = values['Token']
|
self._token = values['token']
|
||||||
self._refresh_token = values['RefreshToken']
|
self._refresh_token = values['refreshToken']
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'Token': self._token,
|
'token': self._token,
|
||||||
'RefreshToken': self._refresh_token
|
'refreshToken': self._refresh_token
|
||||||
}
|
}
|
||||||
|
@ -33,13 +33,13 @@ class UpdateAuthUserDTO(DtoABC):
|
|||||||
return self._change_password
|
return self._change_password
|
||||||
|
|
||||||
def from_dict(self, values: dict):
|
def from_dict(self, values: dict):
|
||||||
self._auth_user = values['AuthUser']
|
self._auth_user = values['authUser']
|
||||||
self._new_auth_user = values['NewAuthUser']
|
self._new_auth_user = values['newAuthUser']
|
||||||
self._change_password = False if 'ChangePassword' not in values else values['ChangePassword']
|
self._change_password = False if 'changePassword' not in values else values['changePassword']
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'AuthUser': self._auth_user,
|
'authUser': self._auth_user,
|
||||||
'NewAuthUser': self._new_auth_user,
|
'newAuthUser': self._new_auth_user,
|
||||||
'ChangePassword': self._change_password
|
'changePassword': self._change_password
|
||||||
}
|
}
|
||||||
|
@ -15,13 +15,13 @@ class VersionDTO(DtoABC):
|
|||||||
self._micro = micro
|
self._micro = micro
|
||||||
|
|
||||||
def from_dict(self, values: dict):
|
def from_dict(self, values: dict):
|
||||||
self._major = values['Major']
|
self._major = values['major']
|
||||||
self._minor = values['Minor']
|
self._minor = values['minor']
|
||||||
self._micro = values['Micro']
|
self._micro = values['micro']
|
||||||
|
|
||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'Major': self._major,
|
'major': self._major,
|
||||||
'Minor': self._minor,
|
'minor': self._minor,
|
||||||
'Micro': self._micro,
|
'micro': self._micro,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user