mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 08:08:19 +08:00
19
lib/models_new/member_guard/data.dart
Normal file
19
lib/models_new/member_guard/data.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:PiliPlus/models_new/member_guard/guard_top_list.dart';
|
||||
|
||||
class MemberGuardData {
|
||||
List<GuardItem> guardTopList;
|
||||
int? hasMore;
|
||||
|
||||
MemberGuardData({
|
||||
required this.guardTopList,
|
||||
this.hasMore,
|
||||
});
|
||||
|
||||
factory MemberGuardData.fromJson(Map<String, dynamic> json) =>
|
||||
MemberGuardData(
|
||||
guardTopList: (json['guard_top_list'] as List<dynamic>)
|
||||
.map((e) => GuardItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
hasMore: json['has_more'] as int?,
|
||||
);
|
||||
}
|
||||
20
lib/models_new/member_guard/guard_top_list.dart
Normal file
20
lib/models_new/member_guard/guard_top_list.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
class GuardItem {
|
||||
int uid;
|
||||
String username;
|
||||
String face;
|
||||
int guardLevel;
|
||||
|
||||
GuardItem({
|
||||
required this.uid,
|
||||
required this.username,
|
||||
required this.face,
|
||||
required this.guardLevel,
|
||||
});
|
||||
|
||||
factory GuardItem.fromJson(Map<String, dynamic> json) => GuardItem(
|
||||
uid: json['uid'],
|
||||
username: json['username'],
|
||||
face: json['face'],
|
||||
guardLevel: json['guard_level'],
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPlus/models/model_owner.dart';
|
||||
|
||||
class Elec {
|
||||
int? total;
|
||||
List<ElecItem>? list;
|
||||
@@ -15,9 +17,11 @@ class Elec {
|
||||
);
|
||||
}
|
||||
|
||||
class ElecItem {
|
||||
class ElecItem extends Owner {
|
||||
String? uname;
|
||||
String? avatar;
|
||||
@override
|
||||
String? get face => avatar;
|
||||
|
||||
ElecItem({
|
||||
this.uname,
|
||||
|
||||
@@ -2,20 +2,17 @@ import 'package:PiliPlus/models/model_owner.dart';
|
||||
|
||||
class Guard {
|
||||
String? uri;
|
||||
String? desc;
|
||||
Object? count;
|
||||
List<Owner>? item;
|
||||
|
||||
Guard({
|
||||
this.uri,
|
||||
this.desc,
|
||||
this.item,
|
||||
});
|
||||
|
||||
factory Guard.fromJson(Map<String, dynamic> json) => Guard(
|
||||
uri: json['uri'] as String?,
|
||||
desc: json['desc'] as String?,
|
||||
item: (json['item'] as List<dynamic>?)
|
||||
Guard.fromJson(Map<String, dynamic> json) {
|
||||
uri = json['uri'] as String?;
|
||||
item = (json['item'] as List<dynamic>?)
|
||||
?.map((e) => Owner.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
.toList();
|
||||
final String? desc = json['desc'];
|
||||
if (desc != null) {
|
||||
count = RegExp(r'^(\d+)').firstMatch(desc)?.group(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user