mod: app端推荐参数补充,统一部分代码位置

This commit is contained in:
orz12
2024-07-11 17:17:22 +08:00
parent 376dae8570
commit 212a87b84c
11 changed files with 290 additions and 306 deletions

View File

@@ -46,7 +46,7 @@ class RecVideoItemModel {
@HiveField(11)
int? isFollowed;
@HiveField(12)
RcmdReason? rcmdReason;
String? rcmdReason;
RecVideoItemModel.fromJson(Map<String, dynamic> json) {
id = json["id"];
@@ -61,9 +61,10 @@ class RecVideoItemModel {
owner = Owner.fromJson(json["owner"]);
stat = Stat.fromJson(json["stat"]);
isFollowed = json["is_followed"] ?? 0;
rcmdReason = json["rcmd_reason"] != null
? RcmdReason.fromJson(json["rcmd_reason"])
: RcmdReason(content: '');
// rcmdReason = json["rcmd_reason"] != null
// ? RcmdReason.fromJson(json["rcmd_reason"])
// : RcmdReason(content: '');
rcmdReason = json["rcmd_reason"]?['content'];
}
}
@@ -89,19 +90,19 @@ class Stat {
}
}
@HiveType(typeId: 2)
class RcmdReason {
RcmdReason({
this.reasonType,
this.content,
});
@HiveField(0)
int? reasonType;
@HiveField(1)
String? content = '';
RcmdReason.fromJson(Map<String, dynamic> json) {
reasonType = json["reason_type"];
content = json["content"] ?? '';
}
}
// @HiveType(typeId: 2)
// class RcmdReason {
// RcmdReason({
// this.reasonType,
// this.content,
// });
// @HiveField(0)
// int? reasonType;
// @HiveField(1)
// String? content = '';
//
// RcmdReason.fromJson(Map<String, dynamic> json) {
// reasonType = json["reason_type"];
// content = json["content"] ?? '';
// }
// }