/*
 * @Author       : WuWei
 * @LastEditors  : WuWei
 * @Date         : 2022-03-14 15:13:45
 * @LastEditTime : 2022-03-18 17:04:35
 * @Description  : Do not edit
 */

class NoticeDetailModel {
  String? id;
  String? title;
  String? publishAt;
  bool? isStick;
  String? content;
  String? createdByName;
  num? readNum;
  List<FilesOfNoticeDetailModel>? files;

  NoticeDetailModel({
    this.id,
    this.title,
    this.publishAt,
    this.isStick,
    this.content,
    this.createdByName,
    this.readNum,
    this.files,
  });

  NoticeDetailModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    id = map['id'];
    title = map['title'];
    publishAt = map['publishAt'];
    isStick = map['isStick'];
    content = map['content'];
    createdByName = map['createdByName'];
    readNum = map['readNum'];
    files = List<FilesOfNoticeDetailModel>.from(
        (map["files"] ?? []).map((x) => FilesOfNoticeDetailModel.fromJson(x)));
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['id'] = this.id;
    json['title'] = this.title;
    json['publishAt'] = this.publishAt;
    json['isStick'] = this.isStick;
    json['content'] = this.content;
    json['createdByName'] = this.createdByName;
    json['readNum'] = this.readNum;
    json['files'] = List<dynamic>.from((files ?? []).map((x) => x.toJson()));

    return json;
  }
}

class FilesOfNoticeDetailModel {
  String? fileId;
  String? fileName;
  String? fileSuffix;

  FilesOfNoticeDetailModel({
    this.fileId,
    this.fileName,
    this.fileSuffix,
  });

  FilesOfNoticeDetailModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});

    fileId = map['fileId'];
    fileName = map['fileName'];
    fileSuffix = map['fileSuffix'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();

    json['fileId'] = this.fileId;
    json['fileName'] = this.fileName;
    json['fileSuffix'] = this.fileSuffix;

    return json;
  }
}
