mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-23 10:36:24 +08:00
opt handle res
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
315
lib/models/pgc/info.dart
Normal file
315
lib/models/pgc/info.dart
Normal file
@@ -0,0 +1,315 @@
|
||||
class BangumiInfoModel {
|
||||
BangumiInfoModel({
|
||||
this.activity,
|
||||
this.actors,
|
||||
this.alias,
|
||||
this.areas,
|
||||
this.bkgCover,
|
||||
this.cover,
|
||||
this.enableVt,
|
||||
this.episodes,
|
||||
this.evaluate,
|
||||
this.freya,
|
||||
this.jpTitle,
|
||||
this.link,
|
||||
this.mediaId,
|
||||
this.newEp,
|
||||
this.playStrategy,
|
||||
this.positive,
|
||||
this.publish,
|
||||
this.rating,
|
||||
this.record,
|
||||
this.rights,
|
||||
this.seasonId,
|
||||
this.seasonTitle,
|
||||
this.seasons,
|
||||
this.series,
|
||||
this.shareCopy,
|
||||
this.shareSubTitle,
|
||||
this.shareUrl,
|
||||
this.show,
|
||||
this.showSeasonType,
|
||||
this.squareCover,
|
||||
this.stat,
|
||||
this.status,
|
||||
this.styles,
|
||||
this.subTitle,
|
||||
this.title,
|
||||
this.total,
|
||||
this.type,
|
||||
this.userStatus,
|
||||
this.staff,
|
||||
});
|
||||
|
||||
Map? activity;
|
||||
String? actors;
|
||||
String? alias;
|
||||
List? areas;
|
||||
String? bkgCover;
|
||||
String? cover;
|
||||
String? enableVt;
|
||||
List<EpisodeItem>? episodes;
|
||||
String? evaluate;
|
||||
Map? freya;
|
||||
String? jpTitle;
|
||||
String? link;
|
||||
int? mediaId;
|
||||
Map? newEp;
|
||||
Map? playStrategy;
|
||||
Map? positive;
|
||||
Map? publish;
|
||||
Map? rating;
|
||||
String? record;
|
||||
Map? rights;
|
||||
int? seasonId;
|
||||
String? seasonTitle;
|
||||
List? seasons;
|
||||
Map? series;
|
||||
String? shareCopy;
|
||||
String? shareSubTitle;
|
||||
String? shareUrl;
|
||||
Map? show;
|
||||
int? showSeasonType;
|
||||
String? squareCover;
|
||||
Map? stat;
|
||||
int? status;
|
||||
List? styles;
|
||||
String? subTitle;
|
||||
String? title;
|
||||
int? total;
|
||||
int? type;
|
||||
UserStatus? userStatus;
|
||||
String? staff;
|
||||
List<Section>? section;
|
||||
|
||||
BangumiInfoModel.fromJson(Map<String, dynamic> json) {
|
||||
activity = json['activity'];
|
||||
actors = json['actors'];
|
||||
alias = json['alias'];
|
||||
areas = json['areas'];
|
||||
bkgCover = json['bkg_cover'];
|
||||
cover = json['cover'];
|
||||
enableVt = json['enableVt'];
|
||||
episodes = (json['episodes'] as List?)
|
||||
?.map<EpisodeItem>((e) => EpisodeItem.fromJson(e))
|
||||
.toList();
|
||||
evaluate = json['evaluate'];
|
||||
freya = json['freya'];
|
||||
jpTitle = json['jp_title'];
|
||||
link = json['link'];
|
||||
mediaId = json['media_id'];
|
||||
newEp = json['new_ep'];
|
||||
playStrategy = json['play_strategy'];
|
||||
positive = json['positive'];
|
||||
publish = json['publish'];
|
||||
rating = json['rating'];
|
||||
record = json['record'];
|
||||
rights = json['rights'];
|
||||
seasonId = json['season_id'];
|
||||
seasonTitle = json['season_title'];
|
||||
seasons = json['seasons'];
|
||||
series = json['series'];
|
||||
shareCopy = json['share_copy'];
|
||||
shareSubTitle = json['share_sub_title'];
|
||||
shareUrl = json['share_url'];
|
||||
show = json['show'];
|
||||
showSeasonType = json['show_season_type'];
|
||||
squareCover = json['square_cover'];
|
||||
stat = json['stat'];
|
||||
status = json['status'];
|
||||
styles = json['styles'];
|
||||
subTitle = json['sub_title'];
|
||||
title = json['title'];
|
||||
total = json['total'];
|
||||
type = json['type'];
|
||||
if (json['user_status'] != null) {
|
||||
userStatus = UserStatus.fromJson(json['user_status']);
|
||||
}
|
||||
staff = json['staff'];
|
||||
section = (json['section'] as List?)
|
||||
?.map((item) => Section.fromJson(item))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
class Section {
|
||||
Section({
|
||||
this.episodes,
|
||||
});
|
||||
List<EpisodeItem>? episodes;
|
||||
|
||||
Section.fromJson(Map<String, dynamic> json) {
|
||||
episodes = (json['episodes'] as List?)
|
||||
?.map<EpisodeItem>((e) => EpisodeItem.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
class EpisodeItem {
|
||||
EpisodeItem({
|
||||
this.aid,
|
||||
this.badge,
|
||||
this.badgeInfo,
|
||||
this.badgeType,
|
||||
this.bvid,
|
||||
this.cid,
|
||||
this.cover,
|
||||
this.dimension,
|
||||
this.duration,
|
||||
this.enableVt,
|
||||
this.epId,
|
||||
this.from,
|
||||
this.id,
|
||||
this.isViewHide,
|
||||
this.link,
|
||||
this.longTitle,
|
||||
this.pubTime,
|
||||
this.pv,
|
||||
this.releaseDate,
|
||||
this.rights,
|
||||
this.shareCopy,
|
||||
this.shareUrl,
|
||||
this.shortLink,
|
||||
this.skip,
|
||||
this.status,
|
||||
this.subtitle,
|
||||
this.title,
|
||||
this.vid,
|
||||
this.showTitle,
|
||||
});
|
||||
|
||||
int? aid;
|
||||
String? badge;
|
||||
Map? badgeInfo;
|
||||
int? badgeType;
|
||||
String? bvid;
|
||||
int? cid;
|
||||
String? cover;
|
||||
Map? dimension;
|
||||
int? duration;
|
||||
bool? enableVt;
|
||||
int? epId;
|
||||
String? from;
|
||||
int? id;
|
||||
bool? isViewHide;
|
||||
String? link;
|
||||
String? longTitle;
|
||||
int? pubTime;
|
||||
int? pv;
|
||||
String? releaseDate;
|
||||
Map? rights;
|
||||
String? shareCopy;
|
||||
String? shareUrl;
|
||||
String? shortLink;
|
||||
Map? skip;
|
||||
int? status;
|
||||
String? subtitle;
|
||||
String? title;
|
||||
String? vid;
|
||||
String? showTitle;
|
||||
|
||||
EpisodeItem.fromJson(Map<String, dynamic> json) {
|
||||
aid = json['aid'];
|
||||
badge = json['badge'] != '' ? json['badge'] : null;
|
||||
badgeInfo = json['badge_info'];
|
||||
badgeType = json['badge_type'];
|
||||
bvid = json['bvid'];
|
||||
cid = json['cid'];
|
||||
cover = json['cover'];
|
||||
dimension = json['dimension'];
|
||||
duration = json['duration'];
|
||||
enableVt = json['enable_vt'];
|
||||
epId = json['ep_id'];
|
||||
from = json['from'];
|
||||
id = json['id'];
|
||||
isViewHide = json['is_view_hide'];
|
||||
link = json['link'];
|
||||
longTitle = json['long_title'];
|
||||
pubTime = json['pub_time'];
|
||||
pv = json['pv'];
|
||||
releaseDate = json['release_date'];
|
||||
rights = json['rights'];
|
||||
shareCopy = json['share_copy'];
|
||||
shareUrl = json['share_url'];
|
||||
shortLink = json['short_link'];
|
||||
skip = json['skip'];
|
||||
status = json['status'];
|
||||
subtitle = json['subtitle'];
|
||||
title = json['title'];
|
||||
vid = json['vid'];
|
||||
showTitle = json['show_title'];
|
||||
}
|
||||
}
|
||||
|
||||
class UserStatus {
|
||||
UserStatus({
|
||||
this.areaLimit,
|
||||
this.banAreaShow,
|
||||
this.follow,
|
||||
this.followStatus,
|
||||
this.login,
|
||||
this.pay,
|
||||
this.payPackPaid,
|
||||
this.progress,
|
||||
this.sponsor,
|
||||
this.vipInfo,
|
||||
});
|
||||
int? areaLimit;
|
||||
int? banAreaShow;
|
||||
int? follow;
|
||||
int? followStatus;
|
||||
int? login;
|
||||
int? pay;
|
||||
int? payPackPaid;
|
||||
UserProgress? progress;
|
||||
int? sponsor;
|
||||
VipInfo? vipInfo;
|
||||
UserStatus.fromJson(Map<String, dynamic> json) {
|
||||
areaLimit = json['area_limit'];
|
||||
banAreaShow = json['ban_area_show'];
|
||||
follow = json['follow'];
|
||||
followStatus = json['follow_status'];
|
||||
login = json['login'];
|
||||
pay = json['pay'];
|
||||
payPackPaid = json['pay_pack_paid'];
|
||||
if (json['progress'] != null) {
|
||||
progress = UserProgress.fromJson(json['progress']);
|
||||
}
|
||||
sponsor = json['sponsor'];
|
||||
if (json['vip_info'] != null) {
|
||||
vipInfo = VipInfo.fromJson(json['vip_info']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class UserProgress {
|
||||
UserProgress({
|
||||
this.lastEpId,
|
||||
this.lastEpIndex,
|
||||
this.lastTime,
|
||||
});
|
||||
int? lastEpId;
|
||||
String? lastEpIndex;
|
||||
int? lastTime;
|
||||
UserProgress.fromJson(Map<String, dynamic> json) {
|
||||
lastEpId = json['last_ep_id'];
|
||||
lastEpIndex = json['last_ep_index'];
|
||||
lastTime = json['last_time'];
|
||||
}
|
||||
}
|
||||
|
||||
class VipInfo {
|
||||
VipInfo({
|
||||
this.dueDate,
|
||||
this.status,
|
||||
this.type,
|
||||
});
|
||||
int? dueDate;
|
||||
int? status;
|
||||
int? type;
|
||||
VipInfo.fromJson(Map<String, dynamic> json) {
|
||||
dueDate = json['due_date'];
|
||||
status = json['status'];
|
||||
type = json['type'];
|
||||
}
|
||||
}
|
||||
102
lib/models/pgc/list.dart
Normal file
102
lib/models/pgc/list.dart
Normal file
@@ -0,0 +1,102 @@
|
||||
import 'package:PiliPlus/pages/common/multi_select_controller.dart'
|
||||
show MultiSelectData;
|
||||
|
||||
class BangumiListDataModel {
|
||||
BangumiListDataModel({
|
||||
this.hasNext,
|
||||
this.list,
|
||||
this.num,
|
||||
this.size,
|
||||
this.total,
|
||||
});
|
||||
|
||||
int? hasNext;
|
||||
List<BangumiListItemModel>? list;
|
||||
int? num;
|
||||
int? size;
|
||||
int? total;
|
||||
|
||||
BangumiListDataModel.fromJson(Map<String, dynamic> json) {
|
||||
hasNext = json['has_next'];
|
||||
list = (json['list'] as List?)
|
||||
?.map<BangumiListItemModel>((e) => BangumiListItemModel.fromJson(e))
|
||||
.toList();
|
||||
num = json['num'];
|
||||
size = json['size'];
|
||||
total = json['total'];
|
||||
}
|
||||
}
|
||||
|
||||
class BangumiListItemModel with MultiSelectData {
|
||||
BangumiListItemModel({
|
||||
this.badge,
|
||||
this.badgeType,
|
||||
this.cover,
|
||||
// this.firstEp,
|
||||
this.indexShow,
|
||||
this.isFinish,
|
||||
this.link,
|
||||
this.mediaId,
|
||||
this.order,
|
||||
this.orderType,
|
||||
this.score,
|
||||
this.seasonId,
|
||||
this.seaconStatus,
|
||||
this.seasonType,
|
||||
this.subTitle,
|
||||
this.title,
|
||||
this.titleIcon,
|
||||
this.progress,
|
||||
this.newEp,
|
||||
});
|
||||
|
||||
String? badge;
|
||||
int? badgeType;
|
||||
String? cover;
|
||||
String? indexShow;
|
||||
int? isFinish;
|
||||
String? link;
|
||||
int? mediaId;
|
||||
String? order;
|
||||
String? orderType;
|
||||
String? score;
|
||||
int? seasonId;
|
||||
int? seaconStatus;
|
||||
int? seasonType;
|
||||
String? subTitle;
|
||||
String? title;
|
||||
String? titleIcon;
|
||||
NewEp? newEp;
|
||||
String? progress;
|
||||
String? renewalTime;
|
||||
|
||||
BangumiListItemModel.fromJson(Map<String, dynamic> json) {
|
||||
renewalTime = json['renewal_time'];
|
||||
badge = json['badge'] == '' ? null : json['badge'];
|
||||
badgeType = json['badge_type'];
|
||||
cover = json['cover'];
|
||||
indexShow = json['index_show'];
|
||||
isFinish = json['is_finish'];
|
||||
link = json['link'];
|
||||
mediaId = json['media_id'];
|
||||
order = json['order'];
|
||||
orderType = json['order_type'];
|
||||
score = json['score'];
|
||||
seasonId = json['season_id'];
|
||||
seaconStatus = json['seacon_status'];
|
||||
seasonType = json['season_type'];
|
||||
subTitle = json['sub_title'];
|
||||
title = json['title'];
|
||||
titleIcon = json['title_icon'];
|
||||
newEp = json['new_ep'] == null ? null : NewEp.fromJson(json['new_ep']);
|
||||
progress = json['progress'];
|
||||
}
|
||||
}
|
||||
|
||||
class NewEp {
|
||||
String? indexShow;
|
||||
|
||||
NewEp.fromJson(Map<String, dynamic> json) {
|
||||
indexShow = json['index_show'];
|
||||
}
|
||||
}
|
||||
70
lib/models/pgc/pgc_index/condition.dart
Normal file
70
lib/models/pgc/pgc_index/condition.dart
Normal file
@@ -0,0 +1,70 @@
|
||||
class PgcIndexCondition {
|
||||
List<Filter>? filter;
|
||||
List<Order>? order;
|
||||
|
||||
PgcIndexCondition({
|
||||
this.filter,
|
||||
this.order,
|
||||
});
|
||||
|
||||
PgcIndexCondition.fromJson(Map json) {
|
||||
filter = (json['filter'] as List?)
|
||||
?.map((item) => Filter.fromJson(item))
|
||||
.toList();
|
||||
order =
|
||||
(json['order'] as List?)?.map((item) => Order.fromJson(item)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
class Order {
|
||||
String? field;
|
||||
String? name;
|
||||
String? sort;
|
||||
|
||||
Order({
|
||||
this.field,
|
||||
this.name,
|
||||
this.sort,
|
||||
});
|
||||
|
||||
Order.fromJson(Map json) {
|
||||
field = json['field'];
|
||||
name = json['name'];
|
||||
sort = json['sort'];
|
||||
}
|
||||
}
|
||||
|
||||
class Filter {
|
||||
String? field;
|
||||
String? name;
|
||||
List<Values>? values;
|
||||
|
||||
Filter({
|
||||
this.field,
|
||||
this.name,
|
||||
this.values,
|
||||
});
|
||||
|
||||
Filter.fromJson(Map json) {
|
||||
field = json['field'];
|
||||
name = json['name'];
|
||||
values = (json['values'] as List?)
|
||||
?.map((item) => Values.fromJson(item))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
class Values {
|
||||
String? keyword;
|
||||
String? name;
|
||||
|
||||
Values({
|
||||
this.keyword,
|
||||
this.name,
|
||||
});
|
||||
|
||||
Values.fromJson(Map json) {
|
||||
keyword = json['keyword'];
|
||||
name = json['name'];
|
||||
}
|
||||
}
|
||||
22
lib/models/pgc/pgc_index_item/data.dart
Normal file
22
lib/models/pgc/pgc_index_item/data.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_index_item/list.dart';
|
||||
|
||||
class PgcIndexItemData {
|
||||
int? hasNext;
|
||||
List<PgcIndexItemModel>? list;
|
||||
int? num;
|
||||
int? size;
|
||||
int? total;
|
||||
|
||||
PgcIndexItemData({this.hasNext, this.list, this.num, this.size, this.total});
|
||||
|
||||
factory PgcIndexItemData.fromJson(Map<String, dynamic> json) =>
|
||||
PgcIndexItemData(
|
||||
hasNext: json['has_next'] as int?,
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) => PgcIndexItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
num: json['num'] as int?,
|
||||
size: json['size'] as int?,
|
||||
total: json['total'] as int?,
|
||||
);
|
||||
}
|
||||
57
lib/models/pgc/pgc_index_item/list.dart
Normal file
57
lib/models/pgc/pgc_index_item/list.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
class PgcIndexItemModel {
|
||||
String? badge;
|
||||
int? badgeType;
|
||||
String? cover;
|
||||
String? indexShow;
|
||||
int? isFinish;
|
||||
String? link;
|
||||
int? mediaId;
|
||||
String? order;
|
||||
String? orderType;
|
||||
String? score;
|
||||
int? seasonId;
|
||||
int? seasonStatus;
|
||||
int? seasonType;
|
||||
String? subTitle;
|
||||
String? title;
|
||||
String? titleIcon;
|
||||
|
||||
PgcIndexItemModel({
|
||||
this.badge,
|
||||
this.badgeType,
|
||||
this.cover,
|
||||
this.indexShow,
|
||||
this.isFinish,
|
||||
this.link,
|
||||
this.mediaId,
|
||||
this.order,
|
||||
this.orderType,
|
||||
this.score,
|
||||
this.seasonId,
|
||||
this.seasonStatus,
|
||||
this.seasonType,
|
||||
this.subTitle,
|
||||
this.title,
|
||||
this.titleIcon,
|
||||
});
|
||||
|
||||
factory PgcIndexItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
PgcIndexItemModel(
|
||||
badge: json['badge'] as String?,
|
||||
badgeType: json['badge_type'] as int?,
|
||||
cover: json['cover'] as String?,
|
||||
indexShow: json['index_show'] as String?,
|
||||
isFinish: json['is_finish'] as int?,
|
||||
link: json['link'] as String?,
|
||||
mediaId: json['media_id'] as int?,
|
||||
order: json['order'] as String?,
|
||||
orderType: json['order_type'] as String?,
|
||||
score: json['score'] as String?,
|
||||
seasonId: json['season_id'] as int?,
|
||||
seasonStatus: json['season_status'] as int?,
|
||||
seasonType: json['season_type'] as int?,
|
||||
subTitle: json['subTitle'] as String?,
|
||||
title: json['title'] as String?,
|
||||
titleIcon: json['title_icon'] as String?,
|
||||
);
|
||||
}
|
||||
19
lib/models/pgc/pgc_rank/badge_info.dart
Normal file
19
lib/models/pgc/pgc_rank/badge_info.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
class BadgeInfo {
|
||||
String? bgColor;
|
||||
String? bgColorNight;
|
||||
String? text;
|
||||
|
||||
BadgeInfo({this.bgColor, this.bgColorNight, this.text});
|
||||
|
||||
factory BadgeInfo.fromJson(Map<String, dynamic> json) => BadgeInfo(
|
||||
bgColor: json['bg_color'] as String?,
|
||||
bgColorNight: json['bg_color_night'] as String?,
|
||||
text: json['text'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'bg_color': bgColor,
|
||||
'bg_color_night': bgColorNight,
|
||||
'text': text,
|
||||
};
|
||||
}
|
||||
23
lib/models/pgc/pgc_rank/data.dart
Normal file
23
lib/models/pgc/pgc_rank/data.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_rank/pgc_rank_item_model.dart';
|
||||
|
||||
class Data {
|
||||
List<PgcRankItemModel>? list;
|
||||
String? note;
|
||||
int? seasonType;
|
||||
|
||||
Data({this.list, this.note, this.seasonType});
|
||||
|
||||
factory Data.fromJson(Map<String, dynamic> json) => Data(
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) => PgcRankItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
note: json['note'] as String?,
|
||||
seasonType: json['season_type'] as int?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'list': list?.map((e) => e.toJson()).toList(),
|
||||
'note': note,
|
||||
'season_type': seasonType,
|
||||
};
|
||||
}
|
||||
16
lib/models/pgc/pgc_rank/icon_font.dart
Normal file
16
lib/models/pgc/pgc_rank/icon_font.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class IconFont {
|
||||
String? name;
|
||||
String? text;
|
||||
|
||||
IconFont({this.name, this.text});
|
||||
|
||||
factory IconFont.fromJson(Map<String, dynamic> json) => IconFont(
|
||||
name: json['name'] as String?,
|
||||
text: json['text'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'name': name,
|
||||
'text': text,
|
||||
};
|
||||
}
|
||||
16
lib/models/pgc/pgc_rank/new_ep.dart
Normal file
16
lib/models/pgc/pgc_rank/new_ep.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class NewEp {
|
||||
String? cover;
|
||||
String? indexShow;
|
||||
|
||||
NewEp({this.cover, this.indexShow});
|
||||
|
||||
factory NewEp.fromJson(Map<String, dynamic> json) => NewEp(
|
||||
cover: json['cover'] as String?,
|
||||
indexShow: json['index_show'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'cover': cover,
|
||||
'index_show': indexShow,
|
||||
};
|
||||
}
|
||||
85
lib/models/pgc/pgc_rank/pgc_rank_item_model.dart
Normal file
85
lib/models/pgc/pgc_rank/pgc_rank_item_model.dart
Normal file
@@ -0,0 +1,85 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_rank/badge_info.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_rank/icon_font.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_rank/new_ep.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_rank/stat.dart';
|
||||
|
||||
class PgcRankItemModel {
|
||||
String? badge;
|
||||
BadgeInfo? badgeInfo;
|
||||
int? badgeType;
|
||||
String? cover;
|
||||
String? desc;
|
||||
bool? enableVt;
|
||||
IconFont? iconFont;
|
||||
NewEp? newEp;
|
||||
int? rank;
|
||||
String? rating;
|
||||
int? seasonId;
|
||||
String? ssHorizontalCover;
|
||||
Stat? stat;
|
||||
String? title;
|
||||
String? url;
|
||||
|
||||
PgcRankItemModel({
|
||||
this.badge,
|
||||
this.badgeInfo,
|
||||
this.badgeType,
|
||||
this.cover,
|
||||
this.desc,
|
||||
this.enableVt,
|
||||
this.iconFont,
|
||||
this.newEp,
|
||||
this.rank,
|
||||
this.rating,
|
||||
this.seasonId,
|
||||
this.ssHorizontalCover,
|
||||
this.stat,
|
||||
this.title,
|
||||
this.url,
|
||||
});
|
||||
|
||||
factory PgcRankItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
PgcRankItemModel(
|
||||
badge: json['badge'] as String?,
|
||||
badgeInfo: json['badge_info'] == null
|
||||
? null
|
||||
: BadgeInfo.fromJson(json['badge_info'] as Map<String, dynamic>),
|
||||
badgeType: json['badge_type'] as int?,
|
||||
cover: json['cover'] as String?,
|
||||
desc: json['desc'] as String?,
|
||||
enableVt: json['enable_vt'] as bool?,
|
||||
iconFont: json['icon_font'] == null
|
||||
? null
|
||||
: IconFont.fromJson(json['icon_font'] as Map<String, dynamic>),
|
||||
newEp: json['new_ep'] == null
|
||||
? null
|
||||
: NewEp.fromJson(json['new_ep'] as Map<String, dynamic>),
|
||||
rank: json['rank'] as int?,
|
||||
rating: json['rating'] as String?,
|
||||
seasonId: json['season_id'] as int?,
|
||||
ssHorizontalCover: json['ss_horizontal_cover'] as String?,
|
||||
stat: json['stat'] == null
|
||||
? null
|
||||
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
|
||||
title: json['title'] as String?,
|
||||
url: json['url'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'badge': badge,
|
||||
'badge_info': badgeInfo?.toJson(),
|
||||
'badge_type': badgeType,
|
||||
'cover': cover,
|
||||
'desc': desc,
|
||||
'enable_vt': enableVt,
|
||||
'icon_font': iconFont?.toJson(),
|
||||
'new_ep': newEp?.toJson(),
|
||||
'rank': rank,
|
||||
'rating': rating,
|
||||
'season_id': seasonId,
|
||||
'ss_horizontal_cover': ssHorizontalCover,
|
||||
'stat': stat?.toJson(),
|
||||
'title': title,
|
||||
'url': url,
|
||||
};
|
||||
}
|
||||
22
lib/models/pgc/pgc_rank/stat.dart
Normal file
22
lib/models/pgc/pgc_rank/stat.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
class Stat {
|
||||
int? danmaku;
|
||||
int? follow;
|
||||
int? seriesFollow;
|
||||
int? view;
|
||||
|
||||
Stat({this.danmaku, this.follow, this.seriesFollow, this.view});
|
||||
|
||||
factory Stat.fromJson(Map<String, dynamic> json) => Stat(
|
||||
danmaku: json['danmaku'] as int?,
|
||||
follow: (json['follow'] as int?) ?? 0,
|
||||
seriesFollow: json['series_follow'] as int?,
|
||||
view: (json['view'] as int?) ?? 0,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'danmaku': danmaku,
|
||||
'follow': follow,
|
||||
'series_follow': seriesFollow,
|
||||
'view': view,
|
||||
};
|
||||
}
|
||||
27
lib/models/pgc/pgc_review/author.dart
Normal file
27
lib/models/pgc/pgc_review/author.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:PiliPlus/models/model_avatar.dart' show Vip;
|
||||
|
||||
class Author {
|
||||
String? avatar;
|
||||
int? level;
|
||||
int? mid;
|
||||
String? uname;
|
||||
Vip? vip;
|
||||
|
||||
Author({
|
||||
this.avatar,
|
||||
this.level,
|
||||
this.mid,
|
||||
this.uname,
|
||||
this.vip,
|
||||
});
|
||||
|
||||
factory Author.fromJson(Map<String, dynamic> json) => Author(
|
||||
avatar: json['avatar'] as String?,
|
||||
level: json['level'] as int?,
|
||||
mid: json['mid'] as int?,
|
||||
uname: json['uname'] as String?,
|
||||
vip: json['vip'] == null
|
||||
? null
|
||||
: Vip.fromJson(json['vip'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
17
lib/models/pgc/pgc_review/data.dart
Normal file
17
lib/models/pgc/pgc_review/data.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_review/list.dart';
|
||||
|
||||
class PgcReviewData {
|
||||
List<PgcReviewItemModel>? list;
|
||||
String? next;
|
||||
int? count;
|
||||
|
||||
PgcReviewData({this.list, this.next, this.count});
|
||||
|
||||
factory PgcReviewData.fromJson(Map<String, dynamic> json) => PgcReviewData(
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) => PgcReviewItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
next: json['next'] as String?,
|
||||
count: json['count'] as int?,
|
||||
);
|
||||
}
|
||||
55
lib/models/pgc/pgc_review/list.dart
Normal file
55
lib/models/pgc/pgc_review/list.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_review/author.dart';
|
||||
import 'package:PiliPlus/models/pgc/pgc_review/stat.dart';
|
||||
|
||||
class PgcReviewItemModel {
|
||||
Author? author;
|
||||
String? title;
|
||||
String? content;
|
||||
int? ctime;
|
||||
int? mediaId;
|
||||
int? mid;
|
||||
int? mtime;
|
||||
String? progress;
|
||||
String? pushTimeStr;
|
||||
int? reviewId;
|
||||
late int score;
|
||||
Stat? stat;
|
||||
int? articleId;
|
||||
|
||||
PgcReviewItemModel({
|
||||
this.author,
|
||||
this.title,
|
||||
this.content,
|
||||
this.ctime,
|
||||
this.mediaId,
|
||||
this.mid,
|
||||
this.mtime,
|
||||
this.progress,
|
||||
this.pushTimeStr,
|
||||
this.reviewId,
|
||||
required this.score,
|
||||
this.stat,
|
||||
this.articleId,
|
||||
});
|
||||
|
||||
factory PgcReviewItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
PgcReviewItemModel(
|
||||
articleId: json['article_id'],
|
||||
author: json['author'] == null
|
||||
? null
|
||||
: Author.fromJson(json['author'] as Map<String, dynamic>),
|
||||
title: json['title'] as String?,
|
||||
content: json['content'] as String?,
|
||||
ctime: json['ctime'] as int?,
|
||||
mediaId: json['media_id'] as int?,
|
||||
mid: json['mid'] as int?,
|
||||
mtime: json['mtime'] as int?,
|
||||
progress: json['progress'] as String?,
|
||||
pushTimeStr: json['push_time_str'] as String?,
|
||||
reviewId: json['review_id'] as int?,
|
||||
score: json['score'] == null ? 0 : json['score'] ~/ 2,
|
||||
stat: json['stat'] == null
|
||||
? null
|
||||
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
19
lib/models/pgc/pgc_review/stat.dart
Normal file
19
lib/models/pgc/pgc_review/stat.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
class Stat {
|
||||
int? disliked;
|
||||
int? liked;
|
||||
int? likes;
|
||||
|
||||
Stat({this.disliked, this.liked, this.likes});
|
||||
|
||||
factory Stat.fromJson(Map<String, dynamic> json) => Stat(
|
||||
disliked: json['disliked'] as int?,
|
||||
liked: json['liked'] as int?,
|
||||
likes: json['likes'] as int?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'disliked': disliked,
|
||||
'liked': liked,
|
||||
'likes': likes,
|
||||
};
|
||||
}
|
||||
91
lib/models/pgc/pgc_timeline/episode.dart
Normal file
91
lib/models/pgc/pgc_timeline/episode.dart
Normal file
@@ -0,0 +1,91 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_timeline/icon_font.dart';
|
||||
|
||||
class Episode {
|
||||
String? cover;
|
||||
int? delay;
|
||||
int? delayId;
|
||||
String? delayIndex;
|
||||
String? delayReason;
|
||||
bool? enableVt;
|
||||
String? epCover;
|
||||
int? episodeId;
|
||||
int? follow;
|
||||
String? follows;
|
||||
IconFont? iconFont;
|
||||
String? plays;
|
||||
String? pubIndex;
|
||||
String? pubTime;
|
||||
int? pubTs;
|
||||
int? published;
|
||||
int? seasonId;
|
||||
String? squareCover;
|
||||
String? title;
|
||||
|
||||
Episode({
|
||||
this.cover,
|
||||
this.delay,
|
||||
this.delayId,
|
||||
this.delayIndex,
|
||||
this.delayReason,
|
||||
this.enableVt,
|
||||
this.epCover,
|
||||
this.episodeId,
|
||||
this.follow,
|
||||
this.follows,
|
||||
this.iconFont,
|
||||
this.plays,
|
||||
this.pubIndex,
|
||||
this.pubTime,
|
||||
this.pubTs,
|
||||
this.published,
|
||||
this.seasonId,
|
||||
this.squareCover,
|
||||
this.title,
|
||||
});
|
||||
|
||||
factory Episode.fromJson(Map<String, dynamic> json) => Episode(
|
||||
cover: json['cover'] as String?,
|
||||
delay: json['delay'] as int?,
|
||||
delayId: json['delay_id'] as int?,
|
||||
delayIndex: json['delay_index'] as String?,
|
||||
delayReason: json['delay_reason'] as String?,
|
||||
enableVt: json['enable_vt'] as bool?,
|
||||
epCover: json['ep_cover'] as String?,
|
||||
episodeId: json['episode_id'] as int?,
|
||||
follow: json['follow'] as int?,
|
||||
follows: json['follows'] as String?,
|
||||
iconFont: json['icon_font'] == null
|
||||
? null
|
||||
: IconFont.fromJson(json['icon_font'] as Map<String, dynamic>),
|
||||
plays: json['plays'] as String?,
|
||||
pubIndex: json['pub_index'] as String?,
|
||||
pubTime: json['pub_time'] as String?,
|
||||
pubTs: json['pub_ts'] as int?,
|
||||
published: json['published'] as int?,
|
||||
seasonId: json['season_id'] as int?,
|
||||
squareCover: json['square_cover'] as String?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'cover': cover,
|
||||
'delay': delay,
|
||||
'delay_id': delayId,
|
||||
'delay_index': delayIndex,
|
||||
'delay_reason': delayReason,
|
||||
'enable_vt': enableVt,
|
||||
'ep_cover': epCover,
|
||||
'episode_id': episodeId,
|
||||
'follow': follow,
|
||||
'follows': follows,
|
||||
'icon_font': iconFont?.toJson(),
|
||||
'plays': plays,
|
||||
'pub_index': pubIndex,
|
||||
'pub_time': pubTime,
|
||||
'pub_ts': pubTs,
|
||||
'published': published,
|
||||
'season_id': seasonId,
|
||||
'square_cover': squareCover,
|
||||
'title': title,
|
||||
};
|
||||
}
|
||||
16
lib/models/pgc/pgc_timeline/icon_font.dart
Normal file
16
lib/models/pgc/pgc_timeline/icon_font.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
class IconFont {
|
||||
String? name;
|
||||
String? text;
|
||||
|
||||
IconFont({this.name, this.text});
|
||||
|
||||
factory IconFont.fromJson(Map<String, dynamic> json) => IconFont(
|
||||
name: json['name'] as String?,
|
||||
text: json['text'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'name': name,
|
||||
'text': text,
|
||||
};
|
||||
}
|
||||
23
lib/models/pgc/pgc_timeline/pgc_timeline.dart
Normal file
23
lib/models/pgc/pgc_timeline/pgc_timeline.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_timeline/result.dart';
|
||||
|
||||
class PgcTimeline {
|
||||
int? code;
|
||||
String? message;
|
||||
List<Result>? result;
|
||||
|
||||
PgcTimeline({this.code, this.message, this.result});
|
||||
|
||||
factory PgcTimeline.fromJson(Map<String, dynamic> json) => PgcTimeline(
|
||||
code: json['code'] as int?,
|
||||
message: json['message'] as String?,
|
||||
result: (json['result'] as List<dynamic>?)
|
||||
?.map((e) => Result.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'code': code,
|
||||
'message': message,
|
||||
'result': result?.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
}
|
||||
35
lib/models/pgc/pgc_timeline/result.dart
Normal file
35
lib/models/pgc/pgc_timeline/result.dart
Normal file
@@ -0,0 +1,35 @@
|
||||
import 'package:PiliPlus/models/pgc/pgc_timeline/episode.dart';
|
||||
|
||||
class Result {
|
||||
String? date;
|
||||
int? dateTs;
|
||||
int? dayOfWeek;
|
||||
List<Episode>? episodes;
|
||||
int? isToday;
|
||||
|
||||
Result({
|
||||
this.date,
|
||||
this.dateTs,
|
||||
this.dayOfWeek,
|
||||
this.episodes,
|
||||
this.isToday,
|
||||
});
|
||||
|
||||
factory Result.fromJson(Map<String, dynamic> json) => Result(
|
||||
date: json['date'] as String?,
|
||||
dateTs: json['date_ts'] as int?,
|
||||
dayOfWeek: json['day_of_week'] as int?,
|
||||
episodes: (json['episodes'] as List<dynamic>?)
|
||||
?.map((e) => Episode.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
isToday: json['is_today'] as int?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'date': date,
|
||||
'date_ts': dateTs,
|
||||
'day_of_week': dayOfWeek,
|
||||
'episodes': episodes?.map((e) => e.toJson()).toList(),
|
||||
'is_today': isToday,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user