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,13 @@
class Author {
String? name;
String? face;
String? mid;
Author({this.name, this.face, this.mid});
factory Author.fromJson(Map<String, dynamic> json) => Author(
name: json['name'] as String?,
face: json['face'] as String?,
mid: json['mid'] as String?,
);
}

View File

@@ -0,0 +1,13 @@
class Cover {
String? url;
int? width;
int? height;
Cover({this.url, this.width, this.height});
factory Cover.fromJson(Map<String, dynamic> json) => Cover(
url: json['url'] as String?,
width: json['width'] as int?,
height: json['height'] as int?,
);
}

View File

@@ -0,0 +1,28 @@
import 'package:PiliPlus/models_new/fav/fav_article/item.dart';
class FavArticleData {
List<FavArticleItemModel>? items;
bool? hasMore;
String? offset;
String? updateNum;
String? updateBaseline;
FavArticleData({
this.items,
this.hasMore,
this.offset,
this.updateNum,
this.updateBaseline,
});
factory FavArticleData.fromJson(Map<String, dynamic> json) => FavArticleData(
items: (json['items'] as List<dynamic>?)
?.map(
(e) => FavArticleItemModel.fromJson(e as Map<String, dynamic>))
.toList(),
hasMore: json['has_more'] as bool?,
offset: json['offset'] as String?,
updateNum: json['update_num'] as String?,
updateBaseline: json['update_baseline'] as String?,
);
}

View File

@@ -0,0 +1,43 @@
import 'package:PiliPlus/models_new/fav/fav_article/author.dart';
import 'package:PiliPlus/models_new/fav/fav_article/cover.dart';
import 'package:PiliPlus/models_new/fav/fav_article/stat.dart';
class FavArticleItemModel {
String? jumpUrl;
String? opusId;
String? content;
dynamic badge;
Author? author;
Cover? cover;
Stat? stat;
String? pubTime;
FavArticleItemModel({
this.jumpUrl,
this.opusId,
this.content,
this.badge,
this.author,
this.cover,
this.stat,
this.pubTime,
});
factory FavArticleItemModel.fromJson(Map<String, dynamic> json) =>
FavArticleItemModel(
jumpUrl: json['jump_url'] as String?,
opusId: json['opus_id'] as String?,
content: json['content'] as String?,
badge: json['badge'] as dynamic,
author: json['author'] == null
? null
: Author.fromJson(json['author'] as Map<String, dynamic>),
cover: json['cover'] == null
? null
: Cover.fromJson(json['cover'] as Map<String, dynamic>),
stat: json['stat'] == null
? null
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
pubTime: json['pub_time'] as String?,
);
}

View File

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