|
@@ -119,123 +119,15 @@ class NotificationDTO {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-class NameItemSettingInfoDTO {
|
|
|
- String? name;
|
|
|
- String? key;
|
|
|
-
|
|
|
- NameItemSettingInfoDTO({
|
|
|
- this.name,
|
|
|
- this.key,
|
|
|
- });
|
|
|
-
|
|
|
- factory NameItemSettingInfoDTO.fromJson(Map<String, dynamic> map) {
|
|
|
- return NameItemSettingInfoDTO(
|
|
|
- name: map['Name'],
|
|
|
- key: map['Key'],
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, dynamic> toJson() {
|
|
|
- final map = Map<String, dynamic>();
|
|
|
- if(name != null)
|
|
|
- map['Name'] = name;
|
|
|
- if(key != null)
|
|
|
- map['Key'] = key;
|
|
|
- return map;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class GroupSettingInfoDTO extends NameItemSettingInfoDTO{
|
|
|
- List<NameItemSettingInfoDTO >? items;
|
|
|
-
|
|
|
- GroupSettingInfoDTO({
|
|
|
- this.items,
|
|
|
- String? name,
|
|
|
- String? key,
|
|
|
- }) : super(
|
|
|
- name: name,
|
|
|
- key: key,
|
|
|
- );
|
|
|
-
|
|
|
- factory GroupSettingInfoDTO.fromJson(Map<String, dynamic> map) {
|
|
|
- return GroupSettingInfoDTO(
|
|
|
- items: map['Items'] != null ? (map['Items'] as List).map((e)=>NameItemSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
- name: map['Name'],
|
|
|
- key: map['Key'],
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, dynamic> toJson() {
|
|
|
- final map = super.toJson();
|
|
|
- if(items != null)
|
|
|
- map['Items'] = items;
|
|
|
- return map;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class ListPageSettingInfoDTO extends NameItemSettingInfoDTO{
|
|
|
- List<GroupSettingInfoDTO >? groups;
|
|
|
-
|
|
|
- ListPageSettingInfoDTO({
|
|
|
- this.groups,
|
|
|
- String? name,
|
|
|
- String? key,
|
|
|
- }) : super(
|
|
|
- name: name,
|
|
|
- key: key,
|
|
|
- );
|
|
|
-
|
|
|
- factory ListPageSettingInfoDTO.fromJson(Map<String, dynamic> map) {
|
|
|
- return ListPageSettingInfoDTO(
|
|
|
- groups: map['Groups'] != null ? (map['Groups'] as List).map((e)=>GroupSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
- name: map['Name'],
|
|
|
- key: map['Key'],
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, dynamic> toJson() {
|
|
|
- final map = super.toJson();
|
|
|
- if(groups != null)
|
|
|
- map['Groups'] = groups;
|
|
|
- return map;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class SystemSettingInfoDTO {
|
|
|
- List<ListPageSettingInfoDTO >? listPages;
|
|
|
- String? applyLicenseResult;
|
|
|
-
|
|
|
- SystemSettingInfoDTO({
|
|
|
- this.listPages,
|
|
|
- this.applyLicenseResult,
|
|
|
- });
|
|
|
-
|
|
|
- factory SystemSettingInfoDTO.fromJson(Map<String, dynamic> map) {
|
|
|
- return SystemSettingInfoDTO(
|
|
|
- listPages: map['ListPages'] != null ? (map['ListPages'] as List).map((e)=>ListPageSettingInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
- applyLicenseResult: map['ApplyLicenseResult'],
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, dynamic> toJson() {
|
|
|
- final map = Map<String, dynamic>();
|
|
|
- if(listPages != null)
|
|
|
- map['ListPages'] = listPages;
|
|
|
- if(applyLicenseResult != null)
|
|
|
- map['ApplyLicenseResult'] = applyLicenseResult;
|
|
|
- return map;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
class SendCommandToDeviceNotification extends NotificationDTO{
|
|
|
String? actionType;
|
|
|
- SystemSettingInfoDTO? settings;
|
|
|
+ String? resultCode;
|
|
|
String? sender;
|
|
|
|
|
|
SendCommandToDeviceNotification({
|
|
|
NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
|
|
|
this.actionType,
|
|
|
- this.settings,
|
|
|
+ this.resultCode,
|
|
|
this.sender,
|
|
|
String? code,
|
|
|
bool isResponse = false,
|
|
@@ -249,7 +141,7 @@ class SendCommandToDeviceNotification extends NotificationDTO{
|
|
|
return SendCommandToDeviceNotification(
|
|
|
notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
|
|
|
actionType: map['ActionType'],
|
|
|
- settings: map['Settings'] != null ? SystemSettingInfoDTO.fromJson(map['Settings']) : null,
|
|
|
+ resultCode: map['ResultCode'],
|
|
|
sender: map['Sender'],
|
|
|
code: map['Code'],
|
|
|
isResponse: map['IsResponse'],
|
|
@@ -260,8 +152,8 @@ class SendCommandToDeviceNotification extends NotificationDTO{
|
|
|
final map = super.toJson();
|
|
|
if(actionType != null)
|
|
|
map['ActionType'] = actionType;
|
|
|
- if(settings != null)
|
|
|
- map['Settings'] = settings;
|
|
|
+ if(resultCode != null)
|
|
|
+ map['ResultCode'] = resultCode;
|
|
|
if(sender != null)
|
|
|
map['Sender'] = sender;
|
|
|
return map;
|
|
@@ -269,12 +161,12 @@ class SendCommandToDeviceNotification extends NotificationDTO{
|
|
|
}
|
|
|
|
|
|
class SendResultToClientNotification extends NotificationDTO{
|
|
|
- SystemSettingInfoDTO? settings;
|
|
|
+ String? resultCode;
|
|
|
String? sender;
|
|
|
|
|
|
SendResultToClientNotification({
|
|
|
NotificationTypeEnum notificationType = NotificationTypeEnum.Unknown,
|
|
|
- this.settings,
|
|
|
+ this.resultCode,
|
|
|
this.sender,
|
|
|
String? code,
|
|
|
bool isResponse = false,
|
|
@@ -287,7 +179,7 @@ class SendResultToClientNotification extends NotificationDTO{
|
|
|
factory SendResultToClientNotification.fromJson(Map<String, dynamic> map) {
|
|
|
return SendResultToClientNotification(
|
|
|
notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
|
|
|
- settings: map['Settings'] != null ? SystemSettingInfoDTO.fromJson(map['Settings']) : null,
|
|
|
+ resultCode: map['ResultCode'],
|
|
|
sender: map['Sender'],
|
|
|
code: map['Code'],
|
|
|
isResponse: map['IsResponse'],
|
|
@@ -296,8 +188,8 @@ class SendResultToClientNotification extends NotificationDTO{
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
final map = super.toJson();
|
|
|
- if(settings != null)
|
|
|
- map['Settings'] = settings;
|
|
|
+ if(resultCode != null)
|
|
|
+ map['ResultCode'] = resultCode;
|
|
|
if(sender != null)
|
|
|
map['Sender'] = sender;
|
|
|
return map;
|