calendar_info.dart 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. class MyCalendarList {
  2. List<CalendarInfo>? myCalendars;
  3. List<CalendarInfo>? unitCalendars;
  4. List<CalendarInfo>? followCalendars;
  5. MyCalendarList({this.myCalendars, this.unitCalendars, this.followCalendars});
  6. factory MyCalendarList.fromJson(Map<String, dynamic> json) => MyCalendarList(
  7. myCalendars: json["myCalendars"] == null
  8. ? []
  9. : List<CalendarInfo>.from(
  10. json["myCalendars"]!.map((e) => CalendarInfo.fromJson(e))),
  11. unitCalendars: json["unitCalendars"] == null
  12. ? []
  13. : List<CalendarInfo>.from(
  14. json["unitCalendars"]!.map((e) => CalendarInfo.fromJson(e))),
  15. followCalendars: json["followCalendars"] == null
  16. ? []
  17. : List<CalendarInfo>.from(
  18. json["followCalendars"]!.map((e) => CalendarInfo.fromJson(e))));
  19. Map<String, dynamic> toJson() => {
  20. "myCalendars": myCalendars,
  21. "unitCalendars": unitCalendars,
  22. "followCalendars": followCalendars,
  23. };
  24. }
  25. class CalendarInfo {
  26. bool? manageable;
  27. bool? publishable;
  28. String? id;
  29. String? name;
  30. String? type;
  31. String? target; // 所属组织
  32. String? color;
  33. String? description;
  34. String? source;
  35. String? createor;
  36. bool? isPublic;
  37. String? createTime;
  38. String? updateTime;
  39. List<String>? manageablePersonList;
  40. List<String>? publishableGroupList;
  41. List<String>? publishablePersonList;
  42. List<String>? publishableUnitList;
  43. List<String>? viewableGroupList;
  44. List<String>? viewablePersonList;
  45. List<String>? viewableUnitList;
  46. String? groupedTag;
  47. CalendarInfo({
  48. this.manageable,
  49. this.publishable,
  50. this.id,
  51. this.name,
  52. this.type,
  53. this.target,
  54. this.color,
  55. this.description,
  56. this.source,
  57. this.createor,
  58. this.isPublic,
  59. this.createTime,
  60. this.updateTime,
  61. this.manageablePersonList,
  62. this.publishableGroupList,
  63. this.publishablePersonList,
  64. this.publishableUnitList,
  65. this.viewableGroupList,
  66. this.viewablePersonList,
  67. this.viewableUnitList,
  68. this.groupedTag,
  69. });
  70. factory CalendarInfo.fromJson(Map<String, dynamic> json) => CalendarInfo(
  71. manageable: json["manageable"],
  72. publishable: json["publishable"],
  73. id: json["id"],
  74. name: json["name"],
  75. type: json["type"],
  76. target: json["target"],
  77. color: json["color"],
  78. description: json["description"],
  79. source: json["source"],
  80. createor: json["createor"],
  81. isPublic: json["isPublic"],
  82. createTime: json["createTime"],
  83. updateTime: json["updateTime"],
  84. manageablePersonList: json["manageablePersonList"] == null ? [] : List<String>.from(json["manageablePersonList"]!.map((x) => x)),
  85. publishableGroupList: json["publishableGroupList"] == null ? [] : List<String>.from(json["publishableGroupList"]!.map((x) => x)),
  86. publishablePersonList: json["publishablePersonList"] == null ? [] : List<String>.from(json["publishablePersonList"]!.map((x) => x)),
  87. publishableUnitList: json["publishableUnitList"] == null ? [] : List<String>.from(json["publishableUnitList"]!.map((x) => x)),
  88. viewableGroupList: json["viewableGroupList"] == null ? [] : List<String>.from(json["viewableGroupList"]!.map((x) => x)),
  89. viewablePersonList: json["viewablePersonList"] == null ? [] : List<String>.from(json["viewablePersonList"]!.map((x) => x)),
  90. viewableUnitList: json["viewableUnitList"] == null ? [] : List<String>.from(json["viewableUnitList"]!.map((x) => x)),
  91. groupedTag: json["groupedTag"],
  92. );
  93. Map<String, dynamic> toJson() => {
  94. "manageable": manageable,
  95. "publishable": publishable,
  96. "id": id,
  97. "name": name,
  98. "type": type,
  99. "target": target,
  100. "color": color,
  101. "description": description,
  102. "source": source,
  103. "createor": createor,
  104. "isPublic": isPublic,
  105. "createTime": createTime,
  106. "updateTime": updateTime,
  107. "manageablePersonList": manageablePersonList == null ? [] : List<String>.from(manageablePersonList!.map((x) => x)),
  108. "publishableGroupList": publishableGroupList == null ? [] : List<String>.from(publishableGroupList!.map((x) => x)),
  109. "publishablePersonList": publishablePersonList == null ? [] : List<String>.from(publishablePersonList!.map((x) => x)),
  110. "publishableUnitList": publishableUnitList == null ? [] : List<String>.from(publishableUnitList!.map((x) => x)),
  111. "viewableGroupList": viewableGroupList == null ? [] : List<String>.from(viewableGroupList!.map((x) => x)),
  112. "viewablePersonList": viewablePersonList == null ? [] : List<String>.from(viewablePersonList!.map((x) => x)),
  113. "viewableUnitList": viewableUnitList == null ? [] : List<String>.from(viewableUnitList!.map((x) => x)),
  114. "groupedTag": groupedTag,
  115. };
  116. }