This commit is contained in:
macbook_max
2026-10-15 20:36:59 +08:00
commit 6bf949949c
7923 changed files with 1369582 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
/// 观看上报(计费)响应模型(《03-接口文档》5.3)
class WatchResult {
WatchResult({
required this.costType,
required this.costPoints,
required this.remainingPoints,
required this.freeRemainingToday,
});
/// 计费类型:0 占用免费额度 / 1 积分扣减 / 2 会员免费 / 3 重复观看或本人作品
final int costType;
/// 本次扣除积分(cost_type=1 时为 1,其余为 0)
final int costPoints;
/// 当前剩余积分
final int remainingPoints;
/// 今日免费观看剩余次数
final int freeRemainingToday;
bool get isPointsCost => costType == 1;
factory WatchResult.fromJson(Map<String, dynamic> json) => WatchResult(
costType: (json['cost_type'] as num?)?.toInt() ?? 0,
costPoints: (json['cost_points'] as num?)?.toInt() ?? 0,
remainingPoints: (json['remaining_points'] as num?)?.toInt() ?? 0,
freeRemainingToday: (json['free_remaining_today'] as num?)?.toInt() ?? 0,
);
}