mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
merged with dev and access_bugs and solved conflicts
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
import 'package:syncrow_web/utils/constants/const.dart';
|
||||
import 'package:syncrow_web/utils/enum/device_types.dart';
|
||||
import 'package:syncrow_web/utils/constants/app_enum.dart';
|
||||
|
||||
class DeviceModel {
|
||||
dynamic productUuid;
|
||||
@ -54,8 +54,7 @@ class DeviceModel {
|
||||
|
||||
if (type == DeviceType.LightBulb) {
|
||||
tempIcon = Assets.lightBulb;
|
||||
} else if (type == DeviceType.CeilingSensor ||
|
||||
type == DeviceType.WallSensor) {
|
||||
} else if (type == DeviceType.CeilingSensor || type == DeviceType.WallSensor) {
|
||||
tempIcon = Assets.sensors;
|
||||
} else if (type == DeviceType.AC) {
|
||||
tempIcon = Assets.ac;
|
||||
|
124
lib/pages/visitor_password/model/failed_operation.dart
Normal file
124
lib/pages/visitor_password/model/failed_operation.dart
Normal file
@ -0,0 +1,124 @@
|
||||
class FailedOperation {
|
||||
final bool success;
|
||||
final dynamic deviceUuid;
|
||||
final dynamic error;
|
||||
|
||||
FailedOperation({
|
||||
required this.success,
|
||||
required this.deviceUuid,
|
||||
required this.error,
|
||||
});
|
||||
|
||||
factory FailedOperation.fromJson(Map<String, dynamic> json) {
|
||||
return FailedOperation(
|
||||
success: json['success'],
|
||||
deviceUuid: json['deviceUuid'],
|
||||
error: json['error'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'success': success,
|
||||
'deviceUuid': deviceUuid,
|
||||
'error': error,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class SuccessOperation {
|
||||
final bool success;
|
||||
// final Result result;
|
||||
final String deviceUuid;
|
||||
|
||||
SuccessOperation({
|
||||
required this.success,
|
||||
// required this.result,
|
||||
required this.deviceUuid,
|
||||
});
|
||||
|
||||
factory SuccessOperation.fromJson(Map<String, dynamic> json) {
|
||||
return SuccessOperation(
|
||||
success: json['success'],
|
||||
// result: Result.fromJson(json['result']),
|
||||
deviceUuid: json['deviceUuid'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'success': success,
|
||||
// 'result': result.toJson(),
|
||||
'deviceUuid': deviceUuid,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// class Result {
|
||||
// final dynamic effectiveTime;
|
||||
// final dynamic invalidTime;
|
||||
// final dynamic offlineTempPassword;
|
||||
// final dynamic offlineTempPasswordId;
|
||||
// final dynamic offlineTempPasswordName;
|
||||
//
|
||||
// Result({
|
||||
// required this.effectiveTime,
|
||||
// required this.invalidTime,
|
||||
// required this.offlineTempPassword,
|
||||
// required this.offlineTempPasswordId,
|
||||
// required this.offlineTempPasswordName,
|
||||
// });
|
||||
//
|
||||
// factory Result.fromJson(Map<String, dynamic> json) {
|
||||
// return Result(
|
||||
// effectiveTime: json['effective_time'],
|
||||
// invalidTime: json['invalid_time'],
|
||||
// offlineTempPassword: json['offline_temp_password'].toString(),
|
||||
// offlineTempPasswordId: json['offline_temp_password_id'],
|
||||
// offlineTempPasswordName: json['offline_temp_password_name'],
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// return {
|
||||
// 'effective_time': effectiveTime,
|
||||
// 'invalid_time': invalidTime,
|
||||
// 'offline_temp_password': offlineTempPassword,
|
||||
// 'offline_temp_password_id': offlineTempPasswordId,
|
||||
// 'offline_temp_password_name': offlineTempPasswordName,
|
||||
// };
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
class PasswordStatus {
|
||||
final List<SuccessOperation> successOperations;
|
||||
final List<FailedOperation> failedOperations;
|
||||
|
||||
PasswordStatus({
|
||||
required this.successOperations,
|
||||
required this.failedOperations,
|
||||
});
|
||||
|
||||
factory PasswordStatus.fromJson(Map<String, dynamic> json) {
|
||||
return PasswordStatus(
|
||||
successOperations: (json['successOperations'] as List)
|
||||
.map((i) => SuccessOperation.fromJson(i))
|
||||
.toList(),
|
||||
failedOperations: (json['failedOperations'] as List)
|
||||
.map((i) => FailedOperation.fromJson(i))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'successOperations': successOperations.map((e) => e.toJson()).toList(),
|
||||
'failedOperations': failedOperations.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user