part of models;

/// type : 1
/// title : "系统通知"
/// content : "v2.0上线了"
/// status : 0
/// url_id : 0
/// create_time : "2021-09-16 14:01:19"

class MsgModel {
  MsgModel({
      this.id,
      this.type, 
      this.title, 
      this.content, 
      this.status, 
      this.urlId, 
      this.createTime,});

  MsgModel.fromJson(dynamic json) {
    id = json['id'];
    type = json['type'];
    title = json['title'];
    content = json['content'];
    status = json['status'];
    urlId = json['url_id'] != null ? UrlIdModel.fromJson(json['url_id']) : null;
    createTime = json['create_time'];
  }
  num? id;
  num? type;
  String? title;
  String? content;
  num? status;
  UrlIdModel? urlId;
  String? createTime;
  MsgModel copyWith({
    num? id,
    num? type,
    String? title,
    String? content,
    num? status,
    UrlIdModel? urlId,
    String? createTime,
  }) => MsgModel(
    id: id ?? this.id,
    type: type ?? this.type,
    title: title ?? this.title,
    content: content ?? this.content,
    status: status ?? this.status,
    urlId: urlId ?? this.urlId,
    createTime: createTime ?? this.createTime,
  );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['type'] = type;
    map['title'] = title;
    map['content'] = content;
    map['status'] = status;
    if (urlId != null) {
      map['url_id'] = urlId?.toJson();
    }
    map['create_time'] = createTime;
    return map;
  }

}

class UrlIdModel {
  UrlIdModel({
    this.bookId,
    this.chapterId,});

  UrlIdModel.fromJson(dynamic json) {
    bookId = json['book_id'];
    chapterId = json['chapter_id'];
  }
  num? bookId;
  num? chapterId;
  UrlIdModel copyWith({  num? bookId,
    num? chapterId,
  }) => UrlIdModel(  bookId: bookId ?? this.bookId,
    chapterId: chapterId ?? this.chapterId,
  );
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['book_id'] = bookId;
    map['chapter_id'] = chapterId;
    return map;
  }

}