refa query follow up

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-31 15:00:23 +08:00
parent 1029621b63
commit e945daba3a
8 changed files with 168 additions and 204 deletions

View File

@@ -1,20 +1,21 @@
class FollowUpModel {
FollowUpModel({
this.liveUsers,
this.upList,
required this.upList,
});
String? errMsg;
LiveUsers? liveUsers;
List<UpItem>? upList;
late List<UpItem> upList;
FollowUpModel.fromJson(Map<String, dynamic> json) {
liveUsers = json['live_users'] != null
? LiveUsers.fromJson(json['live_users'])
: null;
upList = (json['up_list'] as List?)
?.map<UpItem>((e) => UpItem.fromJson(e))
.toList();
upList =
(json['up_list'] as List?)
?.map<UpItem>((e) => UpItem.fromJson(e))
.toList() ??
<UpItem>[];
}
}
@@ -38,54 +39,40 @@ class LiveUsers {
}
}
sealed class UserItem {
String? face;
bool? hasUpdate;
late int mid;
String? uname;
UserItem({
this.face,
this.hasUpdate,
int? mid,
this.uname,
}) : mid = mid ?? -1;
}
class LiveUserItem extends UserItem {
class LiveUserItem extends UpItem {
bool? isReserveRecall;
String? jumpUrl;
int? roomId;
String? title;
LiveUserItem.fromJson(Map<String, dynamic> json) {
LiveUserItem.fromJson(Map<String, dynamic> json)
: super(mid: json['mid'] ?? 0) {
face = json['face'];
isReserveRecall = json['is_reserve_recall'];
jumpUrl = json['jump_url'];
mid = json['mid'] ?? -1;
roomId = json['room_id'];
title = json['title'];
uname = json['uname'];
hasUpdate = false;
}
}
class UpItem extends UserItem {
UpItem({
super.face,
super.hasUpdate,
// this.isReserveRecall,
super.mid,
super.uname,
});
class UpItem {
String? face;
bool? hasUpdate;
late int mid;
String? uname;
// bool? isReserveRecall;
UpItem({
this.face,
this.hasUpdate,
required this.mid,
this.uname,
});
UpItem.fromJson(Map<String, dynamic> json) {
face = json['face'];
hasUpdate = json['has_update'];
// isReserveRecall = json['is_reserve_recall'];
mid = json['mid'] ?? -1;
mid = json['mid'] ?? 0;
uname = json['uname'];
}
}