|
@@ -1,3 +1,7 @@
|
|
|
+import 'authentication.m.dart';
|
|
|
+
|
|
|
+import 'package:fis_jsonrpc/utils.dart';
|
|
|
+
|
|
|
class ConnectResult {
|
|
|
String? token;
|
|
|
String? uniqueCode;
|
|
@@ -100,4 +104,228 @@ class ConnectRequest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class BaseDTO {
|
|
|
+ DateTime? createTime;
|
|
|
+ DateTime? updateTime;
|
|
|
+
|
|
|
+ BaseDTO({
|
|
|
+ this.createTime,
|
|
|
+ this.updateTime,
|
|
|
+ });
|
|
|
+
|
|
|
+ factory BaseDTO.fromJson(Map<String, dynamic> map) {
|
|
|
+ return BaseDTO(
|
|
|
+ createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
+ updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = Map<String, dynamic>();
|
|
|
+ if(createTime != null)
|
|
|
+ map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
|
|
|
+ if(updateTime != null)
|
|
|
+ map['UpdateTime'] = JsonRpcUtils.dateFormat(updateTime!);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class DeviceInfoDTO extends BaseDTO{
|
|
|
+ String? deviceCode;
|
|
|
+ String? serialNumber;
|
|
|
+ String? password;
|
|
|
+ String? name;
|
|
|
+ String? description;
|
|
|
+ String? deviceModel;
|
|
|
+ String? deviceType;
|
|
|
+ String? headPicUrl;
|
|
|
+ String? deviceSoftwareVersion;
|
|
|
+ String? sDKSoftwareVersion;
|
|
|
+ String? organizationCode;
|
|
|
+ String? departmentCode;
|
|
|
+ String? shortCode;
|
|
|
+ bool isAutoShared;
|
|
|
+ DateTime? lastLoginTime;
|
|
|
+ String? systemVersion;
|
|
|
+ String? cPUModel;
|
|
|
+ String? systemLanguage;
|
|
|
+
|
|
|
+ DeviceInfoDTO({
|
|
|
+ this.deviceCode,
|
|
|
+ this.serialNumber,
|
|
|
+ this.password,
|
|
|
+ this.name,
|
|
|
+ this.description,
|
|
|
+ this.deviceModel,
|
|
|
+ this.deviceType,
|
|
|
+ this.headPicUrl,
|
|
|
+ this.deviceSoftwareVersion,
|
|
|
+ this.sDKSoftwareVersion,
|
|
|
+ this.organizationCode,
|
|
|
+ this.departmentCode,
|
|
|
+ this.shortCode,
|
|
|
+ this.isAutoShared = false,
|
|
|
+ this.lastLoginTime,
|
|
|
+ this.systemVersion,
|
|
|
+ this.cPUModel,
|
|
|
+ this.systemLanguage,
|
|
|
+ DateTime? createTime,
|
|
|
+ DateTime? updateTime,
|
|
|
+ }) : super(
|
|
|
+ createTime: createTime,
|
|
|
+ updateTime: updateTime,
|
|
|
+ );
|
|
|
+
|
|
|
+ factory DeviceInfoDTO.fromJson(Map<String, dynamic> map) {
|
|
|
+ return DeviceInfoDTO(
|
|
|
+ deviceCode: map['DeviceCode'],
|
|
|
+ serialNumber: map['SerialNumber'],
|
|
|
+ password: map['Password'],
|
|
|
+ name: map['Name'],
|
|
|
+ description: map['Description'],
|
|
|
+ deviceModel: map['DeviceModel'],
|
|
|
+ deviceType: map['DeviceType'],
|
|
|
+ headPicUrl: map['HeadPicUrl'],
|
|
|
+ deviceSoftwareVersion: map['DeviceSoftwareVersion'],
|
|
|
+ sDKSoftwareVersion: map['SDKSoftwareVersion'],
|
|
|
+ organizationCode: map['OrganizationCode'],
|
|
|
+ departmentCode: map['DepartmentCode'],
|
|
|
+ shortCode: map['ShortCode'],
|
|
|
+ isAutoShared: map['IsAutoShared'],
|
|
|
+ lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
|
|
|
+ systemVersion: map['SystemVersion'],
|
|
|
+ cPUModel: map['CPUModel'],
|
|
|
+ systemLanguage: map['SystemLanguage'],
|
|
|
+ createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
+ updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = super.toJson();
|
|
|
+ if(deviceCode != null)
|
|
|
+ map['DeviceCode'] = deviceCode;
|
|
|
+ if(serialNumber != null)
|
|
|
+ map['SerialNumber'] = serialNumber;
|
|
|
+ if(password != null)
|
|
|
+ map['Password'] = password;
|
|
|
+ if(name != null)
|
|
|
+ map['Name'] = name;
|
|
|
+ if(description != null)
|
|
|
+ map['Description'] = description;
|
|
|
+ if(deviceModel != null)
|
|
|
+ map['DeviceModel'] = deviceModel;
|
|
|
+ if(deviceType != null)
|
|
|
+ map['DeviceType'] = deviceType;
|
|
|
+ if(headPicUrl != null)
|
|
|
+ map['HeadPicUrl'] = headPicUrl;
|
|
|
+ if(deviceSoftwareVersion != null)
|
|
|
+ map['DeviceSoftwareVersion'] = deviceSoftwareVersion;
|
|
|
+ if(sDKSoftwareVersion != null)
|
|
|
+ map['SDKSoftwareVersion'] = sDKSoftwareVersion;
|
|
|
+ if(organizationCode != null)
|
|
|
+ map['OrganizationCode'] = organizationCode;
|
|
|
+ if(departmentCode != null)
|
|
|
+ map['DepartmentCode'] = departmentCode;
|
|
|
+ if(shortCode != null)
|
|
|
+ map['ShortCode'] = shortCode;
|
|
|
+ map['IsAutoShared'] = isAutoShared;
|
|
|
+ if(lastLoginTime != null)
|
|
|
+ map['LastLoginTime'] = JsonRpcUtils.dateFormat(lastLoginTime!);
|
|
|
+ if(systemVersion != null)
|
|
|
+ map['SystemVersion'] = systemVersion;
|
|
|
+ if(cPUModel != null)
|
|
|
+ map['CPUModel'] = cPUModel;
|
|
|
+ if(systemLanguage != null)
|
|
|
+ map['SystemLanguage'] = systemLanguage;
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class CacheDeviceDTO extends DeviceInfoDTO{
|
|
|
+ bool isOnline;
|
|
|
+ String? sourceUrl;
|
|
|
+
|
|
|
+ CacheDeviceDTO({
|
|
|
+ this.isOnline = false,
|
|
|
+ this.sourceUrl,
|
|
|
+ String? deviceCode,
|
|
|
+ String? serialNumber,
|
|
|
+ String? password,
|
|
|
+ String? name,
|
|
|
+ String? description,
|
|
|
+ String? deviceModel,
|
|
|
+ String? deviceType,
|
|
|
+ String? headPicUrl,
|
|
|
+ String? deviceSoftwareVersion,
|
|
|
+ String? sDKSoftwareVersion,
|
|
|
+ String? organizationCode,
|
|
|
+ String? departmentCode,
|
|
|
+ String? shortCode,
|
|
|
+ bool isAutoShared = false,
|
|
|
+ DateTime? lastLoginTime,
|
|
|
+ String? systemVersion,
|
|
|
+ String? cPUModel,
|
|
|
+ String? systemLanguage,
|
|
|
+ DateTime? createTime,
|
|
|
+ DateTime? updateTime,
|
|
|
+ }) : super(
|
|
|
+ deviceCode: deviceCode,
|
|
|
+ serialNumber: serialNumber,
|
|
|
+ password: password,
|
|
|
+ name: name,
|
|
|
+ description: description,
|
|
|
+ deviceModel: deviceModel,
|
|
|
+ deviceType: deviceType,
|
|
|
+ headPicUrl: headPicUrl,
|
|
|
+ deviceSoftwareVersion: deviceSoftwareVersion,
|
|
|
+ sDKSoftwareVersion: sDKSoftwareVersion,
|
|
|
+ organizationCode: organizationCode,
|
|
|
+ departmentCode: departmentCode,
|
|
|
+ shortCode: shortCode,
|
|
|
+ isAutoShared: isAutoShared,
|
|
|
+ lastLoginTime: lastLoginTime,
|
|
|
+ systemVersion: systemVersion,
|
|
|
+ cPUModel: cPUModel,
|
|
|
+ systemLanguage: systemLanguage,
|
|
|
+ createTime: createTime,
|
|
|
+ updateTime: updateTime,
|
|
|
+ );
|
|
|
+
|
|
|
+ factory CacheDeviceDTO.fromJson(Map<String, dynamic> map) {
|
|
|
+ return CacheDeviceDTO(
|
|
|
+ isOnline: map['IsOnline'],
|
|
|
+ sourceUrl: map['SourceUrl'],
|
|
|
+ deviceCode: map['DeviceCode'],
|
|
|
+ serialNumber: map['SerialNumber'],
|
|
|
+ password: map['Password'],
|
|
|
+ name: map['Name'],
|
|
|
+ description: map['Description'],
|
|
|
+ deviceModel: map['DeviceModel'],
|
|
|
+ deviceType: map['DeviceType'],
|
|
|
+ headPicUrl: map['HeadPicUrl'],
|
|
|
+ deviceSoftwareVersion: map['DeviceSoftwareVersion'],
|
|
|
+ sDKSoftwareVersion: map['SDKSoftwareVersion'],
|
|
|
+ organizationCode: map['OrganizationCode'],
|
|
|
+ departmentCode: map['DepartmentCode'],
|
|
|
+ shortCode: map['ShortCode'],
|
|
|
+ isAutoShared: map['IsAutoShared'],
|
|
|
+ lastLoginTime: map['LastLoginTime'] != null ? DateTime.parse(map['LastLoginTime']) : null,
|
|
|
+ systemVersion: map['SystemVersion'],
|
|
|
+ cPUModel: map['CPUModel'],
|
|
|
+ systemLanguage: map['SystemLanguage'],
|
|
|
+ createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
+ updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = super.toJson();
|
|
|
+ map['IsOnline'] = isOnline;
|
|
|
+ if(sourceUrl != null)
|
|
|
+ map['SourceUrl'] = sourceUrl;
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|