notice_board_announ_entity.g.dart 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import 'package:domain/generated/json/base/json_convert_content.dart';
  2. import 'package:domain/entity/notice_board_announ_entity.dart';
  3. NoticeBoardAnnounEntity $NoticeBoardAnnounEntityFromJson(
  4. Map<String, dynamic> json) {
  5. final NoticeBoardAnnounEntity noticeBoardAnnounEntity = NoticeBoardAnnounEntity();
  6. final int? count = jsonConvert.convert<int>(json['count']);
  7. if (count != null) {
  8. noticeBoardAnnounEntity.count = count;
  9. }
  10. final int? page = jsonConvert.convert<int>(json['page']);
  11. if (page != null) {
  12. noticeBoardAnnounEntity.page = page;
  13. }
  14. final int? limit = jsonConvert.convert<int>(json['limit']);
  15. if (limit != null) {
  16. noticeBoardAnnounEntity.limit = limit;
  17. }
  18. final int? countPage = jsonConvert.convert<int>(json['count_page']);
  19. if (countPage != null) {
  20. noticeBoardAnnounEntity.countPage = countPage;
  21. }
  22. final List<NoticeBoardAnnounList>? list = (json['list'] as List<dynamic>?)
  23. ?.map(
  24. (e) =>
  25. jsonConvert.convert<NoticeBoardAnnounList>(e) as NoticeBoardAnnounList)
  26. .toList();
  27. if (list != null) {
  28. noticeBoardAnnounEntity.list = list;
  29. }
  30. return noticeBoardAnnounEntity;
  31. }
  32. Map<String, dynamic> $NoticeBoardAnnounEntityToJson(
  33. NoticeBoardAnnounEntity 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 NoticeBoardAnnounEntityExtension on NoticeBoardAnnounEntity {
  43. NoticeBoardAnnounEntity copyWith({
  44. int? count,
  45. int? page,
  46. int? limit,
  47. int? countPage,
  48. List<NoticeBoardAnnounList>? list,
  49. }) {
  50. return NoticeBoardAnnounEntity()
  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. NoticeBoardAnnounList $NoticeBoardAnnounListFromJson(
  59. Map<String, dynamic> json) {
  60. final NoticeBoardAnnounList noticeBoardAnnounList = NoticeBoardAnnounList();
  61. final int? id = jsonConvert.convert<int>(json['id']);
  62. if (id != null) {
  63. noticeBoardAnnounList.id = id;
  64. }
  65. final String? title = jsonConvert.convert<String>(json['title']);
  66. if (title != null) {
  67. noticeBoardAnnounList.title = title;
  68. }
  69. final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  70. if (createdAt != null) {
  71. noticeBoardAnnounList.createdAt = createdAt;
  72. }
  73. return noticeBoardAnnounList;
  74. }
  75. Map<String, dynamic> $NoticeBoardAnnounListToJson(
  76. NoticeBoardAnnounList entity) {
  77. final Map<String, dynamic> data = <String, dynamic>{};
  78. data['id'] = entity.id;
  79. data['title'] = entity.title;
  80. data['created_at'] = entity.createdAt;
  81. return data;
  82. }
  83. extension NoticeBoardAnnounListExtension on NoticeBoardAnnounList {
  84. NoticeBoardAnnounList copyWith({
  85. int? id,
  86. String? title,
  87. String? createdAt,
  88. }) {
  89. return NoticeBoardAnnounList()
  90. ..id = id ?? this.id
  91. ..title = title ?? this.title
  92. ..createdAt = createdAt ?? this.createdAt;
  93. }
  94. }