notice_board_documents_entity.g.dart 3.4 KB

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