207 lines
5.1 KiB
Dart
Executable File

class KeyListByUserEntity {
KeyListByUserEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
KeyListByUserEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data =
json['data'] != null ? KeyListByUserData.fromJson(json['data']) : null;
}
int? errorCode;
String? description;
String? errorMsg;
KeyListByUserData? data;
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 KeyListByUserData {
KeyListByUserData(
{this.keyList, this.pageNo, this.pageSize, this.pages, this.total});
KeyListByUserData.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
keyList = <KeyListItem>[];
json['list'].forEach((v) {
keyList!.add(KeyListItem.fromJson(v));
});
}
pageNo = json['pageNo'];
pageSize = json['pageSize'];
pages = json['pages'];
total = json['total'];
}
List<KeyListItem>? keyList;
int? pageNo;
int? pageSize;
int? pages;
int? total;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (keyList != null) {
data['list'] = keyList!.map((v) => v.toJson()).toList();
}
data['pageNo'] = pageNo;
data['pageSize'] = pageSize;
data['pages'] = pages;
data['total'] = total;
return data;
}
}
class KeyListItem {
KeyListItem(
{this.clientId,
this.lockOwnerId,
this.lockId,
this.senderUserId,
this.keyName,
this.keyType,
this.startDate,
this.endDate,
this.weekDays,
this.remarks,
this.remoteEnable,
this.isCameraEnable,
this.faceAuthentication,
this.keyRight,
this.userType,
this.keyStatus,
this.groupId,
this.lockUserNo,
this.date,
this.createdAt,
this.updatedAt,
this.userInfo,
this.keyId,
this.uid,
this.lockAlias});
KeyListItem.fromJson(Map<String, dynamic> json) {
clientId = json['clientId'];
lockOwnerId = json['lockOwnerId'];
lockId = json['lockId'];
senderUserId = json['senderUserId'];
keyName = json['keyName'];
keyType = json['keyType'];
startDate = json['startDate'];
endDate = json['endDate'];
if (json['weekDays'] != null) {
weekDays = [];
json['weekDays'].forEach((v) {
weekDays!.add(v);
});
}
remarks = json['remarks'];
remoteEnable = json['remoteEnable'];
isCameraEnable = json['isCameraEnable'];
faceAuthentication = json['faceAuthentication'];
keyRight = json['keyRight'];
userType = json['userType'];
keyStatus = json['keyStatus'];
groupId = json['groupId'];
lockUserNo = json['lockUserNo'];
date = json['date'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
userInfo =
json['user_info'] != null ? UserInfo.fromJson(json['user_info']) : null;
keyId = json['keyId'];
uid = json['uid'];
lockAlias = json['lockAlias'];
}
String? clientId;
int? lockOwnerId;
int? lockId;
int? senderUserId;
String? keyName;
int? keyType;
int? startDate;
int? endDate;
List? weekDays;
String? remarks;
int? remoteEnable;
int? isCameraEnable;
int? faceAuthentication;
int? keyRight;
int? userType;
int? keyStatus;
int? groupId;
int? lockUserNo;
int? date;
String? createdAt;
String? updatedAt;
UserInfo? userInfo;
int? keyId;
int? uid;
String? lockAlias;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['clientId'] = clientId;
data['lockOwnerId'] = lockOwnerId;
data['lockId'] = lockId;
data['senderUserId'] = senderUserId;
data['keyName'] = keyName;
data['keyType'] = keyType;
data['startDate'] = startDate;
data['endDate'] = endDate;
if (weekDays != null) {
data['weekDays'] = weekDays!.map((v) => v.toJson()).toList();
}
data['remarks'] = remarks;
data['remoteEnable'] = remoteEnable;
data['isCameraEnable'] = isCameraEnable;
data['faceAuthentication'] = faceAuthentication;
data['keyRight'] = keyRight;
data['userType'] = userType;
data['keyStatus'] = keyStatus;
data['groupId'] = groupId;
data['lockUserNo'] = lockUserNo;
data['date'] = date;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
if (userInfo != null) {
data['user_info'] = userInfo!.toJson();
}
data['keyId'] = keyId;
data['uid'] = uid;
data['lockAlias'] = lockAlias;
return data;
}
}
class UserInfo {
UserInfo({this.id, this.accountName});
UserInfo.fromJson(Map<String, dynamic> json) {
id = json['id'];
accountName = json['account_name'];
}
int? id;
String? accountName;
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['account_name'] = accountName;
return data;
}
}