feat: space opus

Closes #833

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-08 22:39:29 +08:00
parent bcd0d63db7
commit 2d75d89825
28 changed files with 1107 additions and 511 deletions

View File

@@ -0,0 +1,34 @@
import 'package:PiliPlus/models/space_opus/cover.dart';
import 'package:PiliPlus/models/space_opus/stat.dart';
class SpaceOpusItemModel {
String? content;
String? jumpUrl;
String? opusId;
Stat? stat;
Cover? cover;
SpaceOpusItemModel(
{this.content, this.jumpUrl, this.opusId, this.stat, this.cover});
factory SpaceOpusItemModel.fromJson(Map<String, dynamic> json) =>
SpaceOpusItemModel(
content: json['content'] as String?,
jumpUrl: json['jump_url'] as String?,
opusId: json['opus_id'] as String?,
stat: json['stat'] == null
? null
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
cover: json['cover'] == null
? null
: Cover.fromJson(json['cover'] as Map<String, dynamic>),
);
Map<String, dynamic> toJson() => {
'content': content,
'jump_url': jumpUrl,
'opus_id': opusId,
'stat': stat?.toJson(),
'cover': cover?.toJson(),
};
}