/*
 * @Author: WuXiangNan
 * @Date: 2021-07-05 10:13:47
 * @LastEditors: WuXiangNan
 * @LastEditTime: 2021-07-05 10:19:31
 * @Description: 文件柜文件
 */

import 'package:cabinet_package/src/models/file_list.dart';

class CabinetFile {
  int? pageNum;
  int? pageSize;
  int? pages;
  int? total;
  List<FileList>? list;

  CabinetFile({this.total, this.pages, this.pageSize, this.pageNum, this.list});

  CabinetFile.fromJson(json) {
    Map<String, dynamic> map = Map.from(json ?? {});
    pageNum = map['pageNum'];
    pageSize = map['pageSize'];
    pages = map['pages'];
    total = map['total'];
    list = List<FileList>.from(
        (map['list'] ?? []).map((e) => FileList.fromJson(e)));
  }

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

    json['pageNum'] = this.pageNum;
    json['pageSize'] = this.pageSize;
    json['pages'] = this.pages;
    json['total'] = this.total;
    json['list'] =
        List<FileList>.from((this.list ?? []).map((e) => e.toJson()));

    return json;
  }
}
