mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 20:16:26 +08:00
11
lib/models_new/dynamic/dyn_topic_feed/all_sort_by.dart
Normal file
11
lib/models_new/dynamic/dyn_topic_feed/all_sort_by.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class AllSortBy {
|
||||
int? sortBy;
|
||||
String? sortName;
|
||||
|
||||
AllSortBy({this.sortBy, this.sortName});
|
||||
|
||||
factory AllSortBy.fromJson(Map<String, dynamic> json) => AllSortBy(
|
||||
sortBy: json['sort_by'] as int?,
|
||||
sortName: json['sort_name'] as String?,
|
||||
);
|
||||
}
|
||||
16
lib/models_new/dynamic/dyn_topic_feed/item.dart
Normal file
16
lib/models_new/dynamic/dyn_topic_feed/item.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
|
||||
class TopicCardItem {
|
||||
DynamicItemModel? dynamicCardItem;
|
||||
String? topicType;
|
||||
|
||||
TopicCardItem({this.dynamicCardItem, this.topicType});
|
||||
|
||||
factory TopicCardItem.fromJson(Map<String, dynamic> json) => TopicCardItem(
|
||||
dynamicCardItem: json['dynamic_card_item'] == null
|
||||
? null
|
||||
: DynamicItemModel.fromJson(
|
||||
json['dynamic_card_item'] as Map<String, dynamic>),
|
||||
topicType: json['topic_type'] as String?,
|
||||
);
|
||||
}
|
||||
28
lib/models_new/dynamic/dyn_topic_feed/topic_card_list.dart
Normal file
28
lib/models_new/dynamic/dyn_topic_feed/topic_card_list.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_feed/item.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_feed/topic_sort_by_conf.dart';
|
||||
|
||||
class TopicCardList {
|
||||
bool? hasMore;
|
||||
List<TopicCardItem>? items;
|
||||
String? offset;
|
||||
TopicSortByConf? topicSortByConf;
|
||||
|
||||
TopicCardList({
|
||||
this.hasMore,
|
||||
this.items,
|
||||
this.offset,
|
||||
this.topicSortByConf,
|
||||
});
|
||||
|
||||
factory TopicCardList.fromJson(Map<String, dynamic> json) => TopicCardList(
|
||||
hasMore: json['has_more'] as bool?,
|
||||
items: (json['items'] as List<dynamic>?)
|
||||
?.map((e) => TopicCardItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
offset: json['offset'] as String?,
|
||||
topicSortByConf: json['topic_sort_by_conf'] == null
|
||||
? null
|
||||
: TopicSortByConf.fromJson(
|
||||
json['topic_sort_by_conf'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_feed/all_sort_by.dart';
|
||||
|
||||
class TopicSortByConf {
|
||||
List<AllSortBy>? allSortBy;
|
||||
int? defaultSortBy;
|
||||
int? showSortBy;
|
||||
|
||||
TopicSortByConf({this.allSortBy, this.defaultSortBy, this.showSortBy});
|
||||
|
||||
factory TopicSortByConf.fromJson(Map<String, dynamic> json) {
|
||||
return TopicSortByConf(
|
||||
allSortBy: (json['all_sort_by'] as List<dynamic>?)
|
||||
?.map((e) => AllSortBy.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
defaultSortBy: json['default_sort_by'] as int?,
|
||||
showSortBy: json['show_sort_by'] as int?,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user