feat: login devices

Closes #1140

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-28 16:07:09 +08:00
parent 659cff875f
commit 7a5662c6ca
7 changed files with 211 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import 'package:PiliPlus/models_new/login_devices/device.dart';
class LoginDevicesData {
List<LoginDevice>? devices;
LoginDevicesData({this.devices});
factory LoginDevicesData.fromJson(Map<String, dynamic> json) =>
LoginDevicesData(
devices: (json['devices'] as List<dynamic>?)
?.map((e) => LoginDevice.fromJson(e as Map<String, dynamic>))
.toList(),
);
}

View File

@@ -0,0 +1,32 @@
class LoginDevice {
int? mid;
String? localId;
String? deviceName;
String? devicePlatform;
bool? isCurrentDevice;
String? latestLoginAt;
String? source;
int? origin;
LoginDevice({
this.mid,
this.localId,
this.deviceName,
this.devicePlatform,
this.isCurrentDevice,
this.latestLoginAt,
this.source,
this.origin,
});
factory LoginDevice.fromJson(Map<String, dynamic> json) => LoginDevice(
mid: json['mid'] as int?,
localId: json['local_id'] as String?,
deviceName: json['device_name'] as String?,
devicePlatform: json['device_platform'] as String?,
isCurrentDevice: json['is_current_device'] as bool?,
latestLoginAt: json['latest_login_at'] as String?,
source: json['source'] as String?,
origin: json['origin'] as int?,
);
}