mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
53
lib/models_new/msg/msg_at/content.dart
Normal file
53
lib/models_new/msg/msg_at/content.dart
Normal file
@@ -0,0 +1,53 @@
|
||||
class MsgAtContent {
|
||||
String? type;
|
||||
String? business;
|
||||
int? businessId;
|
||||
String? title;
|
||||
String? image;
|
||||
String? uri;
|
||||
int? subjectId;
|
||||
int? rootId;
|
||||
int? targetId;
|
||||
int? sourceId;
|
||||
String? sourceContent;
|
||||
String? nativeUri;
|
||||
List<dynamic>? atDetails;
|
||||
List<dynamic>? topicDetails;
|
||||
bool? hideReplyButton;
|
||||
|
||||
MsgAtContent({
|
||||
this.type,
|
||||
this.business,
|
||||
this.businessId,
|
||||
this.title,
|
||||
this.image,
|
||||
this.uri,
|
||||
this.subjectId,
|
||||
this.rootId,
|
||||
this.targetId,
|
||||
this.sourceId,
|
||||
this.sourceContent,
|
||||
this.nativeUri,
|
||||
this.atDetails,
|
||||
this.topicDetails,
|
||||
this.hideReplyButton,
|
||||
});
|
||||
|
||||
factory MsgAtContent.fromJson(Map<String, dynamic> json) => MsgAtContent(
|
||||
type: json['type'] as String?,
|
||||
business: json['business'] as String?,
|
||||
businessId: json['business_id'] as int?,
|
||||
title: json['title'] as String?,
|
||||
image: json['image'] as String?,
|
||||
uri: json['uri'] as String?,
|
||||
subjectId: json['subject_id'] as int?,
|
||||
rootId: json['root_id'] as int?,
|
||||
targetId: json['target_id'] as int?,
|
||||
sourceId: json['source_id'] as int?,
|
||||
sourceContent: json['source_content'] as String?,
|
||||
nativeUri: json['native_uri'] as String?,
|
||||
atDetails: json['at_details'] as List<dynamic>?,
|
||||
topicDetails: json['topic_details'] as List<dynamic>?,
|
||||
hideReplyButton: json['hide_reply_button'] as bool?,
|
||||
);
|
||||
}
|
||||
13
lib/models_new/msg/msg_at/cursor.dart
Normal file
13
lib/models_new/msg/msg_at/cursor.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
class Cursor {
|
||||
bool? isEnd;
|
||||
int? id;
|
||||
int? time;
|
||||
|
||||
Cursor({this.isEnd, this.id, this.time});
|
||||
|
||||
factory Cursor.fromJson(Map<String, dynamic> json) => Cursor(
|
||||
isEnd: json['is_end'] as bool?,
|
||||
id: json['id'] as int?,
|
||||
time: json['time'] as int?,
|
||||
);
|
||||
}
|
||||
18
lib/models_new/msg/msg_at/data.dart
Normal file
18
lib/models_new/msg/msg_at/data.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:PiliPlus/models_new/msg/msg_at/cursor.dart';
|
||||
import 'package:PiliPlus/models_new/msg/msg_at/item.dart';
|
||||
|
||||
class MsgAtData {
|
||||
Cursor? cursor;
|
||||
List<MsgAtItem>? items;
|
||||
|
||||
MsgAtData({this.cursor, this.items});
|
||||
|
||||
factory MsgAtData.fromJson(Map<String, dynamic> json) => MsgAtData(
|
||||
cursor: json['cursor'] == null
|
||||
? null
|
||||
: Cursor.fromJson(json['cursor'] as Map<String, dynamic>),
|
||||
items: (json['items'] as List<dynamic>?)
|
||||
?.map((e) => MsgAtItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
22
lib/models_new/msg/msg_at/item.dart
Normal file
22
lib/models_new/msg/msg_at/item.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:PiliPlus/models_new/msg/msg_at/content.dart';
|
||||
import 'package:PiliPlus/models_new/msg/msg_at/user.dart';
|
||||
|
||||
class MsgAtItem {
|
||||
int? id;
|
||||
User? user;
|
||||
MsgAtContent? item;
|
||||
int? atTime;
|
||||
|
||||
MsgAtItem({this.id, this.user, this.item, this.atTime});
|
||||
|
||||
factory MsgAtItem.fromJson(Map<String, dynamic> json) => MsgAtItem(
|
||||
id: json['id'] as int?,
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
item: json['item'] == null
|
||||
? null
|
||||
: MsgAtContent.fromJson(json['item'] as Map<String, dynamic>),
|
||||
atTime: json['at_time'] as int?,
|
||||
);
|
||||
}
|
||||
26
lib/models_new/msg/msg_at/user.dart
Normal file
26
lib/models_new/msg/msg_at/user.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
class User {
|
||||
int? mid;
|
||||
int? fans;
|
||||
String? nickname;
|
||||
String? avatar;
|
||||
String? midLink;
|
||||
bool? follow;
|
||||
|
||||
User({
|
||||
this.mid,
|
||||
this.fans,
|
||||
this.nickname,
|
||||
this.avatar,
|
||||
this.midLink,
|
||||
this.follow,
|
||||
});
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => User(
|
||||
mid: json['mid'] as int?,
|
||||
fans: json['fans'] as int?,
|
||||
nickname: json['nickname'] as String?,
|
||||
avatar: json['avatar'] as String?,
|
||||
midLink: json['mid_link'] as String?,
|
||||
follow: json['follow'] as bool?,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user