import 'aIDiagnosis.m.dart'; import 'connect.m.dart'; import 'authentication.m.dart'; import 'package:fis_common/json_convert.dart'; class UploadDeviceDTO extends BaseDTO{ String? serialNumber; String? deviceModel; String? deviceType; String? deviceSoftwareVersion; String? sDKSoftwareVersion; UploadDeviceDTO({ this.serialNumber, this.deviceModel, this.deviceType, this.deviceSoftwareVersion, this.sDKSoftwareVersion, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory UploadDeviceDTO.fromJson(Map map) { return UploadDeviceDTO( serialNumber: map['SerialNumber'], deviceModel: map['DeviceModel'], deviceType: map['DeviceType'], deviceSoftwareVersion: map['DeviceSoftwareVersion'], sDKSoftwareVersion: map['SDKSoftwareVersion'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if(serialNumber != null) map['SerialNumber'] = serialNumber; if(deviceModel != null) map['DeviceModel'] = deviceModel; if(deviceType != null) map['DeviceType'] = deviceType; if(deviceSoftwareVersion != null) map['DeviceSoftwareVersion'] = deviceSoftwareVersion; if(sDKSoftwareVersion != null) map['SDKSoftwareVersion'] = sDKSoftwareVersion; return map; } } class CreateDeviceRequest extends UploadDeviceDTO{ CreateDeviceRequest({ String? serialNumber, String? deviceModel, String? deviceType, String? deviceSoftwareVersion, String? sDKSoftwareVersion, DateTime? createTime, DateTime? updateTime, }) : super( serialNumber: serialNumber, deviceModel: deviceModel, deviceType: deviceType, deviceSoftwareVersion: deviceSoftwareVersion, sDKSoftwareVersion: sDKSoftwareVersion, createTime: createTime, updateTime: updateTime, ); factory CreateDeviceRequest.fromJson(Map map) { return CreateDeviceRequest( serialNumber: map['SerialNumber'], deviceModel: map['DeviceModel'], deviceType: map['DeviceType'], deviceSoftwareVersion: map['DeviceSoftwareVersion'], sDKSoftwareVersion: map['SDKSoftwareVersion'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); return map; } } class DeviceExtendInfoDTO extends DeviceInfoDTO{ String? organizationName; String? departmentName; bool isOnline; String? organizationDirectorCode; String? organizationDirectorUserName; String? organizationDirectorFullName; DeviceExtendInfoDTO({ this.organizationName, this.departmentName, this.isOnline = false, this.organizationDirectorCode, this.organizationDirectorUserName, this.organizationDirectorFullName, 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 DeviceExtendInfoDTO.fromJson(Map map) { return DeviceExtendInfoDTO( organizationName: map['OrganizationName'], departmentName: map['DepartmentName'], isOnline: map['IsOnline'], organizationDirectorCode: map['OrganizationDirectorCode'], organizationDirectorUserName: map['OrganizationDirectorUserName'], organizationDirectorFullName: map['OrganizationDirectorFullName'], 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 toJson() { final map = super.toJson(); if(organizationName != null) map['OrganizationName'] = organizationName; if(departmentName != null) map['DepartmentName'] = departmentName; map['IsOnline'] = isOnline; if(organizationDirectorCode != null) map['OrganizationDirectorCode'] = organizationDirectorCode; if(organizationDirectorUserName != null) map['OrganizationDirectorUserName'] = organizationDirectorUserName; if(organizationDirectorFullName != null) map['OrganizationDirectorFullName'] = organizationDirectorFullName; return map; } } class GetDeviceRequest extends TokenRequest{ String? deviceCode; GetDeviceRequest({ this.deviceCode, String? token, }) : super( token: token, ); factory GetDeviceRequest.fromJson(Map map) { return GetDeviceRequest( deviceCode: map['DeviceCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class GetDeviceByShortCodeRequest extends TokenRequest{ String? shortCode; GetDeviceByShortCodeRequest({ this.shortCode, String? token, }) : super( token: token, ); factory GetDeviceByShortCodeRequest.fromJson(Map map) { return GetDeviceByShortCodeRequest( shortCode: map['ShortCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(shortCode != null) map['ShortCode'] = shortCode; return map; } } class PageCollection { int currentPage; int pageSize; int dataCount; List? pageData; PageCollection({ this.currentPage = 0, this.pageSize = 0, this.dataCount = 0, this.pageData, }); factory PageCollection.fromJson(Map map) { List pageDataList = []; if (map['PageData'] != null) { pageDataList.addAll( (map['PageData'] as List).map((e) => FJsonConvert.fromJson(e)!)); } return PageCollection( currentPage: map['CurrentPage'], pageSize: map['PageSize'], dataCount: map['DataCount'], pageData: pageDataList, ); } Map toJson() { final map = Map(); map['CurrentPage'] = currentPage; map['PageSize'] = pageSize; map['DataCount'] = dataCount; if(pageData != null) map['PageData'] = pageData; return map; } } class PageFilterRequest extends BaseRequest{ int currentPage; int pageSize; Map? filter; bool isFuzzy; PageFilterRequest({ this.currentPage = 0, this.pageSize = 0, this.filter, this.isFuzzy = false, }) : super( ); factory PageFilterRequest.fromJson(Map map) { return PageFilterRequest( currentPage: map['CurrentPage'], pageSize: map['PageSize'], filter: map['Filter'] != null ? map['Filter'].cast() : null, isFuzzy: map['IsFuzzy'], ); } Map toJson() { final map = super.toJson(); map['CurrentPage'] = currentPage; map['PageSize'] = pageSize; if(filter != null) map['Filter'] = filter; map['IsFuzzy'] = isFuzzy; return map; } } class BindDeviceRequest extends TokenRequest{ String? serialNumber; String? name; String? description; String? headPicUrl; String? organizationCode; String? departmentCode; String? shortCode; bool isAutoShared; BindDeviceRequest({ this.serialNumber, this.name, this.description, this.headPicUrl, this.organizationCode, this.departmentCode, this.shortCode, this.isAutoShared = false, String? token, }) : super( token: token, ); factory BindDeviceRequest.fromJson(Map map) { return BindDeviceRequest( serialNumber: map['SerialNumber'], name: map['Name'], description: map['Description'], headPicUrl: map['HeadPicUrl'], organizationCode: map['OrganizationCode'], departmentCode: map['DepartmentCode'], shortCode: map['ShortCode'], isAutoShared: map['IsAutoShared'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(serialNumber != null) map['SerialNumber'] = serialNumber; if(name != null) map['Name'] = name; if(description != null) map['Description'] = description; if(headPicUrl != null) map['HeadPicUrl'] = headPicUrl; if(organizationCode != null) map['OrganizationCode'] = organizationCode; if(departmentCode != null) map['DepartmentCode'] = departmentCode; if(shortCode != null) map['ShortCode'] = shortCode; map['IsAutoShared'] = isAutoShared; return map; } } class ModifyDeviceRequest extends TokenRequest{ String? deviceCode; String? name; String? headPicUrl; String? departmentCode; bool isAutoShared; ModifyDeviceRequest({ this.deviceCode, this.name, this.headPicUrl, this.departmentCode, this.isAutoShared = false, String? token, }) : super( token: token, ); factory ModifyDeviceRequest.fromJson(Map map) { return ModifyDeviceRequest( deviceCode: map['DeviceCode'], name: map['Name'], headPicUrl: map['HeadPicUrl'], departmentCode: map['DepartmentCode'], isAutoShared: map['IsAutoShared'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; if(name != null) map['Name'] = name; if(headPicUrl != null) map['HeadPicUrl'] = headPicUrl; if(departmentCode != null) map['DepartmentCode'] = departmentCode; map['IsAutoShared'] = isAutoShared; return map; } } enum DictionaryTypeEnum { DeviceModel, DeviceType, } class CreateDictionaryItemRequest extends TokenRequest{ DictionaryTypeEnum dictionaryType; String? dictionaryItemValue; String? parentCode; CreateDictionaryItemRequest({ this.dictionaryType = DictionaryTypeEnum.DeviceModel, this.dictionaryItemValue, this.parentCode, String? token, }) : super( token: token, ); factory CreateDictionaryItemRequest.fromJson(Map map) { return CreateDictionaryItemRequest( dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']), dictionaryItemValue: map['DictionaryItemValue'], parentCode: map['ParentCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); map['DictionaryType'] = dictionaryType.index; if(dictionaryItemValue != null) map['DictionaryItemValue'] = dictionaryItemValue; if(parentCode != null) map['ParentCode'] = parentCode; return map; } } class DictionaryDTO extends BaseDTO{ String? dictionaryCode; DictionaryTypeEnum dictionaryType; String? value; String? parentCode; DictionaryDTO({ this.dictionaryCode, this.dictionaryType = DictionaryTypeEnum.DeviceModel, this.value, this.parentCode, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory DictionaryDTO.fromJson(Map map) { return DictionaryDTO( dictionaryCode: map['DictionaryCode'], dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']), value: map['Value'], parentCode: map['ParentCode'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if(dictionaryCode != null) map['DictionaryCode'] = dictionaryCode; map['DictionaryType'] = dictionaryType.index; if(value != null) map['Value'] = value; if(parentCode != null) map['ParentCode'] = parentCode; return map; } } class FindDeviceModelItemsRequest extends TokenRequest{ DictionaryTypeEnum dictionaryType; String? deviceTypeCode; FindDeviceModelItemsRequest({ this.dictionaryType = DictionaryTypeEnum.DeviceModel, this.deviceTypeCode, String? token, }) : super( token: token, ); factory FindDeviceModelItemsRequest.fromJson(Map map) { return FindDeviceModelItemsRequest( dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']), deviceTypeCode: map['DeviceTypeCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); map['DictionaryType'] = dictionaryType.index; if(deviceTypeCode != null) map['DeviceTypeCode'] = deviceTypeCode; return map; } } class FindDeviceTypeItemsRequest extends TokenRequest{ DictionaryTypeEnum dictionaryType; FindDeviceTypeItemsRequest({ this.dictionaryType = DictionaryTypeEnum.DeviceModel, String? token, }) : super( token: token, ); factory FindDeviceTypeItemsRequest.fromJson(Map map) { return FindDeviceTypeItemsRequest( dictionaryType: DictionaryTypeEnum.values.firstWhere((e) => e.index == map['DictionaryType']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); map['DictionaryType'] = dictionaryType.index; return map; } } class CreateShareDeviceToUserRequest extends TokenRequest{ List? userCodes; String? deviceCode; CreateShareDeviceToUserRequest({ this.userCodes, this.deviceCode, String? token, }) : super( token: token, ); factory CreateShareDeviceToUserRequest.fromJson(Map map) { return CreateShareDeviceToUserRequest( userCodes: map['UserCodes'] != null ? map['UserCodes'].cast().toList() : null, deviceCode: map['DeviceCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userCodes != null) map['UserCodes'] = userCodes; if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class DeleteShareDeviceToUserRequest extends TokenRequest{ List? userCodes; String? deviceCode; DeleteShareDeviceToUserRequest({ this.userCodes, this.deviceCode, String? token, }) : super( token: token, ); factory DeleteShareDeviceToUserRequest.fromJson(Map map) { return DeleteShareDeviceToUserRequest( userCodes: map['UserCodes'] != null ? map['UserCodes'].cast().toList() : null, deviceCode: map['DeviceCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(userCodes != null) map['UserCodes'] = userCodes; if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class RemoveDeviceRelevancyRequest extends TokenRequest{ String? organizationCode; String? departmentCode; String? deviceCode; RemoveDeviceRelevancyRequest({ this.organizationCode, this.departmentCode, this.deviceCode, String? token, }) : super( token: token, ); factory RemoveDeviceRelevancyRequest.fromJson(Map map) { return RemoveDeviceRelevancyRequest( organizationCode: map['OrganizationCode'], departmentCode: map['DepartmentCode'], deviceCode: map['DeviceCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(organizationCode != null) map['OrganizationCode'] = organizationCode; if(departmentCode != null) map['DepartmentCode'] = departmentCode; if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class GetPersonDeviceRequest extends PageRequest{ String? keyWord; String? deviceType; String? deviceModel; bool? isOnline; GetPersonDeviceRequest({ this.keyWord, this.deviceType, this.deviceModel, this.isOnline, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory GetPersonDeviceRequest.fromJson(Map map) { return GetPersonDeviceRequest( keyWord: map['KeyWord'], deviceType: map['DeviceType'], deviceModel: map['DeviceModel'], isOnline: map['IsOnline'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyWord != null) map['KeyWord'] = keyWord; if(deviceType != null) map['DeviceType'] = deviceType; if(deviceModel != null) map['DeviceModel'] = deviceModel; if(isOnline != null) map['IsOnline'] = isOnline; return map; } } class FindDevicesByOrganizationCodeRequest extends TokenRequest{ String? organizationCode; FindDevicesByOrganizationCodeRequest({ this.organizationCode, String? token, }) : super( token: token, ); factory FindDevicesByOrganizationCodeRequest.fromJson(Map map) { return FindDevicesByOrganizationCodeRequest( organizationCode: map['OrganizationCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(organizationCode != null) map['OrganizationCode'] = organizationCode; return map; } } class SelectItemDTO { String? key; String? value; SelectItemDTO({ this.key, this.value, }); factory SelectItemDTO.fromJson(Map map) { return SelectItemDTO( key: map['Key'], value: map['Value'], ); } Map toJson() { final map = Map(); if(key != null) map['Key'] = key; if(value != null) map['Value'] = value; return map; } } class AddDeviceToOrgRequest extends TokenRequest{ String? uniqueCode; AddDeviceToOrgRequest({ this.uniqueCode, String? token, }) : super( token: token, ); factory AddDeviceToOrgRequest.fromJson(Map map) { return AddDeviceToOrgRequest( uniqueCode: map['UniqueCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(uniqueCode != null) map['UniqueCode'] = uniqueCode; return map; } } class DiagnosisModuleDTO extends BaseDTO{ String? diagnosisModuleCode; String? diagnosisModule; bool enabled; DiagnosisModuleDTO({ this.diagnosisModuleCode, this.diagnosisModule, this.enabled = false, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory DiagnosisModuleDTO.fromJson(Map map) { return DiagnosisModuleDTO( diagnosisModuleCode: map['DiagnosisModuleCode'], diagnosisModule: map['DiagnosisModule'], enabled: map['Enabled'], createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if(diagnosisModuleCode != null) map['DiagnosisModuleCode'] = diagnosisModuleCode; if(diagnosisModule != null) map['DiagnosisModule'] = diagnosisModule; map['Enabled'] = enabled; return map; } } class FindDeviceDiagnosisModulesRequest extends TokenRequest{ String? deviceCode; FindDeviceDiagnosisModulesRequest({ this.deviceCode, String? token, }) : super( token: token, ); factory FindDeviceDiagnosisModulesRequest.fromJson(Map map) { return FindDeviceDiagnosisModulesRequest( deviceCode: map['DeviceCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; return map; } } class ModifyDeviceDiagnosisModuleStateRequest extends TokenRequest{ String? deviceCode; String? diagnosisModule; bool enabled; ModifyDeviceDiagnosisModuleStateRequest({ this.deviceCode, this.diagnosisModule, this.enabled = false, String? token, }) : super( token: token, ); factory ModifyDeviceDiagnosisModuleStateRequest.fromJson(Map map) { return ModifyDeviceDiagnosisModuleStateRequest( deviceCode: map['DeviceCode'], diagnosisModule: map['DiagnosisModule'], enabled: map['Enabled'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(deviceCode != null) map['DeviceCode'] = deviceCode; if(diagnosisModule != null) map['DiagnosisModule'] = diagnosisModule; map['Enabled'] = enabled; return map; } }