app-starlock/lib/main/lockMian/entity/lockListInfo_entity.dart
Daisy ba0b9c0fab 1,锁详情页面新增手机需联网字段及标识
2,xhj锁详情页面部分调整
2024-05-31 15:10:57 +08:00

389 lines
10 KiB
Dart
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

class LockListInfoEntity {
int? errorCode;
String? description;
String? errorMsg;
LockListInfoGroupEntity? data;
LockListInfoEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
LockListInfoEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null
? LockListInfoGroupEntity.fromJson(json['data'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class LockListInfoGroupEntity {
List<GroupList>? groupList;
int? pageNo;
int? pageSize;
int? pages;
int? total;
LockListInfoGroupEntity(
{this.groupList, this.pageNo, this.pageSize, this.pages, this.total});
LockListInfoGroupEntity.fromJson(Map<String, dynamic> json) {
if (json['groupList'] != null) {
groupList = <GroupList>[];
json['groupList'].forEach((v) {
groupList!.add(GroupList.fromJson(v));
});
}
pageNo = json['pageNo'];
pageSize = json['pageSize'];
pages = json['pages'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (groupList != null) {
data['groupList'] = groupList!.map((v) => v.toJson()).toList();
}
data['pageNo'] = pageNo;
data['pageSize'] = pageSize;
data['pages'] = pages;
data['total'] = total;
return data;
}
}
class GroupList {
String? groupName;
int? groupId;
List<LockListInfoItemEntity>? lockList;
bool _isChecked = false;
bool get isChecked => _isChecked ?? false;
set isChecked(bool value) => _isChecked = value;
GroupList({this.groupName, this.groupId, this.lockList});
GroupList.fromJson(Map<String, dynamic> json) {
groupName = json['groupName'];
groupId = json['groupId'];
if (json['lockList'] != null) {
lockList = <LockListInfoItemEntity>[];
json['lockList'].forEach((v) {
lockList!.add(LockListInfoItemEntity.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['groupName'] = groupName;
data['groupId'] = groupId;
if (lockList != null) {
data['lockList'] = lockList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class LockListInfoItemEntity {
int? keyId;
int? lockId;
String? lockName;
String? lockAlias;
int? electricQuantity;
String? fwVersion;
String? hwVersion;
int? keyType;
int? passageMode;
int? userType;
int? startDate;
int? endDate;
List? weekDays;
int? remoteEnable;
int? faceAuthentication; //是否实名认证0-未知1-是2-否
int? lastFaceValidateTime;
int? nextFaceValidateTime; //下次人脸认证时间
int? keyRight;
int? keyStatus;
int? isLockOwner;
int? sendDate;
int? lockUserNo;
int? senderUserId;
int? electricQuantityDate;
int? electricQuantityStandby;
int? isOnlyManageSelf;
int? restoreCount;
String? model;
String? vendor;
Bluetooth? bluetooth;
LockFeature? lockFeature;
LockSetting? lockSetting;
int? hasGateway;
int? appUnlockOnline;
String? mac;
LockListInfoItemEntity({
this.keyId,
this.lockId,
this.lockName,
this.lockAlias,
this.electricQuantity,
this.fwVersion,
this.hwVersion,
this.keyType,
this.passageMode,
this.userType,
this.startDate,
this.endDate,
this.weekDays,
this.remoteEnable,
this.faceAuthentication,
this.lastFaceValidateTime,
this.nextFaceValidateTime,
this.keyRight,
this.keyStatus,
this.isLockOwner,
this.bluetooth,
this.lockFeature,
this.lockSetting,
this.sendDate,
this.lockUserNo,
this.electricQuantityDate,
this.electricQuantityStandby,
this.senderUserId,
this.isOnlyManageSelf,
this.restoreCount,
this.model,
this.vendor,
this.hasGateway,
this.appUnlockOnline,
this.mac,
});
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
keyId = json['keyId'];
lockId = json['lockId'];
lockName = json['lockName'];
lockAlias = json['lockAlias'];
electricQuantity = json['electricQuantity'];
fwVersion = json['fwVersion'];
hwVersion = json['hwVersion'];
keyType = json['keyType'];
passageMode = json['passageMode'];
userType = json['userType'];
startDate = json['startDate'];
endDate = json['endDate'];
weekDays = json['weekDays'];
remoteEnable = json['remoteEnable'];
faceAuthentication = json['faceAuthentication'];
lastFaceValidateTime = json['lastFaceValidateTime'];
nextFaceValidateTime = json['nextFaceValidateTime'];
keyRight = json['keyRight'];
keyStatus = json['keyStatus'];
isLockOwner = json['isLockOwner'];
sendDate = json['sendDate'];
lockUserNo = json['lockUserNo'];
senderUserId = json['senderUserId'];
electricQuantityDate = json['electricQuantityDate'];
electricQuantityStandby = json['electricQuantityStandby'];
isOnlyManageSelf = json['isOnlyManageSelf'];
restoreCount = json['restoreCount'];
model = json['model'];
vendor = json['vendor'];
bluetooth = json['bluetooth'] != null
? Bluetooth.fromJson(json['bluetooth'])
: null;
lockFeature = json['lockFeature'] != null
? LockFeature.fromJson(json['lockFeature'])
: null;
lockSetting = json['lockSetting'] != null
? LockSetting.fromJson(json['lockSetting'])
: null;
hasGateway = json['hasGateway'];
appUnlockOnline = json['appUnlockOnline'];
mac = json['mac'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['keyId'] = keyId;
data['lockId'] = lockId;
data['lockName'] = lockName;
data['lockAlias'] = lockAlias;
data['electricQuantity'] = electricQuantity;
data['fwVersion'] = fwVersion;
data['hwVersion'] = hwVersion;
data['keyType'] = keyType;
data['passageMode'] = passageMode;
data['userType'] = userType;
data['startDate'] = startDate;
data['endDate'] = endDate;
data['weekDays'] = weekDays;
data['remoteEnable'] = remoteEnable;
data['faceAuthentication'] = faceAuthentication;
data['lastFaceValidateTime'] = lastFaceValidateTime;
data['nextFaceValidateTime'] = nextFaceValidateTime;
data['keyRight'] = keyRight;
data['keyStatus'] = keyStatus;
data['isLockOwner'] = isLockOwner;
data['sendDate'] = sendDate;
data['lockUserNo'] = lockUserNo;
data['senderUserId'] = senderUserId;
data['electricQuantityDate'] = electricQuantityDate;
data['electricQuantityStandby'] = electricQuantityStandby;
data['isOnlyManageSelf'] = isOnlyManageSelf;
data['restoreCount'] = restoreCount;
data['model'] = model;
data['vendor'] = vendor;
if (bluetooth != null) {
data['bluetooth'] = bluetooth!.toJson();
}
if (lockFeature != null) {
data['lockFeature'] = lockFeature!.toJson();
}
if (lockSetting != null) {
data['lockSetting'] = lockSetting!.toJson();
}
data['hasGateway'] = hasGateway;
data['appUnlockOnline'] = appUnlockOnline;
data['mac'] = mac;
return data;
}
//是否是锁拥有者 也代表是超级管理员
bool isLockOwnerBool() {
return isLockOwner == 1;
}
}
class Bluetooth {
String? bluetoothDeviceId;
String? bluetoothDeviceName;
List<int>? publicKey;
List<int>? privateKey;
List<int>? signKey;
Bluetooth(
{this.bluetoothDeviceId,
this.bluetoothDeviceName,
this.publicKey,
this.privateKey,
this.signKey});
Bluetooth.fromJson(Map<String, dynamic> json) {
bluetoothDeviceId = json['bluetoothDeviceId'];
bluetoothDeviceName = json['bluetoothDeviceName'];
publicKey = json['publicKey'].cast<int>();
privateKey = json['privateKey'].cast<int>();
signKey = json['signKey'].cast<int>();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['bluetoothDeviceId'] = bluetoothDeviceId;
data['bluetoothDeviceName'] = bluetoothDeviceName;
data['publicKey'] = publicKey;
data['privateKey'] = privateKey;
data['signKey'] = signKey;
return data;
}
}
class LockFeature {
int? password;
int? icCard;
int? fingerprint;
int? fingerVein;
int? palmVein;
int? isSupportIris;
int? d3Face;
int? bluetoothRemoteControl;
int? videoIntercom;
int? isSupportCatEye;
int? isSupportBackupBattery;
LockFeature({
this.password,
this.icCard,
this.fingerprint,
this.fingerVein,
this.palmVein,
this.isSupportIris,
this.d3Face,
this.bluetoothRemoteControl,
this.videoIntercom,
this.isSupportCatEye,
this.isSupportBackupBattery,
});
LockFeature.fromJson(Map<String, dynamic> json) {
password = json['password'];
icCard = json['icCard'];
fingerprint = json['fingerprint'];
fingerVein = json['fingerVein'];
palmVein = json['palmVein'];
isSupportIris = json['isSupportIris'];
d3Face = json['d3Face'];
bluetoothRemoteControl = json['bluetoothRemoteControl'];
videoIntercom = json['videoIntercom'];
isSupportCatEye = json['isSupportCatEye'];
isSupportBackupBattery = json['isSupportBackupBattery'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['password'] = password;
data['icCard'] = icCard;
data['fingerprint'] = fingerprint;
data['fingerVein'] = fingerVein;
data['palmVein'] = palmVein;
data['isSupportIris'] = isSupportIris;
data['d3Face'] = d3Face;
data['bluetoothRemoteControl'] = bluetoothRemoteControl;
data['videoIntercom'] = videoIntercom;
data['isSupportCatEye'] = isSupportCatEye;
data['isSupportBackupBattery'] = isSupportBackupBattery;
return data;
}
}
class LockSetting {
int? attendance;
int? appUnlockOnline;
int? remoteUnlock;
LockSetting({
this.attendance,
this.appUnlockOnline,
this.remoteUnlock,
});
LockSetting.fromJson(Map<String, dynamic> json) {
attendance = json['attendance'];
appUnlockOnline = json['appUnlockOnline'];
remoteUnlock = json['remoteUnlock'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['attendance'] = attendance;
data['appUnlockOnline'] = appUnlockOnline;
data['remoteUnlock'] = remoteUnlock;
return data;
}
}