mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-17 23:56:13 +08:00
opt pub panel
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
34
lib/models/topic_pub_search/data.dart
Normal file
34
lib/models/topic_pub_search/data.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:PiliPlus/models/topic_pub_search/new_topic.dart';
|
||||
import 'package:PiliPlus/models/topic_pub_search/page_info.dart';
|
||||
import 'package:PiliPlus/models/topic_pub_search/topic_item.dart';
|
||||
|
||||
class TopicPubSearchData {
|
||||
NewTopic? newTopic;
|
||||
bool? hasCreateJurisdiction;
|
||||
List<TopicPubSearchItem>? topicItems;
|
||||
String? requestId;
|
||||
PageInfo? pageInfo;
|
||||
|
||||
TopicPubSearchData({
|
||||
this.newTopic,
|
||||
this.hasCreateJurisdiction,
|
||||
this.topicItems,
|
||||
this.requestId,
|
||||
this.pageInfo,
|
||||
});
|
||||
|
||||
factory TopicPubSearchData.fromJson(Map<String, dynamic> json) =>
|
||||
TopicPubSearchData(
|
||||
newTopic: json['new_topic'] == null
|
||||
? null
|
||||
: NewTopic.fromJson(json['new_topic'] as Map<String, dynamic>),
|
||||
hasCreateJurisdiction: json['has_create_jurisdiction'] as bool?,
|
||||
topicItems: (json['topic_items'] as List<dynamic>?)
|
||||
?.map((e) => TopicPubSearchItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
requestId: json['request_id'] as String?,
|
||||
pageInfo: json['page_info'] == null
|
||||
? null
|
||||
: PageInfo.fromJson(json['page_info'] as Map<String, dynamic>),
|
||||
);
|
||||
}
|
||||
9
lib/models/topic_pub_search/new_topic.dart
Normal file
9
lib/models/topic_pub_search/new_topic.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
class NewTopic {
|
||||
String? name;
|
||||
|
||||
NewTopic({this.name});
|
||||
|
||||
factory NewTopic.fromJson(Map<String, dynamic> json) => NewTopic(
|
||||
name: json['name'] as String?,
|
||||
);
|
||||
}
|
||||
11
lib/models/topic_pub_search/page_info.dart
Normal file
11
lib/models/topic_pub_search/page_info.dart
Normal file
@@ -0,0 +1,11 @@
|
||||
class PageInfo {
|
||||
int? offset;
|
||||
bool? hasMore;
|
||||
|
||||
PageInfo({this.offset, this.hasMore});
|
||||
|
||||
factory PageInfo.fromJson(Map<String, dynamic> json) => PageInfo(
|
||||
offset: json['offset'] as int?,
|
||||
hasMore: json['has_more'] as bool?,
|
||||
);
|
||||
}
|
||||
30
lib/models/topic_pub_search/topic_item.dart
Normal file
30
lib/models/topic_pub_search/topic_item.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
class TopicPubSearchItem {
|
||||
int? id;
|
||||
String? name;
|
||||
int? view;
|
||||
int? discuss;
|
||||
String? statDesc;
|
||||
String? description;
|
||||
bool? showInteractData;
|
||||
|
||||
TopicPubSearchItem({
|
||||
this.id,
|
||||
this.name,
|
||||
this.view,
|
||||
this.discuss,
|
||||
this.statDesc,
|
||||
this.description,
|
||||
this.showInteractData,
|
||||
});
|
||||
|
||||
factory TopicPubSearchItem.fromJson(Map<String, dynamic> json) =>
|
||||
TopicPubSearchItem(
|
||||
id: json['id'] as int?,
|
||||
name: json['name'] as String?,
|
||||
view: json['view'] as int?,
|
||||
discuss: json['discuss'] as int?,
|
||||
statDesc: json['stat_desc'] as String?,
|
||||
description: json['description'] as String?,
|
||||
showInteractData: json['show_interact_data'] as bool?,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user