
class NewModel {
  List<Data>? data;
  Mess? mess;

  NewModel({this.data, this.mess});

  NewModel.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      data = <Data>[];
      json['data'].forEach((v) {
        data!.add(new Data.fromJson(v));
      });
    }
    mess = json['mess'] != null ? new Mess.fromJson(json['mess']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    if (this.mess != null) {
      data['mess'] = this.mess!.toJson();
    }
    return data;
  }
}

class Data {
  String? blogId;
  String? title;
  String? keyword;
  String? shortContent;
  String? deviceType;
  String? urlImageRepresent;
  String? schoolId;
  String? categoryId;
  String? createDate;
  String? createUser;
  bool? publicBlog;
  int? sortedDate;
  List<Categories>? categories;
  String? updateDate;
  String? updateUser;

  Data(
      {this.blogId,
        this.title,
        this.keyword,
        this.shortContent,
        this.deviceType,
        this.urlImageRepresent,
        this.schoolId,
        this.categoryId,
        this.createDate,
        this.createUser,
        this.publicBlog,
        this.sortedDate,
        this.categories,
        this.updateDate,
        this.updateUser});

  Data.fromJson(Map<String, dynamic> json) {
    blogId = json['blogId'];
    title = json['title'];
    keyword = json['keyword'];
    shortContent = json['shortContent'];
    deviceType = json['deviceType'];
    urlImageRepresent = json['urlImageRepresent'];
    schoolId = json['schoolId'];
    categoryId = json['categoryId'];
    createDate = json['createDate'];
    createUser = json['createUser'];
    publicBlog = json['publicBlog'];
    sortedDate = json['sortedDate'];
    if (json['categories'] != null) {
      categories = <Categories>[];
      json['categories'].forEach((v) {
        categories!.add(new Categories.fromJson(v));
      });
    }
    updateDate = json['updateDate'];
    updateUser = json['updateUser'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['blogId'] = this.blogId;
    data['title'] = this.title;
    data['keyword'] = this.keyword;
    data['shortContent'] = this.shortContent;
    data['deviceType'] = this.deviceType;
    data['urlImageRepresent'] = this.urlImageRepresent;
    data['schoolId'] = this.schoolId;
    data['categoryId'] = this.categoryId;
    data['createDate'] = this.createDate;
    data['createUser'] = this.createUser;
    data['publicBlog'] = this.publicBlog;
    data['sortedDate'] = this.sortedDate;
    if (this.categories != null) {
      data['categories'] = this.categories!.map((v) => v.toJson()).toList();
    }
    data['updateDate'] = this.updateDate;
    data['updateUser'] = this.updateUser;
    return data;
  }
}

class Categories {
  String? id;
  String? blogId;
  String? categoryId;
  String? category;

  Categories({this.id, this.blogId, this.categoryId, this.category});

  Categories.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    blogId = json['blogId'];
    categoryId = json['categoryId'];
    category = json['category'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['blogId'] = this.blogId;
    data['categoryId'] = this.categoryId;
    data['category'] = this.category;
    return data;
  }
}

class Mess {
  int? code;
  String? description;

  Mess({this.code, this.description});

  Mess.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    description = json['description'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['description'] = this.description;
    return data;
  }
}
