class MessageModel {
  final String id;
  final String title;
  final String content;
  final String createTime;
  int isRead; // 0: 已读, 1: 未读

  MessageModel({
    required this.id,
    required this.title,
    required this.content,
    required this.createTime,
    required this.isRead,
  });

  factory MessageModel.fromJson(Map<String, dynamic> json) {
    return MessageModel(
      id: json['id']?.toString() ?? '',
      title: json['title']?.toString() ?? '消息通知',
      content: json['content']?.toString() ?? '',
      createTime: json['createTime']?.toString() ?? '',
      isRead: json['isRead'] as int? ?? 0,
    );
  }
}
