rewards_list_entity.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/rewards_list_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/rewards_list_entity.g.dart';
  5. @JsonSerializable()
  6. class RewardsListEntity {
  7. late int count = 0;
  8. late int page = 0;
  9. late int limit = 0;
  10. @JSONField(name: "count_page")
  11. late int countPage = 0;
  12. late List<RewardsListList> list = [];
  13. RewardsListEntity();
  14. factory RewardsListEntity.fromJson(Map<String, dynamic> json) => $RewardsListEntityFromJson(json);
  15. Map<String, dynamic> toJson() => $RewardsListEntityToJson(this);
  16. @override
  17. String toString() {
  18. return jsonEncode(this);
  19. }
  20. }
  21. @JsonSerializable()
  22. class RewardsListList {
  23. late int id = 0;
  24. late String name = '';
  25. late List<String> resources = [];
  26. @JSONField(name: "original_point")
  27. late int originalPoint = 0;
  28. late int point = 0;
  29. RewardsListList();
  30. factory RewardsListList.fromJson(Map<String, dynamic> json) => $RewardsListListFromJson(json);
  31. Map<String, dynamic> toJson() => $RewardsListListToJson(this);
  32. @override
  33. String toString() {
  34. return jsonEncode(this);
  35. }
  36. }