Showing
2 changed files
with
235 additions
and
0 deletions
lib/models/guest_manage_model.dart
0 → 100644
| 1 | +import 'package:json_annotation/json_annotation.dart'; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | + import 'package:json_annotation/json_annotation.dart'; | ||
| 5 | + | ||
| 6 | +part 'guest_manage_model.g.dart'; | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +@JsonSerializable() | ||
| 10 | + class GuestManageModel extends Object { | ||
| 11 | + | ||
| 12 | + @JsonKey(name: 'ret') | ||
| 13 | + int ret; | ||
| 14 | + | ||
| 15 | + @JsonKey(name: 'data') | ||
| 16 | + GuestManageSunModel data; | ||
| 17 | + | ||
| 18 | + @JsonKey(name: 'msg') | ||
| 19 | + String msg; | ||
| 20 | + | ||
| 21 | + GuestManageModel(this.ret,this.data,this.msg,); | ||
| 22 | + | ||
| 23 | + factory GuestManageModel.fromJson(Map<String, dynamic> srcJson) => _$GuestManageModelFromJson(srcJson); | ||
| 24 | + | ||
| 25 | + Map<String, dynamic> toJson() => _$GuestManageModelToJson(this); | ||
| 26 | + | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | + | ||
| 30 | +@JsonSerializable() | ||
| 31 | + class GuestManageSunModel extends Object { | ||
| 32 | + | ||
| 33 | + @JsonKey(name: 'myCustomer') | ||
| 34 | + int myCustomer; | ||
| 35 | + | ||
| 36 | + @JsonKey(name: 'active') | ||
| 37 | + Active active; | ||
| 38 | + | ||
| 39 | + @JsonKey(name: 'sleep') | ||
| 40 | + Sleep sleep; | ||
| 41 | + | ||
| 42 | + @JsonKey(name: 'drain') | ||
| 43 | + Drain drain; | ||
| 44 | + | ||
| 45 | + @JsonKey(name: 'Tips') | ||
| 46 | + Tips tips; | ||
| 47 | + | ||
| 48 | + GuestManageSunModel(this.myCustomer,this.active,this.sleep,this.drain,this.tips,); | ||
| 49 | + | ||
| 50 | + factory GuestManageSunModel.fromJson(Map<String, dynamic> srcJson) => _$GuestManageSunModelFromJson(srcJson); | ||
| 51 | + | ||
| 52 | + Map<String, dynamic> toJson() => _$GuestManageSunModelToJson(this); | ||
| 53 | + | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | + | ||
| 57 | +@JsonSerializable() | ||
| 58 | + class Active extends Object { | ||
| 59 | + | ||
| 60 | + @JsonKey(name: 'count') | ||
| 61 | + int count; | ||
| 62 | + | ||
| 63 | + @JsonKey(name: 'scale') | ||
| 64 | + String scale; | ||
| 65 | + | ||
| 66 | + Active(this.count,this.scale,); | ||
| 67 | + | ||
| 68 | + factory Active.fromJson(Map<String, dynamic> srcJson) => _$ActiveFromJson(srcJson); | ||
| 69 | + | ||
| 70 | + Map<String, dynamic> toJson() => _$ActiveToJson(this); | ||
| 71 | + | ||
| 72 | +} | ||
| 73 | + | ||
| 74 | + | ||
| 75 | +@JsonSerializable() | ||
| 76 | + class Sleep extends Object { | ||
| 77 | + | ||
| 78 | + @JsonKey(name: 'count') | ||
| 79 | + int count; | ||
| 80 | + | ||
| 81 | + @JsonKey(name: 'scale') | ||
| 82 | + String scale; | ||
| 83 | + | ||
| 84 | + Sleep(this.count,this.scale,); | ||
| 85 | + | ||
| 86 | + factory Sleep.fromJson(Map<String, dynamic> srcJson) => _$SleepFromJson(srcJson); | ||
| 87 | + | ||
| 88 | + Map<String, dynamic> toJson() => _$SleepToJson(this); | ||
| 89 | + | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | + | ||
| 93 | +@JsonSerializable() | ||
| 94 | + class Drain extends Object { | ||
| 95 | + | ||
| 96 | + @JsonKey(name: 'count') | ||
| 97 | + int count; | ||
| 98 | + | ||
| 99 | + @JsonKey(name: 'scale') | ||
| 100 | + String scale; | ||
| 101 | + | ||
| 102 | + Drain(this.count,this.scale,); | ||
| 103 | + | ||
| 104 | + factory Drain.fromJson(Map<String, dynamic> srcJson) => _$DrainFromJson(srcJson); | ||
| 105 | + | ||
| 106 | + Map<String, dynamic> toJson() => _$DrainToJson(this); | ||
| 107 | + | ||
| 108 | +} | ||
| 109 | + | ||
| 110 | + | ||
| 111 | +@JsonSerializable() | ||
| 112 | + class Tips extends Object { | ||
| 113 | + | ||
| 114 | + @JsonKey(name: 'task') | ||
| 115 | + List<List<String>> task; | ||
| 116 | + | ||
| 117 | + @JsonKey(name: 'recover') | ||
| 118 | + List<String> recover; | ||
| 119 | + | ||
| 120 | + @JsonKey(name: 'awaken') | ||
| 121 | + List<String> awaken; | ||
| 122 | + | ||
| 123 | + Tips(this.task,this.recover,this.awaken,); | ||
| 124 | + | ||
| 125 | + factory Tips.fromJson(Map<String, dynamic> srcJson) => _$TipsFromJson(srcJson); | ||
| 126 | + | ||
| 127 | + Map<String, dynamic> toJson() => _$TipsToJson(this); | ||
| 128 | + | ||
| 129 | +} | ||
| 130 | + | ||
| 131 | + |
lib/models/guest_manage_model.g.dart
0 → 100644
| 1 | +// GENERATED CODE - DO NOT MODIFY BY HAND | ||
| 2 | + | ||
| 3 | +part of 'guest_manage_model.dart'; | ||
| 4 | + | ||
| 5 | +// ************************************************************************** | ||
| 6 | +// JsonSerializableGenerator | ||
| 7 | +// ************************************************************************** | ||
| 8 | + | ||
| 9 | +GuestManageModel _$GuestManageModelFromJson(Map<String, dynamic> json) { | ||
| 10 | + return GuestManageModel( | ||
| 11 | + json['ret'] as int, | ||
| 12 | + json['data'] == null | ||
| 13 | + ? null | ||
| 14 | + : GuestManageSunModel.fromJson(json['data'] as Map<String, dynamic>), | ||
| 15 | + json['msg'] as String, | ||
| 16 | + ); | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +Map<String, dynamic> _$GuestManageModelToJson(GuestManageModel instance) => | ||
| 20 | + <String, dynamic>{ | ||
| 21 | + 'ret': instance.ret, | ||
| 22 | + 'data': instance.data, | ||
| 23 | + 'msg': instance.msg, | ||
| 24 | + }; | ||
| 25 | + | ||
| 26 | +GuestManageSunModel _$GuestManageSunModelFromJson(Map<String, dynamic> json) { | ||
| 27 | + return GuestManageSunModel( | ||
| 28 | + json['myCustomer'] as int, | ||
| 29 | + json['active'] == null | ||
| 30 | + ? null | ||
| 31 | + : Active.fromJson(json['active'] as Map<String, dynamic>), | ||
| 32 | + json['sleep'] == null | ||
| 33 | + ? null | ||
| 34 | + : Sleep.fromJson(json['sleep'] as Map<String, dynamic>), | ||
| 35 | + json['drain'] == null | ||
| 36 | + ? null | ||
| 37 | + : Drain.fromJson(json['drain'] as Map<String, dynamic>), | ||
| 38 | + json['Tips'] == null | ||
| 39 | + ? null | ||
| 40 | + : Tips.fromJson(json['Tips'] as Map<String, dynamic>), | ||
| 41 | + ); | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +Map<String, dynamic> _$GuestManageSunModelToJson( | ||
| 45 | + GuestManageSunModel instance) => | ||
| 46 | + <String, dynamic>{ | ||
| 47 | + 'myCustomer': instance.myCustomer, | ||
| 48 | + 'active': instance.active, | ||
| 49 | + 'sleep': instance.sleep, | ||
| 50 | + 'drain': instance.drain, | ||
| 51 | + 'Tips': instance.tips, | ||
| 52 | + }; | ||
| 53 | + | ||
| 54 | +Active _$ActiveFromJson(Map<String, dynamic> json) { | ||
| 55 | + return Active( | ||
| 56 | + json['count'] as int, | ||
| 57 | + json['scale'] as String, | ||
| 58 | + ); | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +Map<String, dynamic> _$ActiveToJson(Active instance) => <String, dynamic>{ | ||
| 62 | + 'count': instance.count, | ||
| 63 | + 'scale': instance.scale, | ||
| 64 | + }; | ||
| 65 | + | ||
| 66 | +Sleep _$SleepFromJson(Map<String, dynamic> json) { | ||
| 67 | + return Sleep( | ||
| 68 | + json['count'] as int, | ||
| 69 | + json['scale'] as String, | ||
| 70 | + ); | ||
| 71 | +} | ||
| 72 | + | ||
| 73 | +Map<String, dynamic> _$SleepToJson(Sleep instance) => <String, dynamic>{ | ||
| 74 | + 'count': instance.count, | ||
| 75 | + 'scale': instance.scale, | ||
| 76 | + }; | ||
| 77 | + | ||
| 78 | +Drain _$DrainFromJson(Map<String, dynamic> json) { | ||
| 79 | + return Drain( | ||
| 80 | + json['count'] as int, | ||
| 81 | + json['scale'] as String, | ||
| 82 | + ); | ||
| 83 | +} | ||
| 84 | + | ||
| 85 | +Map<String, dynamic> _$DrainToJson(Drain instance) => <String, dynamic>{ | ||
| 86 | + 'count': instance.count, | ||
| 87 | + 'scale': instance.scale, | ||
| 88 | + }; | ||
| 89 | + | ||
| 90 | +Tips _$TipsFromJson(Map<String, dynamic> json) { | ||
| 91 | + return Tips( | ||
| 92 | + (json['task'] as List) | ||
| 93 | + ?.map((e) => (e as List)?.map((e) => e as String)?.toList()) | ||
| 94 | + ?.toList(), | ||
| 95 | + (json['recover'] as List)?.map((e) => e as String)?.toList(), | ||
| 96 | + (json['awaken'] as List)?.map((e) => e as String)?.toList(), | ||
| 97 | + ); | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +Map<String, dynamic> _$TipsToJson(Tips instance) => <String, dynamic>{ | ||
| 101 | + 'task': instance.task, | ||
| 102 | + 'recover': instance.recover, | ||
| 103 | + 'awaken': instance.awaken, | ||
| 104 | + }; |
-
Please register or login to post a comment