/// records : [{"id":"","messageId":"","type":"","title":"","content":"","imageUrl":"","extraData":{"":{}},"createdAt":0,"expiresAt":0,"status":""}]
/// total : 0
/// size : 0
/// current : 0

class SCPublicMessagePageRes {
  SCPublicMessagePageRes({
    List<Records>? records,
    num? total,
    num? size,
    num? current,
  }) {
    _records = records;
    _total = total;
    _size = size;
    _current = current;
  }

  SCPublicMessagePageRes.fromJson(dynamic json) {
    if (json['records'] != null) {
      _records = [];
      json['records'].forEach((v) {
        _records?.add(Records.fromJson(v));
      });
    }
    _total = json['total'];
    _size = json['size'];
    _current = json['current'];
  }

  List<Records>? _records;
  num? _total;
  num? _size;
  num? _current;

  List<Records>? get records => _records;

  num? get total => _total;

  num? get size => _size;

  num? get current => _current;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (_records != null) {
      map['records'] = _records?.map((v) => v.toJson()).toList();
    }
    map['total'] = _total;
    map['size'] = _size;
    map['current'] = _current;
    return map;
  }
}

/// id : ""
/// messageId : ""
/// type : ""
/// title : ""
/// content : ""
/// imageUrl : ""
/// extraData : {"":{}}
/// createdAt : 0
/// expiresAt : 0
/// status : ""

class Records {
  Records({
    String? id,
    String? messageId,
    String? type,
    String? title,
    String? content,
    String? imageUrl,
    String? createdAt,
    String? expiresAt,
    String? status,
    ExtraData? extraData,
  }) {
    _id = id;
    _messageId = messageId;
    _type = type;
    _title = title;
    _content = content;
    _imageUrl = imageUrl;
    _createdAt = createdAt;
    _expiresAt = expiresAt;
    _status = status;
    _extraData = extraData;
  }

  Records.fromJson(dynamic json) {
    _id = json['id'];
    _messageId = json['messageId'];
    _type = json['type'];
    _title = json['title'];
    _content = json['content'];
    _imageUrl = json['imageUrl'];
    _createdAt = json['createdAt'];
    _expiresAt = json['expiresAt'];
    _status = json['status'];
    _extraData =
        json['extraData'] != null
            ? ExtraData.fromJson(json['extraData'])
            : null;
  }

  String? _id;
  String? _messageId;
  String? _type;
  String? _title;
  String? _content;
  String? _imageUrl;
  String? _createdAt;
  String? _expiresAt;
  String? _status;
  ExtraData? _extraData;

  String? get id => _id;

  String? get messageId => _messageId;

  String? get type => _type;

  String? get title => _title;

  String? get content => _content;

  String? get imageUrl => _imageUrl;

  String? get createdAt => _createdAt;

  String? get expiresAt => _expiresAt;

  String? get status => _status;

  ExtraData? get extraData => _extraData;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['messageId'] = _messageId;
    map['type'] = _type;
    map['title'] = _title;
    map['content'] = _content;
    map['imageUrl'] = _imageUrl;
    map['createdAt'] = _createdAt;
    map['expiresAt'] = _expiresAt;
    map['status'] = _status;
    if (_extraData != null) {
      map['extraData'] = _extraData?.toJson();
    }
    return map;
  }
}

class ExtraData {
  ExtraData({String? link}) {
    _link = link;
  }

  String? _link;

  String? get link => _link;

  ExtraData.fromJson(dynamic json) {
    _link = json['link'];
  }

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['link'] = _link;
    return map;
  }
}
