country_detail_entity.g.dart 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import 'package:hengyi/generated/json/base/json_convert_content.dart';
  2. import 'package:hengyi/data/country_detail_entity.dart';
  3. CountryDetailEntity $CountryDetailEntityFromJson(Map<String, dynamic> json) {
  4. final CountryDetailEntity countryDetailEntity = CountryDetailEntity();
  5. final int? id = jsonConvert.convert<int>(json['id']);
  6. if (id != null) {
  7. countryDetailEntity.id = id;
  8. }
  9. final String? countryName = jsonConvert.convert<String>(json['country_name']);
  10. if (countryName != null) {
  11. countryDetailEntity.countryName = countryName;
  12. }
  13. final String? countryImgUrl = jsonConvert.convert<String>(json['country_img_url']);
  14. if (countryImgUrl != null) {
  15. countryDetailEntity.countryImgUrl = countryImgUrl;
  16. }
  17. final String? countryContent = jsonConvert.convert<String>(json['country_content']);
  18. if (countryContent != null) {
  19. countryDetailEntity.countryContent = countryContent;
  20. }
  21. final List<CountryDetailCountryVisitVisaUrl>? countryVisitVisaUrl = jsonConvert.convertListNotNull<CountryDetailCountryVisitVisaUrl>(json['country_visit_visa_url']);
  22. if (countryVisitVisaUrl != null) {
  23. countryDetailEntity.countryVisitVisaUrl = countryVisitVisaUrl;
  24. }
  25. return countryDetailEntity;
  26. }
  27. Map<String, dynamic> $CountryDetailEntityToJson(CountryDetailEntity entity) {
  28. final Map<String, dynamic> data = <String, dynamic>{};
  29. data['id'] = entity.id;
  30. data['country_name'] = entity.countryName;
  31. data['country_img_url'] = entity.countryImgUrl;
  32. data['country_content'] = entity.countryContent;
  33. data['country_visit_visa_url'] = entity.countryVisitVisaUrl.map((v) => v.toJson()).toList();
  34. return data;
  35. }
  36. CountryDetailCountryVisitVisaUrl $CountryDetailCountryVisitVisaUrlFromJson(Map<String, dynamic> json) {
  37. final CountryDetailCountryVisitVisaUrl countryDetailCountryVisitVisaUrl = CountryDetailCountryVisitVisaUrl();
  38. final String? fileName = jsonConvert.convert<String>(json['file_name']);
  39. if (fileName != null) {
  40. countryDetailCountryVisitVisaUrl.fileName = fileName;
  41. }
  42. final String? fileUrl = jsonConvert.convert<String>(json['file_url']);
  43. if (fileUrl != null) {
  44. countryDetailCountryVisitVisaUrl.fileUrl = fileUrl;
  45. }
  46. return countryDetailCountryVisitVisaUrl;
  47. }
  48. Map<String, dynamic> $CountryDetailCountryVisitVisaUrlToJson(CountryDetailCountryVisitVisaUrl entity) {
  49. final Map<String, dynamic> data = <String, dynamic>{};
  50. data['file_name'] = entity.fileName;
  51. data['file_url'] = entity.fileUrl;
  52. return data;
  53. }