opt models

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-04 15:20:35 +08:00
parent f50b1d2beb
commit b960359a39
858 changed files with 11000 additions and 12588 deletions

View File

@@ -0,0 +1,31 @@
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/topic_creator.dart';
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(
topicItem: json['topic_item'] == null
? null
: TopicItem.fromJson(json['topic_item'] as Map<String, dynamic>),
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

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

View File

@@ -0,0 +1,56 @@
class TopicItem {
int? id;
String? name;
int? view;
int? discuss;
late int fav;
late int like;
int? dynamics;
String? jumpUrl;
String? backColor;
String? description;
String? sharePic;
String? shareUrl;
int? ctime;
bool? showInteractData;
bool? isFav;
bool? isLike;
TopicItem({
this.id,
this.name,
this.view,
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,
});
factory TopicItem.fromJson(Map<String, dynamic> json) => TopicItem(
id: json['id'] as int?,
name: json['name'] as String?,
view: json['view'] as int? ?? 0,
discuss: json['discuss'] as int? ?? 0,
fav: json['fav'] as int? ?? 0,
like: json['like'] as int? ?? 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?,
);
}