file_info.dart 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. class FileInfo {
  2. FileInfo({
  3. this.id,
  4. this.person,
  5. this.name,
  6. this.extension,
  7. this.length,
  8. this.type,
  9. this.folder,
  10. this.originFile,
  11. this.status,
  12. this.lastUpdateTime,
  13. this.lastUpdatePerson,
  14. this.createTime,
  15. this.updateTime,
  16. this.isAdmin,
  17. this.isEditor,
  18. this.isZone,
  19. this.zoneId
  20. });
  21. String? id;
  22. String? person;
  23. String? name;
  24. String? extension;
  25. int? length;
  26. String? type;
  27. String? folder;
  28. String? originFile;
  29. String? status;
  30. String? lastUpdateTime;
  31. String? lastUpdatePerson;
  32. String? createTime;
  33. String? updateTime;
  34. // v3 版本字段
  35. bool? isAdmin;
  36. bool? isEditor;
  37. bool? isZone;
  38. String? zoneId;
  39. // 不同的接口
  40. bool isV3 = false;
  41. String fileNamePlusExtension() {
  42. return '$name.$extension';
  43. }
  44. factory FileInfo.fromJson(Map<String, dynamic> json) => FileInfo(
  45. id: json["id"],
  46. person: json["person"],
  47. name: json["name"],
  48. extension: json["extension"],
  49. length: json["length"],
  50. type: json["type"],
  51. folder: json["folder"],
  52. originFile: json["originFile"],
  53. status: json["status"],
  54. lastUpdateTime: json["lastUpdateTime"],
  55. lastUpdatePerson: json["lastUpdatePerson"],
  56. createTime: json["createTime"],
  57. updateTime: json["updateTime"],
  58. isAdmin: json["isAdmin"],
  59. isEditor: json["isEditor"],
  60. isZone: json["isZone"],
  61. zoneId: json["zoneId"],
  62. );
  63. Map<String, dynamic> toJson() => {
  64. "id": id,
  65. "person": person,
  66. "name": name,
  67. "extension": extension,
  68. "length": length,
  69. "type": type,
  70. "folder": folder,
  71. "originFile": originFile,
  72. "status": status,
  73. "lastUpdateTime": lastUpdateTime,
  74. "lastUpdatePerson": lastUpdatePerson,
  75. "createTime": createTime,
  76. "updateTime": updateTime,
  77. "isAdmin": isAdmin,
  78. "isEditor": isEditor,
  79. "isZone": isZone,
  80. "zoneId": zoneId,
  81. };
  82. }