refa: opus (#762)

* feat: opus

* fix

* fix

* fix

* fix

* .

* fix

* remove

* wbi sign

* fix

* opus content null check

Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
My-Responsitories
2025-04-27 17:24:14 +08:00
committed by GitHub
parent 3722ff1f33
commit bd3c76ef43
86 changed files with 1259 additions and 3222 deletions

View File

@@ -0,0 +1,308 @@
class ArticleContentModel {
int? align;
int? paraType;
Text? text;
Format? format;
Line? line;
Pic? pic;
LinkCard? linkCard;
Code? code;
L1st? list;
ArticleContentModel.fromJson(Map<String, dynamic> json) {
align = json['align'];
paraType = json['para_type'];
text = json['text'] == null ? null : Text.fromJson(json['text']);
format = json['format'] == null ? null : Format.fromJson(json['format']);
line = json['line'] == null ? null : Line.fromJson(json['line']);
pic = json['pic'] == null ? null : Pic.fromJson(json['pic']);
linkCard =
json['link_card'] == null ? null : LinkCard.fromJson(json['link_card']);
code = json['code'] == null ? null : Code.fromJson(json['code']);
list = json['list'] == null ? null : L1st.fromJson(json['list']);
}
}
class Pic {
List<Pic>? pics;
int? style;
String? url;
num? width;
num? height;
num? size;
String? liveUrl;
double? calHeight;
Pic.fromJson(Map<String, dynamic> json) {
url = json['url'];
width = json['width'];
height = json['height'];
size = json['size'];
pics = (json['pics'] as List?)?.map((item) => Pic.fromJson(item)).toList();
style = json['style'];
liveUrl = json['live_url'];
}
void onCalHeight(double maxWidth) {
if (calHeight == null && height != null && width != null) {
calHeight = maxWidth * height! / width!;
}
}
}
class Line {
Line({
this.pic,
});
Pic? pic;
Line.fromJson(Map<String, dynamic> json) {
pic = json['pic'] == null ? null : Pic.fromJson(json['pic']);
}
}
class Format {
Format({
this.align,
});
int? align;
Format.fromJson(Map<String, dynamic> json) {
align = json['align'];
}
}
class Text {
Text({
this.nodes,
});
List<Nodes>? nodes;
Text.fromJson(Map<String, dynamic> json) {
nodes =
(json['nodes'] as List?)?.map((item) => Nodes.fromJson(item)).toList();
}
}
class Nodes {
int? nodeType;
Word? word;
Rich? rich;
Nodes.fromJson(Map<String, dynamic> json) {
nodeType = json['node_type'];
word = json['word'] == null ? null : Word.fromJson(json['word']);
rich = json['rich'] == null ? null : Rich.fromJson(json['rich']);
}
}
class Word {
String? words;
double? fontSize;
Style? style;
int? color;
String? fontLevel;
Word.fromJson(Map<String, dynamic> json) {
words = json['words'];
fontSize = (json['font_size'] as num?)?.toDouble();
style = json['style'] == null ? null : Style.fromJson(json['style']);
color = json['color'] == null
? null
: int.tryParse('FF${(json['color'] as String).substring(1)}',
radix: 16);
fontLevel = json['font_level'];
}
}
class Style {
Style({
this.bold,
this.italic,
this.strikethrough,
});
bool? bold;
bool? italic;
bool? strikethrough;
Style.fromJson(Map<String, dynamic> json) {
bold = json['bold'];
italic = json['italic'];
strikethrough = json['strikethrough'];
}
}
class Rich {
Style? style;
String? jumpUrl;
String? origText;
String? text;
Rich.fromJson(Map<String, dynamic> json) {
style = json['style'] == null ? null : Style.fromJson(json['style']);
jumpUrl = json['jump_url'];
origText = json['orig_text'];
text = json['text'];
}
}
class Ugc {
String? cover;
String? descSecond;
String? duration;
String? headText;
String? idStr;
String? jumpUrl;
bool? multiLine;
String? title;
Ugc.fromJson(Map<String, dynamic> json) {
cover = json['cover'];
descSecond = json['desc_second'];
duration = json['duration'];
headText = json['head_text'];
idStr = json['id_str'];
jumpUrl = json['jump_url'];
multiLine = json['multi_line'];
title = json['title'];
}
}
class Card {
String? oid;
String? type;
Ugc? ugc;
Card.fromJson(Map<String, dynamic> json) {
oid = json['oid'];
type = json['type'];
ugc = json['ugc'] == null ? null : Ugc.fromJson(json['ugc']);
}
}
class LinkCard {
LinkCard({
this.card,
});
Card? card;
LinkCard.fromJson(Map<String, dynamic> json) {
card = json['card'] == null ? null : Card.fromJson(json['card']);
}
}
class L1st {
List<Item>? items;
int? style;
L1st.fromJson(Map<String, dynamic> json) {
items = (json['items'] as List?)?.map((e) => Item.fromJson(e)).toList();
style = json['style'];
}
}
class Item {
int? level;
int? order;
List<Nodes>? nodes;
Item.fromJson(Map<String, dynamic> json) {
level = json['level'];
order = json['order'];
nodes = (json['nodes'] as List?)?.map((e) => Nodes.fromJson(e)).toList();
}
}
class Code {
String? content;
String? lang;
Code.fromJson(Map<String, dynamic> json) {
content = json['content'];
lang = json['lang'];
}
}
// class ArticleContentModel {
// ArticleContentModel({
// this.attributes,
// this.insert,
// });
// Attributes? attributes;
// dynamic insert;
// ArticleContentModel.fromJson(Map<String, dynamic> json) {
// attributes = json['attributes'] == null
// ? null
// : Attributes.fromJson(json['attributes']);
// insert = json['insert'] == null
// ? null
// : json['attributes']?['class'] == 'normal-img'
// ? Insert.fromJson(json['insert'])
// : json['insert'];
// }
// }
// class Insert {
// Insert({
// this.nativeImage,
// });
// NativeImage? nativeImage;
// Insert.fromJson(Map<String, dynamic> json) {
// nativeImage = json['native-image'] == null
// ? null
// : NativeImage.fromJson(json['native-image']);
// }
// }
// class NativeImage {
// NativeImage({
// this.alt,
// this.url,
// this.width,
// this.height,
// this.size,
// this.status,
// });
// dynamic alt;
// dynamic url;
// dynamic width;
// dynamic height;
// dynamic size;
// dynamic status;
// NativeImage.fromJson(Map<String, dynamic> json) {
// alt = json['alt'];
// url = json['url'];
// width = json['width'];
// height = json['height'];
// size = json['size'];
// status = json['status'];
// }
// }
// class Attributes {
// Attributes({
// this.clazz,
// this.bold,
// this.color,
// this.italic,
// this.strike,
// });
// String? clazz;
// bool? bold;
// String? color;
// bool? italic;
// bool? strike;
// Attributes.fromJson(Map<String, dynamic> json) {
// clazz = json['class'];
// bold = json['bold'];
// color = json['color'];
// italic = json['italic'];
// strike = json['strike'];
// }
// }

View File

@@ -1,26 +0,0 @@
import 'data.dart';
class ArticleView {
int? code;
String? message;
int? ttl;
ArticleData? data;
ArticleView({this.code, this.message, this.ttl, this.data});
factory ArticleView.fromJson(Map<String, dynamic> json) => ArticleView(
code: json['code'] as int?,
message: json['message'] as String?,
ttl: json['ttl'] as int?,
data: json['data'] == null
? null
: ArticleData.fromJson(json['data'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'ttl': ttl,
'data': data?.toJson(),
};
}

View File

@@ -1,60 +0,0 @@
import 'nameplate.dart';
import 'official_verify.dart';
import 'pendant.dart';
import 'vip.dart';
class Author {
int? mid;
String? name;
String? face;
Pendant? pendant;
OfficialVerify? officialVerify;
Nameplate? nameplate;
Vip? vip;
int? fans;
int? level;
Author({
this.mid,
this.name,
this.face,
this.pendant,
this.officialVerify,
this.nameplate,
this.vip,
this.fans,
this.level,
});
factory Author.fromJson(Map<String, dynamic> json) => Author(
mid: json['mid'] as int?,
name: json['name'] as String?,
face: json['face'] as String?,
pendant: json['pendant'] == null
? null
: Pendant.fromJson(json['pendant'] as Map<String, dynamic>),
officialVerify: json['official_verify'] == null
? null
: OfficialVerify.fromJson(json['official_verify'] as Map<String, dynamic>),
nameplate: json['nameplate'] == null
? null
: Nameplate.fromJson(json['nameplate'] as Map<String, dynamic>),
vip: json['vip'] == null
? null
: Vip.fromJson(json['vip'] as Map<String, dynamic>),
fans: json['fans'] as int?,
level: json['level'] as int?,
);
Map<String, dynamic> toJson() => {
'mid': mid,
'name': name,
'face': face,
'pendant': pendant?.toJson(),
'official_verify': officialVerify?.toJson(),
'nameplate': nameplate?.toJson(),
'vip': vip?.toJson(),
'fans': fans,
'level': level,
};
}

View File

@@ -1,19 +0,0 @@
class Category {
int? id;
int? parentId;
String? name;
Category({this.id, this.parentId, this.name});
factory Category.fromJson(Map<String, dynamic> json) => Category(
id: json['id'] as int?,
parentId: json['parent_id'] as int?,
name: json['name'] as String?,
);
Map<String, dynamic> toJson() => {
'id': id,
'parent_id': parentId,
'name': name,
};
}

View File

@@ -1,206 +0,0 @@
import 'package:PiliPlus/models/dynamics/opus_detail/module.dart';
import 'package:PiliPlus/models/dynamics/opus_detail/module_content.dart';
import 'package:PiliPlus/models/dynamics/opus_detail/paragraph.dart';
import 'author.dart';
import 'category.dart';
import 'media.dart';
import 'stats.dart';
import 'tag.dart';
class ArticleData {
int? id;
Category? category;
List<Category>? categories;
String? title;
String? summary;
String? bannerUrl;
int? templateId;
int? state;
Author? author;
int? reprint;
List? imageUrls;
int? publishTime;
int? ctime;
int? mtime;
Stats? stats;
List<Tag>? tags;
int? words;
List? originImageUrls;
dynamic list;
bool? isLike;
Media? media;
String? applyTime;
String? checkTime;
int? original;
int? actId;
dynamic dispute;
dynamic authenMark;
int? coverAvid;
dynamic topVideoInfo;
int? type;
int? checkState;
int? originTemplateId;
int? privatePub;
dynamic contentPicList;
String? content;
String? keywords;
int? versionId;
String? dynIdStr;
int? totalArtNum;
List<OpusModule>? modules;
ArticleData({
this.id,
this.category,
this.categories,
this.title,
this.summary,
this.bannerUrl,
this.templateId,
this.state,
this.author,
this.reprint,
this.imageUrls,
this.publishTime,
this.ctime,
this.mtime,
this.stats,
this.tags,
this.words,
this.originImageUrls,
this.list,
this.isLike,
this.media,
this.applyTime,
this.checkTime,
this.original,
this.actId,
this.dispute,
this.authenMark,
this.coverAvid,
this.topVideoInfo,
this.type,
this.checkState,
this.originTemplateId,
this.privatePub,
this.contentPicList,
this.content,
this.keywords,
this.versionId,
this.dynIdStr,
this.totalArtNum,
this.modules,
});
factory ArticleData.fromJson(Map<String, dynamic> json) {
final data = ArticleData(
id: json['id'] as int?,
category: json['category'] == null
? null
: Category.fromJson(json['category'] as Map<String, dynamic>),
categories: (json['categories'] as List<dynamic>?)
?.map((e) => Category.fromJson(e as Map<String, dynamic>))
.toList(),
title: json['title'] as String?,
summary: json['summary'] as String?,
bannerUrl: json['banner_url'] as String?,
templateId: json['template_id'] as int?,
state: json['state'] as int?,
author: json['author'] == null
? null
: Author.fromJson(json['author'] as Map<String, dynamic>),
reprint: json['reprint'] as int?,
imageUrls: json['image_urls'],
publishTime: json['publish_time'] as int?,
ctime: json['ctime'] as int?,
mtime: json['mtime'] as int?,
stats: json['stats'] == null
? null
: Stats.fromJson(json['stats'] as Map<String, dynamic>),
tags: (json['tags'] as List<dynamic>?)
?.map((e) => Tag.fromJson(e as Map<String, dynamic>))
.toList(),
words: json['words'] as int?,
originImageUrls: json['origin_image_urls'],
list: json['list'] as dynamic,
isLike: json['is_like'] as bool?,
media: json['media'] == null
? null
: Media.fromJson(json['media'] as Map<String, dynamic>),
applyTime: json['apply_time'] as String?,
checkTime: json['check_time'] as String?,
original: json['original'] as int?,
actId: json['act_id'] as int?,
dispute: json['dispute'] as dynamic,
authenMark: json['authenMark'] as dynamic,
coverAvid: json['cover_avid'] as int?,
topVideoInfo: json['top_video_info'] as dynamic,
type: json['type'] as int?,
checkState: json['check_state'] as int?,
originTemplateId: json['origin_template_id'] as int?,
privatePub: json['private_pub'] as int?,
contentPicList: json['content_pic_list'] as dynamic,
content: json['content'] as String?,
keywords: json['keywords'] as String?,
versionId: json['version_id'] as int?,
dynIdStr: json['dyn_id_str'] as String?,
totalArtNum: json['total_art_num'] as int?,
);
if (data.type == 3 && json['opus'] != null) {
data.modules = [
OpusModule(
moduleType: 'MODULE_TYPE_CONTENT',
moduleContent: ModuleContent(
paragraphs: (json['opus']?['content']?['paragraphs'] as List?)
?.map((e) => Paragraph.fromJson(e))
.toList(),
),
)
];
}
return data;
}
Map<String, dynamic> toJson() => {
'id': id,
'category': category?.toJson(),
'categories': categories?.map((e) => e.toJson()).toList(),
'title': title,
'summary': summary,
'banner_url': bannerUrl,
'template_id': templateId,
'state': state,
'author': author?.toJson(),
'reprint': reprint,
'image_urls': imageUrls,
'publish_time': publishTime,
'ctime': ctime,
'mtime': mtime,
'stats': stats?.toJson(),
'tags': tags?.map((e) => e.toJson()).toList(),
'words': words,
'origin_image_urls': originImageUrls,
'list': list,
'is_like': isLike,
'media': media?.toJson(),
'apply_time': applyTime,
'check_time': checkTime,
'original': original,
'act_id': actId,
'dispute': dispute,
'authenMark': authenMark,
'cover_avid': coverAvid,
'top_video_info': topVideoInfo,
'type': type,
'check_state': checkState,
'origin_template_id': originTemplateId,
'private_pub': privatePub,
'content_pic_list': contentPicList,
'content': content,
'keywords': keywords,
'version_id': versionId,
'dyn_id_str': dynIdStr,
'total_art_num': totalArtNum,
};
}

View File

@@ -1,19 +0,0 @@
class Label {
String? path;
String? text;
String? labelTheme;
Label({this.path, this.text, this.labelTheme});
factory Label.fromJson(Map<String, dynamic> json) => Label(
path: json['path'] as String?,
text: json['text'] as String?,
labelTheme: json['label_theme'] as String?,
);
Map<String, dynamic> toJson() => {
'path': path,
'text': text,
'label_theme': labelTheme,
};
}

View File

@@ -1,47 +0,0 @@
class Media {
int? score;
int? mediaId;
String? title;
String? cover;
String? area;
int? typeId;
String? typeName;
int? spoiler;
int? seasonId;
Media({
this.score,
this.mediaId,
this.title,
this.cover,
this.area,
this.typeId,
this.typeName,
this.spoiler,
this.seasonId,
});
factory Media.fromJson(Map<String, dynamic> json) => Media(
score: json['score'] as int?,
mediaId: json['media_id'] as int?,
title: json['title'] as String?,
cover: json['cover'] as String?,
area: json['area'] as String?,
typeId: json['type_id'] as int?,
typeName: json['type_name'] as String?,
spoiler: json['spoiler'] as int?,
seasonId: json['season_id'] as int?,
);
Map<String, dynamic> toJson() => {
'score': score,
'media_id': mediaId,
'title': title,
'cover': cover,
'area': area,
'type_id': typeId,
'type_name': typeName,
'spoiler': spoiler,
'season_id': seasonId,
};
}

View File

@@ -1,35 +0,0 @@
class Nameplate {
int? nid;
String? name;
String? image;
String? imageSmall;
String? level;
String? condition;
Nameplate({
this.nid,
this.name,
this.image,
this.imageSmall,
this.level,
this.condition,
});
factory Nameplate.fromJson(Map<String, dynamic> json) => Nameplate(
nid: json['nid'] as int?,
name: json['name'] as String?,
image: json['image'] as String?,
imageSmall: json['image_small'] as String?,
level: json['level'] as String?,
condition: json['condition'] as String?,
);
Map<String, dynamic> toJson() => {
'nid': nid,
'name': name,
'image': image,
'image_small': imageSmall,
'level': level,
'condition': condition,
};
}

View File

@@ -1,20 +0,0 @@
class OfficialVerify {
int? type;
String? desc;
OfficialVerify({this.type, this.desc});
factory OfficialVerify.fromJson(Map<String, dynamic> json) {
return OfficialVerify(
type: json['type'] as int?,
desc: json['desc'] as String?,
);
}
Map<String, dynamic> toJson() => {
'type': type,
'desc': desc,
};
}

View File

@@ -1,22 +0,0 @@
class Pendant {
int? pid;
String? name;
String? image;
int? expire;
Pendant({this.pid, this.name, this.image, this.expire});
factory Pendant.fromJson(Map<String, dynamic> json) => Pendant(
pid: json['pid'] as int?,
name: json['name'] as String?,
image: json['image'] as String?,
expire: json['expire'] as int?,
);
Map<String, dynamic> toJson() => {
'pid': pid,
'name': name,
'image': image,
'expire': expire,
};
}

View File

@@ -1,43 +0,0 @@
class Stats {
int? view;
int? favorite;
int? like;
int? dislike;
int? reply;
int? share;
int? coin;
int? dynam1c;
Stats({
this.view,
this.favorite,
this.like,
this.dislike,
this.reply,
this.share,
this.coin,
this.dynam1c,
});
factory Stats.fromJson(Map<String, dynamic> json) => Stats(
view: json['view'] as int?,
favorite: json['favorite'] as int?,
like: json['like'] as int?,
dislike: json['dislike'] as int?,
reply: json['reply'] as int?,
share: json['share'] as int?,
coin: json['coin'] as int?,
dynam1c: json['dynamic'] as int?,
);
Map<String, dynamic> toJson() => {
'view': view,
'favorite': favorite,
'like': like,
'dislike': dislike,
'reply': reply,
'share': share,
'coin': coin,
'dynamic': dynam1c,
};
}

View File

@@ -1,16 +0,0 @@
class Tag {
int? tid;
String? name;
Tag({this.tid, this.name});
factory Tag.fromJson(Map<String, dynamic> json) => Tag(
tid: json['tid'] as int?,
name: json['name'] as String?,
);
Map<String, dynamic> toJson() => {
'tid': tid,
'name': name,
};
}

View File

@@ -1,47 +0,0 @@
import 'label.dart';
class Vip {
int? type;
int? status;
int? dueDate;
int? vipPayType;
int? themeType;
Label? label;
int? avatarSubscript;
String? nicknameColor;
Vip({
this.type,
this.status,
this.dueDate,
this.vipPayType,
this.themeType,
this.label,
this.avatarSubscript,
this.nicknameColor,
});
factory Vip.fromJson(Map<String, dynamic> json) => Vip(
type: json['type'] as int?,
status: json['status'] as int?,
dueDate: json['due_date'] as int?,
vipPayType: json['vip_pay_type'] as int?,
themeType: json['theme_type'] as int?,
label: json['label'] == null
? null
: Label.fromJson(json['label'] as Map<String, dynamic>),
avatarSubscript: json['avatar_subscript'] as int?,
nicknameColor: json['nickname_color'] as String?,
);
Map<String, dynamic> toJson() => {
'type': type,
'status': status,
'due_date': dueDate,
'vip_pay_type': vipPayType,
'theme_type': themeType,
'label': label?.toJson(),
'avatar_subscript': avatarSubscript,
'nickname_color': nicknameColor,
};
}

View File

@@ -1,26 +0,0 @@
import 'container_size.dart';
import 'fallback_layers.dart';
class Avatar {
ContainerSize? containerSize;
FallbackLayers? fallbackLayers;
String? mid;
Avatar({this.containerSize, this.fallbackLayers, this.mid});
factory Avatar.fromJson(Map<String, dynamic> json) => Avatar(
containerSize: json['container_size'] == null
? null
: ContainerSize.fromJson(json['container_size'] as Map<String, dynamic>),
fallbackLayers: json['fallback_layers'] == null
? null
: FallbackLayers.fromJson(json['fallback_layers'] as Map<String, dynamic>),
mid: json['mid'] as String?,
);
Map<String, dynamic> toJson() => {
'container_size': containerSize?.toJson(),
'fallback_layers': fallbackLayers?.toJson(),
'mid': mid,
};
}

View File

@@ -1,17 +0,0 @@
import 'icon_resource.dart';
class AvatarIcon {
IconResource? iconResource;
AvatarIcon({this.iconResource});
factory AvatarIcon.fromJson(Map<String, dynamic> json) => AvatarIcon(
iconResource: json['icon_resource'] == null
? null
: IconResource.fromJson(json['icon_resource'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'icon_resource': iconResource?.toJson(),
};
}

View File

@@ -1,14 +0,0 @@
class AvatarLayer {
AvatarLayer();
factory AvatarLayer.fromJson(Map<String, dynamic> json) {
// TODO: implement fromJson
throw UnimplementedError('AvatarLayer.fromJson($json) is not implemented');
}
Map<String, dynamic> toJson() {
// TODO: implement toJson
throw UnimplementedError();
}
}

View File

@@ -1,39 +0,0 @@
import 'like_icon.dart';
class Basic {
String? commentIdStr;
int? commentType;
LikeIcon? likeIcon;
String? ridStr;
String? title;
int? uid;
Basic({
this.commentIdStr,
this.commentType,
this.likeIcon,
this.ridStr,
this.title,
this.uid,
});
factory Basic.fromJson(Map<String, dynamic> json) => Basic(
commentIdStr: json['comment_id_str'] as String?,
commentType: json['comment_type'] as int?,
likeIcon: json['like_icon'] == null
? null
: LikeIcon.fromJson(json['like_icon'] as Map<String, dynamic>),
ridStr: json['rid_str'] as String?,
title: json['title'] as String?,
uid: json['uid'] as int?,
);
Map<String, dynamic> toJson() => {
'comment_id_str': commentIdStr,
'comment_type': commentType,
'like_icon': likeIcon?.toJson(),
'rid_str': ridStr,
'title': title,
'uid': uid,
};
}

View File

@@ -1,19 +0,0 @@
class Coin {
int? count;
bool? forbidden;
bool? status;
Coin({this.count, this.forbidden, this.status});
factory Coin.fromJson(Map<String, dynamic> json) => Coin(
count: json['count'] as int?,
forbidden: json['forbidden'] as bool?,
status: json['status'] as bool?,
);
Map<String, dynamic> toJson() => {
'count': count,
'forbidden': forbidden,
'status': status,
};
}

View File

@@ -1,16 +0,0 @@
class Comment {
int? count;
bool? forbidden;
Comment({this.count, this.forbidden});
factory Comment.fromJson(Map<String, dynamic> json) => Comment(
count: json['count'] as int?,
forbidden: json['forbidden'] as bool?,
);
Map<String, dynamic> toJson() => {
'count': count,
'forbidden': forbidden,
};
}

View File

@@ -1,16 +0,0 @@
class ContainerSize {
double? height;
double? width;
ContainerSize({this.height, this.width});
factory ContainerSize.fromJson(Map<String, dynamic> json) => ContainerSize(
height: (json['height'] as num?)?.toDouble(),
width: (json['width'] as num?)?.toDouble(),
);
Map<String, dynamic> toJson() => {
'height': height,
'width': width,
};
}

View File

@@ -1,26 +0,0 @@
import 'fallback.dart';
import 'item.dart';
class OpusData {
Item? item;
Fallback? fallback;
OpusData({
this.item,
this.fallback,
});
factory OpusData.fromJson(Map<String, dynamic> json) => OpusData(
item: json['item'] == null
? null
: Item.fromJson(json['item'] as Map<String, dynamic>),
fallback: json['fallback'] == null
? null
: Fallback.fromJson(json['fallback']),
);
Map<String, dynamic> toJson() => {
'item': item?.toJson(),
'fallback': fallback?.toJson(),
};
}

View File

@@ -1,19 +0,0 @@
class Fallback {
String? id;
int? type;
Fallback({
this.id,
this.type,
});
factory Fallback.fromJson(Map<String, dynamic> json) => Fallback(
id: json['id'],
type: json['type'],
);
Map<String, dynamic> toJson() => {
'id': id,
'type': type,
};
}

View File

@@ -1,24 +0,0 @@
import 'layer.dart';
class FallbackLayers {
bool? isCriticalGroup;
List<Layer>? layers;
FallbackLayers({this.isCriticalGroup, this.layers});
factory FallbackLayers.fromJson(Map<String, dynamic> json) {
return FallbackLayers(
isCriticalGroup: json['is_critical_group'] as bool?,
layers: (json['layers'] as List<dynamic>?)
?.map((e) => Layer.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
Map<String, dynamic> toJson() => {
'is_critical_group': isCriticalGroup,
'layers': layers?.map((e) => e.toJson()).toList(),
};
}

View File

@@ -1,19 +0,0 @@
class Favorite {
int? count;
bool? forbidden;
bool? status;
Favorite({this.count, this.forbidden, this.status});
factory Favorite.fromJson(Map<String, dynamic> json) => Favorite(
count: json['count'] as int?,
forbidden: json['forbidden'] as bool?,
status: json['status'] as bool?,
);
Map<String, dynamic> toJson() => {
'count': count,
'forbidden': forbidden,
'status': status,
};
}

View File

@@ -1,16 +0,0 @@
class Forward {
int? count;
bool? forbidden;
Forward({this.count, this.forbidden});
factory Forward.fromJson(Map<String, dynamic> json) => Forward(
count: json['count'] as int?,
forbidden: json['forbidden'] as bool?,
);
Map<String, dynamic> toJson() => {
'count': count,
'forbidden': forbidden,
};
}

View File

@@ -1,20 +0,0 @@
import 'general_config.dart';
class GeneralCfg {
int? configType;
GeneralConfig? generalConfig;
GeneralCfg({this.configType, this.generalConfig});
factory GeneralCfg.fromJson(Map<String, dynamic> json) => GeneralCfg(
configType: json['config_type'] as int?,
generalConfig: json['general_config'] == null
? null
: GeneralConfig.fromJson(json['general_config'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'config_type': configType,
'general_config': generalConfig?.toJson(),
};
}

View File

@@ -1,17 +0,0 @@
import 'web_css_style.dart';
class GeneralConfig {
WebCssStyle? webCssStyle;
GeneralConfig({this.webCssStyle});
factory GeneralConfig.fromJson(Map<String, dynamic> json) => GeneralConfig(
webCssStyle: json['web_css_style'] == null
? null
: WebCssStyle.fromJson(json['web_css_style'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'web_css_style': webCssStyle?.toJson(),
};
}

View File

@@ -1,29 +0,0 @@
import 'pos_spec.dart';
import 'render_spec.dart';
import 'size_spec.dart';
class GeneralSpec {
PosSpec? posSpec;
RenderSpec? renderSpec;
SizeSpec? sizeSpec;
GeneralSpec({this.posSpec, this.renderSpec, this.sizeSpec});
factory GeneralSpec.fromJson(Map<String, dynamic> json) => GeneralSpec(
posSpec: json['pos_spec'] == null
? null
: PosSpec.fromJson(json['pos_spec'] as Map<String, dynamic>),
renderSpec: json['render_spec'] == null
? null
: RenderSpec.fromJson(json['render_spec'] as Map<String, dynamic>),
sizeSpec: json['size_spec'] == null
? null
: SizeSpec.fromJson(json['size_spec'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'pos_spec': posSpec?.toJson(),
'render_spec': renderSpec?.toJson(),
'size_spec': sizeSpec?.toJson(),
};
}

View File

@@ -1,14 +0,0 @@
class IconResource {
IconResource();
factory IconResource.fromJson(Map<String, dynamic> json) {
// TODO: implement fromJson
throw UnimplementedError('IconResource.fromJson($json) is not implemented');
}
Map<String, dynamic> toJson() {
// TODO: implement toJson
throw UnimplementedError();
}
}

View File

@@ -1,23 +0,0 @@
import 'remote.dart';
class ImageSrc {
int? placeholder;
Remote? remote;
int? srcType;
ImageSrc({this.placeholder, this.remote, this.srcType});
factory ImageSrc.fromJson(Map<String, dynamic> json) => ImageSrc(
placeholder: json['placeholder'] as int?,
remote: json['remote'] == null
? null
: Remote.fromJson(json['remote'] as Map<String, dynamic>),
srcType: json['src_type'] as int?,
);
Map<String, dynamic> toJson() => {
'placeholder': placeholder,
'remote': remote?.toJson(),
'src_type': srcType,
};
}

View File

@@ -1,29 +0,0 @@
import 'basic.dart';
import 'module.dart';
class Item {
Basic? basic;
String? idStr;
List<OpusModule>? modules;
int? type;
Item({this.basic, this.idStr, this.modules, this.type});
factory Item.fromJson(Map<String, dynamic> json) => Item(
basic: json['basic'] == null
? null
: Basic.fromJson(json['basic'] as Map<String, dynamic>),
idStr: json['id_str'] as String?,
modules: (json['modules'] as List<dynamic>?)
?.map((e) => OpusModule.fromJson(e as Map<String, dynamic>))
.toList(),
type: json['type'] as int?,
);
Map<String, dynamic> toJson() => {
'basic': basic?.toJson(),
'id_str': idStr,
'modules': modules?.map((e) => e.toJson()).toList(),
'type': type,
};
}

View File

@@ -1,59 +0,0 @@
class Label {
String? bgColor;
int? bgStyle;
String? borderColor;
String? imgLabelUriHans;
String? imgLabelUriHansStatic;
String? imgLabelUriHant;
String? imgLabelUriHantStatic;
String? labelTheme;
String? path;
String? text;
String? textColor;
bool? useImgLabel;
Label({
this.bgColor,
this.bgStyle,
this.borderColor,
this.imgLabelUriHans,
this.imgLabelUriHansStatic,
this.imgLabelUriHant,
this.imgLabelUriHantStatic,
this.labelTheme,
this.path,
this.text,
this.textColor,
this.useImgLabel,
});
factory Label.fromJson(Map<String, dynamic> json) => Label(
bgColor: json['bg_color'] as String?,
bgStyle: json['bg_style'] as int?,
borderColor: json['border_color'] as String?,
imgLabelUriHans: json['img_label_uri_hans'] as String?,
imgLabelUriHansStatic: json['img_label_uri_hans_static'] as String?,
imgLabelUriHant: json['img_label_uri_hant'] as String?,
imgLabelUriHantStatic: json['img_label_uri_hant_static'] as String?,
labelTheme: json['label_theme'] as String?,
path: json['path'] as String?,
text: json['text'] as String?,
textColor: json['text_color'] as String?,
useImgLabel: json['use_img_label'] as bool?,
);
Map<String, dynamic> toJson() => {
'bg_color': bgColor,
'bg_style': bgStyle,
'border_color': borderColor,
'img_label_uri_hans': imgLabelUriHans,
'img_label_uri_hans_static': imgLabelUriHansStatic,
'img_label_uri_hant': imgLabelUriHant,
'img_label_uri_hant_static': imgLabelUriHantStatic,
'label_theme': labelTheme,
'path': path,
'text': text,
'text_color': textColor,
'use_img_label': useImgLabel,
};
}

View File

@@ -1,32 +0,0 @@
import 'general_spec.dart';
import 'layer_config.dart';
import 'resource.dart';
class Layer {
GeneralSpec? generalSpec;
LayerConfig? layerConfig;
Resource? resource;
bool? visible;
Layer({this.generalSpec, this.layerConfig, this.resource, this.visible});
factory Layer.fromJson(Map<String, dynamic> json) => Layer(
generalSpec: json['general_spec'] == null
? null
: GeneralSpec.fromJson(json['general_spec'] as Map<String, dynamic>),
layerConfig: json['layer_config'] == null
? null
: LayerConfig.fromJson(json['layer_config'] as Map<String, dynamic>),
resource: json['resource'] == null
? null
: Resource.fromJson(json['resource'] as Map<String, dynamic>),
visible: json['visible'] as bool?,
);
Map<String, dynamic> toJson() => {
'general_spec': generalSpec?.toJson(),
'layer_config': layerConfig?.toJson(),
'resource': resource?.toJson(),
'visible': visible,
};
}

View File

@@ -1,20 +0,0 @@
import 'tags.dart';
class LayerConfig {
bool? isCritical;
Tags? tags;
LayerConfig({this.isCritical, this.tags});
factory LayerConfig.fromJson(Map<String, dynamic> json) => LayerConfig(
isCritical: json['is_critical'] as bool?,
tags: json['tags'] == null
? null
: Tags.fromJson(json['tags'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'is_critical': isCritical,
'tags': tags?.toJson(),
};
}

View File

@@ -1,19 +0,0 @@
class Like {
int? count;
bool? forbidden;
bool? status;
Like({this.count, this.forbidden, this.status});
factory Like.fromJson(Map<String, dynamic> json) => Like(
count: json['count'] as int?,
forbidden: json['forbidden'] as bool?,
status: json['status'] as bool?,
);
Map<String, dynamic> toJson() => {
'count': count,
'forbidden': forbidden,
'status': status,
};
}

View File

@@ -1,22 +0,0 @@
class LikeIcon {
String? actionUrl;
String? endUrl;
int? id;
String? startUrl;
LikeIcon({this.actionUrl, this.endUrl, this.id, this.startUrl});
factory LikeIcon.fromJson(Map<String, dynamic> json) => LikeIcon(
actionUrl: json['action_url'] as String?,
endUrl: json['end_url'] as String?,
id: json['id'] as int?,
startUrl: json['start_url'] as String?,
);
Map<String, dynamic> toJson() => {
'action_url': actionUrl,
'end_url': endUrl,
'id': id,
'start_url': startUrl,
};
}

View File

@@ -1,63 +0,0 @@
import 'module_author.dart';
import 'module_bottom.dart';
import 'module_content.dart';
import 'module_extend.dart';
import 'module_stat.dart';
import 'module_title.dart';
class OpusModule {
ModuleTitle? moduleTitle;
String? moduleType;
ModuleAuthor? moduleAuthor;
ModuleContent? moduleContent;
ModuleExtend? moduleExtend;
ModuleBottom? moduleBottom;
ModuleStat? moduleStat;
OpusModule({
this.moduleTitle,
this.moduleType,
this.moduleAuthor,
this.moduleContent,
this.moduleExtend,
this.moduleBottom,
this.moduleStat,
});
factory OpusModule.fromJson(Map<String, dynamic> json) => OpusModule(
moduleTitle: json['module_title'] == null
? null
: ModuleTitle.fromJson(
json['module_title'] as Map<String, dynamic>),
moduleType: json['module_type'] as String?,
moduleAuthor: json['module_author'] == null
? null
: ModuleAuthor.fromJson(
json['module_author'] as Map<String, dynamic>),
moduleContent: json['module_content'] == null
? null
: ModuleContent.fromJson(
json['module_content'] as Map<String, dynamic>),
moduleExtend: json['module_extend'] == null
? null
: ModuleExtend.fromJson(
json['module_extend'] as Map<String, dynamic>),
moduleBottom: json['module_bottom'] == null
? null
: ModuleBottom.fromJson(
json['module_bottom'] as Map<String, dynamic>),
moduleStat: json['module_stat'] == null
? null
: ModuleStat.fromJson(json['module_stat'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'module_title': moduleTitle?.toJson(),
'module_type': moduleType,
'module_author': moduleAuthor?.toJson(),
'module_content': moduleContent?.toJson(),
'module_extend': moduleExtend?.toJson(),
'module_bottom': moduleBottom?.toJson(),
'module_stat': moduleStat?.toJson(),
};
}

View File

@@ -1,84 +0,0 @@
import 'avatar.dart';
import 'official.dart';
import 'pendant.dart';
import 'vip.dart';
class ModuleAuthor {
Avatar? avatar;
String? face;
bool? faceNft;
dynamic following;
String? jumpUrl;
String? label;
int? mid;
String? name;
Official? official;
Pendant? pendant;
String? pubLocationText;
String? pubTime;
int? pubTs;
String? viewsText;
Vip? vip;
ModuleAuthor({
this.avatar,
this.face,
this.faceNft,
this.following,
this.jumpUrl,
this.label,
this.mid,
this.name,
this.official,
this.pendant,
this.pubLocationText,
this.pubTime,
this.pubTs,
this.viewsText,
this.vip,
});
factory ModuleAuthor.fromJson(Map<String, dynamic> json) => ModuleAuthor(
avatar: json['avatar'] == null
? null
: Avatar.fromJson(json['avatar'] as Map<String, dynamic>),
face: json['face'] as String?,
faceNft: json['face_nft'] as bool?,
following: json['following'] as dynamic,
jumpUrl: json['jump_url'] as String?,
label: json['label'] as String?,
mid: json['mid'] as int?,
name: json['name'] as String?,
official: json['official'] == null
? null
: Official.fromJson(json['official'] as Map<String, dynamic>),
pendant: json['pendant'] == null
? null
: Pendant.fromJson(json['pendant'] as Map<String, dynamic>),
pubLocationText: json['pub_location_text'] as String?,
pubTime: json['pub_time'] as String?,
pubTs: json['pub_ts'] as int?,
viewsText: json['views_text'] as String?,
vip: json['vip'] == null
? null
: Vip.fromJson(json['vip'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'avatar': avatar?.toJson(),
'face': face,
'face_nft': faceNft,
'following': following,
'jump_url': jumpUrl,
'label': label,
'mid': mid,
'name': name,
'official': official?.toJson(),
'pendant': pendant?.toJson(),
'pub_location_text': pubLocationText,
'pub_time': pubTime,
'pub_ts': pubTs,
'views_text': viewsText,
'vip': vip?.toJson(),
};
}

View File

@@ -1,17 +0,0 @@
import 'share_info.dart';
class ModuleBottom {
ShareInfo? shareInfo;
ModuleBottom({this.shareInfo});
factory ModuleBottom.fromJson(Map<String, dynamic> json) => ModuleBottom(
shareInfo: json['share_info'] == null
? null
: ShareInfo.fromJson(json['share_info'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'share_info': shareInfo?.toJson(),
};
}

View File

@@ -1,17 +0,0 @@
import 'paragraph.dart';
class ModuleContent {
List<Paragraph>? paragraphs;
ModuleContent({this.paragraphs});
factory ModuleContent.fromJson(Map<String, dynamic> json) => ModuleContent(
paragraphs: (json['paragraphs'] as List<dynamic>?)
?.map((e) => Paragraph.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> toJson() => {
'paragraphs': paragraphs?.map((e) => e.toJson()).toList(),
};
}

View File

@@ -1,17 +0,0 @@
import 'item.dart';
class ModuleExtend {
List<Item>? items;
ModuleExtend({this.items});
factory ModuleExtend.fromJson(Map<String, dynamic> json) => ModuleExtend(
items: (json['items'] as List<dynamic>?)
?.map((e) => Item.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> toJson() => {
'items': items?.map((e) => e.toJson()).toList(),
};
}

View File

@@ -1,47 +0,0 @@
import 'coin.dart';
import 'comment.dart';
import 'favorite.dart';
import 'forward.dart';
import 'like.dart';
class ModuleStat {
Coin? coin;
Comment? comment;
Favorite? favorite;
Forward? forward;
Like? like;
ModuleStat({
this.coin,
this.comment,
this.favorite,
this.forward,
this.like,
});
factory ModuleStat.fromJson(Map<String, dynamic> json) => ModuleStat(
coin: json['coin'] == null
? null
: Coin.fromJson(json['coin'] as Map<String, dynamic>),
comment: json['comment'] == null
? null
: Comment.fromJson(json['comment'] as Map<String, dynamic>),
favorite: json['favorite'] == null
? null
: Favorite.fromJson(json['favorite'] as Map<String, dynamic>),
forward: json['forward'] == null
? null
: Forward.fromJson(json['forward'] as Map<String, dynamic>),
like: json['like'] == null
? null
: Like.fromJson(json['like'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'coin': coin?.toJson(),
'comment': comment?.toJson(),
'favorite': favorite?.toJson(),
'forward': forward?.toJson(),
'like': like?.toJson(),
};
}

View File

@@ -1,13 +0,0 @@
class ModuleTitle {
String? text;
ModuleTitle({this.text});
factory ModuleTitle.fromJson(Map<String, dynamic> json) => ModuleTitle(
text: json['text'] as String?,
);
Map<String, dynamic> toJson() => {
'text': text,
};
}

View File

@@ -1,30 +0,0 @@
import 'rich.dart';
import 'word.dart';
class Node {
String? type;
Word? word;
Rich? rich;
Node({
this.type,
this.word,
this.rich,
});
factory Node.fromJson(Map<String, dynamic> json) => Node(
type: json['type'] as String?,
word: json['word'] == null
? null
: Word.fromJson(json['word'] as Map<String, dynamic>),
rich: json['rich'] == null
? null
: Rich.fromJson(json['rich'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'type': type,
'word': word?.toJson(),
'rich': rich?.toJson(),
};
}

View File

@@ -1,22 +0,0 @@
class Official {
String? desc;
int? role;
String? title;
int? type;
Official({this.desc, this.role, this.title, this.type});
factory Official.fromJson(Map<String, dynamic> json) => Official(
desc: json['desc'] as String?,
role: json['role'] as int?,
title: json['title'] as String?,
type: json['type'] as int?,
);
Map<String, dynamic> toJson() => {
'desc': desc,
'role': role,
'title': title,
'type': type,
};
}

View File

@@ -1,26 +0,0 @@
import 'data.dart';
class OpusDetail {
int? code;
String? message;
int? ttl;
OpusData? data;
OpusDetail({this.code, this.message, this.ttl, this.data});
factory OpusDetail.fromJson(Map<String, dynamic> json) => OpusDetail(
code: json['code'] as int?,
message: json['message'] as String?,
ttl: json['ttl'] as int?,
data: json['data'] == null
? null
: OpusData.fromJson(json['data'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'code': code,
'message': message,
'ttl': ttl,
'data': data?.toJson(),
};
}

View File

@@ -1,142 +0,0 @@
import 'node.dart';
import 'pic.dart';
import 'text.dart';
class Paragraph {
int? align;
int? paraType;
ParagraphText? text;
Pic? pic;
Line? line;
LinkCard? linkCard;
Code? code;
L1st? list;
Paragraph({
this.align,
this.paraType,
this.text,
this.pic,
this.line,
this.linkCard,
this.code,
this.list,
});
factory Paragraph.fromJson(Map<String, dynamic> json) => Paragraph(
align: json['align'] as int?,
paraType: json['para_type'] as int?,
text: json['text'] == null
? null
: ParagraphText.fromJson(json['text'] as Map<String, dynamic>),
pic: json['pic'] == null
? null
: Pic.fromJson(json['pic'] as Map<String, dynamic>),
line: json['line'] == null ? null : Line.fromJson(json['line']),
linkCard: json['link_card'] == null
? null
: LinkCard.fromJson(json['link_card']),
code: json['code'] == null ? null : Code.fromJson(json['code']),
list: json['list'] == null ? null : L1st.fromJson(json['list']),
);
Map<String, dynamic> toJson() => {
'align': align,
'para_type': paraType,
'text': text?.toJson(),
'pic': pic?.toJson(),
};
}
class L1st {
List<Item>? items;
int? style;
L1st.fromJson(Map<String, dynamic> json) {
items = (json['items'] as List?)?.map((e) => Item.fromJson(e)).toList();
style = json['style'];
}
}
class Item {
int? level;
int? order;
List<Node>? nodes;
Item.fromJson(Map<String, dynamic> json) {
level = json['level'];
order = json['order'];
nodes = (json['nodes'] as List?)?.map((e) => Node.fromJson(e)).toList();
}
}
class Code {
String? content;
String? lang;
Code.fromJson(Map<String, dynamic> json) {
content = json['content'];
lang = json['lang'];
}
}
class Ugc {
String? cover;
String? descSecond;
String? duration;
String? headText;
String? idStr;
String? jumpUrl;
bool? multiLine;
String? title;
Ugc.fromJson(Map<String, dynamic> json) {
cover = json['cover'];
descSecond = json['desc_second'];
duration = json['duration'];
headText = json['head_text'];
idStr = json['id_str'];
jumpUrl = json['jump_url'];
multiLine = json['multi_line'];
title = json['title'];
}
}
class Card {
Card({
this.oid,
this.type,
this.ugc,
});
String? oid;
String? type;
Ugc? ugc;
Card.fromJson(Map<String, dynamic> json) {
oid = json['oid'];
type = json['type'];
ugc = json['ugc'] == null ? null : Ugc.fromJson(json['ugc']);
}
}
class LinkCard {
LinkCard({
this.card,
});
Card? card;
LinkCard.fromJson(Map<String, dynamic> json) {
card = json['card'] == null ? null : Card.fromJson(json['card']);
}
}
class Line {
Line({
this.pic,
});
Pic? pic;
Line.fromJson(Map<String, dynamic> json) {
pic = json['pic'] == null ? null : Pic.fromJson(json['pic']);
}
}

View File

@@ -1,39 +0,0 @@
class Pendant {
int? expire;
String? image;
String? imageEnhance;
String? imageEnhanceFrame;
int? nPid;
String? name;
int? pid;
Pendant({
this.expire,
this.image,
this.imageEnhance,
this.imageEnhanceFrame,
this.nPid,
this.name,
this.pid,
});
factory Pendant.fromJson(Map<String, dynamic> json) => Pendant(
expire: json['expire'] as int?,
image: json['image'] as String?,
imageEnhance: json['image_enhance'] as String?,
imageEnhanceFrame: json['image_enhance_frame'] as String?,
nPid: json['n_pid'] as int?,
name: json['name'] as String?,
pid: json['pid'] as int?,
);
Map<String, dynamic> toJson() => {
'expire': expire,
'image': image,
'image_enhance': imageEnhance,
'image_enhance_frame': imageEnhanceFrame,
'n_pid': nPid,
'name': name,
'pid': pid,
};
}

View File

@@ -1,76 +0,0 @@
class Pic {
List<PicItem>? pics;
int? style;
String? url;
num? width;
double? height;
num? size;
Pic({
this.pics,
this.style,
this.url,
this.height,
this.width,
this.size,
});
factory Pic.fromJson(Map<String, dynamic> json) => Pic(
pics: (json['pics'] as List<dynamic>?)
?.map((e) => PicItem.fromJson(e as Map<String, dynamic>))
.toList(),
style: json['style'] as int?,
url: json['url'],
height: (json['height'] as num?)?.toDouble(),
width: json['width'] as num?,
size: json['size'] as num?,
);
Map<String, dynamic> toJson() => {
'pics': pics?.map((e) => e.toJson()).toList(),
'style': style,
'height': height,
'width': width,
'size': size,
'url': url,
};
}
class PicItem {
num? height;
num? width;
num? size;
String? url;
String? liveUrl;
double? calHeight;
void onCalHeight(maxWidth) {
if (calHeight == null && height != null && width != null) {
calHeight = maxWidth * height! / width!;
}
}
PicItem({
this.height,
this.width,
this.size,
this.url,
this.liveUrl,
});
factory PicItem.fromJson(Map<String, dynamic> json) => PicItem(
height: json['height'] as num?,
width: json['width'] as num?,
size: json['size'] as num?,
url: json['url'] as String?,
liveUrl: json['live_url'] as String?,
);
Map<String, dynamic> toJson() => {
'height': height,
'width': width,
'size': size,
'url': url,
'live_url': liveUrl,
};
}

View File

@@ -1,19 +0,0 @@
class PosSpec {
double? axisX;
double? axisY;
int? coordinatePos;
PosSpec({this.axisX, this.axisY, this.coordinatePos});
factory PosSpec.fromJson(Map<String, dynamic> json) => PosSpec(
axisX: (json['axis_x'] as num?)?.toDouble(),
axisY: (json['axis_y'] as num?)?.toDouble(),
coordinatePos: json['coordinate_pos'] as int?,
);
Map<String, dynamic> toJson() => {
'axis_x': axisX,
'axis_y': axisY,
'coordinate_pos': coordinatePos,
};
}

View File

@@ -1,16 +0,0 @@
class Remote {
String? bfsStyle;
String? url;
Remote({this.bfsStyle, this.url});
factory Remote.fromJson(Map<String, dynamic> json) => Remote(
bfsStyle: json['bfs_style'] as String?,
url: json['url'] as String?,
);
Map<String, dynamic> toJson() => {
'bfs_style': bfsStyle,
'url': url,
};
}

View File

@@ -1,13 +0,0 @@
class RenderSpec {
int? opacity;
RenderSpec({this.opacity});
factory RenderSpec.fromJson(Map<String, dynamic> json) => RenderSpec(
opacity: json['opacity'] as int?,
);
Map<String, dynamic> toJson() => {
'opacity': opacity,
};
}

View File

@@ -1,17 +0,0 @@
import 'image_src.dart';
class ResImage {
ImageSrc? imageSrc;
ResImage({this.imageSrc});
factory ResImage.fromJson(Map<String, dynamic> json) => ResImage(
imageSrc: json['image_src'] == null
? null
: ImageSrc.fromJson(json['image_src'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'image_src': imageSrc?.toJson(),
};
}

View File

@@ -1,20 +0,0 @@
import 'res_image.dart';
class Resource {
ResImage? resImage;
int? resType;
Resource({this.resImage, this.resType});
factory Resource.fromJson(Map<String, dynamic> json) => Resource(
resImage: json['res_image'] == null
? null
: ResImage.fromJson(json['res_image'] as Map<String, dynamic>),
resType: json['res_type'] as int?,
);
Map<String, dynamic> toJson() => {
'res_image': resImage?.toJson(),
'res_type': resType,
};
}

View File

@@ -1,31 +0,0 @@
import 'style.dart';
class Rich {
Style? style;
String? jumpUrl;
String? origText;
String? text;
Rich({
this.style,
this.jumpUrl,
this.origText,
this.text,
});
factory Rich.fromJson(Map<String, dynamic> json) => Rich(
style: json['style'] == null
? null
: Style.fromJson(json['style'] as Map<String, dynamic>),
jumpUrl: json['jump_url'] as String?,
origText: json['orig_text'] as String?,
text: json['text'] as String?,
);
Map<String, dynamic> toJson() => {
'style': style?.toJson(),
'jump_url': jumpUrl,
'orig_text': origText,
'text': text,
};
}

View File

@@ -1,19 +0,0 @@
class ShareInfo {
String? pic;
String? summary;
String? title;
ShareInfo({this.pic, this.summary, this.title});
factory ShareInfo.fromJson(Map<String, dynamic> json) => ShareInfo(
pic: json['pic'] as String?,
summary: json['summary'] as String?,
title: json['title'] as String?,
);
Map<String, dynamic> toJson() => {
'pic': pic,
'summary': summary,
'title': title,
};
}

View File

@@ -1,16 +0,0 @@
class SizeSpec {
num? height;
num? width;
SizeSpec({this.height, this.width});
factory SizeSpec.fromJson(Map<String, dynamic> json) => SizeSpec(
height: json['height'],
width: json['width'],
);
Map<String, dynamic> toJson() => {
'height': height,
'width': width,
};
}

View File

@@ -1,22 +0,0 @@
class Style {
Style({
this.bold,
this.italic,
this.strikethrough,
});
bool? bold;
bool? italic;
bool? strikethrough;
factory Style.fromJson(Map<String, dynamic> json) => Style(
bold: json['bold'],
italic: json['italic'],
strikethrough: json['strikethrough'],
);
Map<String, dynamic> toJson() => {
'bold': bold,
'italic': italic,
'strikethrough': strikethrough,
};
}

View File

@@ -1,26 +0,0 @@
import 'general_cfg.dart';
class Tags {
// AvatarLayer? avatarLayer;
GeneralCfg? generalCfg;
Tags({
// this.avatarLayer,
this.generalCfg,
});
factory Tags.fromJson(Map<String, dynamic> json) => Tags(
// avatarLayer: json['AVATAR_LAYER'] == null
// ? null
// : AvatarLayer.fromJson(
// json['AVATAR_LAYER'] as Map<String, dynamic>),
generalCfg: json['GENERAL_CFG'] == null
? null
: GeneralCfg.fromJson(json['GENERAL_CFG'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
// 'AVATAR_LAYER': avatarLayer?.toJson(),
'GENERAL_CFG': generalCfg?.toJson(),
};
}

View File

@@ -1,17 +0,0 @@
import 'node.dart';
class ParagraphText {
List<Node>? nodes;
ParagraphText({this.nodes});
factory ParagraphText.fromJson(Map<String, dynamic> json) => ParagraphText(
nodes: (json['nodes'] as List<dynamic>?)
?.map((e) => Node.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> toJson() => {
'nodes': nodes?.map((e) => e.toJson()).toList(),
};
}

View File

@@ -1,73 +0,0 @@
import 'label.dart';
class Vip {
// AvatarIcon? avatarIcon;
int? avatarSubscript;
String? avatarSubscriptUrl;
int? dueDate;
Label? label;
String? nicknameColor;
int? role;
int? status;
int? themeType;
int? tvDueDate;
int? tvVipPayType;
int? tvVipStatus;
int? type;
int? vipPayType;
Vip({
// this.avatarIcon,
this.avatarSubscript,
this.avatarSubscriptUrl,
this.dueDate,
this.label,
this.nicknameColor,
this.role,
this.status,
this.themeType,
this.tvDueDate,
this.tvVipPayType,
this.tvVipStatus,
this.type,
this.vipPayType,
});
factory Vip.fromJson(Map<String, dynamic> json) => Vip(
// avatarIcon: json['avatar_icon'] == null
// ? null
// : AvatarIcon.fromJson(json['avatar_icon'] as Map<String, dynamic>),
avatarSubscript: json['avatar_subscript'] as int?,
avatarSubscriptUrl: json['avatar_subscript_url'] as String?,
dueDate: json['due_date'] as int?,
label: json['label'] == null
? null
: Label.fromJson(json['label'] as Map<String, dynamic>),
nicknameColor: json['nickname_color'] as String?,
role: json['role'] as int?,
status: json['status'] as int?,
themeType: json['theme_type'] as int?,
tvDueDate: json['tv_due_date'] as int?,
tvVipPayType: json['tv_vip_pay_type'] as int?,
tvVipStatus: json['tv_vip_status'] as int?,
type: json['type'] as int?,
vipPayType: json['vip_pay_type'] as int?,
);
Map<String, dynamic> toJson() => {
// 'avatar_icon': avatarIcon?.toJson(),
'avatar_subscript': avatarSubscript,
'avatar_subscript_url': avatarSubscriptUrl,
'due_date': dueDate,
'label': label?.toJson(),
'nickname_color': nicknameColor,
'role': role,
'status': status,
'theme_type': themeType,
'tv_due_date': tvDueDate,
'tv_vip_pay_type': tvVipPayType,
'tv_vip_status': tvVipStatus,
'type': type,
'vip_pay_type': vipPayType,
};
}

View File

@@ -1,13 +0,0 @@
class WebCssStyle {
String? borderRadius;
WebCssStyle({this.borderRadius});
factory WebCssStyle.fromJson(Map<String, dynamic> json) => WebCssStyle(
borderRadius: json['borderRadius'] as String?,
);
Map<String, dynamic> toJson() => {
'borderRadius': borderRadius,
};
}

View File

@@ -1,37 +0,0 @@
import 'style.dart';
class Word {
int? color;
double? fontSize;
Style? style;
String? words;
String? fontLevel;
Word({
this.color,
this.fontSize,
this.style,
this.words,
this.fontLevel,
});
factory Word.fromJson(Map<String, dynamic> json) => Word(
color: json['color'] == null
? null
: int.tryParse('0xFF${(json['color'] as String).substring(1)}'),
fontSize: (json['font_size'] as num?)?.toDouble(),
style: json['style'] == null
? null
: Style.fromJson(json['style'] as Map<String, dynamic>),
words: json['words'] as String?,
fontLevel: json['font_level'] as String?,
);
Map<String, dynamic> toJson() => {
'color': color,
'font_size': fontSize,
'style': style?.toJson(),
'words': words,
'font_level': fontLevel,
};
}

View File

@@ -1,14 +1,11 @@
import 'dart:convert';
import 'package:PiliPlus/common/widgets/avatar.dart';
import 'package:PiliPlus/models/model_owner.dart';
import 'article_content_model.dart';
class DynamicsDataModel {
DynamicsDataModel({
this.hasMore,
this.items,
this.offset,
this.total,
});
bool? hasMore;
List<DynamicItemModel>? items;
String? offset;
@@ -26,50 +23,85 @@ class DynamicsDataModel {
// 单个动态
class DynamicItemModel {
DynamicItemModel({
this.basic,
this.idStr,
this.modules,
this.orig,
this.type,
this.visible,
});
Map? basic;
Basic? basic;
dynamic idStr;
ItemModulesModel? modules;
late ItemModulesModel modules;
DynamicItemModel? orig;
String? type;
bool? visible;
bool? isForwarded;
// opus
Fallback? fallback;
DynamicItemModel.fromJson(Map<String, dynamic> json) {
basic = json['basic'];
if (json['basic'] != null) basic = Basic.fromJson(json['basic']);
idStr = json['id_str'];
modules = ItemModulesModel.fromJson(json['modules']);
orig =
json['orig'] != null ? DynamicItemModel.fromJson(json['orig']) : null;
orig?.isForwarded = true;
modules = json['modules'] == null
? ItemModulesModel()
: ItemModulesModel.fromJson(json['modules']);
if (json['orig'] != null) {
orig = DynamicItemModel.fromJson(json['orig'])..isForwarded = true;
}
type = json['type'];
visible = json['visible'];
}
DynamicItemModel.fromOpusJson(Map<String, dynamic> json) {
if (json['item']?['basic'] != null) {
basic = Basic.fromJson(json['item']['basic']);
}
idStr = json['item']?['id_str'];
// type = json['type']; // int
modules = json['item']?['modules'] == null
? ItemModulesModel()
: ItemModulesModel.fromOpusJson(
(json['item']?['modules'] as List).cast());
if (json['fallback'] != null) {
fallback = Fallback.fromJson(json['fallback']);
}
}
}
class Fallback {
String? id;
int? type;
Fallback({
this.id,
this.type,
});
factory Fallback.fromJson(Map<String, dynamic> json) => Fallback(
id: json['id'],
type: json['type'],
);
Map<String, dynamic> toJson() => {
'id': id,
'type': type,
};
}
// 单个动态详情
class ItemModulesModel {
ItemModulesModel({
this.moduleAuthor,
this.moduleDynamic,
// this.moduleInter,
this.moduleStat,
this.moduleTag,
});
ItemModulesModel();
ModuleAuthorModel? moduleAuthor;
ModuleStatModel? moduleStat;
ModuleTag? moduleTag; // 也做opus的title用
// 动态
ModuleDynamicModel? moduleDynamic;
// ModuleInterModel? moduleInter;
ModuleStatModel? moduleStat;
ModuleTag? moduleTag;
// 专栏
List<ModuleTag>? moduleExtend; // opus的tag
List<ArticleContentModel>? moduleContent;
// moduleBottom
ItemModulesModel.fromJson(Map<String, dynamic> json) {
moduleAuthor = json['module_author'] != null
@@ -86,37 +118,63 @@ class ItemModulesModel {
? ModuleTag.fromJson(json['module_tag'])
: null;
}
ItemModulesModel.fromOpusJson(List<Map<String, dynamic>> json) {
for (var i in json) {
switch (i['module_type']) {
case 'MODULE_TYPE_TITLE':
moduleTag = i['module_title'] == null
? null
: ModuleTag.fromJson(i['module_title']);
break;
case 'MODULE_TYPE_AUTHOR':
moduleAuthor = i['module_author'] == null
? null
: ModuleAuthorModel.fromJson(i['module_author']);
break;
case 'MODULE_TYPE_CONTENT':
moduleContent = (i['module_content']?['paragraphs'] as List?)
?.map((i) => ArticleContentModel.fromJson(i))
.toList();
break;
case 'MODULE_TYPE_EXTEND':
moduleExtend = (i['module_extend']['items'] as List?)
?.map((i) => ModuleTag.fromJson(i))
.toList();
break;
case 'MODULE_TYPE_STAT':
moduleStat = i['module_stat'] == null
? null
: ModuleStatModel.fromJson(i['module_stat']);
break;
// case 'MODULE_TYPE_BOTTOM':
// break;
// default:
// debugPrint('unknown type: ${i}');
}
}
}
}
class Basic {
String? commentIdStr;
int? commentType;
Map<String, dynamic>? likeIcon;
String? ridStr;
Basic.fromJson(Map<String, dynamic> json) {
commentIdStr = json['comment_id_str'];
commentType = json['comment_type'];
likeIcon = json['like_icon'];
ridStr = json['rid_str'];
}
}
// 单个动态详情 - 作者信息
class ModuleAuthorModel {
ModuleAuthorModel({
// this.avatar,
// this.decorate,
this.face,
this.following,
this.jumpUrl,
this.label,
this.mid,
this.name,
// this.officialVerify,
// this.pandant,
this.pubAction,
// this.pubLocationText,
this.pubTime,
this.pubTs,
this.type,
this.vip,
this.decorate,
this.pendant,
});
String? face;
class ModuleAuthorModel extends Owner {
bool? following;
String? jumpUrl;
String? label;
int? mid;
String? name;
String? pubAction;
String? pubTime;
int? pubTs;
@@ -790,63 +848,49 @@ class ModuleStatModel {
this.comment,
this.forward,
this.like,
this.favorite,
});
Comment? comment;
ForWard? forward;
Like? like;
DynamicStat? comment;
DynamicStat? forward;
DynamicStat? like;
DynamicStat? favorite;
// DynamicStat? coin;
ModuleStatModel.fromJson(Map<String, dynamic> json) {
comment = Comment.fromJson(json['comment']);
forward = ForWard.fromJson(json['forward']);
like = Like.fromJson(json['like']);
comment = DynamicStat.fromJson(json['comment']);
forward = DynamicStat.fromJson(json['forward']);
like = DynamicStat.fromJson(json['like']);
if (json['favorite'] != null) {
favorite = DynamicStat.fromJson(json['favorite']);
}
}
}
// 动态状态 评论
class Comment {
Comment({
this.count,
this.forbidden,
});
String? count;
bool? forbidden;
Comment.fromJson(Map<String, dynamic> json) {
count = json['count'] == 0 ? null : json['count'].toString();
forbidden = json['forbidden'];
}
}
class ForWard {
ForWard({this.count, this.forbidden});
String? count;
bool? forbidden;
ForWard.fromJson(Map<String, dynamic> json) {
count = json['count'] == 0 ? null : json['count'].toString();
forbidden = json['forbidden'];
}
}
// 动态状态 点赞
class Like {
Like({
// 动态状态
class DynamicStat {
DynamicStat({
this.count,
this.forbidden,
this.status,
});
String? count;
int? count;
bool? forbidden;
bool? status;
Like.fromJson(Map<String, dynamic> json) {
count = json['count'] == 0 ? null : json['count'].toString();
DynamicStat.fromJson(Map<String, dynamic> json) {
count = json['count'] == 0 ? null : _parseInt(json['count']);
forbidden = json['forbidden'];
status = json['status'];
}
static int? _parseInt(dynamic x) => switch (x) {
int() => x,
String() => int.tryParse(x),
double() => x.toInt(),
_ => null
};
}
class Stat {

View File

@@ -1,36 +1,27 @@
import 'package:json_annotation/json_annotation.dart';
import '../model_owner.dart';
import 'nameplate.dart';
import 'official_verify.dart';
import 'pendant.dart';
import 'vip.dart';
part 'author.g.dart';
class Author extends Owner {
Pendant? pendant;
OfficialVerify? officialVerify;
Nameplate? nameplate;
Vip? vip;
@JsonSerializable()
class Author {
int? mid;
String? name;
String? face;
Pendant? pendant;
@JsonKey(name: 'official_verify')
OfficialVerify? officialVerify;
Nameplate? nameplate;
Vip? vip;
Author({
this.mid,
this.name,
this.face,
this.pendant,
this.officialVerify,
this.nameplate,
this.vip,
});
factory Author.fromJson(Map<String, dynamic> json) {
return _$AuthorFromJson(json);
}
Map<String, dynamic> toJson() => _$AuthorToJson(this);
Author.fromJson(Map<String, dynamic> json) {
mid = json['mid'];
name = json['name'] as String?;
face = json['face'] as String?;
pendant =
json['pendant'] == null ? null : Pendant.fromJson(json['pendant']);
officialVerify = json['official_verify'] == null
? null
: OfficialVerify.fromJson(json['official_verify']);
nameplate = json['nameplate'] == null
? null
: Nameplate.fromJson(json['nameplate']);
vip = json['vip'] == null ? null : Vip.fromJson(json['vip']);
}
}

View File

@@ -1,36 +1 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'author.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Author _$AuthorFromJson(Map<String, dynamic> json) => Author(
mid: (json['mid'] as num?)?.toInt(),
name: json['name'] as String?,
face: json['face'] as String?,
pendant: json['pendant'] == null
? null
: Pendant.fromJson(json['pendant'] as Map<String, dynamic>),
officialVerify: json['official_verify'] == null
? null
: OfficialVerify.fromJson(
json['official_verify'] as Map<String, dynamic>),
nameplate: json['nameplate'] == null
? null
: Nameplate.fromJson(json['nameplate'] as Map<String, dynamic>),
vip: json['vip'] == null
? null
: Vip.fromJson(json['vip'] as Map<String, dynamic>),
);
Map<String, dynamic> _$AuthorToJson(Author instance) => <String, dynamic>{
'mid': instance.mid,
'name': instance.name,
'face': instance.face,
'pendant': instance.pendant,
'official_verify': instance.officialVerify,
'nameplate': instance.nameplate,
'vip': instance.vip,
};

View File

@@ -1,107 +1,142 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:PiliPlus/models/dynamics/article_content_model.dart';
import 'author.dart';
import 'category.dart';
import 'media.dart';
import 'stats.dart';
part 'item.g.dart';
@JsonSerializable()
class Item {
int? id;
Category? category;
List<Category>? categories;
String? title;
String? summary;
@JsonKey(name: 'banner_url')
String? bannerUrl;
@JsonKey(name: 'template_id')
int? templateId;
int? state;
Author? author;
int? reprint;
@JsonKey(name: 'image_urls')
List<String>? imageUrls;
@JsonKey(name: 'publish_time')
int? publishTime;
int? ctime;
int? mtime;
Stats? stats;
int? attributes;
int? words;
@JsonKey(name: 'origin_image_urls')
List<String>? originImageUrls;
dynamic list;
@JsonKey(name: 'is_like')
bool? isLike;
Media? media;
@JsonKey(name: 'apply_time')
String? applyTime;
@JsonKey(name: 'check_time')
String? checkTime;
int? original;
@JsonKey(name: 'act_id')
int? actId;
dynamic dispute;
dynamic authenMark;
@JsonKey(name: 'cover_avid')
int? coverAvid;
@JsonKey(name: 'top_video_info')
dynamic topVideoInfo;
int? type;
@JsonKey(name: 'check_state')
int? checkState;
@JsonKey(name: 'origin_template_id')
int? originTemplateId;
// 动态
String? uri;
String? param;
String? goto;
@JsonKey(name: 'publish_time_text')
String? publishTimeText;
String? dyn;
Item({
this.id,
this.category,
this.categories,
this.title,
this.summary,
this.bannerUrl,
this.templateId,
this.state,
this.author,
this.reprint,
this.imageUrls,
this.publishTime,
this.ctime,
this.mtime,
this.stats,
this.attributes,
this.words,
this.originImageUrls,
this.list,
this.isLike,
this.media,
this.applyTime,
this.checkTime,
this.original,
this.actId,
this.dispute,
this.authenMark,
this.coverAvid,
this.topVideoInfo,
this.type,
this.checkState,
this.originTemplateId,
this.uri,
this.param,
this.goto,
this.publishTimeText,
this.dyn,
});
// 专栏
List<Tag>? tags;
int? privatePub;
dynamic contentPicList;
String? content;
String? keywords;
Opus? opus;
int? versionId;
String? dynIdStr;
int? totalArtNum;
factory Item.fromJson(Map<String, dynamic> json) => _$ItemFromJson(json);
Item.fromJson(Map<String, dynamic> json) {
id = json["id"];
category =
json["category"] == null ? null : Category.fromJson(json["category"]);
categories = (json["categories"] as List?)
?.map((x) => Category.fromJson(x))
.toList();
title = json["title"];
summary = json["summary"];
bannerUrl = json["banner_url"];
templateId = json["template_id"];
state = json["state"];
author = json["author"] == null ? null : Author.fromJson(json["author"]);
reprint = json["reprint"];
imageUrls = (json["image_urls"] as List?)?.cast<String>();
publishTime = json["publish_time"];
ctime = json["ctime"];
mtime = json["mtime"];
stats = json["stats"] == null ? null : Stats.fromJson(json["stats"]);
words = json["words"];
originImageUrls = (json["origin_image_urls"] as List?)?.cast<String>();
list = json["list"];
isLike = json["is_like"];
media = json["media"] == null ? null : Media.fromJson(json["media"]);
applyTime = json["apply_time"];
checkTime = json["check_time"];
original = json["original"];
actId = json["act_id"];
dispute = json["dispute"];
authenMark = json["authenMark"];
coverAvid = json["cover_avid"];
topVideoInfo = json["top_video_info"];
type = json["type"];
checkState = json["check_state"];
originTemplateId = json["origin_template_id"];
Map<String, dynamic> toJson() => _$ItemToJson(this);
uri = json['uri'];
param = json['param'];
goto = json['goto'];
publishTimeText = json['publish_time_text'];
dyn = json['dynamic'];
tags = (json["tags"] as List?)?.map((x) => Tag.fromJson(x)).toList();
privatePub = json["private_pub"];
contentPicList = json["content_pic_list"];
content = json["content"];
keywords = json["keywords"];
if (json['opus'] != null) opus = Opus.fromJson(json['opus']);
versionId = json["version_id"];
dynIdStr = json["dyn_id_str"];
totalArtNum = json["total_art_num"];
}
}
class Tag {
int? tid;
String? name;
Tag.fromJson(Map<String, dynamic> json) {
tid = json["tid"];
name = json["name"];
}
}
class Opus {
int? opusid;
int? opussource;
String? title;
List<ArticleContentModel>? content;
// PubInfo? pubinfo;
// Article? article;
// Version? version;
Opus.fromJson(Map<String, dynamic> json) {
opusid = json['opus_id'];
opussource = json['opus_source'];
title = json['title'];
if (json['content']?['paragraphs'] is List) {
content = (json['content']['paragraphs'] as List)
.map((i) => ArticleContentModel.fromJson(i))
.toList();
}
}
}

View File

@@ -1,101 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'item.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Item _$ItemFromJson(Map<String, dynamic> json) => Item(
id: (json['id'] as num?)?.toInt(),
category: json['category'] == null
? null
: Category.fromJson(json['category'] as Map<String, dynamic>),
categories: (json['categories'] as List<dynamic>?)
?.map((e) => Category.fromJson(e as Map<String, dynamic>))
.toList(),
title: json['title'] as String?,
summary: json['summary'] as String?,
bannerUrl: json['banner_url'] as String?,
templateId: (json['template_id'] as num?)?.toInt(),
state: (json['state'] as num?)?.toInt(),
author: json['author'] == null
? null
: Author.fromJson(json['author'] as Map<String, dynamic>),
reprint: (json['reprint'] as num?)?.toInt(),
imageUrls: (json['image_urls'] as List<dynamic>?)
?.map((e) => e as String)
.toList(),
publishTime: (json['publish_time'] as num?)?.toInt(),
ctime: (json['ctime'] as num?)?.toInt(),
mtime: (json['mtime'] as num?)?.toInt(),
stats: json['stats'] == null
? null
: Stats.fromJson(json['stats'] as Map<String, dynamic>),
attributes: (json['attributes'] as num?)?.toInt(),
words: (json['words'] as num?)?.toInt(),
originImageUrls: (json['origin_image_urls'] as List<dynamic>?)
?.map((e) => e as String)
.toList(),
list: json['list'],
isLike: json['is_like'] as bool?,
media: json['media'] == null
? null
: Media.fromJson(json['media'] as Map<String, dynamic>),
applyTime: json['apply_time'] as String?,
checkTime: json['check_time'] as String?,
original: (json['original'] as num?)?.toInt(),
actId: (json['act_id'] as num?)?.toInt(),
dispute: json['dispute'],
authenMark: json['authenMark'],
coverAvid: (json['cover_avid'] as num?)?.toInt(),
topVideoInfo: json['top_video_info'],
type: (json['type'] as num?)?.toInt(),
checkState: (json['check_state'] as num?)?.toInt(),
originTemplateId: (json['origin_template_id'] as num?)?.toInt(),
uri: json['uri'] as String?,
param: json['param'] as String?,
goto: json['goto'] as String?,
publishTimeText: json['publish_time_text'] as String?,
dyn: json['dynamic'] as String?,
);
Map<String, dynamic> _$ItemToJson(Item instance) => <String, dynamic>{
'id': instance.id,
'category': instance.category,
'categories': instance.categories,
'title': instance.title,
'summary': instance.summary,
'banner_url': instance.bannerUrl,
'template_id': instance.templateId,
'state': instance.state,
'author': instance.author,
'reprint': instance.reprint,
'image_urls': instance.imageUrls,
'publish_time': instance.publishTime,
'ctime': instance.ctime,
'mtime': instance.mtime,
'stats': instance.stats,
'attributes': instance.attributes,
'words': instance.words,
'origin_image_urls': instance.originImageUrls,
'list': instance.list,
'is_like': instance.isLike,
'media': instance.media,
'apply_time': instance.applyTime,
'check_time': instance.checkTime,
'original': instance.original,
'act_id': instance.actId,
'dispute': instance.dispute,
'authenMark': instance.authenMark,
'cover_avid': instance.coverAvid,
'top_video_info': instance.topVideoInfo,
'type': instance.type,
'check_state': instance.checkState,
'origin_template_id': instance.originTemplateId,
'uri': instance.uri,
'param': instance.param,
'goto': instance.goto,
'publish_time_text': instance.publishTimeText,
'dynamic': instance.dyn,
};