mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 01:56:47 +08:00
@@ -4,16 +4,16 @@ part 'category.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Category {
|
||||
int? id;
|
||||
@JsonKey(name: 'parent_id')
|
||||
int? parentId;
|
||||
String? name;
|
||||
int? id;
|
||||
@JsonKey(name: 'parent_id')
|
||||
int? parentId;
|
||||
String? name;
|
||||
|
||||
Category({this.id, this.parentId, this.name});
|
||||
Category({this.id, this.parentId, this.name});
|
||||
|
||||
factory Category.fromJson(Map<String, dynamic> json) {
|
||||
return _$CategoryFromJson(json);
|
||||
}
|
||||
factory Category.fromJson(Map<String, dynamic> json) {
|
||||
return _$CategoryFromJson(json);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => _$CategoryToJson(this);
|
||||
Map<String, dynamic> toJson() => _$CategoryToJson(this);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:PiliPlus/models/dynamics/article_content_model.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/models/dynamics/article_content_model.dart';
|
||||
import 'package:PiliPlus/models/dynamics/article_opus/opus.dart';
|
||||
import 'package:PiliPlus/models/space_article/author.dart';
|
||||
import 'package:PiliPlus/models/space_article/category.dart';
|
||||
import 'package:PiliPlus/models/space_article/media.dart';
|
||||
@@ -55,6 +57,7 @@ class SpaceArticleItem {
|
||||
int? versionId;
|
||||
String? dynIdStr;
|
||||
int? totalArtNum;
|
||||
List<ReadOpusModel>? ops;
|
||||
|
||||
SpaceArticleItem.fromJson(Map<String, dynamic> json) {
|
||||
id = json["id"];
|
||||
@@ -105,8 +108,13 @@ class SpaceArticleItem {
|
||||
keywords = json["keywords"];
|
||||
if (json['opus'] != null) opus = Opus.fromJson(json['opus']);
|
||||
versionId = json["version_id"];
|
||||
dynIdStr = json["dyn_id_str"];
|
||||
dynIdStr = json["dyn_id_str"] == '' ? null : json["dyn_id_str"];
|
||||
totalArtNum = json["total_art_num"];
|
||||
if (type == 3 && content != null) {
|
||||
ops = (jsonDecode(content!)['ops'] as List?)
|
||||
?.map((e) => ReadOpusModel.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ part 'label.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Label {
|
||||
String? path;
|
||||
String? text;
|
||||
@JsonKey(name: 'label_theme')
|
||||
String? labelTheme;
|
||||
String? path;
|
||||
String? text;
|
||||
@JsonKey(name: 'label_theme')
|
||||
String? labelTheme;
|
||||
|
||||
Label({this.path, this.text, this.labelTheme});
|
||||
Label({this.path, this.text, this.labelTheme});
|
||||
|
||||
factory Label.fromJson(Map<String, dynamic> json) => _$LabelFromJson(json);
|
||||
factory Label.fromJson(Map<String, dynamic> json) => _$LabelFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$LabelToJson(this);
|
||||
Map<String, dynamic> toJson() => _$LabelToJson(this);
|
||||
}
|
||||
|
||||
@@ -4,30 +4,30 @@ part 'media.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Media {
|
||||
int? score;
|
||||
@JsonKey(name: 'media_id')
|
||||
int? mediaId;
|
||||
String? title;
|
||||
String? cover;
|
||||
String? area;
|
||||
@JsonKey(name: 'type_id')
|
||||
int? typeId;
|
||||
@JsonKey(name: 'type_name')
|
||||
String? typeName;
|
||||
int? spoiler;
|
||||
int? score;
|
||||
@JsonKey(name: 'media_id')
|
||||
int? mediaId;
|
||||
String? title;
|
||||
String? cover;
|
||||
String? area;
|
||||
@JsonKey(name: 'type_id')
|
||||
int? typeId;
|
||||
@JsonKey(name: 'type_name')
|
||||
String? typeName;
|
||||
int? spoiler;
|
||||
|
||||
Media({
|
||||
this.score,
|
||||
this.mediaId,
|
||||
this.title,
|
||||
this.cover,
|
||||
this.area,
|
||||
this.typeId,
|
||||
this.typeName,
|
||||
this.spoiler,
|
||||
});
|
||||
Media({
|
||||
this.score,
|
||||
this.mediaId,
|
||||
this.title,
|
||||
this.cover,
|
||||
this.area,
|
||||
this.typeId,
|
||||
this.typeName,
|
||||
this.spoiler,
|
||||
});
|
||||
|
||||
factory Media.fromJson(Map<String, dynamic> json) => _$MediaFromJson(json);
|
||||
factory Media.fromJson(Map<String, dynamic> json) => _$MediaFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$MediaToJson(this);
|
||||
Map<String, dynamic> toJson() => _$MediaToJson(this);
|
||||
}
|
||||
|
||||
@@ -4,26 +4,26 @@ part 'nameplate.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class Nameplate {
|
||||
int? nid;
|
||||
String? name;
|
||||
String? image;
|
||||
@JsonKey(name: 'image_small')
|
||||
String? imageSmall;
|
||||
String? level;
|
||||
String? condition;
|
||||
int? nid;
|
||||
String? name;
|
||||
String? image;
|
||||
@JsonKey(name: 'image_small')
|
||||
String? imageSmall;
|
||||
String? level;
|
||||
String? condition;
|
||||
|
||||
Nameplate({
|
||||
this.nid,
|
||||
this.name,
|
||||
this.image,
|
||||
this.imageSmall,
|
||||
this.level,
|
||||
this.condition,
|
||||
});
|
||||
Nameplate({
|
||||
this.nid,
|
||||
this.name,
|
||||
this.image,
|
||||
this.imageSmall,
|
||||
this.level,
|
||||
this.condition,
|
||||
});
|
||||
|
||||
factory Nameplate.fromJson(Map<String, dynamic> json) {
|
||||
return _$NameplateFromJson(json);
|
||||
}
|
||||
factory Nameplate.fromJson(Map<String, dynamic> json) {
|
||||
return _$NameplateFromJson(json);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => _$NameplateToJson(this);
|
||||
Map<String, dynamic> toJson() => _$NameplateToJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user