rewards_search_entity.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/rewards_search_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/rewards_search_entity.g.dart';
  5. @JsonSerializable()
  6. class RewardsSearchEntity {
  7. late List<String> recent = [];
  8. late List<String> trending = [];
  9. late List<RewardsSearchRewards> rewards = [];
  10. RewardsSearchEntity();
  11. factory RewardsSearchEntity.fromJson(Map<String, dynamic> json) => $RewardsSearchEntityFromJson(json);
  12. Map<String, dynamic> toJson() => $RewardsSearchEntityToJson(this);
  13. @override
  14. String toString() {
  15. return jsonEncode(this);
  16. }
  17. }
  18. @JsonSerializable()
  19. class RewardsSearchRewards {
  20. late int id = 0;
  21. late String name = '';
  22. late List<String> resources = [];
  23. @JSONField(name: "original_point")
  24. late int originalPoint = 0;
  25. late int point = 0;
  26. RewardsSearchRewards();
  27. factory RewardsSearchRewards.fromJson(Map<String, dynamic> json) => $RewardsSearchRewardsFromJson(json);
  28. Map<String, dynamic> toJson() => $RewardsSearchRewardsToJson(this);
  29. @override
  30. String toString() {
  31. return jsonEncode(this);
  32. }
  33. }