game_record_sum.dart 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import 'package:sport/bean/game.dart';
  2. import 'package:sport/services/Converter.dart';
  3. class GameRecordSum {
  4. int? id;
  5. int? userId;
  6. int? gameId;
  7. String? lastPlayAt;
  8. int? times;
  9. int? duration;
  10. double? score;
  11. int? consume;
  12. double? scoreMax;
  13. int? stepCount;
  14. int? jumpCount;
  15. int? crouchCount;
  16. int? durationAvg;
  17. int? scoreAvg;
  18. int? consumePerMin;
  19. int? durationTotalMinute;
  20. GameInfoData? game;
  21. GameRecordSum(
  22. {this.id,
  23. this.userId,
  24. this.gameId,
  25. this.lastPlayAt,
  26. this.times,
  27. this.duration,
  28. this.score,
  29. this.consume,
  30. this.scoreMax,
  31. this.stepCount,
  32. this.jumpCount,
  33. this.crouchCount,
  34. this.durationAvg,
  35. this.scoreAvg,
  36. this.consumePerMin,
  37. this.durationTotalMinute});
  38. GameRecordSum.fromJson(Map<String, dynamic> json) {
  39. id = json['id'];
  40. userId = json['user_id'];
  41. gameId = json['game_id'];
  42. lastPlayAt = json['last_play_at'];
  43. times = json['times'];
  44. duration = json['duration'];
  45. score = Converter.toDouble(json['score']);
  46. consume = json['consume'];
  47. scoreMax = Converter.toDouble(json['score_max']);
  48. stepCount = json['step_count'];
  49. jumpCount = json['jump_count'];
  50. crouchCount = json['crouch_count'];
  51. durationAvg = json['duration_avg'];
  52. scoreAvg = json['score_avg'];
  53. consumePerMin = json['consume_per_min'];
  54. durationTotalMinute = json['duration_minute'];
  55. game =
  56. json['game'] != null ? new GameInfoData.fromJson(json['game']) : null;
  57. }
  58. Map<String, dynamic> toJson() {
  59. final Map<String, dynamic> data = new Map<String, dynamic>();
  60. data['id'] = this.id;
  61. data['user_id'] = this.userId;
  62. data['game_id'] = this.gameId;
  63. data['last_play_at'] = this.lastPlayAt;
  64. data['times'] = this.times;
  65. data['duration'] = this.duration;
  66. data['score'] = this.score;
  67. data['consume'] = this.consume;
  68. data['score_max'] = this.scoreMax;
  69. data['step_count'] = this.stepCount;
  70. data['jump_count'] = this.jumpCount;
  71. data['crouch_count'] = this.crouchCount;
  72. data['duration_avg'] = this.durationAvg;
  73. data['score_avg'] = this.scoreAvg;
  74. data['consume_per_min'] = this.consumePerMin;
  75. data['duration_minute'] = this.durationTotalMinute;
  76. return data;
  77. }
  78. }