mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-16 06:10:13 +08:00
15
lib/models_new/sub/sub_detail/cnt_info.dart
Normal file
15
lib/models_new/sub/sub_detail/cnt_info.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
class CntInfo {
|
||||
int? collect;
|
||||
int? play;
|
||||
int? danmaku;
|
||||
int? vt;
|
||||
|
||||
CntInfo({this.collect, this.play, this.danmaku, this.vt});
|
||||
|
||||
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
|
||||
collect: json['collect'] as int?,
|
||||
play: json['play'] as int?,
|
||||
danmaku: json['danmaku'] as int?,
|
||||
vt: json['vt'] as int?,
|
||||
);
|
||||
}
|
||||
18
lib/models_new/sub/sub_detail/data.dart
Normal file
18
lib/models_new/sub/sub_detail/data.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import "package:PiliPlus/models_new/sub/sub_detail/info.dart";
|
||||
import 'package:PiliPlus/models_new/sub/sub_detail/media.dart';
|
||||
|
||||
class SubDetailData {
|
||||
Info? info;
|
||||
List<SubDetailItemModel>? medias;
|
||||
|
||||
SubDetailData({this.info, this.medias});
|
||||
|
||||
factory SubDetailData.fromJson(Map<String, dynamic> json) => SubDetailData(
|
||||
info: json['info'] == null
|
||||
? null
|
||||
: Info.fromJson(json['info'] as Map<String, dynamic>),
|
||||
medias: (json['medias'] as List<dynamic>?)
|
||||
?.map((e) => SubDetailItemModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
42
lib/models_new/sub/sub_detail/info.dart
Normal file
42
lib/models_new/sub/sub_detail/info.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'package:PiliPlus/models_new/sub/sub_detail/cnt_info.dart';
|
||||
import 'package:PiliPlus/models_new/sub/sub_detail/upper.dart';
|
||||
|
||||
class Info {
|
||||
int? id;
|
||||
int? seasonType;
|
||||
String? title;
|
||||
String? cover;
|
||||
Upper? upper;
|
||||
CntInfo? cntInfo;
|
||||
int? mediaCount;
|
||||
String? intro;
|
||||
int? enableVt;
|
||||
|
||||
Info({
|
||||
this.id,
|
||||
this.seasonType,
|
||||
this.title,
|
||||
this.cover,
|
||||
this.upper,
|
||||
this.cntInfo,
|
||||
this.mediaCount,
|
||||
this.intro,
|
||||
this.enableVt,
|
||||
});
|
||||
|
||||
factory Info.fromJson(Map<String, dynamic> json) => Info(
|
||||
id: json['id'] as int?,
|
||||
seasonType: json['season_type'] as int?,
|
||||
title: json['title'] as String?,
|
||||
cover: json['cover'] as String?,
|
||||
upper: json['upper'] == null
|
||||
? null
|
||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
||||
cntInfo: json['cnt_info'] == null
|
||||
? null
|
||||
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
||||
mediaCount: json['media_count'] as int?,
|
||||
intro: json['intro'] as String?,
|
||||
enableVt: json['enable_vt'] as int?,
|
||||
);
|
||||
}
|
||||
49
lib/models_new/sub/sub_detail/media.dart
Normal file
49
lib/models_new/sub/sub_detail/media.dart
Normal file
@@ -0,0 +1,49 @@
|
||||
import 'package:PiliPlus/models_new/sub/sub_detail/cnt_info.dart';
|
||||
import 'package:PiliPlus/models_new/sub/sub_detail/upper.dart';
|
||||
|
||||
class SubDetailItemModel {
|
||||
int? id;
|
||||
String? title;
|
||||
String? cover;
|
||||
int? duration;
|
||||
int? pubtime;
|
||||
String? bvid;
|
||||
Upper? upper;
|
||||
CntInfo? cntInfo;
|
||||
int? enableVt;
|
||||
String? vtDisplay;
|
||||
bool? isSelfView;
|
||||
|
||||
SubDetailItemModel({
|
||||
this.id,
|
||||
this.title,
|
||||
this.cover,
|
||||
this.duration,
|
||||
this.pubtime,
|
||||
this.bvid,
|
||||
this.upper,
|
||||
this.cntInfo,
|
||||
this.enableVt,
|
||||
this.vtDisplay,
|
||||
this.isSelfView,
|
||||
});
|
||||
|
||||
factory SubDetailItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
SubDetailItemModel(
|
||||
id: json['id'] as int?,
|
||||
title: json['title'] as String?,
|
||||
cover: json['cover'] as String?,
|
||||
duration: json['duration'] as int?,
|
||||
pubtime: json['pubtime'] as int?,
|
||||
bvid: json['bvid'] as String?,
|
||||
upper: json['upper'] == null
|
||||
? null
|
||||
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
|
||||
cntInfo: json['cnt_info'] == null
|
||||
? null
|
||||
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
|
||||
enableVt: json['enable_vt'] as int?,
|
||||
vtDisplay: json['vt_display'] as String?,
|
||||
isSelfView: json['is_self_view'] as bool?,
|
||||
);
|
||||
}
|
||||
11
lib/models_new/sub/sub_detail/upper.dart
Normal file
11
lib/models_new/sub/sub_detail/upper.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class Upper {
|
||||
int? mid;
|
||||
String? name;
|
||||
|
||||
Upper({this.mid, this.name});
|
||||
|
||||
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
|
||||
mid: json['mid'] as int?,
|
||||
name: json['name'] as String?,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user