rewards_my_detail_entity.dart 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/rewards_my_detail_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/rewards_my_detail_entity.g.dart';
  5. @JsonSerializable()
  6. class RewardsMyDetailEntity {
  7. late int id = 0;
  8. @JSONField(name: "redemption_code")
  9. late int redemptionCode = 0;
  10. @JSONField(name: "used_at")
  11. late String usedAt = '';
  12. @JSONField(name: "created_at")
  13. late String createdAt = '';
  14. @JSONField(name: "expired_at")
  15. late String expiredAt = '';
  16. late int quantity = 0;
  17. late RewardsMyDetailReward reward;
  18. late RewardsMyDetailAccount account;
  19. RewardsMyDetailEntity();
  20. factory RewardsMyDetailEntity.fromJson(Map<String, dynamic> json) =>
  21. $RewardsMyDetailEntityFromJson(json);
  22. Map<String, dynamic> toJson() => $RewardsMyDetailEntityToJson(this);
  23. @override
  24. String toString() {
  25. return jsonEncode(this);
  26. }
  27. }
  28. @JsonSerializable()
  29. class RewardsMyDetailAccount {
  30. late int id = 0;
  31. late String name = '';
  32. late int phone = 0;
  33. RewardsMyDetailAccount();
  34. factory RewardsMyDetailAccount.fromJson(Map<String, dynamic> json) =>
  35. $RewardsMyDetailAccountFromJson(json);
  36. Map<String, dynamic> toJson() => $RewardsMyDetailAccountToJson(this);
  37. @override
  38. String toString() {
  39. return jsonEncode(this);
  40. }
  41. }
  42. @JsonSerializable()
  43. class RewardsMyDetailReward {
  44. late int id = 0;
  45. late String title = '';
  46. late List<String> resources = [];
  47. @JSONField(name: "original_point")
  48. late int originalPoint = 0;
  49. late int point = 0;
  50. @JSONField(name: "redeemed_start")
  51. late String redeemedStart = '';
  52. @JSONField(name: "redeemed_end")
  53. late String redeemedEnd = '';
  54. RewardsMyDetailReward();
  55. factory RewardsMyDetailReward.fromJson(Map<String, dynamic> json) =>
  56. $RewardsMyDetailRewardFromJson(json);
  57. Map<String, dynamic> toJson() => $RewardsMyDetailRewardToJson(this);
  58. @override
  59. String toString() {
  60. return jsonEncode(this);
  61. }
  62. }