import 'package:domain/generated/json/base/json_convert_content.dart'; import 'package:domain/entity/notice_board_announ_entity.dart'; NoticeBoardAnnounEntity $NoticeBoardAnnounEntityFromJson(Map json) { final NoticeBoardAnnounEntity noticeBoardAnnounEntity = NoticeBoardAnnounEntity(); final int? count = jsonConvert.convert(json['count']); if (count != null) { noticeBoardAnnounEntity.count = count; } final int? page = jsonConvert.convert(json['page']); if (page != null) { noticeBoardAnnounEntity.page = page; } final int? limit = jsonConvert.convert(json['limit']); if (limit != null) { noticeBoardAnnounEntity.limit = limit; } final int? countPage = jsonConvert.convert(json['count_page']); if (countPage != null) { noticeBoardAnnounEntity.countPage = countPage; } final List? list = (json['list'] as List?)?.map( (e) => jsonConvert.convert(e) as NoticeBoardAnnounList).toList(); if (list != null) { noticeBoardAnnounEntity.list = list; } return noticeBoardAnnounEntity; } Map $NoticeBoardAnnounEntityToJson(NoticeBoardAnnounEntity entity) { final Map data = {}; data['count'] = entity.count; data['page'] = entity.page; data['limit'] = entity.limit; data['count_page'] = entity.countPage; data['list'] = entity.list.map((v) => v.toJson()).toList(); return data; } extension NoticeBoardAnnounEntityExtension on NoticeBoardAnnounEntity { NoticeBoardAnnounEntity copyWith({ int? count, int? page, int? limit, int? countPage, List? list, }) { return NoticeBoardAnnounEntity() ..count = count ?? this.count ..page = page ?? this.page ..limit = limit ?? this.limit ..countPage = countPage ?? this.countPage ..list = list ?? this.list; } } NoticeBoardAnnounList $NoticeBoardAnnounListFromJson(Map json) { final NoticeBoardAnnounList noticeBoardAnnounList = NoticeBoardAnnounList(); final int? id = jsonConvert.convert(json['id']); if (id != null) { noticeBoardAnnounList.id = id; } final String? title = jsonConvert.convert(json['title']); if (title != null) { noticeBoardAnnounList.title = title; } final String? createdAt = jsonConvert.convert(json['created_at']); if (createdAt != null) { noticeBoardAnnounList.createdAt = createdAt; } return noticeBoardAnnounList; } Map $NoticeBoardAnnounListToJson(NoticeBoardAnnounList entity) { final Map data = {}; data['id'] = entity.id; data['title'] = entity.title; data['created_at'] = entity.createdAt; return data; } extension NoticeBoardAnnounListExtension on NoticeBoardAnnounList { NoticeBoardAnnounList copyWith({ int? id, String? title, String? createdAt, }) { return NoticeBoardAnnounList() ..id = id ?? this.id ..title = title ?? this.title ..createdAt = createdAt ?? this.createdAt; } }