mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-18 07:04:01 +08:00
@@ -2,24 +2,15 @@ import 'package:PiliPlus/models_new/live/live_search/room.dart';
|
||||
import 'package:PiliPlus/models_new/live/live_search/user.dart';
|
||||
|
||||
class LiveSearchData {
|
||||
String? type;
|
||||
int? page;
|
||||
int? pagesize;
|
||||
Room? room;
|
||||
User? user;
|
||||
|
||||
LiveSearchData({
|
||||
this.type,
|
||||
this.page,
|
||||
this.pagesize,
|
||||
this.room,
|
||||
this.user,
|
||||
});
|
||||
|
||||
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>),
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import 'package:PiliPlus/models_new/live/live_search/data.dart';
|
||||
|
||||
class LiveSearch {
|
||||
int? code;
|
||||
String? message;
|
||||
int? ttl;
|
||||
LiveSearchData? data;
|
||||
|
||||
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>),
|
||||
);
|
||||
}
|
||||
@@ -3,9 +3,8 @@ import 'package:PiliPlus/models_new/live/live_search/room_item.dart';
|
||||
class Room {
|
||||
List<LiveSearchRoomItemModel>? list;
|
||||
int? totalRoom;
|
||||
int? totalPage;
|
||||
|
||||
Room({this.list, this.totalRoom, this.totalPage});
|
||||
Room({this.list, this.totalRoom});
|
||||
|
||||
factory Room.fromJson(Map<String, dynamic> json) => Room(
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
@@ -14,6 +13,5 @@ class Room {
|
||||
)
|
||||
.toList(),
|
||||
totalRoom: json['total_room'] as int?,
|
||||
totalPage: json['total_page'] as int?,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,15 +3,13 @@ import 'package:PiliPlus/models_new/live/live_search/user_item.dart';
|
||||
class User {
|
||||
List<LiveSearchUserItemModel>? list;
|
||||
int? totalUser;
|
||||
int? totalPage;
|
||||
|
||||
User({this.list, this.totalUser, this.totalPage});
|
||||
User({this.list, this.totalUser});
|
||||
|
||||
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?,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user