|
@@ -4,36 +4,92 @@ import 'package:domain/entity/myposts_sale_rent_entity.dart';
|
|
MypostsSaleRentEntity $MypostsSaleRentEntityFromJson(
|
|
MypostsSaleRentEntity $MypostsSaleRentEntityFromJson(
|
|
Map<String, dynamic> json) {
|
|
Map<String, dynamic> json) {
|
|
final MypostsSaleRentEntity mypostsSaleRentEntity = MypostsSaleRentEntity();
|
|
final MypostsSaleRentEntity mypostsSaleRentEntity = MypostsSaleRentEntity();
|
|
|
|
+ final int? count = jsonConvert.convert<int>(json['count']);
|
|
|
|
+ if (count != null) {
|
|
|
|
+ mypostsSaleRentEntity.count = count;
|
|
|
|
+ }
|
|
|
|
+ final int? page = jsonConvert.convert<int>(json['page']);
|
|
|
|
+ if (page != null) {
|
|
|
|
+ mypostsSaleRentEntity.page = page;
|
|
|
|
+ }
|
|
|
|
+ final int? limit = jsonConvert.convert<int>(json['limit']);
|
|
|
|
+ if (limit != null) {
|
|
|
|
+ mypostsSaleRentEntity.limit = limit;
|
|
|
|
+ }
|
|
|
|
+ final int? countPage = jsonConvert.convert<int>(json['count_page']);
|
|
|
|
+ if (countPage != null) {
|
|
|
|
+ mypostsSaleRentEntity.countPage = countPage;
|
|
|
|
+ }
|
|
|
|
+ final List<MypostsSaleRentList>? list = (json['list'] as List<dynamic>?)
|
|
|
|
+ ?.map(
|
|
|
|
+ (e) =>
|
|
|
|
+ jsonConvert.convert<MypostsSaleRentList>(e) as MypostsSaleRentList)
|
|
|
|
+ .toList();
|
|
|
|
+ if (list != null) {
|
|
|
|
+ mypostsSaleRentEntity.list = list;
|
|
|
|
+ }
|
|
|
|
+ return mypostsSaleRentEntity;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+Map<String, dynamic> $MypostsSaleRentEntityToJson(
|
|
|
|
+ MypostsSaleRentEntity entity) {
|
|
|
|
+ final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
+ 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 MypostsSaleRentEntityExtension on MypostsSaleRentEntity {
|
|
|
|
+ MypostsSaleRentEntity copyWith({
|
|
|
|
+ int? count,
|
|
|
|
+ int? page,
|
|
|
|
+ int? limit,
|
|
|
|
+ int? countPage,
|
|
|
|
+ List<MypostsSaleRentList>? list,
|
|
|
|
+ }) {
|
|
|
|
+ return MypostsSaleRentEntity()
|
|
|
|
+ ..count = count ?? this.count
|
|
|
|
+ ..page = page ?? this.page
|
|
|
|
+ ..limit = limit ?? this.limit
|
|
|
|
+ ..countPage = countPage ?? this.countPage
|
|
|
|
+ ..list = list ?? this.list;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+MypostsSaleRentList $MypostsSaleRentListFromJson(Map<String, dynamic> json) {
|
|
|
|
+ final MypostsSaleRentList mypostsSaleRentList = MypostsSaleRentList();
|
|
final int? id = jsonConvert.convert<int>(json['id']);
|
|
final int? id = jsonConvert.convert<int>(json['id']);
|
|
if (id != null) {
|
|
if (id != null) {
|
|
- mypostsSaleRentEntity.id = id;
|
|
|
|
|
|
+ mypostsSaleRentList.id = id;
|
|
}
|
|
}
|
|
final String? title = jsonConvert.convert<String>(json['title']);
|
|
final String? title = jsonConvert.convert<String>(json['title']);
|
|
if (title != null) {
|
|
if (title != null) {
|
|
- mypostsSaleRentEntity.title = title;
|
|
|
|
|
|
+ mypostsSaleRentList.title = title;
|
|
}
|
|
}
|
|
final int? price = jsonConvert.convert<int>(json['price']);
|
|
final int? price = jsonConvert.convert<int>(json['price']);
|
|
if (price != null) {
|
|
if (price != null) {
|
|
- mypostsSaleRentEntity.price = price;
|
|
|
|
|
|
+ mypostsSaleRentList.price = price;
|
|
}
|
|
}
|
|
final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
|
|
final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
|
|
(e) => jsonConvert.convert<String>(e) as String).toList();
|
|
(e) => jsonConvert.convert<String>(e) as String).toList();
|
|
if (resources != null) {
|
|
if (resources != null) {
|
|
- mypostsSaleRentEntity.resources = resources;
|
|
|
|
|
|
+ mypostsSaleRentList.resources = resources;
|
|
}
|
|
}
|
|
final String? createdAt = jsonConvert.convert<String>(json['created_at']);
|
|
final String? createdAt = jsonConvert.convert<String>(json['created_at']);
|
|
if (createdAt != null) {
|
|
if (createdAt != null) {
|
|
- mypostsSaleRentEntity.createdAt = createdAt;
|
|
|
|
|
|
+ mypostsSaleRentList.createdAt = createdAt;
|
|
}
|
|
}
|
|
final int? likesCount = jsonConvert.convert<int>(json['likes_count']);
|
|
final int? likesCount = jsonConvert.convert<int>(json['likes_count']);
|
|
if (likesCount != null) {
|
|
if (likesCount != null) {
|
|
- mypostsSaleRentEntity.likesCount = likesCount;
|
|
|
|
|
|
+ mypostsSaleRentList.likesCount = likesCount;
|
|
}
|
|
}
|
|
- return mypostsSaleRentEntity;
|
|
|
|
|
|
+ return mypostsSaleRentList;
|
|
}
|
|
}
|
|
|
|
|
|
-Map<String, dynamic> $MypostsSaleRentEntityToJson(
|
|
|
|
- MypostsSaleRentEntity entity) {
|
|
|
|
|
|
+Map<String, dynamic> $MypostsSaleRentListToJson(MypostsSaleRentList entity) {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = entity.id;
|
|
data['id'] = entity.id;
|
|
data['title'] = entity.title;
|
|
data['title'] = entity.title;
|
|
@@ -44,8 +100,8 @@ Map<String, dynamic> $MypostsSaleRentEntityToJson(
|
|
return data;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
|
|
-extension MypostsSaleRentEntityExtension on MypostsSaleRentEntity {
|
|
|
|
- MypostsSaleRentEntity copyWith({
|
|
|
|
|
|
+extension MypostsSaleRentListExtension on MypostsSaleRentList {
|
|
|
|
+ MypostsSaleRentList copyWith({
|
|
int? id,
|
|
int? id,
|
|
String? title,
|
|
String? title,
|
|
int? price,
|
|
int? price,
|
|
@@ -53,7 +109,7 @@ extension MypostsSaleRentEntityExtension on MypostsSaleRentEntity {
|
|
String? createdAt,
|
|
String? createdAt,
|
|
int? likesCount,
|
|
int? likesCount,
|
|
}) {
|
|
}) {
|
|
- return MypostsSaleRentEntity()
|
|
|
|
|
|
+ return MypostsSaleRentList()
|
|
..id = id ?? this.id
|
|
..id = id ?? this.id
|
|
..title = title ?? this.title
|
|
..title = title ?? this.title
|
|
..price = price ?? this.price
|
|
..price = price ?? this.price
|