opt models

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-04 15:20:35 +08:00
parent f50b1d2beb
commit b960359a39
858 changed files with 11000 additions and 12588 deletions

View File

@@ -0,0 +1,39 @@
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;
String? trackId;
String? abtestId;
String? query;
LiveSearchData({
this.type,
this.page,
this.pagesize,
this.room,
this.user,
this.trackId,
this.abtestId,
this.query,
});
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?,
);
}

View File

@@ -0,0 +1,19 @@
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

@@ -0,0 +1,18 @@
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});
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?,
);
}

View File

@@ -0,0 +1,38 @@
import 'package:PiliPlus/models_new/live/live_feed_index/watched_show.dart';
class LiveSearchRoomItemModel {
int? roomid;
String? cover;
String? title;
String? name;
String? face;
int? online;
String? link;
WatchedShow? watchedShow;
LiveSearchRoomItemModel({
this.roomid,
this.cover,
this.title,
this.name,
this.face,
this.online,
this.link,
this.watchedShow,
});
factory LiveSearchRoomItemModel.fromJson(Map<String, dynamic> json) =>
LiveSearchRoomItemModel(
roomid: json['roomid'] as int?,
cover: json['cover'] as String?,
title: json['title'] as String?,
name: json['name'] as String?,
face: json['face'] as String?,
online: json['online'] as int?,
link: json['link'] as String?,
watchedShow: json['watched_show'] == null
? null
: WatchedShow.fromJson(
json['watched_show'] as Map<String, dynamic>),
);
}

View File

@@ -0,0 +1,17 @@
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});
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?,
);
}

View File

@@ -0,0 +1,30 @@
class LiveSearchUserItemModel {
String? face;
String? name;
int? liveStatus;
String? areaName;
int? fansNum;
int? roomid;
String? link;
LiveSearchUserItemModel({
this.face,
this.name,
this.liveStatus,
this.areaName,
this.fansNum,
this.roomid,
this.link,
});
factory LiveSearchUserItemModel.fromJson(Map<String, dynamic> json) =>
LiveSearchUserItemModel(
face: json['face'] as String?,
name: json['name'] as String?,
liveStatus: json['live_status'] as int?,
areaName: json['areaName'] as String?,
fansNum: json['fansNum'] as int?,
roomid: json['roomid'] as int?,
link: json['link'] as String?,
);
}