mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-23 10:36:24 +08:00
@@ -23,17 +23,17 @@ class LiveSearchData {
|
||||
});
|
||||
|
||||
factory LiveSearchData.fromJson(Map<String, dynamic> json) => LiveSearchData(
|
||||
type: json['type'] as String?,
|
||||
page: json['page'] as int?,
|
||||
pagesize: json['pagesize'] as int?,
|
||||
room: json['room'] == null
|
||||
? null
|
||||
: Room.fromJson(json['room'] as Map<String, dynamic>),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
trackId: json['track_id'] as String?,
|
||||
abtestId: json['abtest_id'] as String?,
|
||||
query: json['query'] as String?,
|
||||
);
|
||||
type: json['type'] as String?,
|
||||
page: json['page'] as int?,
|
||||
pagesize: json['pagesize'] as int?,
|
||||
room: json['room'] == null
|
||||
? null
|
||||
: Room.fromJson(json['room'] as Map<String, dynamic>),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
trackId: json['track_id'] as String?,
|
||||
abtestId: json['abtest_id'] as String?,
|
||||
query: json['query'] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ class LiveSearch {
|
||||
LiveSearch({this.code, this.message, this.ttl, this.data});
|
||||
|
||||
factory LiveSearch.fromJson(Map<String, dynamic> json) => LiveSearch(
|
||||
code: json['code'] as int?,
|
||||
message: json['message'] as String?,
|
||||
ttl: json['ttl'] as int?,
|
||||
data: json['data'] == null
|
||||
? null
|
||||
: LiveSearchData.fromJson(json['data'] as Map<String, dynamic>),
|
||||
);
|
||||
code: json['code'] as int?,
|
||||
message: json['message'] as String?,
|
||||
ttl: json['ttl'] as int?,
|
||||
data: json['data'] == null
|
||||
? null
|
||||
: LiveSearchData.fromJson(json['data'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,11 +8,12 @@ class Room {
|
||||
Room({this.list, this.totalRoom, this.totalPage});
|
||||
|
||||
factory Room.fromJson(Map<String, dynamic> json) => Room(
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) =>
|
||||
LiveSearchRoomItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
totalRoom: json['total_room'] as int?,
|
||||
totalPage: json['total_page'] as int?,
|
||||
);
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map(
|
||||
(e) => LiveSearchRoomItemModel.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
totalRoom: json['total_room'] as int?,
|
||||
totalPage: json['total_page'] as int?,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ class LiveSearchRoomItemModel {
|
||||
watchedShow: json['watched_show'] == null
|
||||
? null
|
||||
: WatchedShow.fromJson(
|
||||
json['watched_show'] as Map<String, dynamic>),
|
||||
json['watched_show'] as Map<String, dynamic>,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ class User {
|
||||
User({this.list, this.totalUser, this.totalPage});
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => User(
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) => LiveSearchUserItemModel.fromJson(e))
|
||||
.toList(),
|
||||
totalUser: json['total_user'] as int?,
|
||||
totalPage: json['total_page'] as int?,
|
||||
);
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) => LiveSearchUserItemModel.fromJson(e))
|
||||
.toList(),
|
||||
totalUser: json['total_user'] as int?,
|
||||
totalPage: json['total_page'] as int?,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user