latest_news_page_entity.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/latest_news_page_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/latest_news_page_entity.g.dart';
  5. @JsonSerializable()
  6. class LatestNewsPageEntity {
  7. int count = 0;
  8. int page = 0;
  9. int limit = 0;
  10. @JSONField(name: "count_page")
  11. int countPage = 0;
  12. List<LatestNewsList>? list = [];
  13. LatestNewsPageEntity();
  14. factory LatestNewsPageEntity.fromJson(Map<String, dynamic> json) => $LatestNewsPageEntityFromJson(json);
  15. Map<String, dynamic> toJson() => $LatestNewsPageEntityToJson(this);
  16. @override
  17. String toString() {
  18. return jsonEncode(this);
  19. }
  20. }
  21. @JsonSerializable()
  22. class LatestNewsList {
  23. String? id;
  24. int type = 0;
  25. String? title;
  26. @JSONField(name: "cover_image")
  27. String? coverImage;
  28. String? content;
  29. @JSONField(name: "created_at")
  30. String? createdAt;
  31. LatestNewsList();
  32. factory LatestNewsList.fromJson(Map<String, dynamic> json) => $LatestNewsListFromJson(json);
  33. Map<String, dynamic> toJson() => $LatestNewsListToJson(this);
  34. @override
  35. String toString() {
  36. return jsonEncode(this);
  37. }
  38. }