12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- class MessageModel {
- List<Records> records;
- MessageModel({this.records});
- MessageModel.fromJson(Map<String, dynamic> json) {
- if (json['records'] != null) {
- records = new List<Records>();
- json['records'].forEach((v) {
- records.add(new Records.fromJson(v));
- });
- }
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- if (this.records != null) {
- data['records'] = this.records.map((v) => v.toJson()).toList();
- }
- return data;
- }
- }
- class Records {
- String id;
- String userId;
- String content;
- int type;
- int viewFlag;
- int deviceModel;
- String createUserId;
- String createTime;
- Records(
- {this.id,
- this.userId,
- this.content,
- this.type,
- this.viewFlag,
- this.deviceModel,
- this.createUserId,
- this.createTime});
- Records.fromJson(Map<String, dynamic> json) {
- if (json == null) return;
- id = json['id'];
- userId = json['userId'];
- content = json['content'];
- type = json['type'];
- viewFlag = json['viewFlag'];
- deviceModel = json['deviceModel'];
- createUserId = json['createUserId'];
- createTime = json['createTime'];
- }
- Map<String, dynamic> toJson() {
- final Map<String, dynamic> data = new Map<String, dynamic>();
- data['id'] = this.id;
- data['userId'] = this.userId;
- data['content'] = this.content;
- data['type'] = this.type;
- data['viewFlag'] = this.viewFlag;
- data['deviceModel'] = this.deviceModel;
- data['createUserId'] = this.createUserId;
- data['createTime'] = this.createTime;
- return data;
- }
- }
- class MessageOverview {
- int systemMessageUnreadCount;
- int notificationMessageUnreadCount;
- Records systemMessageModel;
- Records notificationMessageModel;
- MessageOverview.fromJson(Map<String, dynamic> json) {
- Map<String, dynamic> systemMessage = json['系统消息'];
- systemMessageUnreadCount = systemMessage["count"];
- systemMessageModel = Records.fromJson(systemMessage['timeMessage']);
- Map<String, dynamic> notificationMessage = json['通知消息'];
- notificationMessageUnreadCount = notificationMessage['count'];
- notificationMessageModel =
- Records.fromJson(notificationMessage['timeMessage']);
- }
- }
|