mix_push_message_entity.dart
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class MixPushMessageEntity {
//通知栏标题,透传该字段为空
final String? title;
//通知栏副标题,透传该字段为空
final String? description;
//推送所属平台,比如mi/huawei
final String? platform;
//推送附属的内容信息
final String? payload;
//是否是透传推送
final bool? passThrough;
final String? msgId;
MixPushMessageEntity(
{this.title,
this.description,
this.platform,
this.payload,
this.passThrough,
this.msgId});
factory MixPushMessageEntity.fromJson(Map<String, dynamic> json) {
return MixPushMessageEntity(
title: json['title'],
description: json['description'],
platform: json['platform'],
payload: json['payload'],
passThrough: json['passThrough'],
msgId: json['msgId']);
}
Map<String, dynamic> toJson() => {
'title': title,
'description': description,
'platform': platform,
'payload': payload,
'passThrough': passThrough,
'msgId': msgId,
};
}
class MixPushPlatformEntity {
final String? platformName;
final String? regId;
MixPushPlatformEntity({this.platformName, this.regId});
factory MixPushPlatformEntity.fromJson(Map<String, dynamic> json) {
return MixPushPlatformEntity(
platformName: json['platformName'], regId: json['regId']);
}
Map<String, dynamic> toJson() => {
'platformName': platformName,
'regId': regId,
};
}