notice_board_event_entity.g.dart 3.4 KB

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