repair_service_entity.dart 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/repair_service_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/repair_service_entity.g.dart';
  5. @JsonSerializable()
  6. class RepairServiceEntity {
  7. int? count;
  8. int? page;
  9. int? limit;
  10. @JSONField(name: "count_page")
  11. int? countPage;
  12. List<RepairServiceList>? list;
  13. RepairServiceEntity();
  14. factory RepairServiceEntity.fromJson(Map<String, dynamic> json) => $RepairServiceEntityFromJson(json);
  15. Map<String, dynamic> toJson() => $RepairServiceEntityToJson(this);
  16. @override
  17. String toString() {
  18. return jsonEncode(this);
  19. }
  20. }
  21. @JsonSerializable()
  22. class RepairServiceList {
  23. int? id;
  24. String? name;
  25. @JSONField(name: "likes_count")
  26. int? likesCount;
  27. bool? liked;
  28. RepairServiceListMerchant? merchant;
  29. RepairServiceListCategory? category;
  30. RepairServiceList();
  31. factory RepairServiceList.fromJson(Map<String, dynamic> json) => $RepairServiceListFromJson(json);
  32. Map<String, dynamic> toJson() => $RepairServiceListToJson(this);
  33. @override
  34. String toString() {
  35. return jsonEncode(this);
  36. }
  37. }
  38. @JsonSerializable()
  39. class RepairServiceListMerchant {
  40. int? id;
  41. String? name;
  42. RepairServiceListMerchant();
  43. factory RepairServiceListMerchant.fromJson(Map<String, dynamic> json) => $RepairServiceListMerchantFromJson(json);
  44. Map<String, dynamic> toJson() => $RepairServiceListMerchantToJson(this);
  45. @override
  46. String toString() {
  47. return jsonEncode(this);
  48. }
  49. }
  50. @JsonSerializable()
  51. class RepairServiceListCategory {
  52. int? id;
  53. String? name;
  54. String? type;
  55. RepairServiceListCategory();
  56. factory RepairServiceListCategory.fromJson(Map<String, dynamic> json) => $RepairServiceListCategoryFromJson(json);
  57. Map<String, dynamic> toJson() => $RepairServiceListCategoryToJson(this);
  58. @override
  59. String toString() {
  60. return jsonEncode(this);
  61. }
  62. }