opt model

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-10 15:11:40 +08:00
parent bdf3cfc750
commit 88288f4a7a
44 changed files with 266 additions and 549 deletions

View File

@@ -2,22 +2,40 @@ class CntInfo {
int? collect;
int? play;
int? thumbUp;
int? thumbDown;
int? share;
int? reply;
int? danmaku;
int? coin;
int? vt;
int? playSwitch;
String? viewText1;
CntInfo({
this.collect,
this.play,
this.thumbUp,
this.thumbDown,
this.share,
this.reply,
this.danmaku,
this.coin,
this.vt,
this.playSwitch,
this.viewText1,
});
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
collect: json['collect'] as int?,
play: json['play'] as int?,
thumbUp: json['thumb_up'] as int?,
thumbDown: json['thumb_down'] as int?,
share: json['share'] as int?,
reply: json['reply'] as int?,
danmaku: json['danmaku'] as int?,
coin: json['coin'] as int?,
vt: json['vt'] as int?,
playSwitch: json['play_switch'] as int?,
viewText1: json['view_text_1'] as String?,
);
}

View File

@@ -1,8 +1,8 @@
import 'package:PiliPlus/models_new/fav/fav_detail/media.dart';
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
class FavDetailData {
FavVideoItemModel? info;
FavFolderInfo? info;
List<FavDetailItemModel>? medias;
bool? hasMore;
int? ttl;
@@ -12,7 +12,7 @@ class FavDetailData {
factory FavDetailData.fromJson(Map<String, dynamic> json) => FavDetailData(
info: json['info'] == null
? null
: FavVideoItemModel.fromJson(json['info'] as Map<String, dynamic>),
: FavFolderInfo.fromJson(json['info'] as Map<String, dynamic>),
medias: (json['medias'] as List<dynamic>?)
?.map((e) => FavDetailItemModel.fromJson(e as Map<String, dynamic>))
.toList(),

View File

@@ -1,5 +1,5 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
import 'package:PiliPlus/models_new/fav/fav_detail/upper.dart';
class FavDetailInfo {
int? id;
@@ -8,7 +8,7 @@ class FavDetailInfo {
int? attr;
String? title;
String? cover;
Upper? upper;
Owner? upper;
int? coverType;
CntInfo? cntInfo;
int? type;
@@ -51,7 +51,7 @@ class FavDetailInfo {
cover: json['cover'] as String?,
upper: json['upper'] == null
? null
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
coverType: json['cover_type'] as int?,
cntInfo: json['cnt_info'] == null
? null

View File

@@ -1,7 +1,7 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models_new/fav/fav_detail/cnt_info.dart';
import 'package:PiliPlus/models_new/fav/fav_detail/ogv.dart';
import 'package:PiliPlus/models_new/fav/fav_detail/ugc.dart';
import 'package:PiliPlus/models_new/fav/fav_detail/upper.dart';
import 'package:PiliPlus/pages/common/multi_select_controller.dart';
class FavDetailItemModel with MultiSelectData {
@@ -12,7 +12,7 @@ class FavDetailItemModel with MultiSelectData {
String? intro;
int? page;
int? duration;
Upper? upper;
Owner? upper;
int? attr;
CntInfo? cntInfo;
String? link;
@@ -56,7 +56,7 @@ class FavDetailItemModel with MultiSelectData {
duration: json['duration'] as int?,
upper: json['upper'] == null
? null
: Upper.fromJson(json['upper'] as Map<String, dynamic>),
: Owner.fromJson(json['upper'] as Map<String, dynamic>),
attr: json['attr'] as int?,
cntInfo: json['cnt_info'] == null
? null

View File

@@ -1,26 +0,0 @@
class Upper {
int? mid;
String? name;
String? face;
bool? followed;
int? vipType;
int? vipStatue;
Upper({
this.mid,
this.name,
this.face,
this.followed,
this.vipType,
this.vipStatue,
});
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
mid: json['mid'] as int?,
name: json['name'] as String?,
face: json['face'] as String?,
followed: json['followed'] as bool?,
vipType: json['vip_type'] as int?,
vipStatue: json['vip_statue'] as int?,
);
}

View File

@@ -0,0 +1,17 @@
import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
class FavFolderData {
int? count;
List<FavFolderInfo>? list;
bool? hasMore;
FavFolderData({this.count, this.list, this.hasMore});
factory FavFolderData.fromJson(Map<String, dynamic> json) => FavFolderData(
count: json['count'] as int?,
list: (json['list'] as List<dynamic>?)
?.map((e) => FavFolderInfo.fromJson(e as Map<String, dynamic>))
.toList(),
hasMore: json['has_more'] as bool?,
);
}

View File

@@ -1,21 +1,21 @@
import 'package:PiliPlus/models_new/fav/fav_video/upper.dart';
import 'package:PiliPlus/models/model_owner.dart';
class FavVideoItemModel {
int? id;
class FavFolderInfo {
int id;
int? fid;
int? mid;
int? attr;
int mid;
int attr;
String? attrDesc;
String? title;
String? cover;
Upper? upper;
String title;
String cover;
Owner? upper;
int? coverType;
String? intro;
int? ctime;
int? mtime;
int? state;
int? favState;
int? mediaCount;
int mediaCount;
int? viewCount;
int? vt;
bool? isTop;
@@ -25,14 +25,14 @@ class FavVideoItemModel {
String? link;
String? bvid;
FavVideoItemModel({
this.id,
FavFolderInfo({
this.id = 0,
this.fid,
this.mid,
this.attr,
this.mid = 0,
this.attr = -1,
this.attrDesc,
this.title,
this.cover,
this.title = '',
this.cover = '',
this.upper,
this.coverType,
this.intro,
@@ -40,7 +40,7 @@ class FavVideoItemModel {
this.mtime,
this.state,
this.favState,
this.mediaCount,
this.mediaCount = 0,
this.viewCount,
this.vt,
this.isTop,
@@ -51,25 +51,24 @@ class FavVideoItemModel {
this.bvid,
});
factory FavVideoItemModel.fromJson(Map<String, dynamic> json) =>
FavVideoItemModel(
id: json['id'] as int?,
factory FavFolderInfo.fromJson(Map<String, dynamic> json) => FavFolderInfo(
id: json['id'] as int? ?? 0,
fid: json['fid'] as int?,
mid: json['mid'] as int?,
attr: json['attr'] as int?,
mid: json['mid'] as int? ?? 0,
attr: json['attr'] as int? ?? 0,
attrDesc: json['attr_desc'] as String?,
title: json['title'] as String?,
cover: json['cover'] 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>),
: Owner.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?,
mediaCount: json['media_count'] as int? ?? 0,
viewCount: json['view_count'] as int?,
vt: json['vt'] as int?,
isTop: json['is_top'] as bool?,

View File

@@ -1,15 +0,0 @@
class CntInfo {
int? collect;
int? play;
int? thumbUp;
int? share;
CntInfo({this.collect, this.play, this.thumbUp, this.share});
factory CntInfo.fromJson(Map<String, dynamic> json) => CntInfo(
collect: json['collect'] as int?,
play: json['play'] as int?,
thumbUp: json['thumb_up'] as int?,
share: json['share'] as int?,
);
}

View File

@@ -1,69 +0,0 @@
import 'package:PiliPlus/models_new/fav/fav_folder_info/cnt_info.dart';
import 'package:PiliPlus/models_new/fav/fav_folder_info/upper.dart';
class FolderInfo {
int? id;
int? fid;
int? mid;
int? attr;
String? title;
String? cover;
Upper? upper;
int? coverType;
CntInfo? cntInfo;
int? type;
String? intro;
int? ctime;
int? mtime;
int? state;
int? favState;
int? likeState;
int? mediaCount;
bool? isTop;
FolderInfo({
this.id,
this.fid,
this.mid,
this.attr,
this.title,
this.cover,
this.upper,
this.coverType,
this.cntInfo,
this.type,
this.intro,
this.ctime,
this.mtime,
this.state,
this.favState,
this.likeState,
this.mediaCount,
this.isTop,
});
factory FolderInfo.fromJson(Map<String, dynamic> json) => FolderInfo(
id: json['id'] as int?,
fid: json['fid'] as int?,
mid: json['mid'] as int?,
attr: json['attr'] 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>),
coverType: json['cover_type'] as int?,
cntInfo: json['cnt_info'] == null
? null
: CntInfo.fromJson(json['cnt_info'] as Map<String, dynamic>),
type: json['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?,
likeState: json['like_state'] as int?,
mediaCount: json['media_count'] as int?,
isTop: json['is_top'] as bool?,
);
}

View File

@@ -1,26 +0,0 @@
class Upper {
int? mid;
String? name;
String? face;
bool? followed;
int? vipType;
int? vipStatue;
Upper({
this.mid,
this.name,
this.face,
this.followed,
this.vipType,
this.vipStatue,
});
factory Upper.fromJson(Map<String, dynamic> json) => Upper(
mid: json['mid'] as int?,
name: json['name'] as String?,
face: json['face'] as String?,
followed: json['followed'] as bool?,
vipType: json['vip_type'] as int?,
vipStatue: json['vip_statue'] as int?,
);
}

View File

@@ -1,17 +0,0 @@
import 'package:PiliPlus/models_new/fav/fav_video/list.dart';
class FavVideoData {
int? count;
List<FavVideoItemModel>? list;
bool? hasMore;
FavVideoData({this.count, this.list, this.hasMore});
factory FavVideoData.fromJson(Map<String, dynamic> json) => FavVideoData(
count: json['count'] as int?,
list: (json['list'] as List<dynamic>?)
?.map((e) => FavVideoItemModel.fromJson(e as Map<String, dynamic>))
.toList(),
hasMore: json['has_more'] as bool?,
);
}

View File

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