mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-27 12:36:27 +08:00
17
lib/models_new/sub/sub/data.dart
Normal file
17
lib/models_new/sub/sub/data.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:PiliPlus/models_new/sub/sub/list.dart';
|
||||
|
||||
class SubData {
|
||||
int? count;
|
||||
List<SubItemModel>? list;
|
||||
bool? hasMore;
|
||||
|
||||
SubData({this.count, this.list, this.hasMore});
|
||||
|
||||
factory SubData.fromJson(Map<String, dynamic> json) => SubData(
|
||||
count: json['count'] as int?,
|
||||
list: (json['list'] as List<dynamic>?)
|
||||
?.map((e) => SubItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
hasMore: json['has_more'] as bool?,
|
||||
);
|
||||
}
|
||||
81
lib/models_new/sub/sub/list.dart
Normal file
81
lib/models_new/sub/sub/list.dart
Normal file
@@ -0,0 +1,81 @@
|
||||
import 'package:PiliPlus/models_new/sub/sub/upper.dart';
|
||||
|
||||
class SubItemModel {
|
||||
int? id;
|
||||
int? fid;
|
||||
int? mid;
|
||||
int? attr;
|
||||
String? attrDesc;
|
||||
String? title;
|
||||
String? cover;
|
||||
Upper? upper;
|
||||
int? coverType;
|
||||
String? intro;
|
||||
int? ctime;
|
||||
int? mtime;
|
||||
int? state;
|
||||
int? favState;
|
||||
int? mediaCount;
|
||||
int? viewCount;
|
||||
int? vt;
|
||||
bool? isTop;
|
||||
dynamic recentFav;
|
||||
int? playSwitch;
|
||||
int? type;
|
||||
String? link;
|
||||
String? bvid;
|
||||
|
||||
SubItemModel({
|
||||
this.id,
|
||||
this.fid,
|
||||
this.mid,
|
||||
this.attr,
|
||||
this.attrDesc,
|
||||
this.title,
|
||||
this.cover,
|
||||
this.upper,
|
||||
this.coverType,
|
||||
this.intro,
|
||||
this.ctime,
|
||||
this.mtime,
|
||||
this.state,
|
||||
this.favState,
|
||||
this.mediaCount,
|
||||
this.viewCount,
|
||||
this.vt,
|
||||
this.isTop,
|
||||
this.recentFav,
|
||||
this.playSwitch,
|
||||
this.type,
|
||||
this.link,
|
||||
this.bvid,
|
||||
});
|
||||
|
||||
factory SubItemModel.fromJson(Map<String, dynamic> json) => SubItemModel(
|
||||
id: json['id'] as int?,
|
||||
fid: json['fid'] as int?,
|
||||
mid: json['mid'] as int?,
|
||||
attr: json['attr'] as int?,
|
||||
attrDesc: json['attr_desc'] as String?,
|
||||
title: json['title'] as String?,
|
||||
cover: json['cover'] as String?,
|
||||
upper: json['upper'] == null
|
||||
? null
|
||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
||||
coverType: json['cover_type'] as int?,
|
||||
intro: json['intro'] as String?,
|
||||
ctime: json['ctime'] as int?,
|
||||
mtime: json['mtime'] as int?,
|
||||
state: json['state'] as int?,
|
||||
favState: json['fav_state'] as int?,
|
||||
mediaCount: json['media_count'] as int?,
|
||||
viewCount: json['view_count'] as int?,
|
||||
vt: json['vt'] as int?,
|
||||
isTop: json['is_top'] as bool?,
|
||||
recentFav: json['recent_fav'] as dynamic,
|
||||
playSwitch: json['play_switch'] as int?,
|
||||
type: json['type'] as int?,
|
||||
link: json['link'] as String?,
|
||||
bvid: json['bvid'] as String?,
|
||||
);
|
||||
}
|
||||
15
lib/models_new/sub/sub/upper.dart
Normal file
15
lib/models_new/sub/sub/upper.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class Upper {
|
||||
int? mid;
|
||||
String? name;
|
||||
String? face;
|
||||
String? jumpLink;
|
||||
|
||||
Upper({this.mid, this.name, this.face, this.jumpLink});
|
||||
|
||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
||||
mid: json['mid'] as int?,
|
||||
name: json['name'] as String?,
|
||||
face: json['face'] as String?,
|
||||
jumpLink: json['jump_link'] as String?,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user