mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-27 22:05:53 +08:00
13
lib/models_new/fav/fav_topic/data.dart
Normal file
13
lib/models_new/fav/fav_topic/data.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:PiliPlus/models_new/fav/fav_topic/topic_list.dart';
|
||||
|
||||
class FavTopicData {
|
||||
TopicList? topicList;
|
||||
|
||||
FavTopicData({this.topicList});
|
||||
|
||||
factory FavTopicData.fromJson(Map<String, dynamic> json) => FavTopicData(
|
||||
topicList: json['topic_list'] == null
|
||||
? null
|
||||
: TopicList.fromJson(json['topic_list'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
11
lib/models_new/fav/fav_topic/page_info.dart
Normal file
11
lib/models_new/fav/fav_topic/page_info.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class PageInfo {
|
||||
int? curPageNum;
|
||||
int? total;
|
||||
|
||||
PageInfo({this.curPageNum, this.total});
|
||||
|
||||
factory PageInfo.fromJson(Map<String, dynamic> json) => PageInfo(
|
||||
curPageNum: json['cur_page_num'] as int?,
|
||||
total: json['total'] as int?,
|
||||
);
|
||||
}
|
||||
29
lib/models_new/fav/fav_topic/topic_item.dart
Normal file
29
lib/models_new/fav/fav_topic/topic_item.dart
Normal file
@@ -0,0 +1,29 @@
|
||||
class FavTopicItem {
|
||||
int? id;
|
||||
String? name;
|
||||
int? view;
|
||||
int? discuss;
|
||||
String? jumpUrl;
|
||||
String? statDesc;
|
||||
bool? showInteractData;
|
||||
|
||||
FavTopicItem({
|
||||
this.id,
|
||||
this.name,
|
||||
this.view,
|
||||
this.discuss,
|
||||
this.jumpUrl,
|
||||
this.statDesc,
|
||||
this.showInteractData,
|
||||
});
|
||||
|
||||
factory FavTopicItem.fromJson(Map<String, dynamic> json) => FavTopicItem(
|
||||
id: json['id'] as int?,
|
||||
name: json['name'] as String?,
|
||||
view: json['view'] as int?,
|
||||
discuss: json['discuss'] as int?,
|
||||
jumpUrl: json['jump_url'] as String?,
|
||||
statDesc: json['stat_desc'] as String?,
|
||||
showInteractData: json['show_interact_data'] as bool?,
|
||||
);
|
||||
}
|
||||
18
lib/models_new/fav/fav_topic/topic_list.dart
Normal file
18
lib/models_new/fav/fav_topic/topic_list.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:PiliPlus/models_new/fav/fav_topic/page_info.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_topic/topic_item.dart';
|
||||
|
||||
class TopicList {
|
||||
List<FavTopicItem>? topicItems;
|
||||
PageInfo? pageInfo;
|
||||
|
||||
TopicList({this.topicItems, this.pageInfo});
|
||||
|
||||
factory TopicList.fromJson(Map<String, dynamic> json) => TopicList(
|
||||
topicItems: (json['topic_items'] as List<dynamic>?)
|
||||
?.map((e) => FavTopicItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
pageInfo: json['page_info'] == null
|
||||
? null
|
||||
: PageInfo.fromJson(json['page_info'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user