notice_board_documents_entity.g.dart 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/notice_board_documents_entity.dart';
  3. NoticeBoardDocumentsEntity $NoticeBoardDocumentsEntityFromJson(
  4. Map<String, dynamic> json) {
  5. final NoticeBoardDocumentsEntity noticeBoardDocumentsEntity = NoticeBoardDocumentsEntity();
  6. final int? count = jsonConvert.convert<int>(json['count']);
  7. if (count != null) {
  8. noticeBoardDocumentsEntity.count = count;
  9. }
  10. final int? page = jsonConvert.convert<int>(json['page']);
  11. if (page != null) {
  12. noticeBoardDocumentsEntity.page = page;
  13. }
  14. final int? limit = jsonConvert.convert<int>(json['limit']);
  15. if (limit != null) {
  16. noticeBoardDocumentsEntity.limit = limit;
  17. }
  18. final int? countPage = jsonConvert.convert<int>(json['count_page']);
  19. if (countPage != null) {
  20. noticeBoardDocumentsEntity.countPage = countPage;
  21. }
  22. final List<NoticeBoardDocumentsList>? list = (json['list'] as List<dynamic>?)
  23. ?.map(
  24. (e) =>
  25. jsonConvert.convert<NoticeBoardDocumentsList>(
  26. e) as NoticeBoardDocumentsList)
  27. .toList();
  28. if (list != null) {
  29. noticeBoardDocumentsEntity.list = list;
  30. }
  31. return noticeBoardDocumentsEntity;
  32. }
  33. Map<String, dynamic> $NoticeBoardDocumentsEntityToJson(
  34. NoticeBoardDocumentsEntity entity) {
  35. final Map<String, dynamic> data = <String, dynamic>{};
  36. data['count'] = entity.count;
  37. data['page'] = entity.page;
  38. data['limit'] = entity.limit;
  39. data['count_page'] = entity.countPage;
  40. data['list'] = entity.list.map((v) => v.toJson()).toList();
  41. return data;
  42. }
  43. extension NoticeBoardDocumentsEntityExtension on NoticeBoardDocumentsEntity {
  44. NoticeBoardDocumentsEntity copyWith({
  45. int? count,
  46. int? page,
  47. int? limit,
  48. int? countPage,
  49. List<NoticeBoardDocumentsList>? list,
  50. }) {
  51. return NoticeBoardDocumentsEntity()
  52. ..count = count ?? this.count
  53. ..page = page ?? this.page
  54. ..limit = limit ?? this.limit
  55. ..countPage = countPage ?? this.countPage
  56. ..list = list ?? this.list;
  57. }
  58. }
  59. NoticeBoardDocumentsList $NoticeBoardDocumentsListFromJson(
  60. Map<String, dynamic> json) {
  61. final NoticeBoardDocumentsList noticeBoardDocumentsList = NoticeBoardDocumentsList();
  62. final int? id = jsonConvert.convert<int>(json['id']);
  63. if (id != null) {
  64. noticeBoardDocumentsList.id = id;
  65. }
  66. final int? parentId = jsonConvert.convert<int>(json['parent_id']);
  67. if (parentId != null) {
  68. noticeBoardDocumentsList.parentId = parentId;
  69. }
  70. final String? name = jsonConvert.convert<String>(json['name']);
  71. if (name != null) {
  72. noticeBoardDocumentsList.name = name;
  73. }
  74. final String? url = jsonConvert.convert<String>(json['url']);
  75. if (url != null) {
  76. noticeBoardDocumentsList.url = url;
  77. }
  78. return noticeBoardDocumentsList;
  79. }
  80. Map<String, dynamic> $NoticeBoardDocumentsListToJson(
  81. NoticeBoardDocumentsList entity) {
  82. final Map<String, dynamic> data = <String, dynamic>{};
  83. data['id'] = entity.id;
  84. data['parent_id'] = entity.parentId;
  85. data['name'] = entity.name;
  86. data['url'] = entity.url;
  87. return data;
  88. }
  89. extension NoticeBoardDocumentsListExtension on NoticeBoardDocumentsList {
  90. NoticeBoardDocumentsList copyWith({
  91. int? id,
  92. int? parentId,
  93. String? name,
  94. String? url,
  95. }) {
  96. return NoticeBoardDocumentsList()
  97. ..id = id ?? this.id
  98. ..parentId = parentId ?? this.parentId
  99. ..name = name ?? this.name
  100. ..url = url ?? this.url;
  101. }
  102. }