game_add_entity.dart 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import 'dart:convert';
  2. import 'package:sport/generated/json/base/json_field.dart';
  3. import 'package:sport/generated/json/game_add_entity.g.dart';
  4. @JsonSerializable()
  5. class GameAddEntity {
  6. late int id;
  7. @JSONField(name: "rank_result")
  8. late List<GameAddRankResult> rankResult;
  9. late GameAddRecord record;
  10. @JSONField(name: "achievements_result")
  11. late GameAddAchievementsResult achievementsResult;
  12. GameAddEntity();
  13. factory GameAddEntity.fromJson(Map<String, dynamic> json) => $GameAddEntityFromJson(json);
  14. Map<String, dynamic> toJson() => $GameAddEntityToJson(this);
  15. @override
  16. String toString() {
  17. return jsonEncode(this);
  18. }
  19. }
  20. @JsonSerializable()
  21. class GameAddRankResult {
  22. late int up;
  23. late int position;
  24. late String result;
  25. late GameAddRankResultRank rank;
  26. GameAddRankResult();
  27. factory GameAddRankResult.fromJson(Map<String, dynamic> json) => $GameAddRankResultFromJson(json);
  28. Map<String, dynamic> toJson() => $GameAddRankResultToJson(this);
  29. @override
  30. String toString() {
  31. return jsonEncode(this);
  32. }
  33. }
  34. @JsonSerializable()
  35. class GameAddRankResultRank {
  36. late int id;
  37. late String name;
  38. @JSONField(name: "is_game")
  39. late int isGame;
  40. @JSONField(name: "is_sport")
  41. late int isSport;
  42. @JSONField(name: "game_id")
  43. late int gameId;
  44. late String introduce;
  45. @JSONField(name: "user_count_max")
  46. late int userCountMax;
  47. @JSONField(name: "rate_begin")
  48. late String rateBegin;
  49. @JSONField(name: "rate_end")
  50. late String rateEnd;
  51. late String field;
  52. late String slogan;
  53. late List<GameAddRankResultRankReward> reward;
  54. @JSONField(name: "introduce_detail")
  55. late String introduceDetail;
  56. late String rule;
  57. late String distribute;
  58. dynamic game;
  59. GameAddRankResultRank();
  60. factory GameAddRankResultRank.fromJson(Map<String, dynamic> json) => $GameAddRankResultRankFromJson(json);
  61. Map<String, dynamic> toJson() => $GameAddRankResultRankToJson(this);
  62. @override
  63. String toString() {
  64. return jsonEncode(this);
  65. }
  66. }
  67. @JsonSerializable()
  68. class GameAddRankResultRankReward {
  69. late int begin;
  70. late int end;
  71. late int score;
  72. GameAddRankResultRankReward();
  73. factory GameAddRankResultRankReward.fromJson(Map<String, dynamic> json) => $GameAddRankResultRankRewardFromJson(json);
  74. Map<String, dynamic> toJson() => $GameAddRankResultRankRewardToJson(this);
  75. @override
  76. String toString() {
  77. return jsonEncode(this);
  78. }
  79. }
  80. @JsonSerializable()
  81. class GameAddRecord {
  82. @JSONField(name: "record_id")
  83. late int recordId;
  84. @JSONField(name: "created_at")
  85. late String createdAt;
  86. late int duration;
  87. late int consume;
  88. late double met;
  89. @JSONField(name: "duration_min")
  90. late double durationMin;
  91. late int equivalent;
  92. late String unit;
  93. GameAddRecord();
  94. factory GameAddRecord.fromJson(Map<String, dynamic> json) => $GameAddRecordFromJson(json);
  95. Map<String, dynamic> toJson() => $GameAddRecordToJson(this);
  96. @override
  97. String toString() {
  98. return jsonEncode(this);
  99. }
  100. }
  101. @JsonSerializable()
  102. class GameAddAchievementsResult {
  103. late List<dynamic> achievements;
  104. late bool level;
  105. GameAddAchievementsResult();
  106. factory GameAddAchievementsResult.fromJson(Map<String, dynamic> json) => $GameAddAchievementsResultFromJson(json);
  107. Map<String, dynamic> toJson() => $GameAddAchievementsResultToJson(this);
  108. @override
  109. String toString() {
  110. return jsonEncode(this);
  111. }
  112. }