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,15 @@
class Cursor {
int? max;
int? viewAt;
String? business;
int? ps;
Cursor({this.max, this.viewAt, this.business, this.ps});
factory Cursor.fromJson(Map<String, dynamic> json) => Cursor(
max: json['max'] as int?,
viewAt: json['view_at'] as int?,
business: json['business'] as String?,
ps: json['ps'] as int?,
);
}

View File

@@ -0,0 +1,23 @@
import 'package:PiliPlus/models_new/history/cursor.dart';
import 'package:PiliPlus/models_new/history/list.dart';
import 'package:PiliPlus/models_new/history/tab.dart';
class HistoryData {
Cursor? cursor;
List<HistoryTab>? tab;
List<HistoryItemModel>? list;
HistoryData({this.cursor, this.tab, this.list});
factory HistoryData.fromJson(Map<String, dynamic> json) => HistoryData(
cursor: json['cursor'] == null
? null
: Cursor.fromJson(json['cursor'] as Map<String, dynamic>),
tab: (json['tab'] as List<dynamic>?)
?.map((e) => HistoryTab.fromJson(e as Map<String, dynamic>))
.toList(),
list: (json['list'] as List<dynamic>?)
?.map((e) => HistoryItemModel.fromJson(e as Map<String, dynamic>))
.toList(),
);
}

View File

@@ -0,0 +1,32 @@
class History {
int? oid;
int? epid;
String? bvid;
int? page;
int? cid;
String? part;
String? business;
int? dt;
History({
this.oid,
this.epid,
this.bvid,
this.page,
this.cid,
this.part,
this.business,
this.dt,
});
factory History.fromJson(Map<String, dynamic> json) => History(
oid: json['oid'],
epid: json['epid'],
bvid: json['bvid'],
page: json['page'],
cid: json['cid'] == 0 ? null : json['cid'],
part: json['part'],
business: json['business'],
dt: json['dt'],
);
}

View File

@@ -0,0 +1,83 @@
import 'package:PiliPlus/models_new/history/history.dart';
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
class HistoryItemModel with MultiSelectData {
String? title;
String? longTitle;
String? cover;
List<String>? covers;
String? uri;
late History history;
int? videos;
String? authorName;
String? authorFace;
int? authorMid;
int? viewAt;
int? progress;
String? badge;
String? showTitle;
int? duration;
String? current;
int? total;
String? newDesc;
int? isFinish;
int? isFav;
int? kid;
String? tagName;
int? liveStatus;
HistoryItemModel({
this.title,
this.longTitle,
this.cover,
this.covers,
this.uri,
required this.history,
this.videos,
this.authorName,
this.authorFace,
this.authorMid,
this.viewAt,
this.progress,
this.badge,
this.showTitle,
this.duration,
this.current,
this.total,
this.newDesc,
this.isFinish,
this.isFav,
this.kid,
this.tagName,
this.liveStatus,
});
factory HistoryItemModel.fromJson(Map<String, dynamic> json) =>
HistoryItemModel(
title: json['title'] as String?,
longTitle: json['long_title'] as String?,
cover: json['cover'] as String?,
covers: (json['covers'] as List?)?.cast(),
uri: json['uri'] as String?,
history: json['history'] == null
? History()
: History.fromJson(json['history'] as Map<String, dynamic>),
videos: json['videos'] as int?,
authorName: json['author_name'] as String?,
authorFace: json['author_face'] as String?,
authorMid: json['author_mid'] as int?,
viewAt: json['view_at'] as int?,
progress: json['progress'] as int?,
badge: json['badge'] as String?,
showTitle: json['show_title'] as String?,
duration: json['duration'] as int?,
current: json['current'] as String?,
total: json['total'] as int?,
newDesc: json['new_desc'] as String?,
isFinish: json['is_finish'] as int?,
isFav: json['is_fav'] as int?,
kid: json['kid'] as int?,
tagName: json['tag_name'] as String?,
liveStatus: json['live_status'] as int?,
);
}

View File

@@ -0,0 +1,11 @@
class HistoryTab {
String? type;
String? name;
HistoryTab({this.type, this.name});
factory HistoryTab.fromJson(Map<String, dynamic> json) => HistoryTab(
type: json['type'] as String?,
name: json['name'] as String?,
);
}