mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 20:16:26 +08:00
feat: at user
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
13
lib/models_new/dynamic/dyn_mention/data.dart
Normal file
13
lib/models_new/dynamic/dyn_mention/data.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_mention/group.dart';
|
||||
|
||||
class DynMentionData {
|
||||
List<MentionGroup>? groups;
|
||||
|
||||
DynMentionData({this.groups});
|
||||
|
||||
factory DynMentionData.fromJson(Map<String, dynamic> json) => DynMentionData(
|
||||
groups: (json['groups'] as List<dynamic>?)
|
||||
?.map((e) => MentionGroup.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
17
lib/models_new/dynamic/dyn_mention/group.dart
Normal file
17
lib/models_new/dynamic/dyn_mention/group.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_mention/item.dart';
|
||||
|
||||
class MentionGroup {
|
||||
String? groupName;
|
||||
int? groupType;
|
||||
List<MentionItem>? items;
|
||||
|
||||
MentionGroup({this.groupName, this.groupType, this.items});
|
||||
|
||||
factory MentionGroup.fromJson(Map<String, dynamic> json) => MentionGroup(
|
||||
groupName: json['group_name'] as String?,
|
||||
groupType: json['group_type'] as int?,
|
||||
items: (json['items'] as List<dynamic>?)
|
||||
?.map((e) => MentionItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
37
lib/models_new/dynamic/dyn_mention/item.dart
Normal file
37
lib/models_new/dynamic/dyn_mention/item.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
class MentionItem {
|
||||
String? face;
|
||||
int? fans;
|
||||
String? name;
|
||||
int? officialVerifyType;
|
||||
String? uid;
|
||||
|
||||
MentionItem({
|
||||
this.face,
|
||||
this.fans,
|
||||
this.name,
|
||||
this.officialVerifyType,
|
||||
this.uid,
|
||||
});
|
||||
|
||||
factory MentionItem.fromJson(Map<String, dynamic> json) => MentionItem(
|
||||
face: json['face'] as String?,
|
||||
fans: json['fans'] as int?,
|
||||
name: json['name'] as String?,
|
||||
officialVerifyType: json['official_verify_type'] as int?,
|
||||
uid: json['uid'] as String?,
|
||||
);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (other is MentionItem) {
|
||||
return uid == other.uid;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => uid.hashCode;
|
||||
}
|
||||
Reference in New Issue
Block a user