opt handle res

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-25 11:16:35 +08:00
parent f29385ccef
commit fd55383778
91 changed files with 957 additions and 387 deletions

View File

@@ -0,0 +1,16 @@
class Author {
Author({
this.mid,
this.name,
this.face,
});
String? mid;
String? name;
String? face;
Author.fromJson(Map<String, dynamic> json) {
mid = json["mid"];
name = json["name"];
face = json['face'];
}
}

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,22 @@
import 'package:PiliPlus/models/fav_article/item.dart';
class FavArticleData {
List<FavArticleItemModel>? items;
bool? hasMore;
String? offset;
FavArticleData({
this.items,
this.hasMore,
this.offset,
});
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?,
);
}

View File

@@ -0,0 +1,43 @@
import 'package:PiliPlus/models/fav_article/author.dart';
import 'package:PiliPlus/models/fav_article/cover.dart';
import 'package:PiliPlus/models/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?,
);
}