home_entity.g.dart
3.98 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import 'package:Parlando/generated/json/base/json_convert_content.dart';
import 'package:Parlando/home/models/home_entity.dart';
HomeEntity $HomeEntityFromJson(Map<String, dynamic> json) {
final HomeEntity homeEntity = HomeEntity();
final String? status = jsonConvert.convert<String>(json['status']);
if (status != null) {
homeEntity.status = status;
}
final int? code = jsonConvert.convert<int>(json['code']);
if (code != null) {
homeEntity.code = code;
}
final String? message = jsonConvert.convert<String>(json['message']);
if (message != null) {
homeEntity.message = message;
}
final List<HomeData>? data =
jsonConvert.convertListNotNull<HomeData>(json['data']);
if (data != null) {
homeEntity.data = data;
}
final HomeError? error = jsonConvert.convert<HomeError>(json['error']);
if (error != null) {
homeEntity.error = error;
}
return homeEntity;
}
Map<String, dynamic> $HomeEntityToJson(HomeEntity entity) {
final Map<String, dynamic> data = <String, dynamic>{};
data['status'] = entity.status;
data['code'] = entity.code;
data['message'] = entity.message;
data['data'] = entity.data?.map((v) => v.toJson()).toList();
data['error'] = entity.error?.toJson();
return data;
}
HomeData $HomeDataFromJson(Map<String, dynamic> json) {
final HomeData homeData = HomeData();
final int? id = jsonConvert.convert<int>(json['id']);
if (id != null) {
homeData.id = id;
}
final int? userId = jsonConvert.convert<int>(json['user_id']);
if (userId != null) {
homeData.userId = userId;
}
final String? title = jsonConvert.convert<String>(json['title']);
if (title != null) {
homeData.title = title;
}
final String? content = jsonConvert.convert<String>(json['content']);
if (content != null) {
homeData.content = content;
}
final String? url = jsonConvert.convert<String>(json['url']);
if (url != null) {
homeData.url = url;
}
final int? type = jsonConvert.convert<int>(json['type']);
if (type != null) {
homeData.type = type;
}
final int? poemId = jsonConvert.convert<int>(json['poem_id']);
if (poemId != null) {
homeData.poemId = poemId;
}
final int? tempId = jsonConvert.convert<int>(json['temp_id']);
if (tempId != null) {
homeData.tempId = tempId;
}
final String? bgm = jsonConvert.convert<String>(json['bgm']);
if (bgm != null) {
homeData.bgm = bgm;
}
final int? praise = jsonConvert.convert<int>(json['praise']);
if (praise != null) {
homeData.praise = praise;
}
final int? view = jsonConvert.convert<int>(json['view']);
if (view != null) {
homeData.view = view;
}
final int? collect = jsonConvert.convert<int>(json['collect']);
if (collect != null) {
homeData.collect = collect;
}
final int? share = jsonConvert.convert<int>(json['share']);
if (share != null) {
homeData.share = share;
}
final bool? isPraise = jsonConvert.convert<bool>(json['is_praise']);
if (isPraise != null) {
homeData.isPraise = isPraise;
}
final bool? isCollect = jsonConvert.convert<bool>(json['is_collect']);
if (isCollect != null) {
homeData.isCollect = isCollect;
}
return homeData;
}
Map<String, dynamic> $HomeDataToJson(HomeData entity) {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = entity.id;
data['user_id'] = entity.userId;
data['title'] = entity.title;
data['content'] = entity.content;
data['url'] = entity.url;
data['type'] = entity.type;
data['poem_id'] = entity.poemId;
data['temp_id'] = entity.tempId;
data['bgm'] = entity.bgm;
data['praise'] = entity.praise;
data['view'] = entity.view;
data['collect'] = entity.collect;
data['share'] = entity.share;
data['is_praise'] = entity.isPraise;
data['is_collect'] = entity.isCollect;
return data;
}
HomeError $HomeErrorFromJson(Map<String, dynamic> json) {
final HomeError homeError = HomeError();
return homeError;
}
Map<String, dynamic> $HomeErrorToJson(HomeError entity) {
final Map<String, dynamic> data = <String, dynamic>{};
return data;
}