mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 18:16:54 +08:00
fix: card vip (#825)
This commit is contained in:
committed by
GitHub
parent
a915650bb6
commit
2d1697064d
@@ -12,11 +12,7 @@ import 'package:PiliPlus/models/space/pr_info.dart';
|
|||||||
import 'package:PiliPlus/models/space/profession_verify.dart';
|
import 'package:PiliPlus/models/space/profession_verify.dart';
|
||||||
import 'package:PiliPlus/models/space/relation.dart';
|
import 'package:PiliPlus/models/space/relation.dart';
|
||||||
import 'package:PiliPlus/models/space/space_tag_bottom.dart';
|
import 'package:PiliPlus/models/space/space_tag_bottom.dart';
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
|
||||||
|
|
||||||
part 'card.g.dart';
|
|
||||||
|
|
||||||
@JsonSerializable()
|
|
||||||
class SpaceCard {
|
class SpaceCard {
|
||||||
Avatar? avatar;
|
Avatar? avatar;
|
||||||
String? mid;
|
String? mid;
|
||||||
@@ -24,7 +20,6 @@ class SpaceCard {
|
|||||||
bool? approve;
|
bool? approve;
|
||||||
String? rank;
|
String? rank;
|
||||||
String? face;
|
String? face;
|
||||||
@JsonKey(name: 'DisplayRank')
|
|
||||||
String? displayRank;
|
String? displayRank;
|
||||||
int? regtime;
|
int? regtime;
|
||||||
int? spacesta;
|
int? spacesta;
|
||||||
@@ -33,112 +28,148 @@ class SpaceCard {
|
|||||||
String? description;
|
String? description;
|
||||||
int? article;
|
int? article;
|
||||||
dynamic attentions;
|
dynamic attentions;
|
||||||
int fans;
|
late int fans;
|
||||||
int? friend;
|
int? friend;
|
||||||
int attention;
|
late int attention;
|
||||||
String? sign;
|
String? sign;
|
||||||
@JsonKey(name: 'level_info')
|
|
||||||
LevelInfo? levelInfo;
|
LevelInfo? levelInfo;
|
||||||
Pendant? pendant;
|
Pendant? pendant;
|
||||||
Nameplate? nameplate;
|
Nameplate? nameplate;
|
||||||
@JsonKey(name: 'official_verify')
|
|
||||||
OfficialVerify? officialVerify;
|
OfficialVerify? officialVerify;
|
||||||
@JsonKey(name: 'profession_verify')
|
|
||||||
ProfessionVerify? professionVerify;
|
ProfessionVerify? professionVerify;
|
||||||
Vip? vip;
|
Vip? vip;
|
||||||
int? silence;
|
int? silence;
|
||||||
@JsonKey(name: 'end_time')
|
|
||||||
int? endTime;
|
int? endTime;
|
||||||
@JsonKey(name: 'silence_url')
|
|
||||||
String? silenceUrl;
|
String? silenceUrl;
|
||||||
Likes? likes;
|
Likes? likes;
|
||||||
Achieve? achieve;
|
Achieve? achieve;
|
||||||
@JsonKey(name: 'pendant_url')
|
|
||||||
String? pendantUrl;
|
String? pendantUrl;
|
||||||
@JsonKey(name: 'pendant_title')
|
|
||||||
String? pendantTitle;
|
String? pendantTitle;
|
||||||
@JsonKey(name: 'pr_info')
|
|
||||||
PrInfo? prInfo;
|
PrInfo? prInfo;
|
||||||
Relation? relation;
|
Relation? relation;
|
||||||
@JsonKey(name: 'is_deleted')
|
|
||||||
int? isDeleted;
|
int? isDeleted;
|
||||||
Honours? honours;
|
Honours? honours;
|
||||||
// Profession? profession;
|
// Profession? profession;
|
||||||
// School? school;
|
// School? school;
|
||||||
@JsonKey(name: 'space_tag')
|
|
||||||
List<Item>? spaceTag;
|
List<Item>? spaceTag;
|
||||||
@JsonKey(name: 'face_nft_new')
|
|
||||||
int? faceNftNew;
|
int? faceNftNew;
|
||||||
@JsonKey(name: 'has_face_nft')
|
|
||||||
bool? hasFaceNft;
|
bool? hasFaceNft;
|
||||||
@JsonKey(name: 'nft_certificate')
|
|
||||||
NftCertificate? nftCertificate;
|
NftCertificate? nftCertificate;
|
||||||
Entrance? entrance;
|
Entrance? entrance;
|
||||||
@JsonKey(name: 'nft_id')
|
|
||||||
String? nftId;
|
String? nftId;
|
||||||
@JsonKey(name: 'nft_face_icon')
|
|
||||||
dynamic nftFaceIcon;
|
dynamic nftFaceIcon;
|
||||||
@JsonKey(name: 'space_tag_bottom')
|
|
||||||
List<Item>? spaceTagBottom;
|
List<Item>? spaceTagBottom;
|
||||||
@JsonKey(name: 'digital_id')
|
|
||||||
String? digitalId;
|
String? digitalId;
|
||||||
@JsonKey(name: 'digital_type')
|
|
||||||
int? digitalType;
|
int? digitalType;
|
||||||
@JsonKey(name: 'has_digital_asset')
|
|
||||||
bool? hasDigitalAsset;
|
bool? hasDigitalAsset;
|
||||||
|
|
||||||
SpaceCard({
|
SpaceCard.fromJson(Map<String, dynamic> json) {
|
||||||
this.avatar,
|
avatar = json['avatar'] == null
|
||||||
this.mid,
|
? null
|
||||||
this.name,
|
: Avatar.fromJson(json['avatar'] as Map<String, dynamic>);
|
||||||
this.approve,
|
mid = json['mid'] as String?;
|
||||||
this.rank,
|
name = json['name'] as String?;
|
||||||
this.face,
|
approve = json['approve'] as bool?;
|
||||||
this.displayRank,
|
rank = json['rank'] as String?;
|
||||||
this.regtime,
|
face = json['face'] as String?;
|
||||||
this.spacesta,
|
displayRank = json['DisplayRank'] as String?;
|
||||||
this.birthday,
|
regtime = (json['regtime'] as num?)?.toInt();
|
||||||
this.place,
|
spacesta = (json['spacesta'] as num?)?.toInt();
|
||||||
this.description,
|
birthday = json['birthday'] as String?;
|
||||||
this.article,
|
place = json['place'] as String?;
|
||||||
this.attentions,
|
description = json['description'] as String?;
|
||||||
required this.fans,
|
article = (json['article'] as num?)?.toInt();
|
||||||
this.friend,
|
attentions = json['attentions'];
|
||||||
required this.attention,
|
fans = (json['fans'] as num?)?.toInt() ?? 0;
|
||||||
this.sign,
|
friend = (json['friend'] as num?)?.toInt();
|
||||||
this.levelInfo,
|
attention = (json['attention'] as num?)?.toInt() ?? 0;
|
||||||
this.pendant,
|
sign = json['sign'] as String?;
|
||||||
this.nameplate,
|
levelInfo = json['level_info'] == null
|
||||||
this.officialVerify,
|
? null
|
||||||
this.professionVerify,
|
: LevelInfo.fromJson(json['level_info'] as Map<String, dynamic>);
|
||||||
this.vip,
|
pendant = json['pendant'] == null
|
||||||
this.silence,
|
? null
|
||||||
this.endTime,
|
: Pendant.fromJson(json['pendant'] as Map<String, dynamic>);
|
||||||
this.silenceUrl,
|
nameplate = json['nameplate'] == null
|
||||||
this.likes,
|
? null
|
||||||
this.achieve,
|
: Nameplate.fromJson(json['nameplate'] as Map<String, dynamic>);
|
||||||
this.pendantUrl,
|
officialVerify = json['official_verify'] == null
|
||||||
this.pendantTitle,
|
? null
|
||||||
this.prInfo,
|
: OfficialVerify.fromJson(
|
||||||
this.relation,
|
json['official_verify'] as Map<String, dynamic>);
|
||||||
this.isDeleted,
|
professionVerify = json['profession_verify'] == null
|
||||||
this.honours,
|
? null
|
||||||
// this.profession,
|
: ProfessionVerify.fromJson(
|
||||||
// this.school,
|
json['profession_verify'] as Map<String, dynamic>);
|
||||||
this.spaceTag,
|
vip = json['vip'] == null
|
||||||
this.faceNftNew,
|
? null
|
||||||
this.hasFaceNft,
|
: CardVip.fromJson(json['vip'] as Map<String, dynamic>);
|
||||||
this.nftCertificate,
|
silence = (json['silence'] as num?)?.toInt();
|
||||||
this.entrance,
|
endTime = (json['end_time'] as num?)?.toInt();
|
||||||
this.nftId,
|
silenceUrl = json['silence_url'] as String?;
|
||||||
this.nftFaceIcon,
|
likes = json['likes'] == null
|
||||||
this.spaceTagBottom,
|
? null
|
||||||
this.digitalId,
|
: Likes.fromJson(json['likes'] as Map<String, dynamic>);
|
||||||
this.digitalType,
|
achieve = json['achieve'] == null
|
||||||
this.hasDigitalAsset,
|
? null
|
||||||
});
|
: Achieve.fromJson(json['achieve'] as Map<String, dynamic>);
|
||||||
|
pendantUrl = json['pendant_url'] as String?;
|
||||||
factory SpaceCard.fromJson(Map<String, dynamic> json) => _$CardFromJson(json);
|
pendantTitle = json['pendant_title'] as String?;
|
||||||
|
prInfo = json['pr_info'] == null
|
||||||
Map<String, dynamic> toJson() => _$CardToJson(this);
|
? null
|
||||||
|
: PrInfo.fromJson(json['pr_info'] as Map<String, dynamic>);
|
||||||
|
relation = json['relation'] == null
|
||||||
|
? null
|
||||||
|
: Relation.fromJson(json['relation'] as Map<String, dynamic>);
|
||||||
|
isDeleted = (json['is_deleted'] as num?)?.toInt();
|
||||||
|
honours = json['honours'] == null
|
||||||
|
? null
|
||||||
|
: Honours.fromJson(json['honours'] as Map<String, dynamic>);
|
||||||
|
// profession = json['profession'] == null
|
||||||
|
// ? null
|
||||||
|
// : Profession.fromJson(json['profession'] as Map<String, dynamic>);
|
||||||
|
// school = json['school'] == null
|
||||||
|
// ? null
|
||||||
|
// : School.fromJson(json['school'] as Map<String, dynamic>);
|
||||||
|
spaceTag = (json['space_tag'] as List<dynamic>?)
|
||||||
|
?.where((item) => (item['title'] as String?)?.startsWith('IP') == true)
|
||||||
|
.toList()
|
||||||
|
.map((item) => Item.fromJson(item))
|
||||||
|
.toList();
|
||||||
|
faceNftNew = (json['face_nft_new'] as num?)?.toInt();
|
||||||
|
hasFaceNft = json['has_face_nft'] as bool?;
|
||||||
|
nftCertificate = json['nft_certificate'] == null
|
||||||
|
? null
|
||||||
|
: NftCertificate.fromJson(
|
||||||
|
json['nft_certificate'] as Map<String, dynamic>);
|
||||||
|
entrance = json['entrance'] == null
|
||||||
|
? null
|
||||||
|
: Entrance.fromJson(json['entrance'] as Map<String, dynamic>);
|
||||||
|
nftId = json['nft_id'] as String?;
|
||||||
|
nftFaceIcon = json['nft_face_icon'];
|
||||||
|
spaceTagBottom = (json['space_tag_bottom'] as List<dynamic>?)
|
||||||
|
?.map((item) => Item.fromJson(item))
|
||||||
|
.toList();
|
||||||
|
digitalId = json['digital_id'] as String?;
|
||||||
|
digitalType = (json['digital_type'] as num?)?.toInt();
|
||||||
|
hasDigitalAsset = json['has_digital_asset'] as bool?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CardVip implements Vip {
|
||||||
|
@override
|
||||||
|
int? dueDate;
|
||||||
|
@override
|
||||||
|
Label? label;
|
||||||
|
@override
|
||||||
|
late int status;
|
||||||
|
@override
|
||||||
|
int? type;
|
||||||
|
|
||||||
|
CardVip.fromJson(Map<String, dynamic> json) {
|
||||||
|
type = json['vipType'];
|
||||||
|
status = json['vipStatus'] ?? 0;
|
||||||
|
dueDate = json['vipDueDate'];
|
||||||
|
if (json['label'] != null) label = Label.fromJson(json['label']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,151 +0,0 @@
|
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
||||||
|
|
||||||
part of 'card.dart';
|
|
||||||
|
|
||||||
// **************************************************************************
|
|
||||||
// JsonSerializableGenerator
|
|
||||||
// **************************************************************************
|
|
||||||
|
|
||||||
SpaceCard _$CardFromJson(Map<String, dynamic> json) => SpaceCard(
|
|
||||||
avatar: json['avatar'] == null
|
|
||||||
? null
|
|
||||||
: Avatar.fromJson(json['avatar'] as Map<String, dynamic>),
|
|
||||||
mid: json['mid'] as String?,
|
|
||||||
name: json['name'] as String?,
|
|
||||||
approve: json['approve'] as bool?,
|
|
||||||
rank: json['rank'] as String?,
|
|
||||||
face: json['face'] as String?,
|
|
||||||
displayRank: json['DisplayRank'] as String?,
|
|
||||||
regtime: (json['regtime'] as num?)?.toInt(),
|
|
||||||
spacesta: (json['spacesta'] as num?)?.toInt(),
|
|
||||||
birthday: json['birthday'] as String?,
|
|
||||||
place: json['place'] as String?,
|
|
||||||
description: json['description'] as String?,
|
|
||||||
article: (json['article'] as num?)?.toInt(),
|
|
||||||
attentions: json['attentions'],
|
|
||||||
fans: (json['fans'] as num?)?.toInt() ?? 0,
|
|
||||||
friend: (json['friend'] as num?)?.toInt(),
|
|
||||||
attention: (json['attention'] as num?)?.toInt() ?? 0,
|
|
||||||
sign: json['sign'] as String?,
|
|
||||||
levelInfo: json['level_info'] == null
|
|
||||||
? null
|
|
||||||
: LevelInfo.fromJson(json['level_info'] as Map<String, dynamic>),
|
|
||||||
pendant: json['pendant'] == null
|
|
||||||
? null
|
|
||||||
: Pendant.fromJson(json['pendant'] as Map<String, dynamic>),
|
|
||||||
nameplate: json['nameplate'] == null
|
|
||||||
? null
|
|
||||||
: Nameplate.fromJson(json['nameplate'] as Map<String, dynamic>),
|
|
||||||
officialVerify: json['official_verify'] == null
|
|
||||||
? null
|
|
||||||
: OfficialVerify.fromJson(
|
|
||||||
json['official_verify'] as Map<String, dynamic>),
|
|
||||||
professionVerify: json['profession_verify'] == null
|
|
||||||
? null
|
|
||||||
: ProfessionVerify.fromJson(
|
|
||||||
json['profession_verify'] as Map<String, dynamic>),
|
|
||||||
vip: json['vip'] == null
|
|
||||||
? null
|
|
||||||
: Vip.fromJson(json['vip'] as Map<String, dynamic>),
|
|
||||||
silence: (json['silence'] as num?)?.toInt(),
|
|
||||||
endTime: (json['end_time'] as num?)?.toInt(),
|
|
||||||
silenceUrl: json['silence_url'] as String?,
|
|
||||||
likes: json['likes'] == null
|
|
||||||
? null
|
|
||||||
: Likes.fromJson(json['likes'] as Map<String, dynamic>),
|
|
||||||
achieve: json['achieve'] == null
|
|
||||||
? null
|
|
||||||
: Achieve.fromJson(json['achieve'] as Map<String, dynamic>),
|
|
||||||
pendantUrl: json['pendant_url'] as String?,
|
|
||||||
pendantTitle: json['pendant_title'] as String?,
|
|
||||||
prInfo: json['pr_info'] == null
|
|
||||||
? null
|
|
||||||
: PrInfo.fromJson(json['pr_info'] as Map<String, dynamic>),
|
|
||||||
relation: json['relation'] == null
|
|
||||||
? null
|
|
||||||
: Relation.fromJson(json['relation'] as Map<String, dynamic>),
|
|
||||||
isDeleted: (json['is_deleted'] as num?)?.toInt(),
|
|
||||||
honours: json['honours'] == null
|
|
||||||
? null
|
|
||||||
: Honours.fromJson(json['honours'] as Map<String, dynamic>),
|
|
||||||
// profession: json['profession'] == null
|
|
||||||
// ? null
|
|
||||||
// : Profession.fromJson(json['profession'] as Map<String, dynamic>),
|
|
||||||
// school: json['school'] == null
|
|
||||||
// ? null
|
|
||||||
// : School.fromJson(json['school'] as Map<String, dynamic>),
|
|
||||||
spaceTag: (json['space_tag'] as List<dynamic>?)
|
|
||||||
?.where(
|
|
||||||
(item) => (item['title'] as String?)?.startsWith('IP') == true)
|
|
||||||
.toList()
|
|
||||||
.map((item) => Item.fromJson(item))
|
|
||||||
.toList(),
|
|
||||||
faceNftNew: (json['face_nft_new'] as num?)?.toInt(),
|
|
||||||
hasFaceNft: json['has_face_nft'] as bool?,
|
|
||||||
nftCertificate: json['nft_certificate'] == null
|
|
||||||
? null
|
|
||||||
: NftCertificate.fromJson(
|
|
||||||
json['nft_certificate'] as Map<String, dynamic>),
|
|
||||||
entrance: json['entrance'] == null
|
|
||||||
? null
|
|
||||||
: Entrance.fromJson(json['entrance'] as Map<String, dynamic>),
|
|
||||||
nftId: json['nft_id'] as String?,
|
|
||||||
nftFaceIcon: json['nft_face_icon'],
|
|
||||||
spaceTagBottom: (json['space_tag_bottom'] as List<dynamic>?)
|
|
||||||
?.map((item) => Item.fromJson(item))
|
|
||||||
.toList(),
|
|
||||||
digitalId: json['digital_id'] as String?,
|
|
||||||
digitalType: (json['digital_type'] as num?)?.toInt(),
|
|
||||||
hasDigitalAsset: json['has_digital_asset'] as bool?,
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$CardToJson(SpaceCard instance) => <String, dynamic>{
|
|
||||||
'avatar': instance.avatar,
|
|
||||||
'mid': instance.mid,
|
|
||||||
'name': instance.name,
|
|
||||||
'approve': instance.approve,
|
|
||||||
'rank': instance.rank,
|
|
||||||
'face': instance.face,
|
|
||||||
'DisplayRank': instance.displayRank,
|
|
||||||
'regtime': instance.regtime,
|
|
||||||
'spacesta': instance.spacesta,
|
|
||||||
'birthday': instance.birthday,
|
|
||||||
'place': instance.place,
|
|
||||||
'description': instance.description,
|
|
||||||
'article': instance.article,
|
|
||||||
'attentions': instance.attentions,
|
|
||||||
'fans': instance.fans,
|
|
||||||
'friend': instance.friend,
|
|
||||||
'attention': instance.attention,
|
|
||||||
'sign': instance.sign,
|
|
||||||
'level_info': instance.levelInfo,
|
|
||||||
'pendant': instance.pendant,
|
|
||||||
'nameplate': instance.nameplate,
|
|
||||||
'official_verify': instance.officialVerify,
|
|
||||||
'profession_verify': instance.professionVerify,
|
|
||||||
'vip': instance.vip,
|
|
||||||
'silence': instance.silence,
|
|
||||||
'end_time': instance.endTime,
|
|
||||||
'silence_url': instance.silenceUrl,
|
|
||||||
'likes': instance.likes,
|
|
||||||
'achieve': instance.achieve,
|
|
||||||
'pendant_url': instance.pendantUrl,
|
|
||||||
'pendant_title': instance.pendantTitle,
|
|
||||||
'pr_info': instance.prInfo,
|
|
||||||
'relation': instance.relation,
|
|
||||||
'is_deleted': instance.isDeleted,
|
|
||||||
'honours': instance.honours,
|
|
||||||
// 'profession': instance.profession,
|
|
||||||
// 'school': instance.school,
|
|
||||||
'space_tag': instance.spaceTag,
|
|
||||||
'face_nft_new': instance.faceNftNew,
|
|
||||||
'has_face_nft': instance.hasFaceNft,
|
|
||||||
'nft_certificate': instance.nftCertificate,
|
|
||||||
'entrance': instance.entrance,
|
|
||||||
'nft_id': instance.nftId,
|
|
||||||
'nft_face_icon': instance.nftFaceIcon,
|
|
||||||
'space_tag_bottom': instance.spaceTagBottom,
|
|
||||||
'digital_id': instance.digitalId,
|
|
||||||
'digital_type': instance.digitalType,
|
|
||||||
'has_digital_asset': instance.hasDigitalAsset,
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user