| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /// 报警数据模型
- class AlertModel {
- final String id;
- final String title;
- final String level;
- final String station;
- final String content;
- final String time;
- bool isRead;
-
- AlertModel({
- required this.id,
- required this.title,
- required this.level,
- required this.station,
- required this.content,
- required this.time,
- this.isRead = false,
- });
-
- factory AlertModel.fromJson(Map<String, dynamic> json) {
- return AlertModel(
- id: json['id']?.toString() ?? '',
- title: json['title'] ?? '',
- level: json['level'] ?? 'info',
- station: json['station'] ?? '',
- content: json['content'] ?? '',
- time: json['time'] ?? '',
- isRead: json['isRead'] ?? false,
- );
- }
-
- Map<String, dynamic> toJson() {
- return {
- 'id': id,
- 'title': title,
- 'level': level,
- 'station': station,
- 'content': content,
- 'time': time,
- 'isRead': isRead,
- };
- }
- }
|