hotel_info_entity.dart 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import 'package:domain/generated/json/base/json_field.dart';
  2. import 'package:domain/generated/json/hotel_info_entity.g.dart';
  3. import 'dart:convert';
  4. export 'package:domain/generated/json/hotel_info_entity.g.dart';
  5. @JsonSerializable()
  6. class HotelInfoEntity {
  7. @JSONField(name: "admin_id")
  8. int? adminId = 0;
  9. String? name = '';
  10. @JSONField(name: "hotel_id")
  11. int? hotelId = 0;
  12. @JSONField(name: "hotel_name")
  13. String? hotelName = '';
  14. List<HotelInfoMenus>? menus = [];
  15. String? token = '';
  16. HotelInfoEntity();
  17. factory HotelInfoEntity.fromJson(Map<String, dynamic> json) => $HotelInfoEntityFromJson(json);
  18. Map<String, dynamic> toJson() => $HotelInfoEntityToJson(this);
  19. @override
  20. String toString() {
  21. return jsonEncode(this);
  22. }
  23. }
  24. @JsonSerializable()
  25. class HotelInfoMenus {
  26. String? key = '';
  27. String? name = '';
  28. List<HotelInfoMenusChildren>? children = [];
  29. HotelInfoMenus();
  30. factory HotelInfoMenus.fromJson(Map<String, dynamic> json) => $HotelInfoMenusFromJson(json);
  31. Map<String, dynamic> toJson() => $HotelInfoMenusToJson(this);
  32. @override
  33. String toString() {
  34. return jsonEncode(this);
  35. }
  36. }
  37. @JsonSerializable()
  38. class HotelInfoMenusChildren {
  39. String? key = '';
  40. String? name = '';
  41. HotelInfoMenusChildren();
  42. factory HotelInfoMenusChildren.fromJson(Map<String, dynamic> json) => $HotelInfoMenusChildrenFromJson(json);
  43. Map<String, dynamic> toJson() => $HotelInfoMenusChildrenToJson(this);
  44. @override
  45. String toString() {
  46. return jsonEncode(this);
  47. }
  48. }