初始化

This commit is contained in:
谢宇宁
2026-09-15 15:44:13 +07:00
commit a23ba685e9
1065 changed files with 101122 additions and 0 deletions
@@ -0,0 +1,38 @@
/// 评论区置顶 BannerGET /banner/list?scene=COMMENT_TOP
class CommentTopBannerModel {
String? id;
String? imageUrl;
String? mediaType; // IMAGE | GIF
String? linkType; // INTERNAL | EXTERNAL | NONE
String? linkValue;
int? sort;
CommentTopBannerModel({
this.id,
this.imageUrl,
this.mediaType,
this.linkType,
this.linkValue,
this.sort,
});
bool get hasLink {
final t = linkType?.toUpperCase();
return t == 'INTERNAL' || t == 'EXTERNAL';
}
bool get isGif =>
mediaType?.toUpperCase() == 'GIF' || (imageUrl?.toLowerCase().contains('.gif') ?? false);
factory CommentTopBannerModel.fromJson(Map<String, dynamic>? json) {
json ??= {};
return CommentTopBannerModel(
id: json['id']?.toString(),
imageUrl: json['imageUrl']?.toString(),
mediaType: json['mediaType']?.toString(),
linkType: json['linkType']?.toString(),
linkValue: json['linkValue']?.toString(),
sort: json['sort'] is int ? json['sort'] as int : int.tryParse('${json['sort'] ?? ''}'),
);
}
}