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

View File

@@ -0,0 +1,17 @@
import 'package:PiliPlus/models_new/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?,
);
}

View File

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

View File

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

View File

@@ -0,0 +1,67 @@
import 'package:PiliPlus/models_new/pgc/pgc_rank/badge_info.dart';
import 'package:PiliPlus/models_new/pgc/pgc_rank/icon_font.dart';
import 'package:PiliPlus/models_new/pgc/pgc_rank/new_ep.dart';
import 'package:PiliPlus/models_new/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?,
);
}

View File

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