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,30 @@
import 'package:PiliPlus/models_new/video/video_play_info/interaction.dart';
import 'package:PiliPlus/models_new/video/video_play_info/subtitle_info.dart';
import 'package:PiliPlus/models_new/video/video_play_info/view_point.dart';
class PlayInfoData {
int? lastPlayCid;
SubtitleInfo? subtitle;
List<ViewPoint>? viewPoints;
Interaction? interaction;
PlayInfoData({
this.lastPlayCid,
this.subtitle,
this.viewPoints,
this.interaction,
});
factory PlayInfoData.fromJson(Map<String, dynamic> json) => PlayInfoData(
lastPlayCid: json['last_play_cid'] as int?,
subtitle: json['subtitle'] == null
? null
: SubtitleInfo.fromJson(json['subtitle'] as Map<String, dynamic>),
viewPoints: (json['view_points'] as List?)
?.map((e) => ViewPoint.fromJson(e))
.toList(),
interaction: json["interaction"] == null
? null
: Interaction.fromJson(json["interaction"]),
);
}

View File

@@ -0,0 +1,34 @@
class Interaction {
HistoryNode? historyNode;
int? graphVersion;
Interaction({
this.historyNode,
this.graphVersion,
});
factory Interaction.fromJson(Map<String, dynamic> json) => Interaction(
historyNode: json["history_node"] == null
? null
: HistoryNode.fromJson(json["history_node"]),
graphVersion: json["graph_version"],
);
}
class HistoryNode {
int? nodeId;
String? title;
int? cid;
HistoryNode({
this.nodeId,
this.title,
this.cid,
});
factory HistoryNode.fromJson(Map<String, dynamic> json) => HistoryNode(
nodeId: json["node_id"],
title: json["title"],
cid: json["cid"],
);
}

View File

@@ -0,0 +1,20 @@
class Subtitle {
String? lan;
String? lanDoc;
String? subtitleUrl;
String? subtitleUrlV2;
Subtitle({
this.lan,
this.lanDoc,
this.subtitleUrl,
this.subtitleUrlV2,
});
factory Subtitle.fromJson(Map<String, dynamic> json) => Subtitle(
lan: json["lan"],
lanDoc: json["lan_doc"],
subtitleUrl: json["subtitle_url"],
subtitleUrlV2: json["subtitle_url_v2"],
);
}

View File

@@ -0,0 +1,17 @@
import 'package:PiliPlus/models_new/video/video_play_info/subtitle.dart';
class SubtitleInfo {
String? lan;
String? lanDoc;
List<Subtitle>? subtitles;
SubtitleInfo({this.lan, this.lanDoc, this.subtitles});
factory SubtitleInfo.fromJson(Map<String, dynamic> json) => SubtitleInfo(
lan: json['lan'] as String?,
lanDoc: json['lan_doc'] as String?,
subtitles: (json['subtitles'] as List<dynamic>?)
?.map((e) => Subtitle.fromJson(e as Map<String, dynamic>))
.toList(),
);
}

View File

@@ -0,0 +1,32 @@
class ViewPoint {
int? type;
int? from;
int? to;
String? content;
String? imgUrl;
String? logoUrl;
String? teamType;
String? teamName;
ViewPoint({
this.type,
this.from,
this.to,
this.content,
this.imgUrl,
this.logoUrl,
this.teamType,
this.teamName,
});
factory ViewPoint.fromJson(Map<String, dynamic> json) => ViewPoint(
type: json["type"],
from: json["from"],
to: json["to"],
content: json["content"],
imgUrl: json["imgUrl"],
logoUrl: json["logoUrl"],
teamType: json["team_type"],
teamName: json["team_name"],
);
}