clean up models

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-05 12:10:18 +08:00
parent b897103af0
commit 279f21857d
308 changed files with 156 additions and 6243 deletions

View File

@@ -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>),

View File

@@ -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>),
);
}

View File

@@ -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?,
);
}

View File

@@ -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?,
);
}