import 'package:deus_app/model/equipment_list_entity.dart'; equipmentListEntityFromJson(EquipmentListEntity data, Map json) { if (json['code'] != null) { data.code = json['code'] is String ? int.tryParse(json['code']) : json['code'].toInt(); } if (json['data'] != null) { data.data = EquipmentListData().fromJson(json['data']); } if (json['msg'] != null) { data.msg = json['msg'].toString(); } return data; } Map equipmentListEntityToJson(EquipmentListEntity entity) { final Map data = new Map(); data['code'] = entity.code; data['data'] = entity.data.toJson(); data['msg'] = entity.msg; return data; } equipmentListDataFromJson(EquipmentListData data, Map json) { if (json['total'] != null) { data.total = json['total'] is String ? int.tryParse(json['total']) : json['total'].toInt(); } if (json['index'] != null) { data.index = json['index'] is String ? int.tryParse(json['index']) : json['index'].toInt(); } if (json['size'] != null) { data.size = json['size'] is String ? int.tryParse(json['size']) : json['size'].toInt(); } if (json['sortBy'] != null) { data.sortBy = json['sortBy']; } if (json['sort'] != null) { data.sort = json['sort']; } if (json['query'] != null) { data.query = json['query']; } if (json['equipmentVOS'] != null) { data.equipmentVOS = (json['equipmentVOS'] as List).map((v) => EquipmentListDataEquipmentVOS().fromJson(v)).toList(); } if (json['countDTO'] != null) { data.countDTO = EquipmentListDataCountDTO().fromJson(json['countDTO']); } return data; } Map equipmentListDataToJson(EquipmentListData entity) { final Map data = new Map(); data['total'] = entity.total; data['index'] = entity.index; data['size'] = entity.size; data['sortBy'] = entity.sortBy; data['sort'] = entity.sort; data['query'] = entity.query; data['equipmentVOS'] = entity.equipmentVOS.map((v) => v.toJson()).toList(); data['countDTO'] = entity.countDTO.toJson(); return data; } equipmentListDataEquipmentVOSFromJson(EquipmentListDataEquipmentVOS data, Map json) { if (json['id'] != null) { data.id = json['id'] is String ? int.tryParse(json['id']) : json['id'].toInt(); } if (json['name'] != null) { data.name = json['name'].toString(); } if (json['showName'] != null) { data.showName = json['showName'].toString(); } if (json['deviceKey'] != null) { data.deviceKey = json['deviceKey'].toString(); } if (json['authType'] != null) { data.authType = json['authType'] is String ? int.tryParse(json['authType']) : json['authType'].toInt(); } if (json['isEnable'] != null) { data.isEnable = json['isEnable'] is String ? int.tryParse(json['isEnable']) : json['isEnable'].toInt(); } if (json['isActive'] != null) { data.isActive = json['isActive']; } if (json['deviceSecret'] != null) { data.deviceSecret = json['deviceSecret'].toString(); } if (json['deviceId'] != null) { data.deviceId = json['deviceId'].toString(); } if (json['productName'] != null) { data.productName = json['productName'].toString(); } if (json['productKey'] != null) { data.productKey = json['productKey'].toString(); } if (json['productId'] != null) { data.productId = json['productId'] is String ? int.tryParse(json['productId']) : json['productId'].toInt(); } if (json['status'] != null) { data.status = json['status'] is String ? int.tryParse(json['status']) : json['status'].toInt(); } if (json['nodeType'] != null) { data.nodeType = json['nodeType'] is String ? int.tryParse(json['nodeType']) : json['nodeType'].toInt(); } if (json['connectionProtocol'] != null) { data.connectionProtocol = json['connectionProtocol']; } if (json['ip'] != null) { data.ip = json['ip']; } if (json['lastUpdateOn'] != null) { data.lastUpdateOn = json['lastUpdateOn']; } if (json['activationOn'] != null) { data.activationOn = json['activationOn']; } if (json['positionId'] != null) { data.positionId = json['positionId']; } if (json['number'] != null) { data.number = json['number']; } if (json['speedA'] != null) { data.speedA = json['speedA'].toString(); } if (json['speedB'] != null) { data.speedB = json['speedB'].toString(); } if (json['finenessA'] != null) { data.finenessA = json['finenessA'].toString(); } if (json['finenessB'] != null) { data.finenessB = json['finenessB'].toString(); } if (json['holeCountA'] != null) { data.holeCountA = json['holeCountA'].toString(); } if (json['holeCountB'] != null) { data.holeCountB = json['holeCountB'].toString(); } if (json['activePeriod'] != null) { data.activePeriod = json['activePeriod']; } if (json['createdOn'] != null) { data.createdOn = json['createdOn'].toString(); } if (json['lastOnlineOn'] != null) { data.lastOnlineOn = json['lastOnlineOn']; } if (json['iotId'] != null) { data.iotId = json['iotId'].toString(); } if (json['description'] != null) { data.description = json['description'].toString(); } if (json['customerId'] != null) { data.customerId = json['customerId'].toString(); } if (json['channelId'] != null) { data.channelId = json['channelId']; } if (json['imei'] != null) { data.imei = json['imei']; } return data; } Map equipmentListDataEquipmentVOSToJson(EquipmentListDataEquipmentVOS entity) { final Map data = new Map(); data['id'] = entity.id; data['name'] = entity.name; data['showName'] = entity.showName; data['deviceKey'] = entity.deviceKey; data['authType'] = entity.authType; data['isEnable'] = entity.isEnable; data['isActive'] = entity.isActive; data['deviceSecret'] = entity.deviceSecret; data['deviceId'] = entity.deviceId; data['productName'] = entity.productName; data['productKey'] = entity.productKey; data['productId'] = entity.productId; data['status'] = entity.status; data['nodeType'] = entity.nodeType; data['connectionProtocol'] = entity.connectionProtocol; data['ip'] = entity.ip; data['lastUpdateOn'] = entity.lastUpdateOn; data['activationOn'] = entity.activationOn; data['positionId'] = entity.positionId; data['number'] = entity.number; data['speedA'] = entity.speedA; data['speedB'] = entity.speedB; data['finenessA'] = entity.finenessA; data['finenessB'] = entity.finenessB; data['holeCountA'] = entity.holeCountA; data['holeCountB'] = entity.holeCountB; data['activePeriod'] = entity.activePeriod; data['createdOn'] = entity.createdOn; data['lastOnlineOn'] = entity.lastOnlineOn; data['iotId'] = entity.iotId; data['description'] = entity.description; data['customerId'] = entity.customerId; data['channelId'] = entity.channelId; data['imei'] = entity.imei; return data; } equipmentListDataCountDTOFromJson(EquipmentListDataCountDTO data, Map json) { if (json['count'] != null) { data.count = json['count'] is String ? int.tryParse(json['count']) : json['count'].toInt(); } if (json['active'] != null) { data.active = json['active'] is String ? int.tryParse(json['active']) : json['active'].toInt(); } if (json['online'] != null) { data.online = json['online'] is String ? int.tryParse(json['online']) : json['online'].toInt(); } if (json['offline'] != null) { data.offline = json['offline'] is String ? int.tryParse(json['offline']) : json['offline'].toInt(); } return data; } Map equipmentListDataCountDTOToJson(EquipmentListDataCountDTO entity) { final Map data = new Map(); data['count'] = entity.count; data['active'] = entity.active; data['online'] = entity.online; data['offline'] = entity.offline; return data; }