1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
| import 'package:json_annotation/json_annotation.dart'; part 'Article.g.dart';
@JsonSerializable() class Article { int errorCode; String errorMsg; ArticleData data; Article(this.errorCode, this.errorMsg, this.data);
factory Article.fromJson(Map<String, dynamic> json) => _$ArticleFromJson(json); Map<String, dynamic> toJson() => _$ArticleToJson(this);
}
@JsonSerializable() class ArticleData { int curPage; int offset; bool over; int pageCount; int size; int total; List<Person> datas;
ArticleData(this.curPage, this.offset, this.over, this.pageCount, this.size, this.total, this.datas);
factory ArticleData.fromJson(Map<String, dynamic> json) => _$ArticleDataFromJson(json); Map<String, dynamic> toJson() => _$ArticleDataToJson(this);
}
@JsonSerializable() class Person { String apkLink; int audit; String author; bool canEdit; int chapterId; String chapterName; bool collect; int courseId; String desc; String descMd; String envelopePic; bool fresh; String host; int id; String link; String niceDate; String niceShareDate; String origin; String prefix; String projectLink; int publishTime; int realSuperChapterId; int selfVisible; int shareDate; String shareUser; int superChapterId; String superChapterName; List<Tag> tags; String title; int type; int userId; int visible; int zan;
Person( this.apkLink, this.audit, this.author, this.canEdit, this.chapterId, this.chapterName, this.collect, this.courseId, this.desc, this.descMd, this.envelopePic, this.fresh, this.host, this.id, this.link, this.niceDate, this.niceShareDate, this.origin, this.prefix, this.projectLink, this.publishTime, this.realSuperChapterId, this.selfVisible, this.shareDate, this.shareUser, this.superChapterId, this.superChapterName, this.tags, this.title, this.type, this.userId, this.visible, this.zan);
factory Person.fromJson(Map<String, dynamic> json) => _$PersonFromJson(json); Map<String, dynamic> toJson() => _$PersonToJson(this);
}
@JsonSerializable() class Tag { String name; String url;
Tag(this.name, this.url); factory Tag.fromJson(Map<String, dynamic> json) => _$TagFromJson(json); Map<String, dynamic> toJson() => _$TagToJson(this);
}
|