v1.0.1
This commit is contained in:
87
lib/models/comic/author_model.dart
Normal file
87
lib/models/comic/author_model.dart
Normal file
@@ -0,0 +1,87 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicAuthorModel {
|
||||
ComicAuthorModel({
|
||||
required this.nickname,
|
||||
this.description,
|
||||
required this.cover,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
factory ComicAuthorModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicAuthorComicModel>? data =
|
||||
json['data'] is List ? <ComicAuthorComicModel>[] : null;
|
||||
if (data != null) {
|
||||
for (final dynamic item in json['data']!) {
|
||||
if (item != null) {
|
||||
data.add(
|
||||
ComicAuthorComicModel.fromJson(asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicAuthorModel(
|
||||
nickname: asT<String>(json['nickname'])!,
|
||||
description: asT<String?>(json['description']) ?? "",
|
||||
cover: asT<String>(json['cover'])!,
|
||||
data: data!,
|
||||
);
|
||||
}
|
||||
|
||||
String nickname;
|
||||
String? description;
|
||||
String cover;
|
||||
List<ComicAuthorComicModel> data;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'nickname': nickname,
|
||||
'description': description,
|
||||
'cover': cover,
|
||||
'data': data,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicAuthorComicModel {
|
||||
ComicAuthorComicModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.cover,
|
||||
required this.status,
|
||||
});
|
||||
|
||||
factory ComicAuthorComicModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicAuthorComicModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
name: asT<String>(json['name'])!,
|
||||
cover: asT<String>(json['cover'])!,
|
||||
status: asT<String>(json['status'])!,
|
||||
);
|
||||
|
||||
int id;
|
||||
String name;
|
||||
String cover;
|
||||
String status;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'name': name,
|
||||
'cover': cover,
|
||||
'status': status,
|
||||
};
|
||||
}
|
||||
157
lib/models/comic/category_comic_model.dart
Normal file
157
lib/models/comic/category_comic_model.dart
Normal file
@@ -0,0 +1,157 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicCategoryComicModel {
|
||||
ComicCategoryComicModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
this.authors,
|
||||
this.types,
|
||||
this.status,
|
||||
this.lastUpdateChapterName,
|
||||
this.lastUpdateChapterId,
|
||||
this.lastUpdatetime,
|
||||
this.cover,
|
||||
this.comicPy,
|
||||
this.isFee,
|
||||
this.hotNum,
|
||||
this.authorTag,
|
||||
this.authorTagList,
|
||||
this.copyright,
|
||||
});
|
||||
|
||||
factory ComicCategoryComicModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<AuthorTagList>? authorTagList =
|
||||
json['authorTagList'] is List ? <AuthorTagList>[] : null;
|
||||
if (authorTagList != null) {
|
||||
for (final dynamic item in json['authorTagList']!) {
|
||||
if (item != null) {
|
||||
authorTagList
|
||||
.add(AuthorTagList.fromJson(asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicCategoryComicModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
name: asT<String>(json['name'])!,
|
||||
authors: asT<String?>(json['authors']),
|
||||
types: asT<String?>(json['types']),
|
||||
status: asT<String?>(json['status']),
|
||||
lastUpdateChapterName: asT<String?>(json['last_update_chapter_name']),
|
||||
lastUpdateChapterId: asT<int?>(json['last_update_chapter_id']),
|
||||
lastUpdatetime: asT<int?>(json['last_updatetime']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
comicPy: asT<String?>(json['comic_py']),
|
||||
isFee: asT<bool?>(json['isFee']),
|
||||
hotNum: asT<int?>(json['hotNum']),
|
||||
authorTag: json['authorTag'] == null
|
||||
? null
|
||||
: AuthorTag.fromJson(asT<Map<String, dynamic>>(json['authorTag'])!),
|
||||
authorTagList: authorTagList,
|
||||
copyright: asT<int?>(json['copyright']),
|
||||
);
|
||||
}
|
||||
|
||||
int id;
|
||||
String name;
|
||||
String? authors;
|
||||
String? types;
|
||||
String? status;
|
||||
String? lastUpdateChapterName;
|
||||
int? lastUpdateChapterId;
|
||||
int? lastUpdatetime;
|
||||
String? cover;
|
||||
String? comicPy;
|
||||
bool? isFee;
|
||||
int? hotNum;
|
||||
AuthorTag? authorTag;
|
||||
List<AuthorTagList>? authorTagList;
|
||||
int? copyright;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'name': name,
|
||||
'authors': authors,
|
||||
'types': types,
|
||||
'status': status,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'last_update_chapter_id': lastUpdateChapterId,
|
||||
'last_updatetime': lastUpdatetime,
|
||||
'cover': cover,
|
||||
'comic_py': comicPy,
|
||||
'isFee': isFee,
|
||||
'hotNum': hotNum,
|
||||
'authorTag': authorTag,
|
||||
'authorTagList': authorTagList,
|
||||
'copyright': copyright,
|
||||
};
|
||||
}
|
||||
|
||||
class AuthorTag {
|
||||
AuthorTag({
|
||||
this.id,
|
||||
this.tagName,
|
||||
this.tagPy,
|
||||
});
|
||||
|
||||
factory AuthorTag.fromJson(Map<String, dynamic> json) => AuthorTag(
|
||||
id: asT<int?>(json['id']),
|
||||
tagName: asT<String?>(json['tagName']),
|
||||
tagPy: asT<String?>(json['tagPy']),
|
||||
);
|
||||
|
||||
int? id;
|
||||
String? tagName;
|
||||
String? tagPy;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'tagName': tagName,
|
||||
'tagPy': tagPy,
|
||||
};
|
||||
}
|
||||
|
||||
class AuthorTagList {
|
||||
AuthorTagList({
|
||||
this.id,
|
||||
this.tagName,
|
||||
this.tagPy,
|
||||
});
|
||||
|
||||
factory AuthorTagList.fromJson(Map<String, dynamic> json) => AuthorTagList(
|
||||
id: asT<int?>(json['id']),
|
||||
tagName: asT<String?>(json['tagName']),
|
||||
tagPy: asT<String?>(json['tagPy']),
|
||||
);
|
||||
|
||||
int? id;
|
||||
String? tagName;
|
||||
String? tagPy;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'tagName': tagName,
|
||||
'tagPy': tagPy,
|
||||
};
|
||||
}
|
||||
73
lib/models/comic/category_filter_model.dart
Normal file
73
lib/models/comic/category_filter_model.dart
Normal file
@@ -0,0 +1,73 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicCategoryFilterModel {
|
||||
ComicCategoryFilterModel({
|
||||
required this.title,
|
||||
required this.items,
|
||||
});
|
||||
|
||||
factory ComicCategoryFilterModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicCategoryFilterItemModel>? items =
|
||||
json['items'] is List ? <ComicCategoryFilterItemModel>[] : null;
|
||||
if (items != null) {
|
||||
for (final dynamic item in json['items']!) {
|
||||
if (item != null) {
|
||||
items.add(ComicCategoryFilterItemModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicCategoryFilterModel(
|
||||
title: asT<String>(json['title'])!,
|
||||
items: items!,
|
||||
);
|
||||
}
|
||||
|
||||
String title;
|
||||
List<ComicCategoryFilterItemModel> items;
|
||||
var selectId = 0.obs;
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'title': title,
|
||||
'items': items,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicCategoryFilterItemModel {
|
||||
ComicCategoryFilterItemModel({
|
||||
required this.tagId,
|
||||
required this.tagName,
|
||||
});
|
||||
|
||||
factory ComicCategoryFilterItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicCategoryFilterItemModel(
|
||||
tagId: asT<int>(json['tagId'])!,
|
||||
tagName: asT<String>(json['title'])!,
|
||||
);
|
||||
|
||||
int tagId;
|
||||
String tagName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'tag_id': tagId,
|
||||
'tag_name': tagName,
|
||||
};
|
||||
}
|
||||
38
lib/models/comic/category_item_model.dart
Normal file
38
lib/models/comic/category_item_model.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicCategoryItemModel {
|
||||
ComicCategoryItemModel({
|
||||
required this.tagId,
|
||||
required this.title,
|
||||
required this.cover,
|
||||
});
|
||||
|
||||
factory ComicCategoryItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicCategoryItemModel(
|
||||
tagId: asT<int>(json['tagId'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
cover: asT<String>(json['cover'])!,
|
||||
);
|
||||
|
||||
int tagId;
|
||||
String title;
|
||||
String cover;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'tagId': tagId,
|
||||
'title': title,
|
||||
'cover': cover,
|
||||
};
|
||||
}
|
||||
77
lib/models/comic/chapter_detail_model.dart
Normal file
77
lib/models/comic/chapter_detail_model.dart
Normal file
@@ -0,0 +1,77 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicChapterDetailModel {
|
||||
ComicChapterDetailModel({
|
||||
required this.chapterId,
|
||||
required this.comicId,
|
||||
required this.title,
|
||||
required this.chapterOrder,
|
||||
required this.direction,
|
||||
required this.pageUrl,
|
||||
required this.picnum,
|
||||
required this.pageUrlHd,
|
||||
});
|
||||
|
||||
factory ComicChapterDetailModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<String>? pageUrl = json['page_url'] is List ? <String>[] : null;
|
||||
if (pageUrl != null) {
|
||||
for (final dynamic item in json['page_url']!) {
|
||||
if (item != null) {
|
||||
pageUrl.add(asT<String>(item)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<String>? pageUrlHd =
|
||||
json['page_url_hd'] is List ? <String>[] : null;
|
||||
if (pageUrlHd != null) {
|
||||
for (final dynamic item in json['page_url_hd']!) {
|
||||
if (item != null) {
|
||||
pageUrlHd.add(asT<String>(item)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicChapterDetailModel(
|
||||
chapterId: asT<int>(json['chapter_id'])!,
|
||||
comicId: asT<int>(json['comic_id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
chapterOrder: asT<int>(json['chapter_order'])!,
|
||||
direction: asT<int>(json['direction'])!,
|
||||
pageUrl: pageUrl!,
|
||||
picnum: asT<int>(json['picnum'])!,
|
||||
pageUrlHd: pageUrlHd!,
|
||||
);
|
||||
}
|
||||
|
||||
int chapterId;
|
||||
int comicId;
|
||||
String title;
|
||||
int chapterOrder;
|
||||
int direction;
|
||||
List<String> pageUrl;
|
||||
int picnum;
|
||||
List<String> pageUrlHd;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'chapter_id': chapterId,
|
||||
'comic_id': comicId,
|
||||
'title': title,
|
||||
'chapter_order': chapterOrder,
|
||||
'direction': direction,
|
||||
'page_url': pageUrl,
|
||||
'picnum': picnum,
|
||||
'page_url_hd': pageUrlHd,
|
||||
};
|
||||
}
|
||||
155
lib/models/comic/chapter_detail_web_model.dart
Normal file
155
lib/models/comic/chapter_detail_web_model.dart
Normal file
@@ -0,0 +1,155 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicChapterDetailWebModel {
|
||||
ComicChapterDetailWebModel({
|
||||
required this.id,
|
||||
required this.comicId,
|
||||
required this.chapterName,
|
||||
required this.chapterOrder,
|
||||
required this.createtime,
|
||||
required this.folder,
|
||||
required this.pageUrl,
|
||||
required this.chapterType,
|
||||
required this.chaptertype,
|
||||
required this.chapterTrueType,
|
||||
required this.chapterNum,
|
||||
required this.updatetime,
|
||||
required this.sumPages,
|
||||
required this.snsTag,
|
||||
required this.uid,
|
||||
required this.username,
|
||||
required this.translatorid,
|
||||
required this.translator,
|
||||
required this.link,
|
||||
required this.message,
|
||||
required this.download,
|
||||
required this.hidden,
|
||||
required this.direction,
|
||||
required this.filesize,
|
||||
required this.highFileSize,
|
||||
required this.picnum,
|
||||
required this.hit,
|
||||
required this.nextChapId,
|
||||
required this.prevChapId,
|
||||
required this.commentCount,
|
||||
});
|
||||
|
||||
factory ComicChapterDetailWebModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<String>? pageUrl = json['page_url'] is List ? <String>[] : null;
|
||||
if (pageUrl != null) {
|
||||
for (final dynamic item in json['page_url']!) {
|
||||
if (item != null) {
|
||||
pageUrl.add(asT<String>(item)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicChapterDetailWebModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
comicId: asT<int>(json['comic_id'])!,
|
||||
chapterName: asT<String>(json['chapter_name'])!,
|
||||
chapterOrder: asT<int>(json['chapter_order'])!,
|
||||
createtime: asT<int>(json['createtime'])!,
|
||||
folder: asT<String>(json['folder'])!,
|
||||
pageUrl: pageUrl!,
|
||||
chapterType: asT<int>(json['chapter_type'])!,
|
||||
chaptertype: asT<int>(json['chaptertype'])!,
|
||||
chapterTrueType: asT<int>(json['chapter_true_type'])!,
|
||||
chapterNum: asT<int>(json['chapter_num']) ?? 0,
|
||||
updatetime: asT<int>(json['updatetime'])!,
|
||||
sumPages: asT<int>(json['sum_pages'])!,
|
||||
snsTag: asT<int>(json['sns_tag'])!,
|
||||
uid: asT<int>(json['uid'])!,
|
||||
username: asT<String>(json['username'])!,
|
||||
translatorid: asT<String>(json['translatorid'])!,
|
||||
translator: asT<String>(json['translator'])!,
|
||||
link: asT<String>(json['link'])!,
|
||||
message: asT<String>(json['message'])!,
|
||||
download: asT<String>(json['download'])!,
|
||||
hidden: asT<int>(json['hidden'])!,
|
||||
direction: asT<int>(json['direction']) ?? 0,
|
||||
filesize: asT<int>(json['filesize']) ?? 0,
|
||||
highFileSize: asT<int>(json['high_file_size']) ?? 0,
|
||||
picnum: asT<int>(json['picnum']) ?? 0,
|
||||
hit: asT<int>(json['hit'])!,
|
||||
nextChapId: asT<int?>(json['next_chap_id']) ?? 0,
|
||||
prevChapId: asT<int?>(json['prev_chap_id']) ?? 0,
|
||||
commentCount: asT<int>(json['comment_count'])!,
|
||||
);
|
||||
}
|
||||
|
||||
int id;
|
||||
int comicId;
|
||||
String chapterName;
|
||||
int chapterOrder;
|
||||
int createtime;
|
||||
String folder;
|
||||
List<String> pageUrl;
|
||||
int chapterType;
|
||||
int chaptertype;
|
||||
int chapterTrueType;
|
||||
int chapterNum;
|
||||
int updatetime;
|
||||
int sumPages;
|
||||
int snsTag;
|
||||
int uid;
|
||||
String username;
|
||||
String translatorid;
|
||||
String translator;
|
||||
String link;
|
||||
String message;
|
||||
String download;
|
||||
int hidden;
|
||||
int direction;
|
||||
int filesize;
|
||||
int highFileSize;
|
||||
int picnum;
|
||||
int hit;
|
||||
int nextChapId;
|
||||
int prevChapId;
|
||||
int commentCount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'comic_id': comicId,
|
||||
'chapter_name': chapterName,
|
||||
'chapter_order': chapterOrder,
|
||||
'createtime': createtime,
|
||||
'folder': folder,
|
||||
'page_url': pageUrl,
|
||||
'chapter_type': chapterType,
|
||||
'chaptertype': chaptertype,
|
||||
'chapter_true_type': chapterTrueType,
|
||||
'chapter_num': chapterNum,
|
||||
'updatetime': updatetime,
|
||||
'sum_pages': sumPages,
|
||||
'sns_tag': snsTag,
|
||||
'uid': uid,
|
||||
'username': username,
|
||||
'translatorid': translatorid,
|
||||
'translator': translator,
|
||||
'link': link,
|
||||
'message': message,
|
||||
'download': download,
|
||||
'hidden': hidden,
|
||||
'direction': direction,
|
||||
'filesize': filesize,
|
||||
'high_file_size': highFileSize,
|
||||
'picnum': picnum,
|
||||
'hit': hit,
|
||||
'next_chap_id': nextChapId,
|
||||
'prev_chap_id': prevChapId,
|
||||
'comment_count': commentCount,
|
||||
};
|
||||
}
|
||||
83
lib/models/comic/chapter_info.dart
Normal file
83
lib/models/comic/chapter_info.dart
Normal file
@@ -0,0 +1,83 @@
|
||||
import 'package:flutter_dmzj/models/comic/chapter_detail_model.dart';
|
||||
import 'package:flutter_dmzj/models/comic/chapter_detail_web_model.dart';
|
||||
import 'package:flutter_dmzj/models/db/comic_download_info.dart';
|
||||
import 'package:flutter_dmzj/services/comic_download_service.dart';
|
||||
|
||||
// ignore: depend_on_referenced_packages
|
||||
import 'package:path/path.dart' as p;
|
||||
|
||||
class ComicChapterDetail {
|
||||
ComicChapterDetail({
|
||||
required this.chapterId,
|
||||
required this.comicId,
|
||||
required this.chapterOrder,
|
||||
required this.direction,
|
||||
required this.chapterTitle,
|
||||
required this.pageUrls,
|
||||
required this.picnum,
|
||||
required this.commentCount,
|
||||
this.isLocal = false,
|
||||
});
|
||||
factory ComicChapterDetail.empty() => ComicChapterDetail(
|
||||
chapterId: 0,
|
||||
comicId: 0,
|
||||
chapterOrder: 0,
|
||||
direction: 0,
|
||||
chapterTitle: "",
|
||||
pageUrls: [],
|
||||
picnum: 0,
|
||||
commentCount: 0,
|
||||
);
|
||||
factory ComicChapterDetail.fromWebApi(ComicChapterDetailWebModel item) =>
|
||||
ComicChapterDetail(
|
||||
chapterId: item.id,
|
||||
comicId: item.comicId,
|
||||
chapterOrder: item.chapterOrder,
|
||||
direction: item.direction,
|
||||
chapterTitle: item.chapterName,
|
||||
pageUrls: item.pageUrl,
|
||||
picnum: item.picnum,
|
||||
commentCount: item.commentCount,
|
||||
);
|
||||
|
||||
factory ComicChapterDetail.fromV4(ComicChapterDetailModel item, bool useHD) =>
|
||||
ComicChapterDetail(
|
||||
chapterId: item.chapterId.toInt(),
|
||||
comicId: item.comicId.toInt(),
|
||||
chapterOrder: item.chapterOrder,
|
||||
direction: item.direction,
|
||||
chapterTitle: item.title,
|
||||
pageUrls: useHD
|
||||
? (item.pageUrlHd.isNotEmpty ? item.pageUrlHd : item.pageUrl)
|
||||
: (item.pageUrl.isNotEmpty ? item.pageUrl : item.pageUrlHd),
|
||||
//pageUrls: item.pageUrlHD.isNotEmpty ? item.pageUrlHD : item.pageUrl,
|
||||
picnum: item.picnum,
|
||||
commentCount: 0,
|
||||
);
|
||||
|
||||
factory ComicChapterDetail.fromDownload(ComicDownloadInfo item) =>
|
||||
ComicChapterDetail(
|
||||
chapterId: item.chapterId.toInt(),
|
||||
comicId: item.comicId.toInt(),
|
||||
chapterOrder: item.chapterSort,
|
||||
direction: 1,
|
||||
chapterTitle: item.chapterName,
|
||||
pageUrls: item.files
|
||||
.map((e) =>
|
||||
p.join(ComicDownloadService.instance.savePath, item.taskId, e))
|
||||
.toList(),
|
||||
picnum: item.files.length,
|
||||
commentCount: 0,
|
||||
isLocal: true,
|
||||
);
|
||||
|
||||
int chapterId;
|
||||
int comicId;
|
||||
int chapterOrder;
|
||||
int direction;
|
||||
String chapterTitle;
|
||||
List<String> pageUrls;
|
||||
int picnum;
|
||||
int commentCount;
|
||||
bool isLocal;
|
||||
}
|
||||
146
lib/models/comic/comic_related_model.dart
Normal file
146
lib/models/comic/comic_related_model.dart
Normal file
@@ -0,0 +1,146 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicRelatedModel {
|
||||
ComicRelatedModel({
|
||||
required this.authorComics,
|
||||
required this.themeComics,
|
||||
required this.novels,
|
||||
});
|
||||
|
||||
factory ComicRelatedModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicRelatedAuthorModel>? authorComics =
|
||||
json['author_comics'] is List ? <ComicRelatedAuthorModel>[] : null;
|
||||
if (authorComics != null) {
|
||||
for (final dynamic item in json['author_comics']!) {
|
||||
if (item != null) {
|
||||
authorComics.add(ComicRelatedAuthorModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<ComicRelatedItemModel>? themeComics =
|
||||
json['theme_comics'] is List ? <ComicRelatedItemModel>[] : null;
|
||||
if (themeComics != null) {
|
||||
for (final dynamic item in json['theme_comics']!) {
|
||||
if (item != null) {
|
||||
themeComics.add(
|
||||
ComicRelatedItemModel.fromJson(asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<ComicRelatedItemModel>? novels =
|
||||
json['novels'] is List ? <ComicRelatedItemModel>[] : null;
|
||||
if (novels != null) {
|
||||
for (final dynamic item in json['novels']!) {
|
||||
if (item != null) {
|
||||
novels.add(
|
||||
ComicRelatedItemModel.fromJson(asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicRelatedModel(
|
||||
authorComics: authorComics!,
|
||||
themeComics: themeComics!,
|
||||
novels: novels!,
|
||||
);
|
||||
}
|
||||
|
||||
List<ComicRelatedAuthorModel> authorComics;
|
||||
List<ComicRelatedItemModel> themeComics;
|
||||
List<ComicRelatedItemModel> novels;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'author_comics': authorComics,
|
||||
'theme_comics': themeComics,
|
||||
'novels': novels,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicRelatedAuthorModel {
|
||||
ComicRelatedAuthorModel({
|
||||
required this.authorName,
|
||||
required this.authorId,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
factory ComicRelatedAuthorModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicRelatedItemModel>? data =
|
||||
json['data'] is List ? <ComicRelatedItemModel>[] : null;
|
||||
if (data != null) {
|
||||
for (final dynamic item in json['data']!) {
|
||||
if (item != null) {
|
||||
data.add(
|
||||
ComicRelatedItemModel.fromJson(asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicRelatedAuthorModel(
|
||||
authorName: asT<String>(json['author_name'])!,
|
||||
authorId: asT<int>(json['author_id'])!,
|
||||
data: data!,
|
||||
);
|
||||
}
|
||||
|
||||
String authorName;
|
||||
int authorId;
|
||||
List<ComicRelatedItemModel> data;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'author_name': authorName,
|
||||
'author_id': authorId,
|
||||
'data': data,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicRelatedItemModel {
|
||||
ComicRelatedItemModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.cover,
|
||||
required this.status,
|
||||
});
|
||||
|
||||
factory ComicRelatedItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicRelatedItemModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
name: asT<String>(json['name'])!,
|
||||
cover: asT<String>(json['cover'])!,
|
||||
status: asT<String>(json['status'])!,
|
||||
);
|
||||
|
||||
int id;
|
||||
String name;
|
||||
String cover;
|
||||
String status;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'name': name,
|
||||
'cover': cover,
|
||||
'status': status,
|
||||
};
|
||||
}
|
||||
275
lib/models/comic/detail_info.dart
Normal file
275
lib/models/comic/detail_info.dart
Normal file
@@ -0,0 +1,275 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_dmzj/models/comic/detail_model.dart';
|
||||
import 'package:flutter_dmzj/models/comic/detail_v1_model.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicDetailInfo {
|
||||
ComicDetailInfo({
|
||||
this.id = 0,
|
||||
this.title = "",
|
||||
this.direction = 0,
|
||||
this.isLong = false,
|
||||
this.cover = "",
|
||||
this.description = "",
|
||||
this.lastUpdatetime = 0,
|
||||
this.lastUpdatechapterName = "",
|
||||
this.firstLetter = "",
|
||||
this.comicPy = "",
|
||||
this.hotNum = 0,
|
||||
this.hitNum = 0,
|
||||
this.lastUpdateChapterId = 0,
|
||||
required this.types,
|
||||
required this.status,
|
||||
required this.authors,
|
||||
this.subscribeNum = 0,
|
||||
required this.volumes,
|
||||
this.isHide = false,
|
||||
this.isVip = false,
|
||||
});
|
||||
|
||||
factory ComicDetailInfo.empty() => ComicDetailInfo(
|
||||
types: [],
|
||||
status: [],
|
||||
authors: [],
|
||||
volumes: [],
|
||||
);
|
||||
|
||||
factory ComicDetailInfo.fromV4(ComicDetailModel data) => ComicDetailInfo(
|
||||
id: data.data.id,
|
||||
title: data.data.title,
|
||||
direction: data.data.direction ?? 0,
|
||||
isLong: data.data.islong == 1,
|
||||
cover: data.data.cover ?? "",
|
||||
description: data.data.description ?? "",
|
||||
lastUpdateChapterId: data.data.lastUpdateChapterId ?? 0,
|
||||
lastUpdatechapterName: data.data.lastUpdateChapterName ?? "",
|
||||
lastUpdatetime: data.data.lastUpdatetime ?? 0,
|
||||
hitNum: 0,
|
||||
hotNum: 0,
|
||||
subscribeNum: 0,
|
||||
firstLetter: data.data.firstLetter ?? "",
|
||||
comicPy: data.data.comicPy ?? "",
|
||||
isVip: false,
|
||||
types: (data.data.types ?? [])
|
||||
.map(
|
||||
(e) => ComicDetailTag(
|
||||
tagId: e.tagId.toInt(),
|
||||
tagName: e.tagName,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
status: (data.data.status ?? [])
|
||||
.map(
|
||||
(e) => ComicDetailTag(
|
||||
tagId: e.tagId.toInt(),
|
||||
tagName: e.tagName,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
authors: (data.data.authors ?? [])
|
||||
.map(
|
||||
(e) => ComicDetailTag(
|
||||
tagId: e.tagId,
|
||||
tagName: e.tagName,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
volumes: (data.data.chapters ?? [])
|
||||
.map(
|
||||
(e) => ComicDetailVolume(
|
||||
title: e.title!,
|
||||
chapters: RxList<ComicDetailChapterItem>(
|
||||
(e.data ?? [])
|
||||
.map(
|
||||
(x) => ComicDetailChapterItem(
|
||||
chapterId: x.chapterId.toInt(),
|
||||
chapterTitle: x.chapterTitle,
|
||||
updateTime: x.updatetime ?? 0,
|
||||
fileSize: 0,
|
||||
chapterOrder: x.chapterOrder,
|
||||
isVip: false,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
factory ComicDetailInfo.fromV1(ComicDetailV1Model model,
|
||||
{bool isHide = false}) {
|
||||
var lastChapterId = 0;
|
||||
List<ComicDetailVolume> volumes = [];
|
||||
List<ComicDetailChapterItem> serialItems = [];
|
||||
List<ComicDetailChapterItem> aloneItems = [];
|
||||
for (var item in model.list) {
|
||||
serialItems.add(
|
||||
ComicDetailChapterItem(
|
||||
chapterId: int.tryParse(item.id) ?? 0,
|
||||
chapterTitle: item.chapterName,
|
||||
updateTime: int.tryParse(item.updatetime) ?? 0,
|
||||
fileSize: int.tryParse(item.filesize) ?? 0,
|
||||
chapterOrder: int.tryParse(item.chapterOrder) ?? 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
for (var item in model.alone) {
|
||||
aloneItems.add(
|
||||
ComicDetailChapterItem(
|
||||
chapterId: int.tryParse(item.id) ?? 0,
|
||||
chapterTitle: item.chapterName,
|
||||
updateTime: int.tryParse(item.updatetime) ?? 0,
|
||||
fileSize: int.tryParse(item.filesize) ?? 0,
|
||||
chapterOrder: int.tryParse(item.chapterOrder) ?? 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (serialItems.isNotEmpty) {
|
||||
lastChapterId = serialItems.last.chapterId;
|
||||
}
|
||||
volumes.add(
|
||||
ComicDetailVolume(
|
||||
title: isHide ? "神隐" : "连载",
|
||||
chapters: RxList<ComicDetailChapterItem>(serialItems)),
|
||||
);
|
||||
if (aloneItems.isNotEmpty) {
|
||||
volumes.add(
|
||||
ComicDetailVolume(
|
||||
title: isHide ? "神隐-单行本" : "单行本",
|
||||
chapters: RxList<ComicDetailChapterItem>(aloneItems)),
|
||||
);
|
||||
}
|
||||
return ComicDetailInfo(
|
||||
id: int.tryParse(model.info.id) ?? 0,
|
||||
title: model.info.title,
|
||||
direction: int.tryParse(model.info.direction) ?? 0,
|
||||
isLong: (int.tryParse(model.info.islong) ?? 0) == 1,
|
||||
cover: model.info.cover,
|
||||
description: model.info.description,
|
||||
lastUpdateChapterId: lastChapterId,
|
||||
lastUpdatechapterName: model.info.lastUpdateChapterName,
|
||||
lastUpdatetime: int.tryParse(model.info.lastUpdatetime) ?? 0,
|
||||
hitNum: 0,
|
||||
hotNum: 0,
|
||||
subscribeNum: 0,
|
||||
firstLetter: model.info.firstLetter,
|
||||
comicPy: "",
|
||||
isHide: isHide,
|
||||
types: model.info.types
|
||||
.split("/")
|
||||
.map(
|
||||
(e) => ComicDetailTag(
|
||||
tagId: 0,
|
||||
tagName: e,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
status: [
|
||||
ComicDetailTag(
|
||||
tagId: 0,
|
||||
tagName: model.info.status,
|
||||
)
|
||||
],
|
||||
authors: model.info.authors
|
||||
.split("/")
|
||||
.map(
|
||||
(e) => ComicDetailTag(
|
||||
tagId: 0,
|
||||
tagName: e,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
volumes: volumes,
|
||||
);
|
||||
}
|
||||
|
||||
int id;
|
||||
String title;
|
||||
int direction;
|
||||
bool isLong;
|
||||
String cover;
|
||||
String description;
|
||||
int lastUpdatetime;
|
||||
String lastUpdatechapterName;
|
||||
String firstLetter;
|
||||
String comicPy;
|
||||
int hotNum;
|
||||
int hitNum;
|
||||
int lastUpdateChapterId;
|
||||
List<ComicDetailTag> types = [];
|
||||
List<ComicDetailTag> status = [];
|
||||
List<ComicDetailTag> authors = [];
|
||||
int subscribeNum;
|
||||
List<ComicDetailVolume> volumes = [];
|
||||
|
||||
bool isVip;
|
||||
|
||||
/// 是否神隐
|
||||
bool isHide;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ComicDetailTag {
|
||||
ComicDetailTag({
|
||||
required this.tagId,
|
||||
required this.tagName,
|
||||
});
|
||||
|
||||
int tagId;
|
||||
String tagName;
|
||||
}
|
||||
|
||||
class ComicDetailVolume {
|
||||
ComicDetailVolume({
|
||||
required this.title,
|
||||
required this.chapters,
|
||||
}) {
|
||||
sort();
|
||||
}
|
||||
|
||||
String title;
|
||||
RxList<ComicDetailChapterItem> chapters;
|
||||
//0倒序,1正序
|
||||
var sortType = 0.obs;
|
||||
var showAll = false.obs;
|
||||
bool get showMoreButton => chapters.length > 15;
|
||||
|
||||
void sort() {
|
||||
if (sortType.value == 0) {
|
||||
chapters.sort((a, b) => b.chapterOrder.compareTo(a.chapterOrder));
|
||||
} else {
|
||||
chapters.sort((a, b) => a.chapterOrder.compareTo(b.chapterOrder));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ComicDetailChapterItem {
|
||||
ComicDetailChapterItem({
|
||||
required this.chapterId,
|
||||
required this.chapterTitle,
|
||||
required this.updateTime,
|
||||
required this.fileSize,
|
||||
required this.chapterOrder,
|
||||
this.isVip = false,
|
||||
});
|
||||
|
||||
int chapterId;
|
||||
String chapterTitle;
|
||||
int updateTime;
|
||||
int fileSize;
|
||||
int chapterOrder;
|
||||
|
||||
bool isVip;
|
||||
}
|
||||
352
lib/models/comic/detail_model.dart
Normal file
352
lib/models/comic/detail_model.dart
Normal file
@@ -0,0 +1,352 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicDetailModel {
|
||||
ComicDetailModel({
|
||||
required this.data,
|
||||
required this.readingRecord,
|
||||
});
|
||||
|
||||
factory ComicDetailModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicDetailModel(
|
||||
data: ComicDetailDataModel.fromJson(
|
||||
asT<Map<String, dynamic>>(json['data'])!),
|
||||
readingRecord: ComicDetailReadingRecordModel.fromJson(
|
||||
asT<Map<String, dynamic>>(json['readingRecord'])!),
|
||||
);
|
||||
|
||||
ComicDetailDataModel data;
|
||||
ComicDetailReadingRecordModel readingRecord;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'data': data,
|
||||
'readingRecord': readingRecord,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicDetailDataModel {
|
||||
ComicDetailDataModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
this.direction,
|
||||
this.islong,
|
||||
this.cover,
|
||||
this.description,
|
||||
this.lastUpdatetime,
|
||||
this.lastUpdateChapterName,
|
||||
this.firstLetter,
|
||||
this.comicPy,
|
||||
this.lastUpdateChapterId,
|
||||
this.types,
|
||||
this.status,
|
||||
this.authors,
|
||||
this.chapters,
|
||||
this.dhUrlLinks,
|
||||
});
|
||||
|
||||
factory ComicDetailDataModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicDetailDataTagModel>? types =
|
||||
json['types'] is List ? <ComicDetailDataTagModel>[] : null;
|
||||
if (types != null) {
|
||||
for (final dynamic item in json['types']!) {
|
||||
if (item != null) {
|
||||
types.add(ComicDetailDataTagModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<ComicDetailDataTagModel>? status =
|
||||
json['status'] is List ? <ComicDetailDataTagModel>[] : null;
|
||||
if (status != null) {
|
||||
for (final dynamic item in json['status']!) {
|
||||
if (item != null) {
|
||||
status.add(ComicDetailDataTagModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<ComicDetailDataTagModel>? authors =
|
||||
json['authors'] is List ? <ComicDetailDataTagModel>[] : null;
|
||||
if (authors != null) {
|
||||
for (final dynamic item in json['authors']!) {
|
||||
if (item != null) {
|
||||
authors.add(ComicDetailDataTagModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<ComicDetailChapterModel>? chapters =
|
||||
json['chapters'] is List ? <ComicDetailChapterModel>[] : null;
|
||||
if (chapters != null) {
|
||||
for (final dynamic item in json['chapters']!) {
|
||||
if (item != null) {
|
||||
chapters.add(ComicDetailChapterModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<DhUrlLinks>? dhUrlLinks =
|
||||
json['dh_url_links'] is List ? <DhUrlLinks>[] : null;
|
||||
if (dhUrlLinks != null) {
|
||||
for (final dynamic item in json['dh_url_links']!) {
|
||||
if (item != null) {
|
||||
dhUrlLinks.add(DhUrlLinks.fromJson(asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicDetailDataModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
direction: asT<int?>(json['direction']),
|
||||
islong: asT<int?>(json['islong']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
description: asT<String?>(json['description']),
|
||||
lastUpdatetime: asT<int?>(json['last_updatetime']),
|
||||
lastUpdateChapterName: asT<String?>(json['last_update_chapter_name']),
|
||||
firstLetter: asT<String?>(json['first_letter']),
|
||||
comicPy: asT<String?>(json['comic_py']),
|
||||
lastUpdateChapterId: asT<int?>(json['last_update_chapter_id']),
|
||||
types: types,
|
||||
status: status,
|
||||
authors: authors,
|
||||
chapters: chapters,
|
||||
dhUrlLinks: dhUrlLinks,
|
||||
);
|
||||
}
|
||||
|
||||
int id;
|
||||
String title;
|
||||
int? direction;
|
||||
int? islong;
|
||||
String? cover;
|
||||
String? description;
|
||||
int? lastUpdatetime;
|
||||
String? lastUpdateChapterName;
|
||||
String? firstLetter;
|
||||
String? comicPy;
|
||||
int? lastUpdateChapterId;
|
||||
List<ComicDetailDataTagModel>? types;
|
||||
List<ComicDetailDataTagModel>? status;
|
||||
List<ComicDetailDataTagModel>? authors;
|
||||
List<ComicDetailChapterModel>? chapters;
|
||||
List<DhUrlLinks>? dhUrlLinks;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'direction': direction,
|
||||
'islong': islong,
|
||||
'cover': cover,
|
||||
'description': description,
|
||||
'last_updatetime': lastUpdatetime,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'first_letter': firstLetter,
|
||||
'comic_py': comicPy,
|
||||
'last_update_chapter_id': lastUpdateChapterId,
|
||||
'types': types,
|
||||
'status': status,
|
||||
'authors': authors,
|
||||
'chapters': chapters,
|
||||
'dh_url_links': dhUrlLinks,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicDetailDataTagModel {
|
||||
ComicDetailDataTagModel({
|
||||
required this.tagId,
|
||||
required this.tagName,
|
||||
});
|
||||
|
||||
factory ComicDetailDataTagModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicDetailDataTagModel(
|
||||
tagId: asT<int>(json['tag_id'])!,
|
||||
tagName: asT<String>(json['tag_name'])!,
|
||||
);
|
||||
|
||||
int tagId;
|
||||
String tagName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'tag_id': tagId,
|
||||
'tag_name': tagName,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicDetailChapterModel {
|
||||
ComicDetailChapterModel({
|
||||
this.title,
|
||||
this.data,
|
||||
});
|
||||
|
||||
factory ComicDetailChapterModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicDetailChapterDataModel>? data =
|
||||
json['data'] is List ? <ComicDetailChapterDataModel>[] : null;
|
||||
if (data != null) {
|
||||
for (final dynamic item in json['data']!) {
|
||||
if (item != null) {
|
||||
data.add(ComicDetailChapterDataModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicDetailChapterModel(
|
||||
title: asT<String?>(json['title']),
|
||||
data: data,
|
||||
);
|
||||
}
|
||||
|
||||
String? title;
|
||||
List<ComicDetailChapterDataModel>? data;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'title': title,
|
||||
'data': data,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicDetailChapterDataModel {
|
||||
ComicDetailChapterDataModel({
|
||||
required this.chapterId,
|
||||
required this.chapterTitle,
|
||||
this.updatetime,
|
||||
required this.chapterOrder,
|
||||
});
|
||||
|
||||
factory ComicDetailChapterDataModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicDetailChapterDataModel(
|
||||
chapterId: asT<int>(json['chapter_id'])!,
|
||||
chapterTitle: asT<String>(json['chapter_title'])!,
|
||||
updatetime: asT<int?>(json['updatetime']),
|
||||
chapterOrder: asT<int>(json['chapter_order'])!,
|
||||
);
|
||||
|
||||
int chapterId;
|
||||
String chapterTitle;
|
||||
int? updatetime;
|
||||
int chapterOrder;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'chapter_id': chapterId,
|
||||
'chapter_title': chapterTitle,
|
||||
'updatetime': updatetime,
|
||||
'chapter_order': chapterOrder,
|
||||
};
|
||||
}
|
||||
|
||||
class DhUrlLinks {
|
||||
DhUrlLinks({
|
||||
this.title,
|
||||
});
|
||||
|
||||
factory DhUrlLinks.fromJson(Map<String, dynamic> json) => DhUrlLinks(
|
||||
title: asT<String?>(json['title']),
|
||||
);
|
||||
|
||||
String? title;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'title': title,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicDetailReadingRecordModel {
|
||||
ComicDetailReadingRecordModel({
|
||||
this.typeName,
|
||||
this.uid,
|
||||
this.source,
|
||||
this.bizId,
|
||||
this.chapterId,
|
||||
this.viewingTime,
|
||||
this.record,
|
||||
this.volumeId,
|
||||
this.totalNum,
|
||||
this.chapterName,
|
||||
this.volumeName,
|
||||
});
|
||||
|
||||
factory ComicDetailReadingRecordModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicDetailReadingRecordModel(
|
||||
typeName: asT<String?>(json['type_name']),
|
||||
uid: asT<int?>(json['uid']),
|
||||
source: asT<int?>(json['source']),
|
||||
bizId: asT<int?>(json['biz_id']),
|
||||
chapterId: asT<int?>(json['chapter_id']),
|
||||
viewingTime: asT<int?>(json['viewing_time']),
|
||||
record: asT<int?>(json['record']),
|
||||
volumeId: asT<int?>(json['volume_id']),
|
||||
totalNum: asT<int?>(json['total_num']),
|
||||
chapterName: asT<String?>(json['chapter_name']),
|
||||
volumeName: asT<String?>(json['volume_name']),
|
||||
);
|
||||
|
||||
String? typeName;
|
||||
int? uid;
|
||||
int? source;
|
||||
int? bizId;
|
||||
int? chapterId;
|
||||
int? viewingTime;
|
||||
int? record;
|
||||
int? volumeId;
|
||||
int? totalNum;
|
||||
String? chapterName;
|
||||
String? volumeName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'type_name': typeName,
|
||||
'uid': uid,
|
||||
'source': source,
|
||||
'biz_id': bizId,
|
||||
'chapter_id': chapterId,
|
||||
'viewing_time': viewingTime,
|
||||
'record': record,
|
||||
'volume_id': volumeId,
|
||||
'total_num': totalNum,
|
||||
'chapter_name': chapterName,
|
||||
'volume_name': volumeName,
|
||||
};
|
||||
}
|
||||
186
lib/models/comic/detail_v1_model.dart
Normal file
186
lib/models/comic/detail_v1_model.dart
Normal file
@@ -0,0 +1,186 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicDetailV1Model {
|
||||
ComicDetailV1Model({
|
||||
required this.info,
|
||||
required this.list,
|
||||
required this.alone,
|
||||
});
|
||||
|
||||
factory ComicDetailV1Model.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicDetailV1ChapterModel>? list =
|
||||
json['list'] is List ? <ComicDetailV1ChapterModel>[] : null;
|
||||
if (list != null) {
|
||||
for (final dynamic item in json['list']!) {
|
||||
if (item != null) {
|
||||
list.add(ComicDetailV1ChapterModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<ComicDetailV1ChapterModel>? alone =
|
||||
json['alone'] is List ? <ComicDetailV1ChapterModel>[] : null;
|
||||
if (alone != null) {
|
||||
for (final dynamic item in json['alone']!) {
|
||||
if (item != null) {
|
||||
alone.add(ComicDetailV1ChapterModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ComicDetailV1Model(
|
||||
info: ComicDetailV1InfoModel.fromJson(
|
||||
asT<Map<String, dynamic>>(json['info'])!),
|
||||
list: list!,
|
||||
alone: alone!,
|
||||
);
|
||||
}
|
||||
|
||||
ComicDetailV1InfoModel info;
|
||||
List<ComicDetailV1ChapterModel> list;
|
||||
List<ComicDetailV1ChapterModel> alone;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'info': info,
|
||||
'list': list,
|
||||
'alone': alone,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicDetailV1InfoModel {
|
||||
ComicDetailV1InfoModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.subtitle,
|
||||
required this.types,
|
||||
required this.zone,
|
||||
required this.status,
|
||||
required this.lastUpdateChapterName,
|
||||
required this.lastUpdatetime,
|
||||
required this.cover,
|
||||
required this.authors,
|
||||
required this.description,
|
||||
required this.firstLetter,
|
||||
required this.direction,
|
||||
required this.islong,
|
||||
required this.copyright,
|
||||
});
|
||||
|
||||
factory ComicDetailV1InfoModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicDetailV1InfoModel(
|
||||
id: asT<String>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
subtitle: asT<String>(json['subtitle'])!,
|
||||
types: asT<String>(json['types'])!,
|
||||
zone: asT<String>(json['zone'])!,
|
||||
status: asT<String>(json['status'])!,
|
||||
lastUpdateChapterName: asT<String>(json['last_update_chapter_name'])!,
|
||||
lastUpdatetime: asT<String>(json['last_updatetime'])!,
|
||||
cover: asT<String>(json['cover'])!,
|
||||
authors: asT<String>(json['authors'])!,
|
||||
description: asT<String>(json['description'])!,
|
||||
firstLetter: asT<String>(json['first_letter'])!,
|
||||
direction: asT<String>(json['direction'])!,
|
||||
islong: asT<String>(json['islong'])!,
|
||||
copyright: asT<String>(json['copyright'])!,
|
||||
);
|
||||
|
||||
String id;
|
||||
String title;
|
||||
String subtitle;
|
||||
String types;
|
||||
String zone;
|
||||
String status;
|
||||
String lastUpdateChapterName;
|
||||
String lastUpdatetime;
|
||||
String cover;
|
||||
String authors;
|
||||
String description;
|
||||
String firstLetter;
|
||||
String direction;
|
||||
String islong;
|
||||
String copyright;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'subtitle': subtitle,
|
||||
'types': types,
|
||||
'zone': zone,
|
||||
'status': status,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'last_updatetime': lastUpdatetime,
|
||||
'cover': cover,
|
||||
'authors': authors,
|
||||
'description': description,
|
||||
'first_letter': firstLetter,
|
||||
'direction': direction,
|
||||
'islong': islong,
|
||||
'copyright': copyright,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicDetailV1ChapterModel {
|
||||
ComicDetailV1ChapterModel({
|
||||
required this.id,
|
||||
required this.comicId,
|
||||
required this.chapterName,
|
||||
required this.chapterOrder,
|
||||
required this.filesize,
|
||||
required this.createtime,
|
||||
required this.updatetime,
|
||||
});
|
||||
|
||||
factory ComicDetailV1ChapterModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicDetailV1ChapterModel(
|
||||
id: asT<String>(json['id'])!,
|
||||
comicId: asT<String>(json['comic_id'])!,
|
||||
chapterName: asT<String>(json['chapter_name'])!,
|
||||
chapterOrder: asT<String>(json['chapter_order'])!,
|
||||
filesize: asT<String>(json['filesize'])!,
|
||||
createtime: asT<String>(json['createtime'])!,
|
||||
updatetime: asT<String>(json['updatetime'])!,
|
||||
);
|
||||
|
||||
String id;
|
||||
String comicId;
|
||||
String chapterName;
|
||||
String chapterOrder;
|
||||
String filesize;
|
||||
String createtime;
|
||||
String updatetime;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'comic_id': comicId,
|
||||
'chapter_name': chapterName,
|
||||
'chapter_order': chapterOrder,
|
||||
'filesize': filesize,
|
||||
'createtime': createtime,
|
||||
'updatetime': updatetime,
|
||||
};
|
||||
}
|
||||
70
lib/models/comic/rank_item_model.dart
Normal file
70
lib/models/comic/rank_item_model.dart
Normal file
@@ -0,0 +1,70 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicRankListItemModel {
|
||||
ComicRankListItemModel({
|
||||
required this.comicId,
|
||||
required this.title,
|
||||
this.authors,
|
||||
this.status,
|
||||
this.cover,
|
||||
this.types,
|
||||
this.lastUpdatetime,
|
||||
this.lastUpdateChapterName,
|
||||
this.comicPy,
|
||||
this.num,
|
||||
this.tagId,
|
||||
});
|
||||
|
||||
factory ComicRankListItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicRankListItemModel(
|
||||
comicId: asT<int>(json['comic_id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
authors: asT<String?>(json['authors']),
|
||||
status: asT<String?>(json['status']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
types: asT<String?>(json['types']),
|
||||
lastUpdatetime: asT<int?>(json['last_updatetime']),
|
||||
lastUpdateChapterName: asT<String?>(json['last_update_chapter_name']),
|
||||
comicPy: asT<String?>(json['comic_py']),
|
||||
num: asT<int?>(json['num']),
|
||||
tagId: asT<int?>(json['tag_id']),
|
||||
);
|
||||
|
||||
int comicId;
|
||||
String title;
|
||||
String? authors;
|
||||
String? status;
|
||||
String? cover;
|
||||
String? types;
|
||||
int? lastUpdatetime;
|
||||
String? lastUpdateChapterName;
|
||||
String? comicPy;
|
||||
int? num;
|
||||
int? tagId;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'comic_id': comicId,
|
||||
'title': title,
|
||||
'authors': authors,
|
||||
'status': status,
|
||||
'cover': cover,
|
||||
'types': types,
|
||||
'last_updatetime': lastUpdatetime,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'comic_py': comicPy,
|
||||
'num': num,
|
||||
'tag_id': tagId,
|
||||
};
|
||||
}
|
||||
101
lib/models/comic/recommend_model.dart
Normal file
101
lib/models/comic/recommend_model.dart
Normal file
@@ -0,0 +1,101 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicRecommendModel {
|
||||
ComicRecommendModel({
|
||||
required this.categoryId,
|
||||
required this.title,
|
||||
required this.sort,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
factory ComicRecommendModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicRecommendItemModel>? data =
|
||||
json['data'] is List ? <ComicRecommendItemModel>[] : null;
|
||||
if (data != null) {
|
||||
for (final dynamic item in json['data']!) {
|
||||
if (item != null) {
|
||||
data.add(ComicRecommendItemModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicRecommendModel(
|
||||
categoryId: asT<int>(json['category_id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
sort: asT<int>(json['sort'])!,
|
||||
data: data ?? [],
|
||||
);
|
||||
}
|
||||
|
||||
int categoryId;
|
||||
String title;
|
||||
int sort;
|
||||
List<ComicRecommendItemModel> data;
|
||||
int page = 1;
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'category_id': categoryId,
|
||||
'title': title,
|
||||
'sort': sort,
|
||||
'data': data,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicRecommendItemModel {
|
||||
ComicRecommendItemModel({
|
||||
required this.cover,
|
||||
required this.title,
|
||||
this.subTitle,
|
||||
this.type,
|
||||
this.url,
|
||||
required this.objId,
|
||||
this.status,
|
||||
this.id,
|
||||
});
|
||||
|
||||
factory ComicRecommendItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicRecommendItemModel(
|
||||
id: asT<int?>(json['id']),
|
||||
cover: asT<String>(json['cover'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
subTitle: asT<String?>(json['sub_title']),
|
||||
type: asT<int?>(json['type']),
|
||||
url: asT<String?>(json['url']),
|
||||
objId: asT<int?>(json['obj_id']),
|
||||
status: asT<String?>(json['status']),
|
||||
);
|
||||
int? id;
|
||||
String cover;
|
||||
String title;
|
||||
String? subTitle;
|
||||
int? type;
|
||||
String? url;
|
||||
int? objId;
|
||||
String? status;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'cover': cover,
|
||||
'title': title,
|
||||
'sub_title': subTitle,
|
||||
'type': type,
|
||||
'url': url,
|
||||
'obj_id': objId,
|
||||
'status': status,
|
||||
};
|
||||
}
|
||||
36
lib/models/comic/search_item.dart
Normal file
36
lib/models/comic/search_item.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter_dmzj/models/comic/search_model.dart';
|
||||
import 'package:flutter_dmzj/models/comic/web_search_model.dart';
|
||||
|
||||
class SearchComicItem {
|
||||
final int comicId;
|
||||
final String title;
|
||||
final String cover;
|
||||
final String author;
|
||||
final String lastChapterName;
|
||||
final String tags;
|
||||
SearchComicItem({
|
||||
required this.author,
|
||||
required this.comicId,
|
||||
required this.cover,
|
||||
required this.lastChapterName,
|
||||
required this.tags,
|
||||
required this.title,
|
||||
});
|
||||
|
||||
factory SearchComicItem.fromApi(ComicSearchModel item) => SearchComicItem(
|
||||
author: item.authors ?? "",
|
||||
comicId: item.id,
|
||||
cover: item.cover ?? "",
|
||||
lastChapterName: item.lastName ?? "",
|
||||
tags: item.types ?? "",
|
||||
title: item.title,
|
||||
);
|
||||
factory SearchComicItem.fromWeb(ComicWebSearchModel item) => SearchComicItem(
|
||||
author: item.comicAuthor,
|
||||
comicId: item.id,
|
||||
cover: item.cover,
|
||||
lastChapterName: item.lastUpdateChapterName,
|
||||
tags: "/",
|
||||
title: item.comicName,
|
||||
);
|
||||
}
|
||||
70
lib/models/comic/search_model.dart
Normal file
70
lib/models/comic/search_model.dart
Normal file
@@ -0,0 +1,70 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicSearchModel {
|
||||
ComicSearchModel({
|
||||
required this.id,
|
||||
this.authors,
|
||||
this.copyright,
|
||||
this.cover,
|
||||
this.hotHits,
|
||||
this.lastName,
|
||||
this.status,
|
||||
required this.title,
|
||||
this.types,
|
||||
this.aliasName,
|
||||
this.comicPy,
|
||||
});
|
||||
|
||||
factory ComicSearchModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicSearchModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
authors: asT<String?>(json['authors']),
|
||||
copyright: asT<int?>(json['copyright']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
hotHits: asT<int?>(json['hot_hits']),
|
||||
lastName: asT<String?>(json['last_name']),
|
||||
status: asT<String?>(json['status']),
|
||||
title: asT<String>(json['title'])!,
|
||||
types: asT<String?>(json['types']),
|
||||
aliasName: asT<String?>(json['alias_name']),
|
||||
comicPy: asT<String?>(json['comic_py']),
|
||||
);
|
||||
|
||||
int id;
|
||||
String? authors;
|
||||
int? copyright;
|
||||
String? cover;
|
||||
int? hotHits;
|
||||
String? lastName;
|
||||
String? status;
|
||||
String title;
|
||||
String? types;
|
||||
String? aliasName;
|
||||
String? comicPy;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'authors': authors,
|
||||
'copyright': copyright,
|
||||
'cover': cover,
|
||||
'hot_hits': hotHits,
|
||||
'last_name': lastName,
|
||||
'status': status,
|
||||
'title': title,
|
||||
'types': types,
|
||||
'alias_name': aliasName,
|
||||
'comic_py': comicPy,
|
||||
};
|
||||
}
|
||||
103
lib/models/comic/special_detail_model.dart
Normal file
103
lib/models/comic/special_detail_model.dart
Normal file
@@ -0,0 +1,103 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicSpecialDetailModel {
|
||||
ComicSpecialDetailModel({
|
||||
required this.mobileHeaderPic,
|
||||
required this.title,
|
||||
required this.pageUrl,
|
||||
required this.description,
|
||||
required this.comics,
|
||||
required this.commentAmount,
|
||||
});
|
||||
|
||||
factory ComicSpecialDetailModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<ComicSpecialComicModel>? comics =
|
||||
json['comics'] is List ? <ComicSpecialComicModel>[] : null;
|
||||
if (comics != null) {
|
||||
for (final dynamic item in json['comics']!) {
|
||||
if (item != null) {
|
||||
comics.add(ComicSpecialComicModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ComicSpecialDetailModel(
|
||||
mobileHeaderPic: asT<String>(json['mobile_header_pic'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
pageUrl: asT<String>(json['page_url'])!,
|
||||
description: asT<String>(json['description'])!,
|
||||
comics: comics!,
|
||||
commentAmount: asT<int>(json['comment_amount'])!,
|
||||
);
|
||||
}
|
||||
|
||||
String mobileHeaderPic;
|
||||
String title;
|
||||
String pageUrl;
|
||||
String description;
|
||||
List<ComicSpecialComicModel> comics;
|
||||
int commentAmount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'mobile_header_pic': mobileHeaderPic,
|
||||
'title': title,
|
||||
'page_url': pageUrl,
|
||||
'description': description,
|
||||
'comics': comics,
|
||||
'comment_amount': commentAmount,
|
||||
};
|
||||
}
|
||||
|
||||
class ComicSpecialComicModel {
|
||||
ComicSpecialComicModel({
|
||||
required this.cover,
|
||||
required this.recommendBrief,
|
||||
required this.recommendReason,
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.aliasName,
|
||||
});
|
||||
|
||||
factory ComicSpecialComicModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicSpecialComicModel(
|
||||
cover: asT<String?>(json['cover']) ?? "",
|
||||
recommendBrief: asT<String?>(json['recommend_brief']) ?? "",
|
||||
recommendReason: asT<String?>(json['recommend_reason']) ?? "",
|
||||
id: asT<int>(json['id'])!,
|
||||
name: asT<String?>(json['name']) ?? "",
|
||||
aliasName: asT<String?>(json['alias_name']) ?? "",
|
||||
);
|
||||
|
||||
String cover;
|
||||
String recommendBrief;
|
||||
String recommendReason;
|
||||
int id;
|
||||
String name;
|
||||
String aliasName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'cover': cover,
|
||||
'recommend_brief': recommendBrief,
|
||||
'recommend_reason': recommendReason,
|
||||
'id': id,
|
||||
'name': name,
|
||||
'alias_name': aliasName,
|
||||
};
|
||||
}
|
||||
58
lib/models/comic/special_model.dart
Normal file
58
lib/models/comic/special_model.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicSpecialModel {
|
||||
ComicSpecialModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.shortTitle,
|
||||
required this.createTime,
|
||||
required this.smallCover,
|
||||
required this.pageType,
|
||||
required this.sort,
|
||||
required this.pageUrl,
|
||||
});
|
||||
|
||||
factory ComicSpecialModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicSpecialModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
shortTitle: asT<String>(json['short_title'])!,
|
||||
createTime: asT<int>(json['create_time'])!,
|
||||
smallCover: asT<String>(json['small_cover'])!,
|
||||
pageType: asT<int>(json['page_type'])!,
|
||||
sort: asT<int>(json['sort'])!,
|
||||
pageUrl: asT<String>(json['page_url'])!,
|
||||
);
|
||||
|
||||
int id;
|
||||
String title;
|
||||
String shortTitle;
|
||||
int createTime;
|
||||
String smallCover;
|
||||
int pageType;
|
||||
int sort;
|
||||
String pageUrl;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'short_title': shortTitle,
|
||||
'create_time': createTime,
|
||||
'small_cover': smallCover,
|
||||
'page_type': pageType,
|
||||
'sort': sort,
|
||||
'page_url': pageUrl,
|
||||
};
|
||||
}
|
||||
66
lib/models/comic/update_item_model.dart
Normal file
66
lib/models/comic/update_item_model.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicUpdateItemModel {
|
||||
ComicUpdateItemModel({
|
||||
required this.comicId,
|
||||
required this.title,
|
||||
this.islong,
|
||||
this.authors,
|
||||
this.types,
|
||||
this.cover,
|
||||
this.status,
|
||||
this.lastUpdateChapterName,
|
||||
this.lastUpdateChapterId,
|
||||
this.lastUpdatetime,
|
||||
});
|
||||
|
||||
factory ComicUpdateItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicUpdateItemModel(
|
||||
comicId: asT<int>(json['comic_id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
islong: asT<int?>(json['islong']),
|
||||
authors: asT<String?>(json['authors']),
|
||||
types: asT<String?>(json['types']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
status: asT<String?>(json['status']),
|
||||
lastUpdateChapterName: asT<String?>(json['last_update_chapter_name']),
|
||||
lastUpdateChapterId: asT<int?>(json['last_update_chapter_id']),
|
||||
lastUpdatetime: asT<int?>(json['last_updatetime']),
|
||||
);
|
||||
|
||||
int comicId;
|
||||
String title;
|
||||
int? islong;
|
||||
String? authors;
|
||||
String? types;
|
||||
String? cover;
|
||||
String? status;
|
||||
String? lastUpdateChapterName;
|
||||
int? lastUpdateChapterId;
|
||||
int? lastUpdatetime;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'comic_id': comicId,
|
||||
'title': title,
|
||||
'islong': islong,
|
||||
'authors': authors,
|
||||
'types': types,
|
||||
'cover': cover,
|
||||
'status': status,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'last_update_chapter_id': lastUpdateChapterId,
|
||||
'last_updatetime': lastUpdatetime,
|
||||
};
|
||||
}
|
||||
48
lib/models/comic/view_point_model.dart
Normal file
48
lib/models/comic/view_point_model.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicViewPointModel {
|
||||
ComicViewPointModel({
|
||||
required this.id,
|
||||
required this.uid,
|
||||
required this.content,
|
||||
required this.num,
|
||||
required this.page,
|
||||
});
|
||||
|
||||
factory ComicViewPointModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicViewPointModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
uid: asT<int>(json['uid'])!,
|
||||
content: asT<String>(json['content'])!,
|
||||
num: (asT<int?>(json['num']) ?? 0).obs,
|
||||
page: asT<int>(json['page'])!,
|
||||
);
|
||||
|
||||
int id;
|
||||
int uid;
|
||||
String content;
|
||||
RxInt num;
|
||||
int page;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'uid': uid,
|
||||
'content': content,
|
||||
'num': num,
|
||||
'page': page,
|
||||
};
|
||||
}
|
||||
71
lib/models/comic/web_search_model.dart
Normal file
71
lib/models/comic/web_search_model.dart
Normal file
@@ -0,0 +1,71 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class ComicWebSearchModel {
|
||||
ComicWebSearchModel({
|
||||
required this.id,
|
||||
required this.comicName,
|
||||
required this.comicAuthor,
|
||||
required this.comicCover,
|
||||
required this.cover,
|
||||
required this.lastUpdateChapterName,
|
||||
required this.comicUrlRaw,
|
||||
required this.comicUrl,
|
||||
required this.status,
|
||||
required this.chapterUrlRaw,
|
||||
required this.chapterUrl,
|
||||
});
|
||||
|
||||
factory ComicWebSearchModel.fromJson(Map<String, dynamic> json) =>
|
||||
ComicWebSearchModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
comicName: asT<String>(json['comic_name'])!,
|
||||
comicAuthor: asT<String?>(json['comic_author']) ?? "",
|
||||
comicCover: asT<String?>(json['comic_cover']) ?? "",
|
||||
cover: asT<String?>(json['cover']) ?? "",
|
||||
lastUpdateChapterName:
|
||||
asT<String?>(json['last_update_chapter_name']) ?? "",
|
||||
comicUrlRaw: asT<String?>(json['comic_url_raw']) ?? "",
|
||||
comicUrl: asT<String?>(json['comic_url']) ?? "",
|
||||
status: asT<String?>(json['status']) ?? "",
|
||||
chapterUrlRaw: asT<String?>(json['chapter_url_raw']) ?? "",
|
||||
chapterUrl: asT<String?>(json['chapter_url']) ?? "",
|
||||
);
|
||||
|
||||
int id;
|
||||
String comicName;
|
||||
String comicAuthor;
|
||||
String comicCover;
|
||||
String cover;
|
||||
String lastUpdateChapterName;
|
||||
String comicUrlRaw;
|
||||
String comicUrl;
|
||||
String status;
|
||||
String chapterUrlRaw;
|
||||
String chapterUrl;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'comic_name': comicName,
|
||||
'comic_author': comicAuthor,
|
||||
'comic_cover': comicCover,
|
||||
'cover': cover,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'comic_url_raw': comicUrlRaw,
|
||||
'comic_url': comicUrl,
|
||||
'status': status,
|
||||
'chapter_url_raw': chapterUrlRaw,
|
||||
'chapter_url': chapterUrl,
|
||||
};
|
||||
}
|
||||
58
lib/models/comment/comment_item.dart
Normal file
58
lib/models/comment/comment_item.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
/// 动漫之家评论接口太TM混乱了
|
||||
/// 使用此类统一Model
|
||||
|
||||
class CommentItem {
|
||||
CommentItem({
|
||||
required this.id,
|
||||
required this.objId,
|
||||
required this.content,
|
||||
required this.photo,
|
||||
required this.createTime,
|
||||
required this.images,
|
||||
required this.likeAmount,
|
||||
required this.nickname,
|
||||
required this.replyAmount,
|
||||
required this.userId,
|
||||
required this.gender,
|
||||
required this.type,
|
||||
required this.originId,
|
||||
this.isEmpty = false,
|
||||
});
|
||||
|
||||
factory CommentItem.createEmpty() {
|
||||
return CommentItem(
|
||||
id: 0,
|
||||
objId: 0,
|
||||
content: "该评论不存在,可能已被删除",
|
||||
photo: "",
|
||||
createTime: 0,
|
||||
images: [],
|
||||
likeAmount: 0.obs,
|
||||
nickname: "-",
|
||||
replyAmount: 0,
|
||||
userId: 0,
|
||||
gender: 0,
|
||||
type: 0,
|
||||
originId: 0,
|
||||
isEmpty: true,
|
||||
);
|
||||
}
|
||||
|
||||
int id;
|
||||
int objId;
|
||||
String content;
|
||||
int createTime;
|
||||
Rx<int> likeAmount;
|
||||
int replyAmount;
|
||||
String nickname;
|
||||
String photo;
|
||||
List<String> images;
|
||||
int userId;
|
||||
List<CommentItem> parents = [];
|
||||
bool isEmpty;
|
||||
int gender;
|
||||
int type;
|
||||
int originId;
|
||||
}
|
||||
123
lib/models/comment/user_comment_item.dart
Normal file
123
lib/models/comment/user_comment_item.dart
Normal file
@@ -0,0 +1,123 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserCommentItem {
|
||||
UserCommentItem({
|
||||
required this.commentId,
|
||||
required this.content,
|
||||
required this.replyAmount,
|
||||
required this.likeAmount,
|
||||
this.originCommentId,
|
||||
required this.objId,
|
||||
required this.createTime,
|
||||
this.toCommentId,
|
||||
required this.objCover,
|
||||
required this.objName,
|
||||
this.pageUrl,
|
||||
this.mastercomment,
|
||||
});
|
||||
|
||||
factory UserCommentItem.fromJson(Map<String, dynamic> json) =>
|
||||
UserCommentItem(
|
||||
commentId: asT<int>(json['comment_id']) ?? 0,
|
||||
content: asT<String>(json['content']) ?? '',
|
||||
replyAmount: asT<int>(json['reply_amount']) ?? 0,
|
||||
likeAmount: asT<int>(json['like_amount']) ?? 0,
|
||||
originCommentId: asT<int?>(json['origin_comment_id']),
|
||||
objId: asT<int>(json['obj_id']) ?? 0,
|
||||
createTime: asT<int>(json['create_time']) ?? 0,
|
||||
toCommentId: asT<int?>(json['to_comment_id']),
|
||||
objCover: asT<String>(json['obj_cover']) ?? '',
|
||||
objName: asT<String>(json['obj_name']) ?? '',
|
||||
pageUrl: asT<String?>(json['page_url']),
|
||||
mastercomment: json['masterComment'] == null
|
||||
? null
|
||||
: UserMasterComment.fromJson(
|
||||
asT<Map<String, dynamic>>(json['masterComment'])!),
|
||||
);
|
||||
|
||||
int commentId;
|
||||
String content;
|
||||
int replyAmount;
|
||||
int likeAmount;
|
||||
int? originCommentId;
|
||||
int objId;
|
||||
int createTime;
|
||||
int? toCommentId;
|
||||
String objCover;
|
||||
String objName;
|
||||
String? pageUrl;
|
||||
UserMasterComment? mastercomment;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'comment_id': commentId,
|
||||
'content': content,
|
||||
'reply_amount': replyAmount,
|
||||
'like_amount': likeAmount,
|
||||
'origin_comment_id': originCommentId,
|
||||
'obj_id': objId,
|
||||
'create_time': createTime,
|
||||
'to_comment_id': toCommentId,
|
||||
'obj_cover': objCover,
|
||||
'obj_name': objName,
|
||||
'page_url': pageUrl,
|
||||
'masterComment': mastercomment,
|
||||
};
|
||||
}
|
||||
|
||||
class UserMasterComment {
|
||||
UserMasterComment({
|
||||
required this.id,
|
||||
required this.content,
|
||||
this.senderUid,
|
||||
this.likeAmount,
|
||||
required this.createTime,
|
||||
this.replyAmount,
|
||||
required this.nickname,
|
||||
});
|
||||
|
||||
factory UserMasterComment.fromJson(Map<String, dynamic> json) =>
|
||||
UserMasterComment(
|
||||
id: asT<int>(json['id'])!,
|
||||
content: asT<String>(json['content'])!,
|
||||
senderUid: asT<int?>(json['sender_uid']),
|
||||
likeAmount: asT<int?>(json['like_amount']),
|
||||
createTime: asT<int>(json['create_time'])!,
|
||||
replyAmount: asT<int?>(json['reply_amount']),
|
||||
nickname: asT<String>(json['nickname'])!,
|
||||
);
|
||||
|
||||
int id;
|
||||
String content;
|
||||
int? senderUid;
|
||||
int? likeAmount;
|
||||
int createTime;
|
||||
int? replyAmount;
|
||||
String nickname;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'content': content,
|
||||
'sender_uid': senderUid,
|
||||
'like_amount': likeAmount,
|
||||
'create_time': createTime,
|
||||
'reply_amount': replyAmount,
|
||||
'nickname': nickname,
|
||||
};
|
||||
}
|
||||
94
lib/models/db/comic_download_info.dart
Normal file
94
lib/models/db/comic_download_info.dart
Normal file
@@ -0,0 +1,94 @@
|
||||
import 'package:flutter_dmzj/models/db/download_status.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
part 'comic_download_info.g.dart';
|
||||
|
||||
@HiveType(typeId: 3)
|
||||
class ComicDownloadInfo {
|
||||
ComicDownloadInfo({
|
||||
required this.addTime,
|
||||
required this.chapterId,
|
||||
required this.chapterSort,
|
||||
required this.comicCover,
|
||||
required this.comicId,
|
||||
required this.comicName,
|
||||
required this.files,
|
||||
required this.index,
|
||||
required this.savePath,
|
||||
required this.status,
|
||||
required this.taskId,
|
||||
required this.total,
|
||||
required this.volumeName,
|
||||
required this.urls,
|
||||
required this.chapterName,
|
||||
required this.isVip,
|
||||
required this.isLongComic,
|
||||
});
|
||||
|
||||
///TaskID 任务,由漫画ID_章节ID组成
|
||||
@HiveField(0)
|
||||
String taskId;
|
||||
|
||||
///ComicID 漫画ID
|
||||
@HiveField(1)
|
||||
int comicId;
|
||||
|
||||
///ComicName 漫画名称
|
||||
@HiveField(2)
|
||||
String comicName;
|
||||
|
||||
///ComicCover 漫画封面
|
||||
@HiveField(3)
|
||||
String comicCover;
|
||||
|
||||
///ChapterID 章节ID
|
||||
@HiveField(4)
|
||||
int chapterId;
|
||||
|
||||
@HiveField(5)
|
||||
String chapterName;
|
||||
|
||||
///VoulmeName 分卷名称
|
||||
@HiveField(6)
|
||||
String volumeName;
|
||||
|
||||
///ChapterSort 排序
|
||||
@HiveField(7)
|
||||
int chapterSort;
|
||||
|
||||
///SavePath 存储路径
|
||||
@HiveField(8)
|
||||
String savePath;
|
||||
|
||||
///Files 文件列表
|
||||
@HiveField(9)
|
||||
List<String> files;
|
||||
|
||||
///Index 当前下载页数
|
||||
@HiveField(10)
|
||||
int index;
|
||||
|
||||
///Total 总计页数
|
||||
@HiveField(11)
|
||||
int total;
|
||||
|
||||
///Status 当前状态
|
||||
@HiveField(12)
|
||||
DownloadStatus status;
|
||||
|
||||
///AddTime 任务时间
|
||||
@HiveField(13)
|
||||
DateTime addTime;
|
||||
|
||||
/// 下载图片链接
|
||||
@HiveField(14)
|
||||
List<String> urls;
|
||||
|
||||
/// 是否VIP章节
|
||||
/// * 暂时没啥用,总之先加上
|
||||
@HiveField(15)
|
||||
bool isVip;
|
||||
|
||||
/// 是否为条漫
|
||||
@HiveField(16)
|
||||
bool isLongComic;
|
||||
}
|
||||
89
lib/models/db/comic_download_info.g.dart
Normal file
89
lib/models/db/comic_download_info.g.dart
Normal file
@@ -0,0 +1,89 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'comic_download_info.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class ComicDownloadInfoAdapter extends TypeAdapter<ComicDownloadInfo> {
|
||||
@override
|
||||
final int typeId = 3;
|
||||
|
||||
@override
|
||||
ComicDownloadInfo read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return ComicDownloadInfo(
|
||||
addTime: fields[13] as DateTime,
|
||||
chapterId: fields[4] as int,
|
||||
chapterSort: fields[7] as int,
|
||||
comicCover: fields[3] as String,
|
||||
comicId: fields[1] as int,
|
||||
comicName: fields[2] as String,
|
||||
files: (fields[9] as List).cast<String>(),
|
||||
index: fields[10] as int,
|
||||
savePath: fields[8] as String,
|
||||
status: fields[12] as DownloadStatus,
|
||||
taskId: fields[0] as String,
|
||||
total: fields[11] as int,
|
||||
volumeName: fields[6] as String,
|
||||
urls: (fields[14] as List).cast<String>(),
|
||||
chapterName: fields[5] as String,
|
||||
isVip: (fields[15] ?? false) as bool,
|
||||
isLongComic: (fields[16] ?? false) as bool,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, ComicDownloadInfo obj) {
|
||||
writer
|
||||
..writeByte(17)
|
||||
..writeByte(0)
|
||||
..write(obj.taskId)
|
||||
..writeByte(1)
|
||||
..write(obj.comicId)
|
||||
..writeByte(2)
|
||||
..write(obj.comicName)
|
||||
..writeByte(3)
|
||||
..write(obj.comicCover)
|
||||
..writeByte(4)
|
||||
..write(obj.chapterId)
|
||||
..writeByte(5)
|
||||
..write(obj.chapterName)
|
||||
..writeByte(6)
|
||||
..write(obj.volumeName)
|
||||
..writeByte(7)
|
||||
..write(obj.chapterSort)
|
||||
..writeByte(8)
|
||||
..write(obj.savePath)
|
||||
..writeByte(9)
|
||||
..write(obj.files)
|
||||
..writeByte(10)
|
||||
..write(obj.index)
|
||||
..writeByte(11)
|
||||
..write(obj.total)
|
||||
..writeByte(12)
|
||||
..write(obj.status)
|
||||
..writeByte(13)
|
||||
..write(obj.addTime)
|
||||
..writeByte(14)
|
||||
..write(obj.urls)
|
||||
..writeByte(15)
|
||||
..write(obj.isVip)
|
||||
..writeByte(16)
|
||||
..write(obj.isLongComic);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ComicDownloadInfoAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
36
lib/models/db/comic_history.dart
Normal file
36
lib/models/db/comic_history.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:hive/hive.dart';
|
||||
part 'comic_history.g.dart';
|
||||
|
||||
@HiveType(typeId: 1)
|
||||
class ComicHistory {
|
||||
ComicHistory({
|
||||
required this.comicId,
|
||||
required this.chapterId,
|
||||
required this.comicName,
|
||||
required this.comicCover,
|
||||
required this.chapterName,
|
||||
required this.updateTime,
|
||||
required this.page,
|
||||
});
|
||||
|
||||
@HiveField(0)
|
||||
int comicId;
|
||||
|
||||
@HiveField(1)
|
||||
int chapterId;
|
||||
|
||||
@HiveField(2)
|
||||
String comicName;
|
||||
|
||||
@HiveField(3)
|
||||
String comicCover;
|
||||
|
||||
@HiveField(4)
|
||||
String chapterName;
|
||||
|
||||
@HiveField(5)
|
||||
int page;
|
||||
|
||||
@HiveField(6)
|
||||
DateTime updateTime;
|
||||
}
|
||||
59
lib/models/db/comic_history.g.dart
Normal file
59
lib/models/db/comic_history.g.dart
Normal file
@@ -0,0 +1,59 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'comic_history.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class ComicHistoryAdapter extends TypeAdapter<ComicHistory> {
|
||||
@override
|
||||
final int typeId = 1;
|
||||
|
||||
@override
|
||||
ComicHistory read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return ComicHistory(
|
||||
comicId: fields[0] as int,
|
||||
chapterId: fields[1] as int,
|
||||
comicName: fields[2] as String,
|
||||
comicCover: fields[3] as String,
|
||||
chapterName: fields[4] as String,
|
||||
updateTime: fields[6] as DateTime,
|
||||
page: fields[5] as int,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, ComicHistory obj) {
|
||||
writer
|
||||
..writeByte(7)
|
||||
..writeByte(0)
|
||||
..write(obj.comicId)
|
||||
..writeByte(1)
|
||||
..write(obj.chapterId)
|
||||
..writeByte(2)
|
||||
..write(obj.comicName)
|
||||
..writeByte(3)
|
||||
..write(obj.comicCover)
|
||||
..writeByte(4)
|
||||
..write(obj.chapterName)
|
||||
..writeByte(5)
|
||||
..write(obj.page)
|
||||
..writeByte(6)
|
||||
..write(obj.updateTime);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is ComicHistoryAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
46
lib/models/db/download_status.dart
Normal file
46
lib/models/db/download_status.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:hive/hive.dart';
|
||||
part 'download_status.g.dart';
|
||||
|
||||
/// 下载状态
|
||||
@HiveType(typeId: 4)
|
||||
enum DownloadStatus {
|
||||
/// 等待下载中
|
||||
@HiveField(0)
|
||||
wait,
|
||||
|
||||
/// 正在读取章节信息
|
||||
@HiveField(1)
|
||||
loadding,
|
||||
|
||||
/// 下载中
|
||||
@HiveField(2)
|
||||
downloading,
|
||||
|
||||
/// 使用数据,自动暂停,当网络切换时恢复下载
|
||||
@HiveField(3)
|
||||
pauseCellular,
|
||||
|
||||
/// 暂停
|
||||
@HiveField(4)
|
||||
pause,
|
||||
|
||||
/// 已完成
|
||||
@HiveField(5)
|
||||
complete,
|
||||
|
||||
/// 读取信息时出现错误
|
||||
@HiveField(6)
|
||||
errorLoad,
|
||||
|
||||
/// 下载出错
|
||||
@HiveField(7)
|
||||
error,
|
||||
|
||||
/// 已取消
|
||||
@HiveField(8)
|
||||
cancel,
|
||||
|
||||
/// 等待网络连接
|
||||
@HiveField(9)
|
||||
waitNetwork,
|
||||
}
|
||||
86
lib/models/db/download_status.g.dart
Normal file
86
lib/models/db/download_status.g.dart
Normal file
@@ -0,0 +1,86 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'download_status.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class DownloadStatusAdapter extends TypeAdapter<DownloadStatus> {
|
||||
@override
|
||||
final int typeId = 4;
|
||||
|
||||
@override
|
||||
DownloadStatus read(BinaryReader reader) {
|
||||
switch (reader.readByte()) {
|
||||
case 0:
|
||||
return DownloadStatus.wait;
|
||||
case 1:
|
||||
return DownloadStatus.loadding;
|
||||
case 2:
|
||||
return DownloadStatus.downloading;
|
||||
case 3:
|
||||
return DownloadStatus.pauseCellular;
|
||||
case 4:
|
||||
return DownloadStatus.pause;
|
||||
case 5:
|
||||
return DownloadStatus.complete;
|
||||
case 6:
|
||||
return DownloadStatus.errorLoad;
|
||||
case 7:
|
||||
return DownloadStatus.error;
|
||||
case 8:
|
||||
return DownloadStatus.cancel;
|
||||
case 9:
|
||||
return DownloadStatus.waitNetwork;
|
||||
default:
|
||||
return DownloadStatus.wait;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, DownloadStatus obj) {
|
||||
switch (obj) {
|
||||
case DownloadStatus.wait:
|
||||
writer.writeByte(0);
|
||||
break;
|
||||
case DownloadStatus.loadding:
|
||||
writer.writeByte(1);
|
||||
break;
|
||||
case DownloadStatus.downloading:
|
||||
writer.writeByte(2);
|
||||
break;
|
||||
case DownloadStatus.pauseCellular:
|
||||
writer.writeByte(3);
|
||||
break;
|
||||
case DownloadStatus.pause:
|
||||
writer.writeByte(4);
|
||||
break;
|
||||
case DownloadStatus.complete:
|
||||
writer.writeByte(5);
|
||||
break;
|
||||
case DownloadStatus.errorLoad:
|
||||
writer.writeByte(6);
|
||||
break;
|
||||
case DownloadStatus.error:
|
||||
writer.writeByte(7);
|
||||
break;
|
||||
case DownloadStatus.cancel:
|
||||
writer.writeByte(8);
|
||||
break;
|
||||
case DownloadStatus.waitNetwork:
|
||||
writer.writeByte(9);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is DownloadStatusAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
39
lib/models/db/local_favorite.dart
Normal file
39
lib/models/db/local_favorite.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
part 'local_favorite.g.dart';
|
||||
|
||||
@HiveType(typeId: 6)
|
||||
class LocalFavorite {
|
||||
LocalFavorite({
|
||||
required this.id,
|
||||
required this.objId,
|
||||
required this.title,
|
||||
required this.cover,
|
||||
required this.type,
|
||||
required this.updateTime,
|
||||
});
|
||||
|
||||
@HiveField(0)
|
||||
String id;
|
||||
|
||||
String get hiveId => "${type}_$objId";
|
||||
|
||||
@HiveField(1)
|
||||
int objId;
|
||||
|
||||
@HiveField(2)
|
||||
String title;
|
||||
|
||||
@HiveField(3)
|
||||
String cover;
|
||||
|
||||
/// 类型,对应app_constant,漫画或小说
|
||||
@HiveField(4)
|
||||
int type;
|
||||
|
||||
@HiveField(5)
|
||||
DateTime updateTime;
|
||||
|
||||
//是否被选中
|
||||
Rx<bool> isChecked = false.obs;
|
||||
}
|
||||
56
lib/models/db/local_favorite.g.dart
Normal file
56
lib/models/db/local_favorite.g.dart
Normal file
@@ -0,0 +1,56 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'local_favorite.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class LocalFavoriteAdapter extends TypeAdapter<LocalFavorite> {
|
||||
@override
|
||||
final int typeId = 6;
|
||||
|
||||
@override
|
||||
LocalFavorite read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return LocalFavorite(
|
||||
id: fields[0] as String,
|
||||
objId: fields[1] as int,
|
||||
title: fields[2] as String,
|
||||
cover: fields[3] as String,
|
||||
type: fields[4] as int,
|
||||
updateTime: fields[5] as DateTime,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, LocalFavorite obj) {
|
||||
writer
|
||||
..writeByte(6)
|
||||
..writeByte(0)
|
||||
..write(obj.id)
|
||||
..writeByte(1)
|
||||
..write(obj.objId)
|
||||
..writeByte(2)
|
||||
..write(obj.title)
|
||||
..writeByte(3)
|
||||
..write(obj.cover)
|
||||
..writeByte(4)
|
||||
..write(obj.type)
|
||||
..writeByte(5)
|
||||
..write(obj.updateTime);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is LocalFavoriteAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
105
lib/models/db/novel_download_info.dart
Normal file
105
lib/models/db/novel_download_info.dart
Normal file
@@ -0,0 +1,105 @@
|
||||
import 'package:flutter_dmzj/models/db/download_status.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
part 'novel_download_info.g.dart';
|
||||
|
||||
@HiveType(typeId: 5)
|
||||
class NovelDownloadInfo {
|
||||
NovelDownloadInfo({
|
||||
required this.addTime,
|
||||
required this.chapterId,
|
||||
required this.chapterSort,
|
||||
required this.novelCover,
|
||||
required this.novelId,
|
||||
required this.novelName,
|
||||
required this.fileName,
|
||||
required this.imageFiles,
|
||||
required this.savePath,
|
||||
required this.status,
|
||||
required this.taskId,
|
||||
required this.isImage,
|
||||
required this.volumeName,
|
||||
required this.progress,
|
||||
required this.chapterName,
|
||||
required this.volumeID,
|
||||
required this.isVip,
|
||||
required this.volumeOrder,
|
||||
required this.imageUrls,
|
||||
});
|
||||
|
||||
///TaskID 任务,由小说ID_章节ID组成
|
||||
@HiveField(0)
|
||||
String taskId;
|
||||
|
||||
///NovelID 小说ID
|
||||
@HiveField(1)
|
||||
int novelId;
|
||||
|
||||
///NovelName 小说名称
|
||||
@HiveField(2)
|
||||
String novelName;
|
||||
|
||||
///NovelCover 小说封面
|
||||
@HiveField(3)
|
||||
String novelCover;
|
||||
|
||||
///ChapterID 章节ID
|
||||
@HiveField(4)
|
||||
int chapterId;
|
||||
|
||||
///chapterName 章节名称
|
||||
@HiveField(5)
|
||||
String chapterName;
|
||||
|
||||
///VoulmeID 分卷ID
|
||||
@HiveField(6)
|
||||
int volumeID;
|
||||
|
||||
///VoulmeName 分卷名称
|
||||
@HiveField(7)
|
||||
String volumeName;
|
||||
|
||||
///volumeOrder 分卷排序
|
||||
@HiveField(8)
|
||||
int volumeOrder;
|
||||
|
||||
///ChapterSort 排序
|
||||
@HiveField(9)
|
||||
int chapterSort;
|
||||
|
||||
///SavePath 存储路径
|
||||
@HiveField(10)
|
||||
String savePath;
|
||||
|
||||
///Files 文件列表
|
||||
@HiveField(11)
|
||||
String fileName;
|
||||
|
||||
///isImage 是否为插图
|
||||
@HiveField(12)
|
||||
bool isImage;
|
||||
|
||||
/// 图片保存路径
|
||||
@HiveField(13)
|
||||
List<String> imageFiles;
|
||||
|
||||
///下载进度 0-100
|
||||
@HiveField(14)
|
||||
int progress;
|
||||
|
||||
///Status 当前状态
|
||||
@HiveField(15)
|
||||
DownloadStatus status;
|
||||
|
||||
///AddTime 任务时间
|
||||
@HiveField(16)
|
||||
DateTime addTime;
|
||||
|
||||
/// 是否VIP章节
|
||||
/// * 暂时没啥用,总之先加上
|
||||
@HiveField(17)
|
||||
bool isVip;
|
||||
|
||||
/// 下载图片链接
|
||||
@HiveField(18)
|
||||
List<String> imageUrls;
|
||||
}
|
||||
95
lib/models/db/novel_download_info.g.dart
Normal file
95
lib/models/db/novel_download_info.g.dart
Normal file
@@ -0,0 +1,95 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'novel_download_info.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class NovelDownloadInfoAdapter extends TypeAdapter<NovelDownloadInfo> {
|
||||
@override
|
||||
final int typeId = 5;
|
||||
|
||||
@override
|
||||
NovelDownloadInfo read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return NovelDownloadInfo(
|
||||
addTime: fields[16] as DateTime,
|
||||
chapterId: fields[4] as int,
|
||||
chapterSort: fields[9] as int,
|
||||
novelCover: fields[3] as String,
|
||||
novelId: fields[1] as int,
|
||||
novelName: fields[2] as String,
|
||||
fileName: fields[11] as String,
|
||||
imageFiles: (fields[13] as List).cast<String>(),
|
||||
savePath: fields[10] as String,
|
||||
status: fields[15] as DownloadStatus,
|
||||
taskId: fields[0] as String,
|
||||
isImage: fields[12] as bool,
|
||||
volumeName: fields[7] as String,
|
||||
progress: fields[14] as int,
|
||||
chapterName: fields[5] as String,
|
||||
volumeID: fields[6] as int,
|
||||
isVip: fields[17] as bool,
|
||||
volumeOrder: fields[8] as int,
|
||||
imageUrls: (fields[18] as List).cast<String>(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, NovelDownloadInfo obj) {
|
||||
writer
|
||||
..writeByte(19)
|
||||
..writeByte(0)
|
||||
..write(obj.taskId)
|
||||
..writeByte(1)
|
||||
..write(obj.novelId)
|
||||
..writeByte(2)
|
||||
..write(obj.novelName)
|
||||
..writeByte(3)
|
||||
..write(obj.novelCover)
|
||||
..writeByte(4)
|
||||
..write(obj.chapterId)
|
||||
..writeByte(5)
|
||||
..write(obj.chapterName)
|
||||
..writeByte(6)
|
||||
..write(obj.volumeID)
|
||||
..writeByte(7)
|
||||
..write(obj.volumeName)
|
||||
..writeByte(8)
|
||||
..write(obj.volumeOrder)
|
||||
..writeByte(9)
|
||||
..write(obj.chapterSort)
|
||||
..writeByte(10)
|
||||
..write(obj.savePath)
|
||||
..writeByte(11)
|
||||
..write(obj.fileName)
|
||||
..writeByte(12)
|
||||
..write(obj.isImage)
|
||||
..writeByte(13)
|
||||
..write(obj.imageFiles)
|
||||
..writeByte(14)
|
||||
..write(obj.progress)
|
||||
..writeByte(15)
|
||||
..write(obj.status)
|
||||
..writeByte(16)
|
||||
..write(obj.addTime)
|
||||
..writeByte(17)
|
||||
..write(obj.isVip)
|
||||
..writeByte(18)
|
||||
..write(obj.imageUrls);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is NovelDownloadInfoAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
48
lib/models/db/novel_history.dart
Normal file
48
lib/models/db/novel_history.dart
Normal file
@@ -0,0 +1,48 @@
|
||||
import 'package:hive/hive.dart';
|
||||
part 'novel_history.g.dart';
|
||||
|
||||
@HiveType(typeId: 2)
|
||||
class NovelHistory {
|
||||
NovelHistory({
|
||||
required this.novelId,
|
||||
required this.chapterId,
|
||||
required this.novelName,
|
||||
required this.novelCover,
|
||||
required this.chapterName,
|
||||
required this.updateTime,
|
||||
required this.index,
|
||||
required this.total,
|
||||
required this.volumeId,
|
||||
required this.volumeName,
|
||||
});
|
||||
|
||||
@HiveField(0)
|
||||
int novelId;
|
||||
|
||||
@HiveField(1)
|
||||
int chapterId;
|
||||
|
||||
@HiveField(2)
|
||||
String novelName;
|
||||
|
||||
@HiveField(3)
|
||||
String novelCover;
|
||||
|
||||
@HiveField(4)
|
||||
String chapterName;
|
||||
|
||||
@HiveField(5)
|
||||
int index;
|
||||
|
||||
@HiveField(6)
|
||||
int total;
|
||||
|
||||
@HiveField(7)
|
||||
int volumeId;
|
||||
|
||||
@HiveField(8)
|
||||
String volumeName;
|
||||
|
||||
@HiveField(9)
|
||||
DateTime updateTime;
|
||||
}
|
||||
68
lib/models/db/novel_history.g.dart
Normal file
68
lib/models/db/novel_history.g.dart
Normal file
@@ -0,0 +1,68 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'novel_history.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class NovelHistoryAdapter extends TypeAdapter<NovelHistory> {
|
||||
@override
|
||||
final int typeId = 2;
|
||||
|
||||
@override
|
||||
NovelHistory read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return NovelHistory(
|
||||
novelId: fields[0] as int,
|
||||
chapterId: fields[1] as int,
|
||||
novelName: fields[2] as String,
|
||||
novelCover: fields[3] as String,
|
||||
chapterName: fields[4] as String,
|
||||
updateTime: fields[9] as DateTime,
|
||||
index: fields[5] as int,
|
||||
total: fields[6] as int,
|
||||
volumeId: fields[7] as int,
|
||||
volumeName: fields[8] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, NovelHistory obj) {
|
||||
writer
|
||||
..writeByte(10)
|
||||
..writeByte(0)
|
||||
..write(obj.novelId)
|
||||
..writeByte(1)
|
||||
..write(obj.chapterId)
|
||||
..writeByte(2)
|
||||
..write(obj.novelName)
|
||||
..writeByte(3)
|
||||
..write(obj.novelCover)
|
||||
..writeByte(4)
|
||||
..write(obj.chapterName)
|
||||
..writeByte(5)
|
||||
..write(obj.index)
|
||||
..writeByte(6)
|
||||
..write(obj.total)
|
||||
..writeByte(7)
|
||||
..write(obj.volumeId)
|
||||
..writeByte(8)
|
||||
..write(obj.volumeName)
|
||||
..writeByte(9)
|
||||
..write(obj.updateTime);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is NovelHistoryAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
46
lib/models/news/news_banner_model.dart
Normal file
46
lib/models/news/news_banner_model.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NewsBannerModel {
|
||||
NewsBannerModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.picUrl,
|
||||
this.objectId,
|
||||
this.objectUrl,
|
||||
});
|
||||
|
||||
factory NewsBannerModel.fromJson(Map<String, dynamic> json) =>
|
||||
NewsBannerModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
picUrl: asT<String>(json['pic_url'])!,
|
||||
objectId: asT<int?>(json['object_id']),
|
||||
objectUrl: asT<String?>(json['object_url']),
|
||||
);
|
||||
|
||||
int id;
|
||||
String title;
|
||||
String picUrl;
|
||||
int? objectId;
|
||||
String? objectUrl;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'pic_url': picUrl,
|
||||
'object_id': objectId,
|
||||
'object_url': objectUrl,
|
||||
};
|
||||
}
|
||||
74
lib/models/news/news_list_item_model.dart
Normal file
74
lib/models/news/news_list_item_model.dart
Normal file
@@ -0,0 +1,74 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NewsListItemModel {
|
||||
NewsListItemModel({
|
||||
required this.articleId,
|
||||
required this.title,
|
||||
this.createTime,
|
||||
this.intro,
|
||||
this.authorId,
|
||||
this.status,
|
||||
this.rowPicUrl,
|
||||
this.colPicUrl,
|
||||
this.pageUrl,
|
||||
this.authorUid,
|
||||
this.cover,
|
||||
this.nickname,
|
||||
});
|
||||
|
||||
factory NewsListItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
NewsListItemModel(
|
||||
articleId: asT<int>(json['article_id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
createTime: asT<int?>(json['create_time']),
|
||||
intro: asT<String?>(json['intro']),
|
||||
authorId: asT<int?>(json['author_id']),
|
||||
status: asT<int?>(json['status']),
|
||||
rowPicUrl: asT<String?>(json['row_pic_url']),
|
||||
colPicUrl: asT<String?>(json['col_pic_url']),
|
||||
pageUrl: asT<String?>(json['page_url']),
|
||||
authorUid: asT<int?>(json['author_uid']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
nickname: asT<String?>(json['nickname']),
|
||||
);
|
||||
|
||||
int articleId;
|
||||
String title;
|
||||
int? createTime;
|
||||
String? intro;
|
||||
int? authorId;
|
||||
int? status;
|
||||
String? rowPicUrl;
|
||||
String? colPicUrl;
|
||||
String? pageUrl;
|
||||
int? authorUid;
|
||||
String? cover;
|
||||
String? nickname;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'article_id': articleId,
|
||||
'title': title,
|
||||
'create_time': createTime,
|
||||
'intro': intro,
|
||||
'author_id': authorId,
|
||||
'status': status,
|
||||
'row_pic_url': rowPicUrl,
|
||||
'col_pic_url': colPicUrl,
|
||||
'page_url': pageUrl,
|
||||
'author_uid': authorUid,
|
||||
'cover': cover,
|
||||
'nickname': nickname,
|
||||
};
|
||||
}
|
||||
42
lib/models/news/news_stat_model.dart
Normal file
42
lib/models/news/news_stat_model.dart
Normal file
@@ -0,0 +1,42 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NewsStatModel {
|
||||
NewsStatModel({
|
||||
required this.commentAmount,
|
||||
required this.moodAmount,
|
||||
required this.rowPicUrl,
|
||||
required this.title,
|
||||
});
|
||||
|
||||
factory NewsStatModel.fromJson(Map<String, dynamic> json) => NewsStatModel(
|
||||
/// DMZJ后端是真混乱... commentAmount是string,mood_amount是int
|
||||
commentAmount: int.tryParse(json['comment_amount'].toString()) ?? 0,
|
||||
moodAmount: int.tryParse(json['mood_amount'].toString()) ?? 0,
|
||||
rowPicUrl: asT<String>(json['row_pic_url'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
);
|
||||
|
||||
int commentAmount;
|
||||
int moodAmount;
|
||||
String rowPicUrl;
|
||||
String title;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'comment_amount': commentAmount,
|
||||
'mood_amount': moodAmount,
|
||||
'row_pic_url': rowPicUrl,
|
||||
'title': title,
|
||||
};
|
||||
}
|
||||
33
lib/models/news/news_tag_model.dart
Normal file
33
lib/models/news/news_tag_model.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NewsTagModel {
|
||||
NewsTagModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
factory NewsTagModel.fromJson(Map<String, dynamic> json) => NewsTagModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
name: asT<String>(json['name'])!,
|
||||
);
|
||||
|
||||
int id;
|
||||
String name;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'name': name,
|
||||
};
|
||||
}
|
||||
73
lib/models/novel/category_filter_model.dart
Normal file
73
lib/models/novel/category_filter_model.dart
Normal file
@@ -0,0 +1,73 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelCategoryFilterModel {
|
||||
NovelCategoryFilterModel({
|
||||
required this.title,
|
||||
required this.items,
|
||||
});
|
||||
|
||||
factory NovelCategoryFilterModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<NovelCategoryFilterItemModel>? items =
|
||||
json['items'] is List ? <NovelCategoryFilterItemModel>[] : null;
|
||||
if (items != null) {
|
||||
for (final dynamic item in json['items']!) {
|
||||
if (item != null) {
|
||||
items.add(NovelCategoryFilterItemModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return NovelCategoryFilterModel(
|
||||
title: asT<String>(json['title'])!,
|
||||
items: items!,
|
||||
);
|
||||
}
|
||||
|
||||
String title;
|
||||
List<NovelCategoryFilterItemModel> items;
|
||||
var selectId = 0.obs;
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'title': title,
|
||||
'items': items,
|
||||
};
|
||||
}
|
||||
|
||||
class NovelCategoryFilterItemModel {
|
||||
NovelCategoryFilterItemModel({
|
||||
required this.tagId,
|
||||
required this.tagName,
|
||||
});
|
||||
|
||||
factory NovelCategoryFilterItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelCategoryFilterItemModel(
|
||||
tagId: asT<int>(json['tagId'])!,
|
||||
tagName: asT<String>(json['title'])!,
|
||||
);
|
||||
|
||||
int tagId;
|
||||
String tagName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'tag_id': tagId,
|
||||
'tag_name': tagName,
|
||||
};
|
||||
}
|
||||
38
lib/models/novel/category_model.dart
Normal file
38
lib/models/novel/category_model.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelCategoryModel {
|
||||
NovelCategoryModel({
|
||||
required this.tagId,
|
||||
required this.title,
|
||||
required this.cover,
|
||||
});
|
||||
|
||||
factory NovelCategoryModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelCategoryModel(
|
||||
tagId: asT<int>(json['tagId'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
cover: asT<String>(json['cover'])!,
|
||||
);
|
||||
|
||||
int tagId;
|
||||
String title;
|
||||
String cover;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'tag_id': tagId,
|
||||
'title': title,
|
||||
'cover': cover,
|
||||
};
|
||||
}
|
||||
62
lib/models/novel/category_novel_model.dart
Normal file
62
lib/models/novel/category_novel_model.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelCategoryNovelModel {
|
||||
NovelCategoryNovelModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
this.authors,
|
||||
this.cover,
|
||||
this.hotHits,
|
||||
this.lastName,
|
||||
this.status,
|
||||
this.types,
|
||||
this.subNums,
|
||||
});
|
||||
|
||||
factory NovelCategoryNovelModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelCategoryNovelModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
authors: asT<String?>(json['authors']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
hotHits: asT<int?>(json['hot_hits']),
|
||||
lastName: asT<String?>(json['last_name']),
|
||||
status: asT<String?>(json['status']),
|
||||
types: asT<String?>(json['types']),
|
||||
subNums: asT<int?>(json['sub_nums']),
|
||||
);
|
||||
|
||||
int id;
|
||||
String title;
|
||||
String? authors;
|
||||
String? cover;
|
||||
int? hotHits;
|
||||
String? lastName;
|
||||
String? status;
|
||||
String? types;
|
||||
int? subNums;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'authors': authors,
|
||||
'cover': cover,
|
||||
'hot_hits': hotHits,
|
||||
'last_name': lastName,
|
||||
'status': status,
|
||||
'types': types,
|
||||
'sub_nums': subNums,
|
||||
};
|
||||
}
|
||||
239
lib/models/novel/detail_model.dart
Normal file
239
lib/models/novel/detail_model.dart
Normal file
@@ -0,0 +1,239 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelDetailModel {
|
||||
NovelDetailModel({
|
||||
required this.data,
|
||||
required this.readingRecord,
|
||||
});
|
||||
|
||||
factory NovelDetailModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelDetailModel(
|
||||
data: NovelDetailDataModel.fromJson(
|
||||
asT<Map<String, dynamic>>(json['data'])!),
|
||||
readingRecord: NovelDetailReadingRecordModel.fromJson(
|
||||
asT<Map<String, dynamic>>(json['readingRecord'])!),
|
||||
);
|
||||
|
||||
NovelDetailDataModel data;
|
||||
NovelDetailReadingRecordModel readingRecord;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'data': data,
|
||||
'readingRecord': readingRecord,
|
||||
};
|
||||
}
|
||||
|
||||
class NovelDetailDataModel {
|
||||
NovelDetailDataModel({
|
||||
required this.novelId,
|
||||
required this.name,
|
||||
required this.zone,
|
||||
required this.status,
|
||||
required this.lastUpdateVolumeName,
|
||||
required this.lastUpdateChapterName,
|
||||
required this.lastUpdateVolumeId,
|
||||
required this.lastUpdateChapterId,
|
||||
required this.lastUpdateTime,
|
||||
required this.cover,
|
||||
required this.hotHits,
|
||||
required this.introduction,
|
||||
required this.types,
|
||||
required this.authors,
|
||||
required this.firstLetter,
|
||||
required this.volume,
|
||||
});
|
||||
|
||||
factory NovelDetailDataModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<String>? types = json['types'] is List ? <String>[] : null;
|
||||
if (types != null) {
|
||||
for (final dynamic item in json['types']!) {
|
||||
if (item != null) {
|
||||
types.add(asT<String>(item)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<Volume>? volume = json['volume'] is List ? <Volume>[] : null;
|
||||
if (volume != null) {
|
||||
for (final dynamic item in json['volume']!) {
|
||||
if (item != null) {
|
||||
volume.add(Volume.fromJson(asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return NovelDetailDataModel(
|
||||
novelId: asT<int>(json['novel_id'])!,
|
||||
name: asT<String>(json['name'])!,
|
||||
zone: asT<String>(json['zone'])!,
|
||||
status: asT<String>(json['status'])!,
|
||||
lastUpdateVolumeName: asT<String>(json['last_update_volume_name'])!,
|
||||
lastUpdateChapterName: asT<String>(json['last_update_chapter_name'])!,
|
||||
lastUpdateVolumeId: asT<int>(json['last_update_volume_id'])!,
|
||||
lastUpdateChapterId: asT<int>(json['last_update_chapter_id'])!,
|
||||
lastUpdateTime: asT<int>(json['last_update_time'])!,
|
||||
cover: asT<String>(json['cover'])!,
|
||||
hotHits: asT<int?>(json['hot_hits']) ?? 0,
|
||||
introduction: asT<String>(json['introduction'])!,
|
||||
types: types!,
|
||||
authors: asT<String>(json['authors'])!,
|
||||
firstLetter: asT<String>(json['first_letter'])!,
|
||||
volume: volume!,
|
||||
);
|
||||
}
|
||||
|
||||
int novelId;
|
||||
String name;
|
||||
String zone;
|
||||
String status;
|
||||
String lastUpdateVolumeName;
|
||||
String lastUpdateChapterName;
|
||||
int lastUpdateVolumeId;
|
||||
int lastUpdateChapterId;
|
||||
int lastUpdateTime;
|
||||
String cover;
|
||||
int hotHits;
|
||||
String introduction;
|
||||
List<String> types;
|
||||
String authors;
|
||||
String firstLetter;
|
||||
List<Volume> volume;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'novel_id': novelId,
|
||||
'name': name,
|
||||
'zone': zone,
|
||||
'status': status,
|
||||
'last_update_volume_name': lastUpdateVolumeName,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'last_update_volume_id': lastUpdateVolumeId,
|
||||
'last_update_chapter_id': lastUpdateChapterId,
|
||||
'last_update_time': lastUpdateTime,
|
||||
'cover': cover,
|
||||
'hot_hits': hotHits,
|
||||
'introduction': introduction,
|
||||
'types': types,
|
||||
'authors': authors,
|
||||
'first_letter': firstLetter,
|
||||
'volume': volume,
|
||||
};
|
||||
}
|
||||
|
||||
class Volume {
|
||||
Volume({
|
||||
required this.volumeId,
|
||||
required this.lnovelId,
|
||||
required this.volumeName,
|
||||
required this.volumeOrder,
|
||||
required this.addtime,
|
||||
required this.sumChapters,
|
||||
});
|
||||
|
||||
factory Volume.fromJson(Map<String, dynamic> json) => Volume(
|
||||
volumeId: asT<int>(json['volume_id'])!,
|
||||
lnovelId: asT<int>(json['lnovel_id'])!,
|
||||
volumeName: asT<String>(json['volume_name'])!,
|
||||
volumeOrder: asT<int>(json['volume_order'])!,
|
||||
addtime: asT<int>(json['addtime'])!,
|
||||
sumChapters: asT<int>(json['sum_chapters'])!,
|
||||
);
|
||||
|
||||
int volumeId;
|
||||
int lnovelId;
|
||||
String volumeName;
|
||||
int volumeOrder;
|
||||
int addtime;
|
||||
int sumChapters;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'volume_id': volumeId,
|
||||
'lnovel_id': lnovelId,
|
||||
'volume_name': volumeName,
|
||||
'volume_order': volumeOrder,
|
||||
'addtime': addtime,
|
||||
'sum_chapters': sumChapters,
|
||||
};
|
||||
}
|
||||
|
||||
class NovelDetailReadingRecordModel {
|
||||
NovelDetailReadingRecordModel({
|
||||
required this.typeName,
|
||||
required this.uid,
|
||||
required this.source,
|
||||
required this.bizId,
|
||||
required this.chapterId,
|
||||
required this.viewingTime,
|
||||
required this.record,
|
||||
required this.volumeId,
|
||||
required this.totalNum,
|
||||
required this.chapterName,
|
||||
required this.volumeName,
|
||||
});
|
||||
|
||||
factory NovelDetailReadingRecordModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelDetailReadingRecordModel(
|
||||
typeName: asT<String>(json['type_name'])!,
|
||||
uid: asT<int>(json['uid'])!,
|
||||
source: asT<int>(json['source'])!,
|
||||
bizId: asT<int>(json['biz_id'])!,
|
||||
chapterId: asT<int>(json['chapter_id'])!,
|
||||
viewingTime: asT<int>(json['viewing_time'])!,
|
||||
record: asT<int>(json['record'])!,
|
||||
volumeId: asT<int>(json['volume_id'])!,
|
||||
totalNum: asT<int>(json['total_num'])!,
|
||||
chapterName: asT<String>(json['chapter_name'])!,
|
||||
volumeName: asT<String>(json['volume_name'])!,
|
||||
);
|
||||
|
||||
String typeName;
|
||||
int uid;
|
||||
int source;
|
||||
int bizId;
|
||||
int chapterId;
|
||||
int viewingTime;
|
||||
int record;
|
||||
int volumeId;
|
||||
int totalNum;
|
||||
String chapterName;
|
||||
String volumeName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'type_name': typeName,
|
||||
'uid': uid,
|
||||
'source': source,
|
||||
'biz_id': bizId,
|
||||
'chapter_id': chapterId,
|
||||
'viewing_time': viewingTime,
|
||||
'record': record,
|
||||
'volume_id': volumeId,
|
||||
'total_num': totalNum,
|
||||
'chapter_name': chapterName,
|
||||
'volume_name': volumeName,
|
||||
};
|
||||
}
|
||||
62
lib/models/novel/latest_model.dart
Normal file
62
lib/models/novel/latest_model.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelLatestModel {
|
||||
NovelLatestModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
this.authors,
|
||||
this.cover,
|
||||
this.hotHits,
|
||||
this.lastName,
|
||||
this.status,
|
||||
this.types,
|
||||
this.subNums,
|
||||
});
|
||||
|
||||
factory NovelLatestModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelLatestModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
authors: asT<String?>(json['authors']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
hotHits: asT<int?>(json['hot_hits']),
|
||||
lastName: asT<String?>(json['last_name']),
|
||||
status: asT<String?>(json['status']),
|
||||
types: asT<String?>(json['types']),
|
||||
subNums: asT<int?>(json['sub_nums']),
|
||||
);
|
||||
|
||||
int id;
|
||||
String title;
|
||||
String? authors;
|
||||
String? cover;
|
||||
int? hotHits;
|
||||
String? lastName;
|
||||
String? status;
|
||||
String? types;
|
||||
int? subNums;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'authors': authors,
|
||||
'cover': cover,
|
||||
'hot_hits': hotHits,
|
||||
'last_name': lastName,
|
||||
'status': status,
|
||||
'types': types,
|
||||
'sub_nums': subNums,
|
||||
};
|
||||
}
|
||||
193
lib/models/novel/novel_detail_model.dart
Normal file
193
lib/models/novel/novel_detail_model.dart
Normal file
@@ -0,0 +1,193 @@
|
||||
import 'package:flutter_dmzj/models/novel/detail_model.dart';
|
||||
import 'package:flutter_dmzj/models/novel/volume_detail_model.dart';
|
||||
import 'package:flutter_dmzj/models/proto/novel.pb.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelDetailInfo {
|
||||
NovelDetailInfo({
|
||||
required this.novelId,
|
||||
required this.name,
|
||||
required this.zone,
|
||||
required this.status,
|
||||
required this.lastUpdateVolumeName,
|
||||
required this.lastUpdateChapterName,
|
||||
required this.lastUpdateVolumeId,
|
||||
required this.lastUpdateChapterId,
|
||||
required this.lastUpdateTime,
|
||||
required this.cover,
|
||||
required this.hotHits,
|
||||
required this.introduction,
|
||||
required this.types,
|
||||
required this.authors,
|
||||
required this.firstLetter,
|
||||
required this.subscribeNum,
|
||||
});
|
||||
|
||||
factory NovelDetailInfo.empty() => NovelDetailInfo(
|
||||
novelId: 0,
|
||||
name: "",
|
||||
zone: "",
|
||||
status: "",
|
||||
lastUpdateVolumeName: "",
|
||||
lastUpdateChapterName: "",
|
||||
lastUpdateVolumeId: 0,
|
||||
lastUpdateChapterId: 0,
|
||||
lastUpdateTime: 0,
|
||||
cover: "",
|
||||
hotHits: 0,
|
||||
introduction: "",
|
||||
types: [],
|
||||
authors: "",
|
||||
firstLetter: "",
|
||||
subscribeNum: 0,
|
||||
);
|
||||
factory NovelDetailInfo.fromJson(NovelDetailDataModel item) =>
|
||||
NovelDetailInfo(
|
||||
novelId: item.novelId.toInt(),
|
||||
name: item.name,
|
||||
zone: item.zone,
|
||||
status: item.status,
|
||||
lastUpdateVolumeName: item.lastUpdateVolumeName,
|
||||
lastUpdateChapterName: item.lastUpdateChapterName,
|
||||
lastUpdateVolumeId: item.lastUpdateVolumeId.toInt(),
|
||||
lastUpdateChapterId: item.lastUpdateChapterId.toInt(),
|
||||
lastUpdateTime: item.lastUpdateTime.toInt(),
|
||||
cover: item.cover,
|
||||
hotHits: item.hotHits.toInt(),
|
||||
introduction: item.introduction,
|
||||
types: item.types,
|
||||
authors: item.authors,
|
||||
firstLetter: item.firstLetter,
|
||||
subscribeNum: 0,
|
||||
);
|
||||
|
||||
factory NovelDetailInfo.fromV4(NovelDetailProto item) => NovelDetailInfo(
|
||||
novelId: item.novelId.toInt(),
|
||||
name: item.name,
|
||||
zone: item.zone,
|
||||
status: item.status,
|
||||
lastUpdateVolumeName: item.lastUpdateVolumeName,
|
||||
lastUpdateChapterName: item.lastUpdateChapterName,
|
||||
lastUpdateVolumeId: item.lastUpdateVolumeId.toInt(),
|
||||
lastUpdateChapterId: item.lastUpdateChapterId.toInt(),
|
||||
lastUpdateTime: item.lastUpdateTime.toInt(),
|
||||
cover: item.cover,
|
||||
hotHits: item.hotHits.toInt(),
|
||||
introduction: item.introduction,
|
||||
types: item.types,
|
||||
authors: item.authors,
|
||||
firstLetter: item.firstLetter,
|
||||
subscribeNum: item.subscribeNum.toInt(),
|
||||
);
|
||||
|
||||
int novelId;
|
||||
String name;
|
||||
String zone;
|
||||
String status;
|
||||
String lastUpdateVolumeName;
|
||||
String lastUpdateChapterName;
|
||||
int lastUpdateVolumeId;
|
||||
int lastUpdateChapterId;
|
||||
int lastUpdateTime;
|
||||
String cover;
|
||||
int hotHits;
|
||||
String introduction;
|
||||
List<String> types;
|
||||
String authors;
|
||||
String firstLetter;
|
||||
int subscribeNum;
|
||||
RxList<NovelDetailVolume> volume = RxList<NovelDetailVolume>();
|
||||
}
|
||||
|
||||
class NovelDetailVolume {
|
||||
NovelDetailVolume({
|
||||
required this.volumeId,
|
||||
required this.volumeName,
|
||||
required this.volumeOrder,
|
||||
required this.chapters,
|
||||
});
|
||||
factory NovelDetailVolume.fromJson(NovelVolumeDetailModel item) =>
|
||||
NovelDetailVolume(
|
||||
volumeId: item.volumeId.toInt(),
|
||||
volumeName: item.volumeName,
|
||||
volumeOrder: item.volumeOrder,
|
||||
chapters: item.chapters
|
||||
.map(
|
||||
(e) => NovelDetailChapter.fromJson(
|
||||
e,
|
||||
item.volumeId.toInt(),
|
||||
item.volumeName,
|
||||
item.volumeOrder,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
|
||||
factory NovelDetailVolume.fromV4(NovelVolumeDetailProto item) =>
|
||||
NovelDetailVolume(
|
||||
volumeId: item.volumeId.toInt(),
|
||||
volumeName: item.volumeName,
|
||||
volumeOrder: item.volumeOrder,
|
||||
chapters: item.chapters
|
||||
.map(
|
||||
(e) => NovelDetailChapter.fromV4(
|
||||
e,
|
||||
item.volumeId.toInt(),
|
||||
item.volumeName,
|
||||
item.volumeOrder,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
|
||||
int volumeId;
|
||||
String volumeName;
|
||||
int volumeOrder;
|
||||
List<NovelDetailChapter> chapters;
|
||||
}
|
||||
|
||||
class NovelDetailChapter {
|
||||
NovelDetailChapter({
|
||||
required this.chapterId,
|
||||
required this.chapterName,
|
||||
required this.chapterOrder,
|
||||
required this.volumeId,
|
||||
required this.volumeName,
|
||||
required this.volumeOrder,
|
||||
});
|
||||
factory NovelDetailChapter.fromJson(NovelVolumeDetailChapterModel item,
|
||||
int volumeId, String volumeName, int volumeOrder) =>
|
||||
NovelDetailChapter(
|
||||
chapterId: item.chapterId.toInt(),
|
||||
chapterName: item.chapterName,
|
||||
chapterOrder: item.chapterOrder,
|
||||
volumeId: volumeId,
|
||||
volumeName: volumeName,
|
||||
volumeOrder: volumeOrder,
|
||||
);
|
||||
|
||||
factory NovelDetailChapter.fromV4(NovelChapterDetailProto item, int volumeId,
|
||||
String volumeName, int volumeOrder) =>
|
||||
NovelDetailChapter(
|
||||
chapterId: item.chapterId.toInt(),
|
||||
chapterName: item.chapterName,
|
||||
chapterOrder: item.chapterOrder,
|
||||
volumeId: volumeId,
|
||||
volumeName: volumeName,
|
||||
volumeOrder: volumeOrder,
|
||||
);
|
||||
|
||||
int chapterId;
|
||||
String chapterName;
|
||||
int chapterOrder;
|
||||
int volumeId;
|
||||
int volumeOrder;
|
||||
String volumeName;
|
||||
}
|
||||
71
lib/models/novel/rank_model.dart
Normal file
71
lib/models/novel/rank_model.dart
Normal file
@@ -0,0 +1,71 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelRankModel {
|
||||
NovelRankModel({
|
||||
required this.id,
|
||||
required this.lastUpdateTime,
|
||||
required this.name,
|
||||
required this.types,
|
||||
required this.cover,
|
||||
required this.authors,
|
||||
required this.lastUpdateChapterName,
|
||||
required this.top,
|
||||
required this.subscribeAmount,
|
||||
});
|
||||
|
||||
factory NovelRankModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<String>? types = json['types'] is List ? <String>[] : null;
|
||||
if (types != null) {
|
||||
for (final dynamic item in json['types']!) {
|
||||
if (item != null) {
|
||||
types.add(asT<String>(item)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NovelRankModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
lastUpdateTime: asT<int>(json['last_update_time'])!,
|
||||
name: asT<String>(json['name'])!,
|
||||
types: types!,
|
||||
cover: asT<String>(json['cover'])!,
|
||||
authors: asT<String>(json['authors'])!,
|
||||
lastUpdateChapterName: asT<String>(json['last_update_chapter_name'])!,
|
||||
top: asT<int>(json['top'])!,
|
||||
subscribeAmount: asT<int>(json['subscribe_amount'])!,
|
||||
);
|
||||
}
|
||||
|
||||
int id;
|
||||
int lastUpdateTime;
|
||||
String name;
|
||||
List<String> types;
|
||||
String cover;
|
||||
String authors;
|
||||
String lastUpdateChapterName;
|
||||
int top;
|
||||
int subscribeAmount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'last_update_time': lastUpdateTime,
|
||||
'name': name,
|
||||
'types': types,
|
||||
'cover': cover,
|
||||
'authors': authors,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'top': top,
|
||||
'subscribe_amount': subscribeAmount,
|
||||
};
|
||||
}
|
||||
101
lib/models/novel/recommend_model.dart
Normal file
101
lib/models/novel/recommend_model.dart
Normal file
@@ -0,0 +1,101 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelRecommendModel {
|
||||
NovelRecommendModel({
|
||||
required this.categoryId,
|
||||
required this.title,
|
||||
required this.sort,
|
||||
required this.data,
|
||||
});
|
||||
|
||||
factory NovelRecommendModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<NovelRecommendItemModel>? data =
|
||||
json['data'] is List ? <NovelRecommendItemModel>[] : null;
|
||||
if (data != null) {
|
||||
for (final dynamic item in json['data']!) {
|
||||
if (item != null) {
|
||||
data.add(NovelRecommendItemModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return NovelRecommendModel(
|
||||
categoryId: asT<int>(json['category_id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
sort: asT<int>(json['sort'])!,
|
||||
data: data!,
|
||||
);
|
||||
}
|
||||
|
||||
int categoryId;
|
||||
String title;
|
||||
int sort;
|
||||
List<NovelRecommendItemModel> data;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'category_id': categoryId,
|
||||
'title': title,
|
||||
'sort': sort,
|
||||
'data': data,
|
||||
};
|
||||
}
|
||||
|
||||
class NovelRecommendItemModel {
|
||||
NovelRecommendItemModel({
|
||||
required this.cover,
|
||||
required this.title,
|
||||
this.subTitle,
|
||||
this.type,
|
||||
this.url,
|
||||
required this.objId,
|
||||
this.status,
|
||||
this.id,
|
||||
});
|
||||
|
||||
factory NovelRecommendItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelRecommendItemModel(
|
||||
id: asT<int?>(json['id']),
|
||||
cover: asT<String>(json['cover'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
subTitle: asT<String?>(json['sub_title']),
|
||||
type: asT<int?>(json['type']),
|
||||
url: asT<String?>(json['url']),
|
||||
objId: asT<int?>(json['obj_id']),
|
||||
status: asT<String?>(json['status']),
|
||||
);
|
||||
int? id;
|
||||
String cover;
|
||||
String title;
|
||||
String? subTitle;
|
||||
int? type;
|
||||
String? url;
|
||||
int? objId;
|
||||
String? status;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'cover': cover,
|
||||
'title': title,
|
||||
'sub_title': subTitle,
|
||||
'type': type,
|
||||
'url': url,
|
||||
'obj_id': objId,
|
||||
'status': status,
|
||||
};
|
||||
}
|
||||
62
lib/models/novel/search_model.dart
Normal file
62
lib/models/novel/search_model.dart
Normal file
@@ -0,0 +1,62 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelSearchModel {
|
||||
NovelSearchModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
this.authors,
|
||||
this.cover,
|
||||
this.hotHits,
|
||||
this.lastName,
|
||||
this.status,
|
||||
this.types,
|
||||
this.subNums,
|
||||
});
|
||||
|
||||
factory NovelSearchModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelSearchModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
authors: asT<String?>(json['authors']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
hotHits: asT<int?>(json['hot_hits']),
|
||||
lastName: asT<String?>(json['last_name']),
|
||||
status: asT<String?>(json['status']),
|
||||
types: asT<String?>(json['types']),
|
||||
subNums: asT<int?>(json['sub_nums']),
|
||||
);
|
||||
|
||||
int id;
|
||||
String title;
|
||||
String? authors;
|
||||
String? cover;
|
||||
int? hotHits;
|
||||
String? lastName;
|
||||
String? status;
|
||||
String? types;
|
||||
int? subNums;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'authors': authors,
|
||||
'cover': cover,
|
||||
'hot_hits': hotHits,
|
||||
'last_name': lastName,
|
||||
'status': status,
|
||||
'types': types,
|
||||
'sub_nums': subNums,
|
||||
};
|
||||
}
|
||||
83
lib/models/novel/volume_detail_model.dart
Normal file
83
lib/models/novel/volume_detail_model.dart
Normal file
@@ -0,0 +1,83 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class NovelVolumeDetailModel {
|
||||
NovelVolumeDetailModel({
|
||||
required this.volumeId,
|
||||
required this.volumeName,
|
||||
required this.volumeOrder,
|
||||
required this.chapters,
|
||||
});
|
||||
|
||||
factory NovelVolumeDetailModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<NovelVolumeDetailChapterModel>? chapters =
|
||||
json['chapters'] is List ? <NovelVolumeDetailChapterModel>[] : null;
|
||||
if (chapters != null) {
|
||||
for (final dynamic item in json['chapters']!) {
|
||||
if (item != null) {
|
||||
chapters.add(NovelVolumeDetailChapterModel.fromJson(
|
||||
asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return NovelVolumeDetailModel(
|
||||
volumeId: asT<int>(json['volume_id'])!,
|
||||
volumeName: asT<String>(json['volume_name'])!,
|
||||
volumeOrder: asT<int>(json['volume_order'])!,
|
||||
chapters: chapters!,
|
||||
);
|
||||
}
|
||||
|
||||
int volumeId;
|
||||
String volumeName;
|
||||
int volumeOrder;
|
||||
List<NovelVolumeDetailChapterModel> chapters;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'volume_id': volumeId,
|
||||
'volume_name': volumeName,
|
||||
'volume_order': volumeOrder,
|
||||
'chapters': chapters,
|
||||
};
|
||||
}
|
||||
|
||||
class NovelVolumeDetailChapterModel {
|
||||
NovelVolumeDetailChapterModel({
|
||||
required this.chapterId,
|
||||
required this.chapterName,
|
||||
required this.chapterOrder,
|
||||
});
|
||||
|
||||
factory NovelVolumeDetailChapterModel.fromJson(Map<String, dynamic> json) =>
|
||||
NovelVolumeDetailChapterModel(
|
||||
chapterId: asT<int>(json['chapter_id'])!,
|
||||
chapterName: asT<String>(json['chapter_name'])!,
|
||||
chapterOrder: asT<int>(json['chapter_order'])!,
|
||||
);
|
||||
|
||||
int chapterId;
|
||||
String chapterName;
|
||||
int chapterOrder;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'chapter_id': chapterId,
|
||||
'chapter_name': chapterName,
|
||||
'chapter_order': chapterOrder,
|
||||
};
|
||||
}
|
||||
2593
lib/models/proto/comic.pb.dart
Normal file
2593
lib/models/proto/comic.pb.dart
Normal file
File diff suppressed because it is too large
Load Diff
231
lib/models/proto/comic.pbjson.dart
Normal file
231
lib/models/proto/comic.pbjson.dart
Normal file
@@ -0,0 +1,231 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: comic.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name
|
||||
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use comicChapterDetailProtoDescriptor instead')
|
||||
const ComicChapterDetailProto$json = const {
|
||||
'1': 'ComicChapterDetailProto',
|
||||
'2': const [
|
||||
const {'1': 'chapterId', '3': 1, '4': 1, '5': 3, '10': 'chapterId'},
|
||||
const {'1': 'comicId', '3': 2, '4': 1, '5': 3, '10': 'comicId'},
|
||||
const {'1': 'title', '3': 3, '4': 1, '5': 9, '10': 'title'},
|
||||
const {'1': 'chapterOrder', '3': 4, '4': 1, '5': 5, '10': 'chapterOrder'},
|
||||
const {'1': 'direction', '3': 5, '4': 1, '5': 5, '10': 'direction'},
|
||||
const {'1': 'pageUrl', '3': 6, '4': 3, '5': 9, '10': 'pageUrl'},
|
||||
const {'1': 'picnum', '3': 7, '4': 1, '5': 5, '10': 'picnum'},
|
||||
const {'1': 'pageUrlHD', '3': 8, '4': 3, '5': 9, '10': 'pageUrlHD'},
|
||||
const {'1': 'commentCount', '3': 9, '4': 1, '5': 5, '10': 'commentCount'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicChapterDetailProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicChapterDetailProtoDescriptor = $convert.base64Decode('ChdDb21pY0NoYXB0ZXJEZXRhaWxQcm90bxIcCgljaGFwdGVySWQYASABKANSCWNoYXB0ZXJJZBIYCgdjb21pY0lkGAIgASgDUgdjb21pY0lkEhQKBXRpdGxlGAMgASgJUgV0aXRsZRIiCgxjaGFwdGVyT3JkZXIYBCABKAVSDGNoYXB0ZXJPcmRlchIcCglkaXJlY3Rpb24YBSABKAVSCWRpcmVjdGlvbhIYCgdwYWdlVXJsGAYgAygJUgdwYWdlVXJsEhYKBnBpY251bRgHIAEoBVIGcGljbnVtEhwKCXBhZ2VVcmxIRBgIIAMoCVIJcGFnZVVybEhEEiIKDGNvbW1lbnRDb3VudBgJIAEoBVIMY29tbWVudENvdW50');
|
||||
@$core.Deprecated('Use comicChapterInfoProtoDescriptor instead')
|
||||
const ComicChapterInfoProto$json = const {
|
||||
'1': 'ComicChapterInfoProto',
|
||||
'2': const [
|
||||
const {'1': 'chapterId', '3': 1, '4': 1, '5': 3, '10': 'chapterId'},
|
||||
const {'1': 'chapterTitle', '3': 2, '4': 1, '5': 9, '10': 'chapterTitle'},
|
||||
const {'1': 'updateTime', '3': 3, '4': 1, '5': 3, '10': 'updateTime'},
|
||||
const {'1': 'fileSize', '3': 4, '4': 1, '5': 5, '10': 'fileSize'},
|
||||
const {'1': 'chapterOrder', '3': 5, '4': 1, '5': 5, '10': 'chapterOrder'},
|
||||
const {'1': 'isFee', '3': 6, '4': 1, '5': 5, '10': 'isFee'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicChapterInfoProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicChapterInfoProtoDescriptor = $convert.base64Decode('ChVDb21pY0NoYXB0ZXJJbmZvUHJvdG8SHAoJY2hhcHRlcklkGAEgASgDUgljaGFwdGVySWQSIgoMY2hhcHRlclRpdGxlGAIgASgJUgxjaGFwdGVyVGl0bGUSHgoKdXBkYXRlVGltZRgDIAEoA1IKdXBkYXRlVGltZRIaCghmaWxlU2l6ZRgEIAEoBVIIZmlsZVNpemUSIgoMY2hhcHRlck9yZGVyGAUgASgFUgxjaGFwdGVyT3JkZXISFAoFaXNGZWUYBiABKAVSBWlzRmVl');
|
||||
@$core.Deprecated('Use comicChapterResponseProtoDescriptor instead')
|
||||
const ComicChapterResponseProto$json = const {
|
||||
'1': 'ComicChapterResponseProto',
|
||||
'2': const [
|
||||
const {'1': 'errno', '3': 1, '4': 1, '5': 5, '10': 'errno'},
|
||||
const {'1': 'errmsg', '3': 2, '4': 1, '5': 9, '10': 'errmsg'},
|
||||
const {'1': 'data', '3': 3, '4': 1, '5': 11, '6': '.ComicChapterDetailProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicChapterResponseProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicChapterResponseProtoDescriptor = $convert.base64Decode('ChlDb21pY0NoYXB0ZXJSZXNwb25zZVByb3RvEhQKBWVycm5vGAEgASgFUgVlcnJubxIWCgZlcnJtc2cYAiABKAlSBmVycm1zZxIsCgRkYXRhGAMgASgLMhguQ29taWNDaGFwdGVyRGV0YWlsUHJvdG9SBGRhdGE=');
|
||||
@$core.Deprecated('Use comicChapterListProtoDescriptor instead')
|
||||
const ComicChapterListProto$json = const {
|
||||
'1': 'ComicChapterListProto',
|
||||
'2': const [
|
||||
const {'1': 'title', '3': 1, '4': 1, '5': 9, '10': 'title'},
|
||||
const {'1': 'data', '3': 2, '4': 3, '5': 11, '6': '.ComicChapterInfoProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicChapterListProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicChapterListProtoDescriptor = $convert.base64Decode('ChVDb21pY0NoYXB0ZXJMaXN0UHJvdG8SFAoFdGl0bGUYASABKAlSBXRpdGxlEioKBGRhdGEYAiADKAsyFi5Db21pY0NoYXB0ZXJJbmZvUHJvdG9SBGRhdGE=');
|
||||
@$core.Deprecated('Use comicDetailResponseProtoDescriptor instead')
|
||||
const ComicDetailResponseProto$json = const {
|
||||
'1': 'ComicDetailResponseProto',
|
||||
'2': const [
|
||||
const {'1': 'errno', '3': 1, '4': 1, '5': 5, '10': 'errno'},
|
||||
const {'1': 'errmsg', '3': 2, '4': 1, '5': 9, '10': 'errmsg'},
|
||||
const {'1': 'data', '3': 3, '4': 1, '5': 11, '6': '.ComicDetailProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicDetailResponseProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicDetailResponseProtoDescriptor = $convert.base64Decode('ChhDb21pY0RldGFpbFJlc3BvbnNlUHJvdG8SFAoFZXJybm8YASABKAVSBWVycm5vEhYKBmVycm1zZxgCIAEoCVIGZXJybXNnEiUKBGRhdGEYAyABKAsyES5Db21pY0RldGFpbFByb3RvUgRkYXRh');
|
||||
@$core.Deprecated('Use comicDetailProtoDescriptor instead')
|
||||
const ComicDetailProto$json = const {
|
||||
'1': 'ComicDetailProto',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 3, '10': 'id'},
|
||||
const {'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'},
|
||||
const {'1': 'direction', '3': 3, '4': 1, '5': 5, '10': 'direction'},
|
||||
const {'1': 'islong', '3': 4, '4': 1, '5': 5, '10': 'islong'},
|
||||
const {'1': 'isDmzj', '3': 5, '4': 1, '5': 5, '10': 'isDmzj'},
|
||||
const {'1': 'cover', '3': 6, '4': 1, '5': 9, '10': 'cover'},
|
||||
const {'1': 'description', '3': 7, '4': 1, '5': 9, '10': 'description'},
|
||||
const {'1': 'lastUpdatetime', '3': 8, '4': 1, '5': 3, '10': 'lastUpdatetime'},
|
||||
const {'1': 'lastUpdateChapterName', '3': 9, '4': 1, '5': 9, '10': 'lastUpdateChapterName'},
|
||||
const {'1': 'copyright', '3': 10, '4': 1, '5': 5, '10': 'copyright'},
|
||||
const {'1': 'firstLetter', '3': 11, '4': 1, '5': 9, '10': 'firstLetter'},
|
||||
const {'1': 'comicPy', '3': 12, '4': 1, '5': 9, '10': 'comicPy'},
|
||||
const {'1': 'hidden', '3': 13, '4': 1, '5': 5, '10': 'hidden'},
|
||||
const {'1': 'hotNum', '3': 14, '4': 1, '5': 3, '10': 'hotNum'},
|
||||
const {'1': 'hitNum', '3': 15, '4': 1, '5': 3, '10': 'hitNum'},
|
||||
const {'1': 'uid', '3': 16, '4': 1, '5': 3, '10': 'uid'},
|
||||
const {'1': 'isLock', '3': 17, '4': 1, '5': 5, '10': 'isLock'},
|
||||
const {'1': 'lastUpdateChapterId', '3': 18, '4': 1, '5': 5, '10': 'lastUpdateChapterId'},
|
||||
const {'1': 'types', '3': 19, '4': 3, '5': 11, '6': '.ComicTagProto', '10': 'types'},
|
||||
const {'1': 'status', '3': 20, '4': 3, '5': 11, '6': '.ComicTagProto', '10': 'status'},
|
||||
const {'1': 'authors', '3': 21, '4': 3, '5': 11, '6': '.ComicTagProto', '10': 'authors'},
|
||||
const {'1': 'subscribeNum', '3': 22, '4': 1, '5': 3, '10': 'subscribeNum'},
|
||||
const {'1': 'chapters', '3': 23, '4': 3, '5': 11, '6': '.ComicChapterListProto', '10': 'chapters'},
|
||||
const {'1': 'isNeedLogin', '3': 24, '4': 1, '5': 5, '10': 'isNeedLogin'},
|
||||
const {'1': 'urlLinks', '3': 25, '4': 3, '5': 11, '6': '.ComicDetailUrlLinkProto', '10': 'urlLinks'},
|
||||
const {'1': 'isHideChapter', '3': 26, '4': 1, '5': 5, '10': 'isHideChapter'},
|
||||
const {'1': 'dhUrlLinks', '3': 27, '4': 3, '5': 11, '6': '.ComicDetailUrlLinkProto', '10': 'dhUrlLinks'},
|
||||
const {'1': 'cornerMark', '3': 28, '4': 1, '5': 9, '10': 'cornerMark'},
|
||||
const {'1': 'isFee', '3': 29, '4': 1, '5': 5, '10': 'isFee'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicDetailProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicDetailProtoDescriptor = $convert.base64Decode('ChBDb21pY0RldGFpbFByb3RvEg4KAmlkGAEgASgDUgJpZBIUCgV0aXRsZRgCIAEoCVIFdGl0bGUSHAoJZGlyZWN0aW9uGAMgASgFUglkaXJlY3Rpb24SFgoGaXNsb25nGAQgASgFUgZpc2xvbmcSFgoGaXNEbXpqGAUgASgFUgZpc0RtemoSFAoFY292ZXIYBiABKAlSBWNvdmVyEiAKC2Rlc2NyaXB0aW9uGAcgASgJUgtkZXNjcmlwdGlvbhImCg5sYXN0VXBkYXRldGltZRgIIAEoA1IObGFzdFVwZGF0ZXRpbWUSNAoVbGFzdFVwZGF0ZUNoYXB0ZXJOYW1lGAkgASgJUhVsYXN0VXBkYXRlQ2hhcHRlck5hbWUSHAoJY29weXJpZ2h0GAogASgFUgljb3B5cmlnaHQSIAoLZmlyc3RMZXR0ZXIYCyABKAlSC2ZpcnN0TGV0dGVyEhgKB2NvbWljUHkYDCABKAlSB2NvbWljUHkSFgoGaGlkZGVuGA0gASgFUgZoaWRkZW4SFgoGaG90TnVtGA4gASgDUgZob3ROdW0SFgoGaGl0TnVtGA8gASgDUgZoaXROdW0SEAoDdWlkGBAgASgDUgN1aWQSFgoGaXNMb2NrGBEgASgFUgZpc0xvY2sSMAoTbGFzdFVwZGF0ZUNoYXB0ZXJJZBgSIAEoBVITbGFzdFVwZGF0ZUNoYXB0ZXJJZBIkCgV0eXBlcxgTIAMoCzIOLkNvbWljVGFnUHJvdG9SBXR5cGVzEiYKBnN0YXR1cxgUIAMoCzIOLkNvbWljVGFnUHJvdG9SBnN0YXR1cxIoCgdhdXRob3JzGBUgAygLMg4uQ29taWNUYWdQcm90b1IHYXV0aG9ycxIiCgxzdWJzY3JpYmVOdW0YFiABKANSDHN1YnNjcmliZU51bRIyCghjaGFwdGVycxgXIAMoCzIWLkNvbWljQ2hhcHRlckxpc3RQcm90b1IIY2hhcHRlcnMSIAoLaXNOZWVkTG9naW4YGCABKAVSC2lzTmVlZExvZ2luEjQKCHVybExpbmtzGBkgAygLMhguQ29taWNEZXRhaWxVcmxMaW5rUHJvdG9SCHVybExpbmtzEiQKDWlzSGlkZUNoYXB0ZXIYGiABKAVSDWlzSGlkZUNoYXB0ZXISOAoKZGhVcmxMaW5rcxgbIAMoCzIYLkNvbWljRGV0YWlsVXJsTGlua1Byb3RvUgpkaFVybExpbmtzEh4KCmNvcm5lck1hcmsYHCABKAlSCmNvcm5lck1hcmsSFAoFaXNGZWUYHSABKAVSBWlzRmVl');
|
||||
@$core.Deprecated('Use comicTagProtoDescriptor instead')
|
||||
const ComicTagProto$json = const {
|
||||
'1': 'ComicTagProto',
|
||||
'2': const [
|
||||
const {'1': 'tagId', '3': 1, '4': 1, '5': 3, '10': 'tagId'},
|
||||
const {'1': 'tagName', '3': 2, '4': 1, '5': 9, '10': 'tagName'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicTagProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicTagProtoDescriptor = $convert.base64Decode('Cg1Db21pY1RhZ1Byb3RvEhQKBXRhZ0lkGAEgASgDUgV0YWdJZBIYCgd0YWdOYW1lGAIgASgJUgd0YWdOYW1l');
|
||||
@$core.Deprecated('Use comicDetailUrlLinkProtoDescriptor instead')
|
||||
const ComicDetailUrlLinkProto$json = const {
|
||||
'1': 'ComicDetailUrlLinkProto',
|
||||
'2': const [
|
||||
const {'1': 'title', '3': 1, '4': 1, '5': 9, '10': 'title'},
|
||||
const {'1': 'list', '3': 2, '4': 3, '5': 11, '6': '.ComicDetailUrlProto', '10': 'list'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicDetailUrlLinkProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicDetailUrlLinkProtoDescriptor = $convert.base64Decode('ChdDb21pY0RldGFpbFVybExpbmtQcm90bxIUCgV0aXRsZRgBIAEoCVIFdGl0bGUSKAoEbGlzdBgCIAMoCzIULkNvbWljRGV0YWlsVXJsUHJvdG9SBGxpc3Q=');
|
||||
@$core.Deprecated('Use comicDetailUrlProtoDescriptor instead')
|
||||
const ComicDetailUrlProto$json = const {
|
||||
'1': 'ComicDetailUrlProto',
|
||||
'2': const [
|
||||
const {'1': 'id', '3': 1, '4': 1, '5': 3, '10': 'id'},
|
||||
const {'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'},
|
||||
const {'1': 'url', '3': 3, '4': 1, '5': 9, '10': 'url'},
|
||||
const {'1': 'icon', '3': 4, '4': 1, '5': 9, '10': 'icon'},
|
||||
const {'1': 'packageName', '3': 5, '4': 1, '5': 9, '10': 'packageName'},
|
||||
const {'1': 'dUrl', '3': 6, '4': 1, '5': 9, '10': 'dUrl'},
|
||||
const {'1': 'btype', '3': 7, '4': 1, '5': 5, '10': 'btype'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicDetailUrlProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicDetailUrlProtoDescriptor = $convert.base64Decode('ChNDb21pY0RldGFpbFVybFByb3RvEg4KAmlkGAEgASgDUgJpZBIUCgV0aXRsZRgCIAEoCVIFdGl0bGUSEAoDdXJsGAMgASgJUgN1cmwSEgoEaWNvbhgEIAEoCVIEaWNvbhIgCgtwYWNrYWdlTmFtZRgFIAEoCVILcGFja2FnZU5hbWUSEgoEZFVybBgGIAEoCVIEZFVybBIUCgVidHlwZRgHIAEoBVIFYnR5cGU=');
|
||||
@$core.Deprecated('Use comicRankListResponseProtoDescriptor instead')
|
||||
const ComicRankListResponseProto$json = const {
|
||||
'1': 'ComicRankListResponseProto',
|
||||
'2': const [
|
||||
const {'1': 'errno', '3': 1, '4': 1, '5': 5, '10': 'errno'},
|
||||
const {'1': 'errmsg', '3': 2, '4': 1, '5': 9, '10': 'errmsg'},
|
||||
const {'1': 'data', '3': 3, '4': 3, '5': 11, '6': '.ComicRankListInfoProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicRankListResponseProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicRankListResponseProtoDescriptor = $convert.base64Decode('ChpDb21pY1JhbmtMaXN0UmVzcG9uc2VQcm90bxIUCgVlcnJubxgBIAEoBVIFZXJybm8SFgoGZXJybXNnGAIgASgJUgZlcnJtc2cSKwoEZGF0YRgDIAMoCzIXLkNvbWljUmFua0xpc3RJbmZvUHJvdG9SBGRhdGE=');
|
||||
@$core.Deprecated('Use comicRankListInfoProtoDescriptor instead')
|
||||
const ComicRankListInfoProto$json = const {
|
||||
'1': 'ComicRankListInfoProto',
|
||||
'2': const [
|
||||
const {'1': 'comic_id', '3': 1, '4': 1, '5': 3, '10': 'comicId'},
|
||||
const {'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'},
|
||||
const {'1': 'authors', '3': 3, '4': 1, '5': 9, '10': 'authors'},
|
||||
const {'1': 'status', '3': 4, '4': 1, '5': 9, '10': 'status'},
|
||||
const {'1': 'cover', '3': 5, '4': 1, '5': 9, '10': 'cover'},
|
||||
const {'1': 'types', '3': 6, '4': 1, '5': 9, '10': 'types'},
|
||||
const {'1': 'last_updatetime', '3': 7, '4': 1, '5': 3, '10': 'lastUpdatetime'},
|
||||
const {'1': 'last_update_chapter_name', '3': 8, '4': 1, '5': 9, '10': 'lastUpdateChapterName'},
|
||||
const {'1': 'comic_py', '3': 9, '4': 1, '5': 9, '10': 'comicPy'},
|
||||
const {'1': 'num', '3': 10, '4': 1, '5': 3, '10': 'num'},
|
||||
const {'1': 'tag_id', '3': 11, '4': 1, '5': 5, '10': 'tagId'},
|
||||
const {'1': 'chapter_name', '3': 12, '4': 1, '5': 9, '10': 'chapterName'},
|
||||
const {'1': 'chapter_id', '3': 13, '4': 1, '5': 3, '10': 'chapterId'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicRankListInfoProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicRankListInfoProtoDescriptor = $convert.base64Decode('ChZDb21pY1JhbmtMaXN0SW5mb1Byb3RvEhkKCGNvbWljX2lkGAEgASgDUgdjb21pY0lkEhQKBXRpdGxlGAIgASgJUgV0aXRsZRIYCgdhdXRob3JzGAMgASgJUgdhdXRob3JzEhYKBnN0YXR1cxgEIAEoCVIGc3RhdHVzEhQKBWNvdmVyGAUgASgJUgVjb3ZlchIUCgV0eXBlcxgGIAEoCVIFdHlwZXMSJwoPbGFzdF91cGRhdGV0aW1lGAcgASgDUg5sYXN0VXBkYXRldGltZRI3ChhsYXN0X3VwZGF0ZV9jaGFwdGVyX25hbWUYCCABKAlSFWxhc3RVcGRhdGVDaGFwdGVyTmFtZRIZCghjb21pY19weRgJIAEoCVIHY29taWNQeRIQCgNudW0YCiABKANSA251bRIVCgZ0YWdfaWQYCyABKAVSBXRhZ0lkEiEKDGNoYXB0ZXJfbmFtZRgMIAEoCVILY2hhcHRlck5hbWUSHQoKY2hhcHRlcl9pZBgNIAEoA1IJY2hhcHRlcklk');
|
||||
@$core.Deprecated('Use rankTypeFilterResponseProtoDescriptor instead')
|
||||
const RankTypeFilterResponseProto$json = const {
|
||||
'1': 'RankTypeFilterResponseProto',
|
||||
'2': const [
|
||||
const {'1': 'errno', '3': 1, '4': 1, '5': 5, '10': 'errno'},
|
||||
const {'1': 'errmsg', '3': 2, '4': 1, '5': 9, '10': 'errmsg'},
|
||||
const {'1': 'data', '3': 3, '4': 3, '5': 11, '6': '.ComicTagProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `RankTypeFilterResponseProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List rankTypeFilterResponseProtoDescriptor = $convert.base64Decode('ChtSYW5rVHlwZUZpbHRlclJlc3BvbnNlUHJvdG8SFAoFZXJybm8YASABKAVSBWVycm5vEhYKBmVycm1zZxgCIAEoCVIGZXJybXNnEiIKBGRhdGEYAyADKAsyDi5Db21pY1RhZ1Byb3RvUgRkYXRh');
|
||||
@$core.Deprecated('Use comicUpdateListResponseProtoDescriptor instead')
|
||||
const ComicUpdateListResponseProto$json = const {
|
||||
'1': 'ComicUpdateListResponseProto',
|
||||
'2': const [
|
||||
const {'1': 'errno', '3': 1, '4': 1, '5': 5, '10': 'errno'},
|
||||
const {'1': 'errmsg', '3': 2, '4': 1, '5': 9, '10': 'errmsg'},
|
||||
const {'1': 'data', '3': 3, '4': 3, '5': 11, '6': '.ComicUpdateListInfoProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicUpdateListResponseProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicUpdateListResponseProtoDescriptor = $convert.base64Decode('ChxDb21pY1VwZGF0ZUxpc3RSZXNwb25zZVByb3RvEhQKBWVycm5vGAEgASgFUgVlcnJubxIWCgZlcnJtc2cYAiABKAlSBmVycm1zZxItCgRkYXRhGAMgAygLMhkuQ29taWNVcGRhdGVMaXN0SW5mb1Byb3RvUgRkYXRh');
|
||||
@$core.Deprecated('Use comicUpdateListInfoProtoDescriptor instead')
|
||||
const ComicUpdateListInfoProto$json = const {
|
||||
'1': 'ComicUpdateListInfoProto',
|
||||
'2': const [
|
||||
const {'1': 'comicId', '3': 1, '4': 1, '5': 3, '10': 'comicId'},
|
||||
const {'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'},
|
||||
const {'1': 'islong', '3': 3, '4': 1, '5': 5, '10': 'islong'},
|
||||
const {'1': 'authors', '3': 4, '4': 1, '5': 9, '10': 'authors'},
|
||||
const {'1': 'types', '3': 5, '4': 1, '5': 9, '10': 'types'},
|
||||
const {'1': 'cover', '3': 6, '4': 1, '5': 9, '10': 'cover'},
|
||||
const {'1': 'status', '3': 7, '4': 1, '5': 9, '10': 'status'},
|
||||
const {'1': 'lastUpdateChapterName', '3': 8, '4': 1, '5': 9, '10': 'lastUpdateChapterName'},
|
||||
const {'1': 'lastUpdateChapterId', '3': 9, '4': 1, '5': 3, '10': 'lastUpdateChapterId'},
|
||||
const {'1': 'lastUpdatetime', '3': 10, '4': 1, '5': 3, '10': 'lastUpdatetime'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `ComicUpdateListInfoProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List comicUpdateListInfoProtoDescriptor = $convert.base64Decode('ChhDb21pY1VwZGF0ZUxpc3RJbmZvUHJvdG8SGAoHY29taWNJZBgBIAEoA1IHY29taWNJZBIUCgV0aXRsZRgCIAEoCVIFdGl0bGUSFgoGaXNsb25nGAMgASgFUgZpc2xvbmcSGAoHYXV0aG9ycxgEIAEoCVIHYXV0aG9ycxIUCgV0eXBlcxgFIAEoCVIFdHlwZXMSFAoFY292ZXIYBiABKAlSBWNvdmVyEhYKBnN0YXR1cxgHIAEoCVIGc3RhdHVzEjQKFWxhc3RVcGRhdGVDaGFwdGVyTmFtZRgIIAEoCVIVbGFzdFVwZGF0ZUNoYXB0ZXJOYW1lEjAKE2xhc3RVcGRhdGVDaGFwdGVySWQYCSABKANSE2xhc3RVcGRhdGVDaGFwdGVySWQSJgoObGFzdFVwZGF0ZXRpbWUYCiABKANSDmxhc3RVcGRhdGV0aW1l');
|
||||
570
lib/models/proto/news.pb.dart
Normal file
570
lib/models/proto/news.pb.dart
Normal file
@@ -0,0 +1,570 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: news.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name, depend_on_referenced_packages, no_leading_underscores_for_local_identifiers
|
||||
|
||||
import 'dart:core' as $core;
|
||||
|
||||
import 'package:fixnum/fixnum.dart' as $fixnum;
|
||||
import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class NewsListResponseProto extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
||||
? ''
|
||||
: 'NewsListResponseProto',
|
||||
createEmptyInstance: create)
|
||||
..a<$core.int>(
|
||||
1,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'errno',
|
||||
$pb.PbFieldType.O3)
|
||||
..aOS(
|
||||
2,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'errmsg')
|
||||
..pc<NewsListInfoProto>(
|
||||
3,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'data',
|
||||
$pb.PbFieldType.PM,
|
||||
subBuilder: NewsListInfoProto.create)
|
||||
..hasRequiredFields = false;
|
||||
|
||||
NewsListResponseProto._() : super();
|
||||
factory NewsListResponseProto({
|
||||
$core.int? errno,
|
||||
$core.String? errmsg,
|
||||
$core.Iterable<NewsListInfoProto>? data,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (errno != null) {
|
||||
_result.errno = errno;
|
||||
}
|
||||
if (errmsg != null) {
|
||||
_result.errmsg = errmsg;
|
||||
}
|
||||
if (data != null) {
|
||||
_result.data.addAll(data);
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory NewsListResponseProto.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory NewsListResponseProto.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
NewsListResponseProto clone() =>
|
||||
NewsListResponseProto()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
NewsListResponseProto copyWith(
|
||||
void Function(NewsListResponseProto) updates) =>
|
||||
super.copyWith((message) => updates(message as NewsListResponseProto))
|
||||
as NewsListResponseProto; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NewsListResponseProto create() => NewsListResponseProto._();
|
||||
NewsListResponseProto createEmptyInstance() => create();
|
||||
static $pb.PbList<NewsListResponseProto> createRepeated() =>
|
||||
$pb.PbList<NewsListResponseProto>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NewsListResponseProto getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<NewsListResponseProto>(create);
|
||||
static NewsListResponseProto? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.int get errno => $_getIZ(0);
|
||||
@$pb.TagNumber(1)
|
||||
set errno($core.int v) {
|
||||
$_setSignedInt32(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasErrno() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearErrno() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get errmsg => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set errmsg($core.String v) {
|
||||
$_setString(1, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasErrmsg() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearErrmsg() => clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.List<NewsListInfoProto> get data => $_getList(2);
|
||||
}
|
||||
|
||||
class NewsListInfoProto extends $pb.GeneratedMessage {
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(
|
||||
const $core.bool.fromEnvironment('protobuf.omit_message_names')
|
||||
? ''
|
||||
: 'NewsListInfoProto',
|
||||
createEmptyInstance: create)
|
||||
..aInt64(
|
||||
1,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'articleId',
|
||||
protoName: 'articleId')
|
||||
..aOS(
|
||||
2,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'title')
|
||||
..aOS(
|
||||
3,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'fromName',
|
||||
protoName: 'fromName')
|
||||
..aOS(
|
||||
4,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'fromUrl',
|
||||
protoName: 'fromUrl')
|
||||
..aInt64(
|
||||
5,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'createTime',
|
||||
protoName: 'createTime')
|
||||
..a<$core.int>(
|
||||
6,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'isForeign',
|
||||
$pb.PbFieldType.O3,
|
||||
protoName: 'isForeign')
|
||||
..aOS(
|
||||
7,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'foreignUrl',
|
||||
protoName: 'foreignUrl')
|
||||
..aOS(
|
||||
8,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'intro')
|
||||
..aInt64(
|
||||
9,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'authorId',
|
||||
protoName: 'authorId')
|
||||
..a<$core.int>(
|
||||
10,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'status',
|
||||
$pb.PbFieldType.O3)
|
||||
..aOS(
|
||||
11,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'rowPicUrl',
|
||||
protoName: 'rowPicUrl')
|
||||
..aOS(
|
||||
12,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'colPicUrl',
|
||||
protoName: 'colPicUrl')
|
||||
..a<$core.int>(
|
||||
13,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'qchatShow',
|
||||
$pb.PbFieldType.O3,
|
||||
protoName: 'qchatShow')
|
||||
..aOS(
|
||||
14,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'pageUrl',
|
||||
protoName: 'pageUrl')
|
||||
..aInt64(
|
||||
15,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'commentAmount',
|
||||
protoName: 'commentAmount')
|
||||
..aInt64(
|
||||
16,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'authorUid',
|
||||
protoName: 'authorUid')
|
||||
..aOS(
|
||||
17,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'cover')
|
||||
..aOS(
|
||||
18,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'nickname')
|
||||
..aInt64(
|
||||
19,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_field_names')
|
||||
? ''
|
||||
: 'moodAmount',
|
||||
protoName: 'moodAmount')
|
||||
..hasRequiredFields = false;
|
||||
|
||||
NewsListInfoProto._() : super();
|
||||
factory NewsListInfoProto({
|
||||
$fixnum.Int64? articleId,
|
||||
$core.String? title,
|
||||
$core.String? fromName,
|
||||
$core.String? fromUrl,
|
||||
$fixnum.Int64? createTime,
|
||||
$core.int? isForeign,
|
||||
$core.String? foreignUrl,
|
||||
$core.String? intro,
|
||||
$fixnum.Int64? authorId,
|
||||
$core.int? status,
|
||||
$core.String? rowPicUrl,
|
||||
$core.String? colPicUrl,
|
||||
$core.int? qchatShow,
|
||||
$core.String? pageUrl,
|
||||
$fixnum.Int64? commentAmount,
|
||||
$fixnum.Int64? authorUid,
|
||||
$core.String? cover,
|
||||
$core.String? nickname,
|
||||
$fixnum.Int64? moodAmount,
|
||||
}) {
|
||||
final _result = create();
|
||||
if (articleId != null) {
|
||||
_result.articleId = articleId;
|
||||
}
|
||||
if (title != null) {
|
||||
_result.title = title;
|
||||
}
|
||||
if (fromName != null) {
|
||||
_result.fromName = fromName;
|
||||
}
|
||||
if (fromUrl != null) {
|
||||
_result.fromUrl = fromUrl;
|
||||
}
|
||||
if (createTime != null) {
|
||||
_result.createTime = createTime;
|
||||
}
|
||||
if (isForeign != null) {
|
||||
_result.isForeign = isForeign;
|
||||
}
|
||||
if (foreignUrl != null) {
|
||||
_result.foreignUrl = foreignUrl;
|
||||
}
|
||||
if (intro != null) {
|
||||
_result.intro = intro;
|
||||
}
|
||||
if (authorId != null) {
|
||||
_result.authorId = authorId;
|
||||
}
|
||||
if (status != null) {
|
||||
_result.status = status;
|
||||
}
|
||||
if (rowPicUrl != null) {
|
||||
_result.rowPicUrl = rowPicUrl;
|
||||
}
|
||||
if (colPicUrl != null) {
|
||||
_result.colPicUrl = colPicUrl;
|
||||
}
|
||||
if (qchatShow != null) {
|
||||
_result.qchatShow = qchatShow;
|
||||
}
|
||||
if (pageUrl != null) {
|
||||
_result.pageUrl = pageUrl;
|
||||
}
|
||||
if (commentAmount != null) {
|
||||
_result.commentAmount = commentAmount;
|
||||
}
|
||||
if (authorUid != null) {
|
||||
_result.authorUid = authorUid;
|
||||
}
|
||||
if (cover != null) {
|
||||
_result.cover = cover;
|
||||
}
|
||||
if (nickname != null) {
|
||||
_result.nickname = nickname;
|
||||
}
|
||||
if (moodAmount != null) {
|
||||
_result.moodAmount = moodAmount;
|
||||
}
|
||||
return _result;
|
||||
}
|
||||
factory NewsListInfoProto.fromBuffer($core.List<$core.int> i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromBuffer(i, r);
|
||||
factory NewsListInfoProto.fromJson($core.String i,
|
||||
[$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) =>
|
||||
create()..mergeFromJson(i, r);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
|
||||
'Will be removed in next major version')
|
||||
NewsListInfoProto clone() => NewsListInfoProto()..mergeFromMessage(this);
|
||||
@$core.Deprecated('Using this can add significant overhead to your binary. '
|
||||
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
|
||||
'Will be removed in next major version')
|
||||
NewsListInfoProto copyWith(void Function(NewsListInfoProto) updates) =>
|
||||
super.copyWith((message) => updates(message as NewsListInfoProto))
|
||||
as NewsListInfoProto; // ignore: deprecated_member_use
|
||||
$pb.BuilderInfo get info_ => _i;
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NewsListInfoProto create() => NewsListInfoProto._();
|
||||
NewsListInfoProto createEmptyInstance() => create();
|
||||
static $pb.PbList<NewsListInfoProto> createRepeated() =>
|
||||
$pb.PbList<NewsListInfoProto>();
|
||||
@$core.pragma('dart2js:noInline')
|
||||
static NewsListInfoProto getDefault() => _defaultInstance ??=
|
||||
$pb.GeneratedMessage.$_defaultFor<NewsListInfoProto>(create);
|
||||
static NewsListInfoProto? _defaultInstance;
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$fixnum.Int64 get articleId => $_getI64(0);
|
||||
@$pb.TagNumber(1)
|
||||
set articleId($fixnum.Int64 v) {
|
||||
$_setInt64(0, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(1)
|
||||
$core.bool hasArticleId() => $_has(0);
|
||||
@$pb.TagNumber(1)
|
||||
void clearArticleId() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get title => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set title($core.String v) {
|
||||
$_setString(1, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasTitle() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearTitle() => clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get fromName => $_getSZ(2);
|
||||
@$pb.TagNumber(3)
|
||||
set fromName($core.String v) {
|
||||
$_setString(2, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.bool hasFromName() => $_has(2);
|
||||
@$pb.TagNumber(3)
|
||||
void clearFromName() => clearField(3);
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.String get fromUrl => $_getSZ(3);
|
||||
@$pb.TagNumber(4)
|
||||
set fromUrl($core.String v) {
|
||||
$_setString(3, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(4)
|
||||
$core.bool hasFromUrl() => $_has(3);
|
||||
@$pb.TagNumber(4)
|
||||
void clearFromUrl() => clearField(4);
|
||||
|
||||
@$pb.TagNumber(5)
|
||||
$fixnum.Int64 get createTime => $_getI64(4);
|
||||
@$pb.TagNumber(5)
|
||||
set createTime($fixnum.Int64 v) {
|
||||
$_setInt64(4, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(5)
|
||||
$core.bool hasCreateTime() => $_has(4);
|
||||
@$pb.TagNumber(5)
|
||||
void clearCreateTime() => clearField(5);
|
||||
|
||||
@$pb.TagNumber(6)
|
||||
$core.int get isForeign => $_getIZ(5);
|
||||
@$pb.TagNumber(6)
|
||||
set isForeign($core.int v) {
|
||||
$_setSignedInt32(5, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(6)
|
||||
$core.bool hasIsForeign() => $_has(5);
|
||||
@$pb.TagNumber(6)
|
||||
void clearIsForeign() => clearField(6);
|
||||
|
||||
@$pb.TagNumber(7)
|
||||
$core.String get foreignUrl => $_getSZ(6);
|
||||
@$pb.TagNumber(7)
|
||||
set foreignUrl($core.String v) {
|
||||
$_setString(6, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(7)
|
||||
$core.bool hasForeignUrl() => $_has(6);
|
||||
@$pb.TagNumber(7)
|
||||
void clearForeignUrl() => clearField(7);
|
||||
|
||||
@$pb.TagNumber(8)
|
||||
$core.String get intro => $_getSZ(7);
|
||||
@$pb.TagNumber(8)
|
||||
set intro($core.String v) {
|
||||
$_setString(7, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(8)
|
||||
$core.bool hasIntro() => $_has(7);
|
||||
@$pb.TagNumber(8)
|
||||
void clearIntro() => clearField(8);
|
||||
|
||||
@$pb.TagNumber(9)
|
||||
$fixnum.Int64 get authorId => $_getI64(8);
|
||||
@$pb.TagNumber(9)
|
||||
set authorId($fixnum.Int64 v) {
|
||||
$_setInt64(8, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(9)
|
||||
$core.bool hasAuthorId() => $_has(8);
|
||||
@$pb.TagNumber(9)
|
||||
void clearAuthorId() => clearField(9);
|
||||
|
||||
@$pb.TagNumber(10)
|
||||
$core.int get status => $_getIZ(9);
|
||||
@$pb.TagNumber(10)
|
||||
set status($core.int v) {
|
||||
$_setSignedInt32(9, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(10)
|
||||
$core.bool hasStatus() => $_has(9);
|
||||
@$pb.TagNumber(10)
|
||||
void clearStatus() => clearField(10);
|
||||
|
||||
@$pb.TagNumber(11)
|
||||
$core.String get rowPicUrl => $_getSZ(10);
|
||||
@$pb.TagNumber(11)
|
||||
set rowPicUrl($core.String v) {
|
||||
$_setString(10, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(11)
|
||||
$core.bool hasRowPicUrl() => $_has(10);
|
||||
@$pb.TagNumber(11)
|
||||
void clearRowPicUrl() => clearField(11);
|
||||
|
||||
@$pb.TagNumber(12)
|
||||
$core.String get colPicUrl => $_getSZ(11);
|
||||
@$pb.TagNumber(12)
|
||||
set colPicUrl($core.String v) {
|
||||
$_setString(11, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(12)
|
||||
$core.bool hasColPicUrl() => $_has(11);
|
||||
@$pb.TagNumber(12)
|
||||
void clearColPicUrl() => clearField(12);
|
||||
|
||||
@$pb.TagNumber(13)
|
||||
$core.int get qchatShow => $_getIZ(12);
|
||||
@$pb.TagNumber(13)
|
||||
set qchatShow($core.int v) {
|
||||
$_setSignedInt32(12, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(13)
|
||||
$core.bool hasQchatShow() => $_has(12);
|
||||
@$pb.TagNumber(13)
|
||||
void clearQchatShow() => clearField(13);
|
||||
|
||||
@$pb.TagNumber(14)
|
||||
$core.String get pageUrl => $_getSZ(13);
|
||||
@$pb.TagNumber(14)
|
||||
set pageUrl($core.String v) {
|
||||
$_setString(13, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(14)
|
||||
$core.bool hasPageUrl() => $_has(13);
|
||||
@$pb.TagNumber(14)
|
||||
void clearPageUrl() => clearField(14);
|
||||
|
||||
@$pb.TagNumber(15)
|
||||
$fixnum.Int64 get commentAmount => $_getI64(14);
|
||||
@$pb.TagNumber(15)
|
||||
set commentAmount($fixnum.Int64 v) {
|
||||
$_setInt64(14, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(15)
|
||||
$core.bool hasCommentAmount() => $_has(14);
|
||||
@$pb.TagNumber(15)
|
||||
void clearCommentAmount() => clearField(15);
|
||||
|
||||
@$pb.TagNumber(16)
|
||||
$fixnum.Int64 get authorUid => $_getI64(15);
|
||||
@$pb.TagNumber(16)
|
||||
set authorUid($fixnum.Int64 v) {
|
||||
$_setInt64(15, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(16)
|
||||
$core.bool hasAuthorUid() => $_has(15);
|
||||
@$pb.TagNumber(16)
|
||||
void clearAuthorUid() => clearField(16);
|
||||
|
||||
@$pb.TagNumber(17)
|
||||
$core.String get cover => $_getSZ(16);
|
||||
@$pb.TagNumber(17)
|
||||
set cover($core.String v) {
|
||||
$_setString(16, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(17)
|
||||
$core.bool hasCover() => $_has(16);
|
||||
@$pb.TagNumber(17)
|
||||
void clearCover() => clearField(17);
|
||||
|
||||
@$pb.TagNumber(18)
|
||||
$core.String get nickname => $_getSZ(17);
|
||||
@$pb.TagNumber(18)
|
||||
set nickname($core.String v) {
|
||||
$_setString(17, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(18)
|
||||
$core.bool hasNickname() => $_has(17);
|
||||
@$pb.TagNumber(18)
|
||||
void clearNickname() => clearField(18);
|
||||
|
||||
@$pb.TagNumber(19)
|
||||
$fixnum.Int64 get moodAmount => $_getI64(18);
|
||||
@$pb.TagNumber(19)
|
||||
set moodAmount($fixnum.Int64 v) {
|
||||
$_setInt64(18, v);
|
||||
}
|
||||
|
||||
@$pb.TagNumber(19)
|
||||
$core.bool hasMoodAmount() => $_has(18);
|
||||
@$pb.TagNumber(19)
|
||||
void clearMoodAmount() => clearField(19);
|
||||
}
|
||||
50
lib/models/proto/news.pbjson.dart
Normal file
50
lib/models/proto/news.pbjson.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: news.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name
|
||||
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use newsListResponseProtoDescriptor instead')
|
||||
const NewsListResponseProto$json = const {
|
||||
'1': 'NewsListResponseProto',
|
||||
'2': const [
|
||||
const {'1': 'errno', '3': 1, '4': 1, '5': 5, '10': 'errno'},
|
||||
const {'1': 'errmsg', '3': 2, '4': 1, '5': 9, '10': 'errmsg'},
|
||||
const {'1': 'data', '3': 3, '4': 3, '5': 11, '6': '.NewsListInfoProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NewsListResponseProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List newsListResponseProtoDescriptor = $convert.base64Decode('ChVOZXdzTGlzdFJlc3BvbnNlUHJvdG8SFAoFZXJybm8YASABKAVSBWVycm5vEhYKBmVycm1zZxgCIAEoCVIGZXJybXNnEiYKBGRhdGEYAyADKAsyEi5OZXdzTGlzdEluZm9Qcm90b1IEZGF0YQ==');
|
||||
@$core.Deprecated('Use newsListInfoProtoDescriptor instead')
|
||||
const NewsListInfoProto$json = const {
|
||||
'1': 'NewsListInfoProto',
|
||||
'2': const [
|
||||
const {'1': 'articleId', '3': 1, '4': 1, '5': 3, '10': 'articleId'},
|
||||
const {'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'},
|
||||
const {'1': 'fromName', '3': 3, '4': 1, '5': 9, '10': 'fromName'},
|
||||
const {'1': 'fromUrl', '3': 4, '4': 1, '5': 9, '10': 'fromUrl'},
|
||||
const {'1': 'createTime', '3': 5, '4': 1, '5': 3, '10': 'createTime'},
|
||||
const {'1': 'isForeign', '3': 6, '4': 1, '5': 5, '10': 'isForeign'},
|
||||
const {'1': 'foreignUrl', '3': 7, '4': 1, '5': 9, '10': 'foreignUrl'},
|
||||
const {'1': 'intro', '3': 8, '4': 1, '5': 9, '10': 'intro'},
|
||||
const {'1': 'authorId', '3': 9, '4': 1, '5': 3, '10': 'authorId'},
|
||||
const {'1': 'status', '3': 10, '4': 1, '5': 5, '10': 'status'},
|
||||
const {'1': 'rowPicUrl', '3': 11, '4': 1, '5': 9, '10': 'rowPicUrl'},
|
||||
const {'1': 'colPicUrl', '3': 12, '4': 1, '5': 9, '10': 'colPicUrl'},
|
||||
const {'1': 'qchatShow', '3': 13, '4': 1, '5': 5, '10': 'qchatShow'},
|
||||
const {'1': 'pageUrl', '3': 14, '4': 1, '5': 9, '10': 'pageUrl'},
|
||||
const {'1': 'commentAmount', '3': 15, '4': 1, '5': 3, '10': 'commentAmount'},
|
||||
const {'1': 'authorUid', '3': 16, '4': 1, '5': 3, '10': 'authorUid'},
|
||||
const {'1': 'cover', '3': 17, '4': 1, '5': 9, '10': 'cover'},
|
||||
const {'1': 'nickname', '3': 18, '4': 1, '5': 9, '10': 'nickname'},
|
||||
const {'1': 'moodAmount', '3': 19, '4': 1, '5': 3, '10': 'moodAmount'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NewsListInfoProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List newsListInfoProtoDescriptor = $convert.base64Decode('ChFOZXdzTGlzdEluZm9Qcm90bxIcCglhcnRpY2xlSWQYASABKANSCWFydGljbGVJZBIUCgV0aXRsZRgCIAEoCVIFdGl0bGUSGgoIZnJvbU5hbWUYAyABKAlSCGZyb21OYW1lEhgKB2Zyb21VcmwYBCABKAlSB2Zyb21VcmwSHgoKY3JlYXRlVGltZRgFIAEoA1IKY3JlYXRlVGltZRIcCglpc0ZvcmVpZ24YBiABKAVSCWlzRm9yZWlnbhIeCgpmb3JlaWduVXJsGAcgASgJUgpmb3JlaWduVXJsEhQKBWludHJvGAggASgJUgVpbnRybxIaCghhdXRob3JJZBgJIAEoA1IIYXV0aG9ySWQSFgoGc3RhdHVzGAogASgFUgZzdGF0dXMSHAoJcm93UGljVXJsGAsgASgJUglyb3dQaWNVcmwSHAoJY29sUGljVXJsGAwgASgJUgljb2xQaWNVcmwSHAoJcWNoYXRTaG93GA0gASgFUglxY2hhdFNob3cSGAoHcGFnZVVybBgOIAEoCVIHcGFnZVVybBIkCg1jb21tZW50QW1vdW50GA8gASgDUg1jb21tZW50QW1vdW50EhwKCWF1dGhvclVpZBgQIAEoA1IJYXV0aG9yVWlkEhQKBWNvdmVyGBEgASgJUgVjb3ZlchIaCghuaWNrbmFtZRgSIAEoCVIIbmlja25hbWUSHgoKbW9vZEFtb3VudBgTIAEoA1IKbW9vZEFtb3VudA==');
|
||||
1030
lib/models/proto/novel.pb.dart
Normal file
1030
lib/models/proto/novel.pb.dart
Normal file
File diff suppressed because it is too large
Load Diff
101
lib/models/proto/novel.pbjson.dart
Normal file
101
lib/models/proto/novel.pbjson.dart
Normal file
@@ -0,0 +1,101 @@
|
||||
///
|
||||
// Generated code. Do not modify.
|
||||
// source: novel.proto
|
||||
//
|
||||
// @dart = 2.12
|
||||
// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name
|
||||
|
||||
import 'dart:core' as $core;
|
||||
import 'dart:convert' as $convert;
|
||||
import 'dart:typed_data' as $typed_data;
|
||||
@$core.Deprecated('Use novelChapterDetailProtoDescriptor instead')
|
||||
const NovelChapterDetailProto$json = const {
|
||||
'1': 'NovelChapterDetailProto',
|
||||
'2': const [
|
||||
const {'1': 'chapterId', '3': 1, '4': 1, '5': 3, '10': 'chapterId'},
|
||||
const {'1': 'chapterName', '3': 2, '4': 1, '5': 9, '10': 'chapterName'},
|
||||
const {'1': 'chapterOrder', '3': 3, '4': 1, '5': 5, '10': 'chapterOrder'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NovelChapterDetailProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List novelChapterDetailProtoDescriptor = $convert.base64Decode('ChdOb3ZlbENoYXB0ZXJEZXRhaWxQcm90bxIcCgljaGFwdGVySWQYASABKANSCWNoYXB0ZXJJZBIgCgtjaGFwdGVyTmFtZRgCIAEoCVILY2hhcHRlck5hbWUSIgoMY2hhcHRlck9yZGVyGAMgASgFUgxjaGFwdGVyT3JkZXI=');
|
||||
@$core.Deprecated('Use novelVolumeProtoDescriptor instead')
|
||||
const NovelVolumeProto$json = const {
|
||||
'1': 'NovelVolumeProto',
|
||||
'2': const [
|
||||
const {'1': 'volume_id', '3': 1, '4': 1, '5': 3, '10': 'volumeId'},
|
||||
const {'1': 'lnovel_id', '3': 2, '4': 1, '5': 3, '10': 'lnovelId'},
|
||||
const {'1': 'volume_name', '3': 3, '4': 1, '5': 9, '10': 'volumeName'},
|
||||
const {'1': 'volume_order', '3': 4, '4': 1, '5': 5, '10': 'volumeOrder'},
|
||||
const {'1': 'addtime', '3': 5, '4': 1, '5': 3, '10': 'addtime'},
|
||||
const {'1': 'sum_chapters', '3': 6, '4': 1, '5': 5, '10': 'sumChapters'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NovelVolumeProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List novelVolumeProtoDescriptor = $convert.base64Decode('ChBOb3ZlbFZvbHVtZVByb3RvEhsKCXZvbHVtZV9pZBgBIAEoA1IIdm9sdW1lSWQSGwoJbG5vdmVsX2lkGAIgASgDUghsbm92ZWxJZBIfCgt2b2x1bWVfbmFtZRgDIAEoCVIKdm9sdW1lTmFtZRIhCgx2b2x1bWVfb3JkZXIYBCABKAVSC3ZvbHVtZU9yZGVyEhgKB2FkZHRpbWUYBSABKANSB2FkZHRpbWUSIQoMc3VtX2NoYXB0ZXJzGAYgASgFUgtzdW1DaGFwdGVycw==');
|
||||
@$core.Deprecated('Use novelChapterResponseProtoDescriptor instead')
|
||||
const NovelChapterResponseProto$json = const {
|
||||
'1': 'NovelChapterResponseProto',
|
||||
'2': const [
|
||||
const {'1': 'errno', '3': 1, '4': 1, '5': 5, '10': 'errno'},
|
||||
const {'1': 'errmsg', '3': 2, '4': 1, '5': 9, '10': 'errmsg'},
|
||||
const {'1': 'data', '3': 3, '4': 3, '5': 11, '6': '.NovelVolumeDetailProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NovelChapterResponseProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List novelChapterResponseProtoDescriptor = $convert.base64Decode('ChlOb3ZlbENoYXB0ZXJSZXNwb25zZVByb3RvEhQKBWVycm5vGAEgASgFUgVlcnJubxIWCgZlcnJtc2cYAiABKAlSBmVycm1zZxIrCgRkYXRhGAMgAygLMhcuTm92ZWxWb2x1bWVEZXRhaWxQcm90b1IEZGF0YQ==');
|
||||
@$core.Deprecated('Use novelVolumeDetailProtoDescriptor instead')
|
||||
const NovelVolumeDetailProto$json = const {
|
||||
'1': 'NovelVolumeDetailProto',
|
||||
'2': const [
|
||||
const {'1': 'volume_id', '3': 1, '4': 1, '5': 3, '10': 'volumeId'},
|
||||
const {'1': 'volume_name', '3': 2, '4': 1, '5': 9, '10': 'volumeName'},
|
||||
const {'1': 'volume_order', '3': 3, '4': 1, '5': 5, '10': 'volumeOrder'},
|
||||
const {'1': 'chapters', '3': 4, '4': 3, '5': 11, '6': '.NovelChapterDetailProto', '10': 'chapters'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NovelVolumeDetailProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List novelVolumeDetailProtoDescriptor = $convert.base64Decode('ChZOb3ZlbFZvbHVtZURldGFpbFByb3RvEhsKCXZvbHVtZV9pZBgBIAEoA1IIdm9sdW1lSWQSHwoLdm9sdW1lX25hbWUYAiABKAlSCnZvbHVtZU5hbWUSIQoMdm9sdW1lX29yZGVyGAMgASgFUgt2b2x1bWVPcmRlchI0CghjaGFwdGVycxgEIAMoCzIYLk5vdmVsQ2hhcHRlckRldGFpbFByb3RvUghjaGFwdGVycw==');
|
||||
@$core.Deprecated('Use novelDetailProtoDescriptor instead')
|
||||
const NovelDetailProto$json = const {
|
||||
'1': 'NovelDetailProto',
|
||||
'2': const [
|
||||
const {'1': 'novel_id', '3': 1, '4': 1, '5': 3, '10': 'novelId'},
|
||||
const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
|
||||
const {'1': 'zone', '3': 3, '4': 1, '5': 9, '10': 'zone'},
|
||||
const {'1': 'status', '3': 4, '4': 1, '5': 9, '10': 'status'},
|
||||
const {'1': 'last_update_volume_name', '3': 5, '4': 1, '5': 9, '10': 'lastUpdateVolumeName'},
|
||||
const {'1': 'last_update_chapter_name', '3': 6, '4': 1, '5': 9, '10': 'lastUpdateChapterName'},
|
||||
const {'1': 'last_update_volume_id', '3': 7, '4': 1, '5': 3, '10': 'lastUpdateVolumeId'},
|
||||
const {'1': 'last_update_chapter_id', '3': 8, '4': 1, '5': 3, '10': 'lastUpdateChapterId'},
|
||||
const {'1': 'last_update_time', '3': 9, '4': 1, '5': 3, '10': 'lastUpdateTime'},
|
||||
const {'1': 'cover', '3': 10, '4': 1, '5': 9, '10': 'cover'},
|
||||
const {'1': 'hot_hits', '3': 11, '4': 1, '5': 3, '10': 'hotHits'},
|
||||
const {'1': 'introduction', '3': 12, '4': 1, '5': 9, '10': 'introduction'},
|
||||
const {'1': 'types', '3': 13, '4': 3, '5': 9, '10': 'types'},
|
||||
const {'1': 'authors', '3': 14, '4': 1, '5': 9, '10': 'authors'},
|
||||
const {'1': 'first_letter', '3': 15, '4': 1, '5': 9, '10': 'firstLetter'},
|
||||
const {'1': 'subscribe_num', '3': 16, '4': 1, '5': 3, '10': 'subscribeNum'},
|
||||
const {'1': 'redis_update_time', '3': 17, '4': 1, '5': 3, '10': 'redisUpdateTime'},
|
||||
const {'1': 'volume', '3': 18, '4': 3, '5': 11, '6': '.NovelVolumeProto', '10': 'volume'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NovelDetailProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List novelDetailProtoDescriptor = $convert.base64Decode('ChBOb3ZlbERldGFpbFByb3RvEhkKCG5vdmVsX2lkGAEgASgDUgdub3ZlbElkEhIKBG5hbWUYAiABKAlSBG5hbWUSEgoEem9uZRgDIAEoCVIEem9uZRIWCgZzdGF0dXMYBCABKAlSBnN0YXR1cxI1ChdsYXN0X3VwZGF0ZV92b2x1bWVfbmFtZRgFIAEoCVIUbGFzdFVwZGF0ZVZvbHVtZU5hbWUSNwoYbGFzdF91cGRhdGVfY2hhcHRlcl9uYW1lGAYgASgJUhVsYXN0VXBkYXRlQ2hhcHRlck5hbWUSMQoVbGFzdF91cGRhdGVfdm9sdW1lX2lkGAcgASgDUhJsYXN0VXBkYXRlVm9sdW1lSWQSMwoWbGFzdF91cGRhdGVfY2hhcHRlcl9pZBgIIAEoA1ITbGFzdFVwZGF0ZUNoYXB0ZXJJZBIoChBsYXN0X3VwZGF0ZV90aW1lGAkgASgDUg5sYXN0VXBkYXRlVGltZRIUCgVjb3ZlchgKIAEoCVIFY292ZXISGQoIaG90X2hpdHMYCyABKANSB2hvdEhpdHMSIgoMaW50cm9kdWN0aW9uGAwgASgJUgxpbnRyb2R1Y3Rpb24SFAoFdHlwZXMYDSADKAlSBXR5cGVzEhgKB2F1dGhvcnMYDiABKAlSB2F1dGhvcnMSIQoMZmlyc3RfbGV0dGVyGA8gASgJUgtmaXJzdExldHRlchIjCg1zdWJzY3JpYmVfbnVtGBAgASgDUgxzdWJzY3JpYmVOdW0SKgoRcmVkaXNfdXBkYXRlX3RpbWUYESABKANSD3JlZGlzVXBkYXRlVGltZRIpCgZ2b2x1bWUYEiADKAsyES5Ob3ZlbFZvbHVtZVByb3RvUgZ2b2x1bWU=');
|
||||
@$core.Deprecated('Use novelDetailResponseProtoDescriptor instead')
|
||||
const NovelDetailResponseProto$json = const {
|
||||
'1': 'NovelDetailResponseProto',
|
||||
'2': const [
|
||||
const {'1': 'errno', '3': 1, '4': 1, '5': 5, '10': 'errno'},
|
||||
const {'1': 'errmsg', '3': 2, '4': 1, '5': 9, '10': 'errmsg'},
|
||||
const {'1': 'data', '3': 3, '4': 1, '5': 11, '6': '.NovelDetailProto', '10': 'data'},
|
||||
],
|
||||
};
|
||||
|
||||
/// Descriptor for `NovelDetailResponseProto`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List novelDetailResponseProtoDescriptor = $convert.base64Decode('ChhOb3ZlbERldGFpbFJlc3BvbnNlUHJvdG8SFAoFZXJybm8YASABKAVSBWVycm5vEhYKBmVycm1zZxgCIAEoCVIGZXJybXNnEiUKBGRhdGEYAyABKAsyES5Ob3ZlbERldGFpbFByb3RvUgRkYXRh');
|
||||
34
lib/models/user/bind_status_model.dart
Normal file
34
lib/models/user/bind_status_model.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserBindStatusModel {
|
||||
UserBindStatusModel({
|
||||
required this.isBindTel,
|
||||
required this.isSetPwd,
|
||||
});
|
||||
|
||||
factory UserBindStatusModel.fromJson(Map<String, dynamic> json) =>
|
||||
UserBindStatusModel(
|
||||
isBindTel: asT<int>(json['is_bind_tel'])!,
|
||||
isSetPwd: asT<int>(json['is_set_pwd'])!,
|
||||
);
|
||||
|
||||
int isBindTel;
|
||||
int isSetPwd;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'is_bind_tel': isBindTel,
|
||||
'is_set_pwd': isSetPwd,
|
||||
};
|
||||
}
|
||||
63
lib/models/user/comic_history_model.dart
Normal file
63
lib/models/user/comic_history_model.dart
Normal file
@@ -0,0 +1,63 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserComicHistoryModel {
|
||||
UserComicHistoryModel({
|
||||
this.uid,
|
||||
this.type,
|
||||
required this.comicId,
|
||||
this.chapterId,
|
||||
this.record,
|
||||
this.viewingTime,
|
||||
required this.comicName,
|
||||
required this.cover,
|
||||
this.chapterName,
|
||||
});
|
||||
|
||||
factory UserComicHistoryModel.fromJson(Map<String, dynamic> json) =>
|
||||
// 接口不知道那些可能为空,所以全部变为可空
|
||||
UserComicHistoryModel(
|
||||
uid: asT<int?>(json['uid']) ?? 0,
|
||||
type: asT<int?>(json['type']) ?? 0,
|
||||
comicId: asT<int?>(json['comic_id']) ?? 0,
|
||||
chapterId: asT<int?>(json['chapter_id']) ?? 0,
|
||||
record: asT<int?>(json['record']) ?? 0,
|
||||
viewingTime: asT<int?>(json['viewing_time']) ?? 0,
|
||||
comicName: asT<String?>(json['comic_name']) ?? "未知漫画",
|
||||
cover: asT<String?>(json['cover']) ?? "",
|
||||
chapterName: asT<String?>(json['chapter_name']) ?? "-",
|
||||
);
|
||||
|
||||
int? uid;
|
||||
int? type;
|
||||
int comicId;
|
||||
int? chapterId;
|
||||
int? record;
|
||||
int? viewingTime;
|
||||
String comicName;
|
||||
String cover;
|
||||
String? chapterName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'uid': uid,
|
||||
'type': type,
|
||||
'comic_id': comicId,
|
||||
'chapter_id': chapterId,
|
||||
'record': record,
|
||||
'viewing_time': viewingTime,
|
||||
'comic_name': comicName,
|
||||
'cover': cover,
|
||||
'chapter_name': chapterName,
|
||||
};
|
||||
}
|
||||
54
lib/models/user/login_result_model.dart
Normal file
54
lib/models/user/login_result_model.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class LoginResultModel {
|
||||
LoginResultModel({
|
||||
required this.uid,
|
||||
required this.nickname,
|
||||
required this.token,
|
||||
required this.photo,
|
||||
required this.bindPhone,
|
||||
required this.email,
|
||||
required this.setPasswd,
|
||||
});
|
||||
|
||||
factory LoginResultModel.fromJson(Map<String, dynamic> json) =>
|
||||
LoginResultModel(
|
||||
uid: asT<int>(json['uid'])!,
|
||||
nickname: asT<String>(json['nickname'])!,
|
||||
token: asT<String>(json['token'])!,
|
||||
photo: asT<String>(json['photo'])!,
|
||||
bindPhone: asT<String>(json['bind_phone'])!,
|
||||
email: asT<String>(json['email'])!,
|
||||
setPasswd: asT<int>(json['setPasswd'])!,
|
||||
);
|
||||
|
||||
int uid;
|
||||
String nickname;
|
||||
String token;
|
||||
String photo;
|
||||
String bindPhone;
|
||||
String email;
|
||||
int setPasswd;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'uid': uid,
|
||||
'nickname': nickname,
|
||||
'token': token,
|
||||
'photo': photo,
|
||||
'bind_phone': bindPhone,
|
||||
'email': email,
|
||||
'setPasswd': setPasswd
|
||||
};
|
||||
}
|
||||
75
lib/models/user/novel_history_model.dart
Normal file
75
lib/models/user/novel_history_model.dart
Normal file
@@ -0,0 +1,75 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserNovelHistoryModel {
|
||||
UserNovelHistoryModel({
|
||||
this.uid,
|
||||
this.type,
|
||||
required this.lnovelId,
|
||||
this.volumeId,
|
||||
this.chapterId,
|
||||
this.record,
|
||||
this.viewingTime,
|
||||
this.totalNum,
|
||||
required this.cover,
|
||||
required this.novelName,
|
||||
this.volumeName,
|
||||
this.chapterName,
|
||||
});
|
||||
|
||||
factory UserNovelHistoryModel.fromJson(Map<String, dynamic> json) =>
|
||||
// 接口不知道那些可能为空,所以全部变为可空
|
||||
UserNovelHistoryModel(
|
||||
uid: asT<int?>(json['uid']) ?? 0,
|
||||
type: asT<int?>(json['type']) ?? 0,
|
||||
lnovelId: int.tryParse(json['lnovel_id'].toString()) ?? 0,
|
||||
volumeId: asT<int?>(json['volume_id']) ?? 0,
|
||||
chapterId: asT<int?>(json['chapter_id']) ?? 0,
|
||||
record: asT<int?>(json['record']) ?? 0,
|
||||
viewingTime: asT<int?>(json['viewing_time']) ?? 0,
|
||||
totalNum: asT<int?>(json['total_num']) ?? 0,
|
||||
cover: asT<String?>(json['cover']) ?? "",
|
||||
novelName: asT<String?>(json['novel_name']) ?? "未知小说",
|
||||
volumeName: asT<String?>(json['volume_name']) ?? "-",
|
||||
chapterName: asT<String?>(json['chapter_name']) ?? "-",
|
||||
);
|
||||
|
||||
int? uid;
|
||||
int? type;
|
||||
int lnovelId;
|
||||
int? volumeId;
|
||||
int? chapterId;
|
||||
int? record;
|
||||
int? viewingTime;
|
||||
int? totalNum;
|
||||
String cover;
|
||||
String novelName;
|
||||
String? volumeName;
|
||||
String? chapterName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'uid': uid,
|
||||
'type': type,
|
||||
'lnovel_id': lnovelId,
|
||||
'volume_id': volumeId,
|
||||
'chapter_id': chapterId,
|
||||
'record': record,
|
||||
'viewing_time': viewingTime,
|
||||
'total_num': totalNum,
|
||||
'cover': cover,
|
||||
'novel_name': novelName,
|
||||
'volume_name': volumeName,
|
||||
'chapter_name': chapterName,
|
||||
};
|
||||
}
|
||||
131
lib/models/user/subscribe_comic_model.dart
Normal file
131
lib/models/user/subscribe_comic_model.dart
Normal file
@@ -0,0 +1,131 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserSubscribeComicItemModel {
|
||||
UserSubscribeComicItemModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.cover,
|
||||
required this.subReaded,
|
||||
required this.lastUpdateChapterId,
|
||||
required this.lastUpdateChapterName,
|
||||
required this.comicPy,
|
||||
required this.status,
|
||||
required this.readingRecord,
|
||||
required this.hasNew,
|
||||
});
|
||||
|
||||
factory UserSubscribeComicItemModel.fromJson(Map<String, dynamic> json) =>
|
||||
UserSubscribeComicItemModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
cover: asT<String>(json['cover'])!,
|
||||
subReaded: asT<int>(json['sub_readed'])!,
|
||||
lastUpdateChapterId: asT<int>(json['last_update_chapter_id'])!,
|
||||
lastUpdateChapterName: asT<String>(json['last_update_chapter_name'])!,
|
||||
comicPy: asT<String>(json['comic_py'])!,
|
||||
status: asT<String>(json['status'])!,
|
||||
readingRecord: ReadingRecord.fromJson(
|
||||
asT<Map<String, dynamic>>(json['readingRecord'])!),
|
||||
hasNew: (asT<int>(json['sub_readed']) == 0).obs,
|
||||
);
|
||||
|
||||
int id;
|
||||
String title;
|
||||
String cover;
|
||||
int subReaded;
|
||||
int lastUpdateChapterId;
|
||||
String lastUpdateChapterName;
|
||||
String comicPy;
|
||||
String status;
|
||||
ReadingRecord readingRecord;
|
||||
|
||||
var isChecked = false.obs;
|
||||
var hasNew = false.obs;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'cover': cover,
|
||||
'sub_readed': subReaded,
|
||||
'last_update_chapter_id': lastUpdateChapterId,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'comic_py': comicPy,
|
||||
'status': status,
|
||||
'readingRecord': readingRecord,
|
||||
};
|
||||
}
|
||||
|
||||
class ReadingRecord {
|
||||
ReadingRecord({
|
||||
required this.typeName,
|
||||
required this.uid,
|
||||
required this.source,
|
||||
required this.bizId,
|
||||
required this.chapterId,
|
||||
required this.viewingTime,
|
||||
required this.record,
|
||||
required this.volumeId,
|
||||
required this.totalNum,
|
||||
required this.chapterName,
|
||||
required this.volumeName,
|
||||
});
|
||||
|
||||
factory ReadingRecord.fromJson(Map<String, dynamic> json) => ReadingRecord(
|
||||
typeName: asT<String>(json['type_name'])!,
|
||||
uid: asT<int>(json['uid'])!,
|
||||
source: asT<int>(json['source'])!,
|
||||
bizId: asT<int>(json['biz_id'])!,
|
||||
chapterId: asT<int>(json['chapter_id'])!,
|
||||
viewingTime: asT<int>(json['viewing_time'])!,
|
||||
record: asT<int>(json['record'])!,
|
||||
volumeId: asT<int>(json['volume_id'])!,
|
||||
totalNum: asT<int>(json['total_num'])!,
|
||||
chapterName: asT<String>(json['chapter_name'])!,
|
||||
volumeName: asT<String>(json['volume_name'])!,
|
||||
);
|
||||
|
||||
String typeName;
|
||||
int uid;
|
||||
int source;
|
||||
int bizId;
|
||||
int chapterId;
|
||||
int viewingTime;
|
||||
int record;
|
||||
int volumeId;
|
||||
int totalNum;
|
||||
String chapterName;
|
||||
String volumeName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'type_name': typeName,
|
||||
'uid': uid,
|
||||
'source': source,
|
||||
'biz_id': bizId,
|
||||
'chapter_id': chapterId,
|
||||
'viewing_time': viewingTime,
|
||||
'record': record,
|
||||
'volume_id': volumeId,
|
||||
'total_num': totalNum,
|
||||
'chapter_name': chapterName,
|
||||
'volume_name': volumeName,
|
||||
};
|
||||
}
|
||||
78
lib/models/user/subscribe_news_model.dart
Normal file
78
lib/models/user/subscribe_news_model.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserSubscribeNewsModel {
|
||||
UserSubscribeNewsModel({
|
||||
required this.subId,
|
||||
required this.subTime,
|
||||
required this.title,
|
||||
required this.authorId,
|
||||
required this.rowPicUrl,
|
||||
required this.colPicUrl,
|
||||
required this.isForeign,
|
||||
required this.foreignUrl,
|
||||
required this.userPhoto,
|
||||
required this.userNickname,
|
||||
required this.pageUrl,
|
||||
required this.commentAmount,
|
||||
required this.moodAmount,
|
||||
});
|
||||
|
||||
factory UserSubscribeNewsModel.fromJson(Map<String, dynamic> json) =>
|
||||
UserSubscribeNewsModel(
|
||||
subId: asT<int>(json['sub_id'])!,
|
||||
subTime: asT<int>(json['sub_time'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
authorId: asT<int>(json['author_id'])!,
|
||||
rowPicUrl: asT<String>(json['row_pic_url'])!,
|
||||
colPicUrl: asT<String>(json['col_pic_url'])!,
|
||||
isForeign: asT<int>(json['is_foreign'])!,
|
||||
foreignUrl: asT<String>(json['foreign_url'])!,
|
||||
userPhoto: asT<String>(json['user_photo'])!,
|
||||
userNickname: asT<String>(json['user_nickname'])!,
|
||||
pageUrl: asT<String>(json['page_url'])!,
|
||||
commentAmount: int.tryParse(json['comment_amount'].toString()) ?? 0,
|
||||
moodAmount: int.tryParse(json['mood_amount'].toString()) ?? 0,
|
||||
);
|
||||
|
||||
int subId;
|
||||
int subTime;
|
||||
String title;
|
||||
int authorId;
|
||||
String rowPicUrl;
|
||||
String colPicUrl;
|
||||
int isForeign;
|
||||
String foreignUrl;
|
||||
String userPhoto;
|
||||
String userNickname;
|
||||
String pageUrl;
|
||||
int commentAmount;
|
||||
int moodAmount;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'sub_id': subId,
|
||||
'sub_time': subTime,
|
||||
'title': title,
|
||||
'author_id': authorId,
|
||||
'row_pic_url': rowPicUrl,
|
||||
'col_pic_url': colPicUrl,
|
||||
'is_foreign': isForeign,
|
||||
'foreign_url': foreignUrl,
|
||||
'user_photo': userPhoto,
|
||||
'user_nickname': userNickname,
|
||||
'page_url': pageUrl,
|
||||
'comment_amount': commentAmount,
|
||||
'mood_amount': moodAmount,
|
||||
};
|
||||
}
|
||||
133
lib/models/user/subscribe_novel_model.dart
Normal file
133
lib/models/user/subscribe_novel_model.dart
Normal file
@@ -0,0 +1,133 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserSubscribeNovelModel {
|
||||
UserSubscribeNovelModel({
|
||||
required this.id,
|
||||
required this.title,
|
||||
this.cover,
|
||||
this.subReaded,
|
||||
this.lastUpdateChapterId,
|
||||
this.lastUpdateChapterName,
|
||||
this.comicPy,
|
||||
this.status,
|
||||
required this.readingRecord,
|
||||
required this.hasNew,
|
||||
});
|
||||
|
||||
factory UserSubscribeNovelModel.fromJson(Map<String, dynamic> json) =>
|
||||
UserSubscribeNovelModel(
|
||||
id: asT<int>(json['id'])!,
|
||||
title: asT<String>(json['title'])!,
|
||||
cover: asT<String?>(json['cover']),
|
||||
subReaded: asT<int?>(json['sub_readed']),
|
||||
lastUpdateChapterId: asT<int?>(json['last_update_chapter_id']),
|
||||
lastUpdateChapterName: asT<String?>(json['last_update_chapter_name']),
|
||||
comicPy: asT<String?>(json['comic_py']),
|
||||
status: asT<String?>(json['status']),
|
||||
readingRecord: UserSubscribeNovelReadingRecordModel.fromJson(
|
||||
asT<Map<String, dynamic>>(json['readingRecord'])!),
|
||||
hasNew: (asT<int>(json['sub_readed']) == 0).obs,
|
||||
);
|
||||
|
||||
int id;
|
||||
String title;
|
||||
String? cover;
|
||||
int? subReaded;
|
||||
int? lastUpdateChapterId;
|
||||
String? lastUpdateChapterName;
|
||||
String? comicPy;
|
||||
String? status;
|
||||
UserSubscribeNovelReadingRecordModel readingRecord;
|
||||
|
||||
var isChecked = false.obs;
|
||||
var hasNew = false.obs;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'id': id,
|
||||
'title': title,
|
||||
'cover': cover,
|
||||
'sub_readed': subReaded,
|
||||
'last_update_chapter_id': lastUpdateChapterId,
|
||||
'last_update_chapter_name': lastUpdateChapterName,
|
||||
'comic_py': comicPy,
|
||||
'status': status,
|
||||
'readingRecord': readingRecord,
|
||||
};
|
||||
}
|
||||
|
||||
class UserSubscribeNovelReadingRecordModel {
|
||||
UserSubscribeNovelReadingRecordModel({
|
||||
this.typeName,
|
||||
this.uid,
|
||||
this.source,
|
||||
this.bizId,
|
||||
this.chapterId,
|
||||
this.viewingTime,
|
||||
this.record,
|
||||
this.volumeId,
|
||||
this.totalNum,
|
||||
this.chapterName,
|
||||
this.volumeName,
|
||||
});
|
||||
|
||||
factory UserSubscribeNovelReadingRecordModel.fromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
UserSubscribeNovelReadingRecordModel(
|
||||
typeName: asT<String?>(json['type_name']),
|
||||
uid: asT<int?>(json['uid']),
|
||||
source: asT<int?>(json['source']),
|
||||
bizId: asT<int?>(json['biz_id']),
|
||||
chapterId: asT<int?>(json['chapter_id']),
|
||||
viewingTime: asT<int?>(json['viewing_time']),
|
||||
record: asT<int?>(json['record']),
|
||||
volumeId: asT<int?>(json['volume_id']),
|
||||
totalNum: asT<int?>(json['total_num']),
|
||||
chapterName: asT<String?>(json['chapter_name']),
|
||||
volumeName: asT<String?>(json['volume_name']),
|
||||
);
|
||||
|
||||
String? typeName;
|
||||
int? uid;
|
||||
int? source;
|
||||
int? bizId;
|
||||
int? chapterId;
|
||||
int? viewingTime;
|
||||
int? record;
|
||||
int? volumeId;
|
||||
int? totalNum;
|
||||
String? chapterName;
|
||||
String? volumeName;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'type_name': typeName,
|
||||
'uid': uid,
|
||||
'source': source,
|
||||
'biz_id': bizId,
|
||||
'chapter_id': chapterId,
|
||||
'viewing_time': viewingTime,
|
||||
'record': record,
|
||||
'volume_id': volumeId,
|
||||
'total_num': totalNum,
|
||||
'chapter_name': chapterName,
|
||||
'volume_name': volumeName,
|
||||
};
|
||||
}
|
||||
298
lib/models/user/user_profile_model.dart
Normal file
298
lib/models/user/user_profile_model.dart
Normal file
@@ -0,0 +1,298 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class UserProfileModel {
|
||||
UserProfileModel({
|
||||
required this.nickname,
|
||||
this.description,
|
||||
this.birthday,
|
||||
this.sex,
|
||||
this.cover,
|
||||
this.blood,
|
||||
this.constellation,
|
||||
this.bindPhone,
|
||||
this.email,
|
||||
this.channel,
|
||||
this.channelid,
|
||||
this.isVerify,
|
||||
this.status,
|
||||
this.reason,
|
||||
this.submitLogout,
|
||||
this.userDelInfo,
|
||||
this.ip,
|
||||
this.ipRegion,
|
||||
this.isModifyName,
|
||||
this.data,
|
||||
this.amount,
|
||||
this.isSetPwd,
|
||||
this.bind,
|
||||
this.userfeeinfo,
|
||||
this.userLevel,
|
||||
this.cookieVal,
|
||||
this.isBbsAdmin,
|
||||
});
|
||||
|
||||
factory UserProfileModel.fromJson(Map<String, dynamic> json) {
|
||||
final List<Object>? data = json['data'] is List ? <Object>[] : null;
|
||||
if (data != null) {
|
||||
for (final dynamic item in json['data']!) {
|
||||
if (item != null) {
|
||||
data.add(asT<Object>(item)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final List<UserPorfileBindModel>? bind =
|
||||
json['bind'] is List ? <UserPorfileBindModel>[] : null;
|
||||
if (bind != null) {
|
||||
for (final dynamic item in json['bind']!) {
|
||||
if (item != null) {
|
||||
bind.add(
|
||||
UserPorfileBindModel.fromJson(asT<Map<String, dynamic>>(item)!));
|
||||
}
|
||||
}
|
||||
}
|
||||
return UserProfileModel(
|
||||
nickname: asT<String>(json['nickname'])!,
|
||||
description: asT<String?>(json['description']),
|
||||
birthday: asT<String?>(json['birthday']),
|
||||
sex: asT<int?>(json['sex']),
|
||||
cover: asT<String?>(json['cover']),
|
||||
blood: asT<int?>(json['blood']),
|
||||
constellation: asT<String?>(json['constellation']),
|
||||
bindPhone: asT<String?>(json['bind_phone']),
|
||||
email: asT<String?>(json['email']),
|
||||
channel: asT<String?>(json['channel']),
|
||||
channelid: asT<String?>(json['channelid']),
|
||||
isVerify: asT<int?>(json['is_verify']),
|
||||
status: asT<int?>(json['status']),
|
||||
reason: asT<String?>(json['reason']),
|
||||
submitLogout: asT<bool?>(json['submit_logout']),
|
||||
userDelInfo: json['user_del_info'] == null
|
||||
? null
|
||||
: UserDelInfoModel.fromJson(
|
||||
asT<Map<String, dynamic>>(json['user_del_info'])!),
|
||||
ip: asT<String?>(json['ip']),
|
||||
ipRegion: json['ip_region'] == null
|
||||
? null
|
||||
: UserIpRegionModel.fromJson(
|
||||
asT<Map<String, dynamic>>(json['ip_region'])!),
|
||||
isModifyName: asT<int?>(json['is_modify_name']),
|
||||
data: data,
|
||||
amount: asT<int?>(json['amount']),
|
||||
isSetPwd: asT<int?>(json['is_set_pwd']),
|
||||
bind: bind,
|
||||
userfeeinfo: json['userFeeInfo'] == null
|
||||
? null
|
||||
: UserfeeInfo.fromJson(
|
||||
asT<Map<String, dynamic>>(json['userFeeInfo'])!),
|
||||
userLevel: asT<String?>(json['user_level']),
|
||||
cookieVal: asT<String?>(json['cookie_val']),
|
||||
isBbsAdmin: asT<int?>(json['is_bbs_admin']),
|
||||
);
|
||||
}
|
||||
|
||||
String nickname;
|
||||
String? description;
|
||||
String? birthday;
|
||||
int? sex;
|
||||
String? cover;
|
||||
int? blood;
|
||||
String? constellation;
|
||||
String? bindPhone;
|
||||
String? email;
|
||||
String? channel;
|
||||
String? channelid;
|
||||
int? isVerify;
|
||||
int? status;
|
||||
String? reason;
|
||||
bool? submitLogout;
|
||||
UserDelInfoModel? userDelInfo;
|
||||
String? ip;
|
||||
UserIpRegionModel? ipRegion;
|
||||
int? isModifyName;
|
||||
List<Object>? data;
|
||||
int? amount;
|
||||
int? isSetPwd;
|
||||
List<UserPorfileBindModel>? bind;
|
||||
UserfeeInfo? userfeeinfo;
|
||||
String? userLevel;
|
||||
String? cookieVal;
|
||||
int? isBbsAdmin;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'nickname': nickname,
|
||||
'description': description,
|
||||
'birthday': birthday,
|
||||
'sex': sex,
|
||||
'cover': cover,
|
||||
'blood': blood,
|
||||
'constellation': constellation,
|
||||
'bind_phone': bindPhone,
|
||||
'email': email,
|
||||
'channel': channel,
|
||||
'channelid': channelid,
|
||||
'is_verify': isVerify,
|
||||
'status': status,
|
||||
'reason': reason,
|
||||
'submit_logout': submitLogout,
|
||||
'user_del_info': userDelInfo,
|
||||
'ip': ip,
|
||||
'ip_region': ipRegion,
|
||||
'is_modify_name': isModifyName,
|
||||
'data': data,
|
||||
'amount': amount,
|
||||
'is_set_pwd': isSetPwd,
|
||||
'bind': bind,
|
||||
'userFeeInfo': userfeeinfo,
|
||||
'user_level': userLevel,
|
||||
'cookie_val': cookieVal,
|
||||
'is_bbs_admin': isBbsAdmin,
|
||||
};
|
||||
}
|
||||
|
||||
class UserDelInfoModel {
|
||||
UserDelInfoModel({
|
||||
this.uid,
|
||||
this.logoutId,
|
||||
this.status,
|
||||
this.subTime,
|
||||
this.cancelTime,
|
||||
this.cancelUserType,
|
||||
this.currentTime,
|
||||
});
|
||||
|
||||
factory UserDelInfoModel.fromJson(Map<String, dynamic> json) =>
|
||||
UserDelInfoModel(
|
||||
uid: asT<int?>(json['uid']),
|
||||
logoutId: asT<int?>(json['logout_id']),
|
||||
status: asT<int?>(json['status']),
|
||||
subTime: asT<int?>(json['sub_time']),
|
||||
cancelTime: asT<int?>(json['cancel_time']),
|
||||
cancelUserType: asT<int?>(json['cancel_user_type']),
|
||||
currentTime: asT<int?>(json['current_time']),
|
||||
);
|
||||
|
||||
int? uid;
|
||||
int? logoutId;
|
||||
int? status;
|
||||
int? subTime;
|
||||
int? cancelTime;
|
||||
int? cancelUserType;
|
||||
int? currentTime;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'uid': uid,
|
||||
'logout_id': logoutId,
|
||||
'status': status,
|
||||
'sub_time': subTime,
|
||||
'cancel_time': cancelTime,
|
||||
'cancel_user_type': cancelUserType,
|
||||
'current_time': currentTime,
|
||||
};
|
||||
}
|
||||
|
||||
class UserIpRegionModel {
|
||||
UserIpRegionModel({
|
||||
this.country,
|
||||
this.province,
|
||||
this.city,
|
||||
this.provider,
|
||||
});
|
||||
|
||||
factory UserIpRegionModel.fromJson(Map<String, dynamic> json) =>
|
||||
UserIpRegionModel(
|
||||
country: asT<String?>(json['country']),
|
||||
province: asT<String?>(json['province']),
|
||||
city: asT<String?>(json['city']),
|
||||
provider: asT<String?>(json['provider']),
|
||||
);
|
||||
|
||||
String? country;
|
||||
String? province;
|
||||
String? city;
|
||||
String? provider;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'country': country,
|
||||
'province': province,
|
||||
'city': city,
|
||||
'provider': provider,
|
||||
};
|
||||
}
|
||||
|
||||
class UserPorfileBindModel {
|
||||
UserPorfileBindModel({
|
||||
this.type,
|
||||
this.name,
|
||||
});
|
||||
|
||||
factory UserPorfileBindModel.fromJson(Map<String, dynamic> json) =>
|
||||
UserPorfileBindModel(
|
||||
type: asT<String?>(json['type']),
|
||||
name: asT<String?>(json['name']),
|
||||
);
|
||||
|
||||
String? type;
|
||||
String? name;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'type': type,
|
||||
'name': name,
|
||||
};
|
||||
}
|
||||
|
||||
class UserfeeInfo {
|
||||
UserfeeInfo({
|
||||
this.mCate,
|
||||
this.mPeriod,
|
||||
});
|
||||
|
||||
factory UserfeeInfo.fromJson(Map<String, dynamic> json) => UserfeeInfo(
|
||||
mCate: asT<int?>(json['m_cate']),
|
||||
mPeriod: asT<int?>(json['m_period']),
|
||||
);
|
||||
|
||||
int? mCate;
|
||||
int? mPeriod;
|
||||
|
||||
bool get isVip => (mCate ?? 0) > 0;
|
||||
DateTime get expiresTime =>
|
||||
DateTime.fromMillisecondsSinceEpoch((mPeriod ?? 0) * 1000);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'm_cate': mCate,
|
||||
'm_period': mPeriod,
|
||||
};
|
||||
}
|
||||
41
lib/models/version_model.dart
Normal file
41
lib/models/version_model.dart
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'dart:convert';
|
||||
|
||||
T? asT<T>(dynamic value) {
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
class VersionModel {
|
||||
VersionModel({
|
||||
required this.version,
|
||||
required this.versionNum,
|
||||
required this.versionDesc,
|
||||
required this.downloadUrl,
|
||||
});
|
||||
|
||||
factory VersionModel.fromJson(Map<String, dynamic> json) => VersionModel(
|
||||
version: asT<String>(json['version'])!,
|
||||
versionNum: asT<int>(json['version_num'])!,
|
||||
versionDesc: asT<String>(json['version_desc'])!,
|
||||
downloadUrl: asT<String>(json['download_url'])!,
|
||||
);
|
||||
|
||||
String version;
|
||||
int versionNum;
|
||||
String versionDesc;
|
||||
String downloadUrl;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return jsonEncode(this);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => <String, dynamic>{
|
||||
'version': version,
|
||||
'version_num': versionNum,
|
||||
'version_desc': versionDesc,
|
||||
'download_url': downloadUrl,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user