rewards_my_entity.dart 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/rewards_my_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/rewards_my_entity.g.dart';
  5. @JsonSerializable()
  6. class RewardsMyEntity {
  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<RewardsMyList> list = [];
  13. RewardsMyEntity();
  14. factory RewardsMyEntity.fromJson(Map<String, dynamic> json) => $RewardsMyEntityFromJson(json);
  15. Map<String, dynamic> toJson() => $RewardsMyEntityToJson(this);
  16. @override
  17. String toString() {
  18. return jsonEncode(this);
  19. }
  20. }
  21. @JsonSerializable()
  22. class RewardsMyList {
  23. late int id = 0;
  24. @JSONField(name: "redemption_code")
  25. late int redemptionCode = 0;
  26. @JSONField(name: "used_at")
  27. late String usedAt = '';
  28. late RewardsMyListReward reward;
  29. RewardsMyList();
  30. factory RewardsMyList.fromJson(Map<String, dynamic> json) => $RewardsMyListFromJson(json);
  31. Map<String, dynamic> toJson() => $RewardsMyListToJson(this);
  32. @override
  33. String toString() {
  34. return jsonEncode(this);
  35. }
  36. }
  37. @JsonSerializable()
  38. class RewardsMyListReward {
  39. late int id = 0;
  40. late String title = '';
  41. late List<String> resources = [];
  42. @JSONField(name: "original_point")
  43. late int originalPoint = 0;
  44. late int point = 0;
  45. @JSONField(name: "redeemed_start")
  46. late String redeemedStart = '';
  47. @JSONField(name: "redeemed_end")
  48. late String redeemedEnd = '';
  49. RewardsMyListReward();
  50. factory RewardsMyListReward.fromJson(Map<String, dynamic> json) => $RewardsMyListRewardFromJson(json);
  51. Map<String, dynamic> toJson() => $RewardsMyListRewardToJson(this);
  52. @override
  53. String toString() {
  54. return jsonEncode(this);
  55. }
  56. }