mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 14:47:23 +00:00
54 lines
1.6 KiB
Dart
54 lines
1.6 KiB
Dart
import 'package:syncrow_web/utils/constants/app_enum.dart';
|
|
|
|
class PasswordModel {
|
|
final dynamic passwordId;
|
|
final dynamic invalidTime;
|
|
final dynamic effectiveTime;
|
|
final dynamic passwordCreated;
|
|
final dynamic createdTime;
|
|
final dynamic passwordName; // New field
|
|
final AccessStatus passwordStatus;
|
|
final AccessType passwordType;
|
|
final dynamic deviceUuid;
|
|
|
|
PasswordModel({
|
|
this.passwordId,
|
|
this.invalidTime,
|
|
this.effectiveTime,
|
|
this.passwordCreated,
|
|
this.createdTime,
|
|
this.passwordName, // New field
|
|
required this.passwordStatus,
|
|
required this.passwordType,
|
|
this.deviceUuid,
|
|
});
|
|
|
|
factory PasswordModel.fromJson(Map<String, dynamic> json) {
|
|
return PasswordModel(
|
|
passwordId: json['passwordId'],
|
|
invalidTime: json['invalidTime'],
|
|
effectiveTime: json['effectiveTime'],
|
|
passwordCreated: json['passwordCreated'],
|
|
createdTime: json['createdTime'],
|
|
passwordName: json['passwordName'] ?? 'No name', // New field
|
|
passwordStatus: AccessStatusExtension.fromString(json['passwordStatus']),
|
|
passwordType: AccessTypeExtension.fromString(json['passwordType']),
|
|
deviceUuid: json['deviceUuid'],
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'passwordId': passwordId,
|
|
'invalidTime': invalidTime,
|
|
'effectiveTime': effectiveTime,
|
|
'passwordCreated': passwordCreated,
|
|
'createdTime': createdTime,
|
|
'passwodName': passwordName, // New field
|
|
'passwordStatus': passwordStatus,
|
|
'passwordType': passwordType,
|
|
'deviceUuid': deviceUuid,
|
|
};
|
|
}
|
|
}
|