v1.0.1
This commit is contained in:
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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user