property_news_entity.dart 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/property_news_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/property_news_entity.g.dart';
  5. @JsonSerializable()
  6. class PropertyNewsEntity {
  7. int? count;
  8. int? page;
  9. int? limit;
  10. @JSONField(name: "count_page")
  11. int? countPage;
  12. List<PropertyNewsList>? list;
  13. PropertyNewsEntity();
  14. factory PropertyNewsEntity.fromJson(Map<String, dynamic> json) => $PropertyNewsEntityFromJson(json);
  15. Map<String, dynamic> toJson() => $PropertyNewsEntityToJson(this);
  16. @override
  17. String toString() {
  18. return jsonEncode(this);
  19. }
  20. }
  21. @JsonSerializable()
  22. class PropertyNewsList {
  23. int? id;
  24. String? title;
  25. @JSONField(name: "cover_image")
  26. String? coverImage;
  27. String? content;
  28. @JSONField(name: "likes_count")
  29. int? likesCount;
  30. bool? liked;
  31. @JSONField(name: "created_at")
  32. String? createdAt;
  33. PropertyNewsList();
  34. factory PropertyNewsList.fromJson(Map<String, dynamic> json) => $PropertyNewsListFromJson(json);
  35. Map<String, dynamic> toJson() => $PropertyNewsListToJson(this);
  36. @override
  37. String toString() {
  38. return jsonEncode(this);
  39. }
  40. }