clean up models

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-05 12:10:18 +08:00
parent b897103af0
commit 279f21857d
308 changed files with 156 additions and 6243 deletions

View File

@@ -2,14 +2,12 @@ import 'package:PiliPlus/models_new/dynamic/dyn_mention/item.dart';
class MentionGroup {
String? groupName;
int? groupType;
List<MentionItem>? items;
MentionGroup({this.groupName, this.groupType, this.items});
MentionGroup({this.groupName, this.items});
factory MentionGroup.fromJson(Map<String, dynamic> json) => MentionGroup(
groupName: json['group_name'] as String?,
groupType: json['group_type'] as int?,
items: (json['items'] as List<dynamic>?)
?.map((e) => MentionItem.fromJson(e as Map<String, dynamic>))
.toList(),

View File

@@ -4,14 +4,12 @@ class MentionItem with MultiSelectData {
final String? face;
final int? fans;
final String? name;
final int? officialVerifyType;
final String? uid;
MentionItem({
this.face,
this.fans,
this.name,
this.officialVerifyType,
this.uid,
});
@@ -19,7 +17,6 @@ class MentionItem with MultiSelectData {
face: json['face'] as String?,
fans: json['fans'] as int?,
name: json['name'] as String?,
officialVerifyType: json['official_verify_type'] as int?,
uid: json['uid'] as String?,
);

View File

@@ -1,23 +1,17 @@
class DynReserveData {
int? finalBtnStatus;
int? btnMode;
int? reserveUpdate;
String? descUpdate;
String? toast;
DynReserveData({
this.finalBtnStatus,
this.btnMode,
this.reserveUpdate,
this.descUpdate,
this.toast,
});
factory DynReserveData.fromJson(Map<String, dynamic> json) => DynReserveData(
finalBtnStatus: json['final_btn_status'] as int?,
btnMode: json['btn_mode'] as int?,
reserveUpdate: json['reserve_update'] as int?,
descUpdate: json['desc_update'] as String?,
toast: json['toast'] as String?,
);
}

View File

@@ -1,48 +1,18 @@
class ReserveInfoData {
int? id;
String? title;
int? stime;
int? etime;
int? type;
int? livePlanStartTime;
int? lotteryType;
String? lotteryId;
int? subType;
ReserveInfoData({
this.id,
this.title,
this.stime,
this.etime,
this.type,
this.livePlanStartTime,
this.lotteryType,
this.lotteryId,
this.subType,
});
factory ReserveInfoData.fromJson(Map<String, dynamic> json) =>
ReserveInfoData(
id: json['id'] as int?,
title: json['title'] as String?,
stime: json['stime'] as int?,
etime: json['etime'] as int?,
type: json['type'] as int?,
livePlanStartTime: json['live_plan_start_time'] as int?,
lotteryType: json['lottery_type'] as int?,
lotteryId: json['lottery_id'] as String?,
subType: json['sub_type'] as int?,
);
Map<String, dynamic> toJson() => {
'id': id,
'title': title,
'stime': stime,
'etime': etime,
'type': type,
'live_plan_start_time': livePlanStartTime,
'lottery_type': lotteryType,
'lottery_id': lotteryId,
'sub_type': subType,
};
}

View File

@@ -2,17 +2,15 @@ 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});
TopicSortByConf({this.allSortBy, 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?,
);
}

View File

@@ -1,32 +1,20 @@
import 'package:PiliPlus/models_new/dynamic/dyn_topic_pub_search/new_topic.dart';
import 'package:PiliPlus/models_new/dynamic/dyn_topic_pub_search/page_info.dart';
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/topic_item.dart';
class TopicPubSearchData {
NewTopic? newTopic;
bool? hasCreateJurisdiction;
List<TopicItem>? 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) => TopicItem.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>),

View File

@@ -1,9 +0,0 @@
class NewTopic {
String? name;
NewTopic({this.name});
factory NewTopic.fromJson(Map<String, dynamic> json) => NewTopic(
name: json['name'] as String?,
);
}

View File

@@ -1,11 +1,9 @@
class PageInfo {
int? offset;
bool? hasMore;
PageInfo({this.offset, this.hasMore});
PageInfo({this.hasMore});
factory PageInfo.fromJson(Map<String, dynamic> json) => PageInfo(
offset: json['offset'] as int?,
hasMore: json['has_more'] as bool?,
);
}

View File

@@ -4,16 +4,10 @@ import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/topic_item.dart';
class TopDetails {
TopicItem? topicItem;
TopicCreator? topicCreator;
bool? hasCreateJurisdiction;
int? wordColor;
bool? closePubLayerEntry;
TopDetails({
this.topicItem,
this.topicCreator,
this.hasCreateJurisdiction,
this.wordColor,
this.closePubLayerEntry,
});
factory TopDetails.fromJson(Map<String, dynamic> json) => TopDetails(
@@ -23,8 +17,5 @@ class TopDetails {
topicCreator: json['topic_creator'] == null
? null
: TopicCreator.fromJson(json['topic_creator'] as Map<String, dynamic>),
hasCreateJurisdiction: json['has_create_jurisdiction'] as bool?,
wordColor: json['word_color'] as int?,
closePubLayerEntry: json['close_pub_layer_entry'] as bool?,
);
}

View File

@@ -5,14 +5,7 @@ class TopicItem {
int discuss;
int fav;
int like;
int? dynamics;
String? jumpUrl;
String? backColor;
String? description;
String? sharePic;
String? shareUrl;
int? ctime;
bool? showInteractData;
bool? isFav;
bool? isLike;
@@ -23,14 +16,7 @@ class TopicItem {
required this.discuss,
required this.fav,
required this.like,
this.dynamics,
this.jumpUrl,
this.backColor,
this.description,
this.sharePic,
this.shareUrl,
this.ctime,
this.showInteractData,
this.isFav,
this.isLike,
});
@@ -42,14 +28,7 @@ class TopicItem {
discuss: json['discuss'] ?? 0,
fav: json['fav'] ?? 0,
like: json['like'] ?? 0,
dynamics: json['dynamics'] as int?,
jumpUrl: json['jump_url'] as String?,
backColor: json['back_color'] as String?,
description: json['description'] as String?,
sharePic: json['share_pic'] as String?,
shareUrl: json['share_url'] as String?,
ctime: json['ctime'] as int?,
showInteractData: json['show_interact_data'] as bool?,
isFav: json['is_fav'] as bool?,
isLike: json['is_like'] as bool?,
);