meeting_room.dart 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import 'meeting_info.dart';
  2. class MeetingRoomBuildModel {
  3. String? id;
  4. String? name;
  5. String? address;
  6. List<MeetingRoom>? roomList;
  7. MeetingRoomBuildModel({ this.id, this.name, this.address });
  8. MeetingRoomBuildModel.fromJson(Map<String, dynamic> json){
  9. id = json['id'];
  10. name = json['name'];
  11. address = json['address'];
  12. roomList = json['roomList'] == null ? null : List<MeetingRoom>.from(json['roomList'].map((x)=> MeetingRoom.fromJson(x)));
  13. }
  14. Map<String, dynamic> toJson(){
  15. final Map<String, dynamic> data = <String, dynamic>{};
  16. data['id'] = id;
  17. data['name'] = name;
  18. data['address'] = address;
  19. data['roomList'] = roomList == null ? null : roomList!.map((e) => e.toJson()).toList();
  20. return data;
  21. }
  22. }
  23. class MeetingRoom {
  24. MeetingRoom({
  25. this.id,
  26. this.pinyin,
  27. this.pinyinInitial,
  28. this.name,
  29. this.building,
  30. this.floor,
  31. this.roomNumber,
  32. this.phoneNumber,
  33. this.device,
  34. this.capacity,
  35. this.available,
  36. this.idle,
  37. this.createTime,
  38. this.updateTime,
  39. this.buildName,
  40. this.meetingList
  41. });
  42. String? id;
  43. String? pinyin;
  44. String? pinyinInitial;
  45. String? name;
  46. String? building;
  47. int? floor;
  48. String? roomNumber;
  49. String? phoneNumber;
  50. String? device;
  51. int? capacity;
  52. bool? available;
  53. bool? idle;
  54. String? createTime;
  55. String? updateTime;
  56. String? buildName; // 分组使用
  57. List<MeetingInfoModel>? meetingList;
  58. factory MeetingRoom.fromJson(Map<String, dynamic> json) => MeetingRoom(
  59. id: json["id"] ,
  60. pinyin: json["pinyin"],
  61. pinyinInitial: json["pinyinInitial"],
  62. name: json["name"],
  63. building: json["building"] ,
  64. floor: json["floor"],
  65. roomNumber: json["roomNumber"] ,
  66. phoneNumber: json["phoneNumber"] ,
  67. device: json["device"],
  68. capacity: json["capacity"],
  69. available: json["available"],
  70. idle: json["idle"],
  71. createTime: json["createTime"] ,
  72. updateTime: json["updateTime"],
  73. meetingList: json["meetingList"] == null ? null : List<MeetingInfoModel>.from(json["meetingList"].map((x) => MeetingInfoModel.fromJson(x))),
  74. );
  75. Map<String, dynamic> toJson() => {
  76. "id": id ,
  77. "pinyin": pinyin ,
  78. "pinyinInitial": pinyinInitial,
  79. "name": name ,
  80. "building": building ,
  81. "floor": floor,
  82. "roomNumber": roomNumber ,
  83. "phoneNumber": phoneNumber,
  84. "device": device ,
  85. "capacity": capacity ,
  86. "available": available ,
  87. "idle": idle ,
  88. "createTime": createTime ,
  89. "updateTime": updateTime,
  90. "meetingList": meetingList == null ? null : meetingList!.map((e) => e.toJson()).toList() ,
  91. };
  92. }