首次提交
This commit is contained in:
20
lib/models/DeviceInfo.dart
Normal file
20
lib/models/DeviceInfo.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
// 设备信息模型
|
||||
class DeviceInfo {
|
||||
final String name;
|
||||
final String id;
|
||||
final int rssi;
|
||||
|
||||
DeviceInfo({
|
||||
required this.name,
|
||||
required this.id,
|
||||
required this.rssi,
|
||||
});
|
||||
|
||||
factory DeviceInfo.fromJson(Map<String, dynamic> json) {
|
||||
return DeviceInfo(
|
||||
name: json['name'] ?? '',
|
||||
id: json['id'] ?? '',
|
||||
rssi: json['rssi'] ?? 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
24
lib/models/LogType.dart
Normal file
24
lib/models/LogType.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
// 日志类型
|
||||
enum LogType {
|
||||
info,
|
||||
success,
|
||||
error,
|
||||
warning,
|
||||
device, // 设备日志
|
||||
connection, // 连接日志
|
||||
}
|
||||
|
||||
// 日志条目模型
|
||||
class LogEntry {
|
||||
final String message;
|
||||
final DateTime time;
|
||||
final LogType type;
|
||||
final String? deviceId; // 可选,关联的设备ID
|
||||
|
||||
LogEntry({
|
||||
required this.message,
|
||||
required this.time,
|
||||
required this.type,
|
||||
this.deviceId,
|
||||
});
|
||||
}
|
||||
22
lib/models/UserInfo.dart
Normal file
22
lib/models/UserInfo.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
// 用户信息模型
|
||||
class UserInfo {
|
||||
final String uuid;
|
||||
final String deviceModel;
|
||||
final String connectedAt;
|
||||
|
||||
UserInfo({
|
||||
required this.uuid,
|
||||
required this.deviceModel,
|
||||
required this.connectedAt,
|
||||
});
|
||||
|
||||
factory UserInfo.fromJson(Map<String, dynamic> json) {
|
||||
return UserInfo(
|
||||
uuid: json['uuid'] ?? '',
|
||||
deviceModel: json['deviceModel'] ?? '',
|
||||
connectedAt: json['connectedAt'] ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user