notice_board_announ_entity.g.dart 3.1 KB

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