country_detail_entity.dart 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import 'package:hengyi/generated/json/base/json_field.dart';
  2. import 'package:hengyi/generated/json/country_detail_entity.g.dart';
  3. import 'dart:convert';
  4. @JsonSerializable()
  5. class CountryDetailEntity {
  6. late int id;
  7. @JSONField(name: "country_name")
  8. late String countryName;
  9. @JSONField(name: "country_img_url")
  10. late String countryImgUrl;
  11. @JSONField(name: "country_content")
  12. late String countryContent;
  13. @JSONField(name: "country_visit_visa_url")
  14. late List<CountryDetailCountryVisitVisaUrl> countryVisitVisaUrl;
  15. CountryDetailEntity();
  16. factory CountryDetailEntity.fromJson(Map<String, dynamic> json) => $CountryDetailEntityFromJson(json);
  17. Map<String, dynamic> toJson() => $CountryDetailEntityToJson(this);
  18. @override
  19. String toString() {
  20. return jsonEncode(this);
  21. }
  22. }
  23. @JsonSerializable()
  24. class CountryDetailCountryVisitVisaUrl {
  25. @JSONField(name: "file_name")
  26. late String fileName;
  27. @JSONField(name: "file_url")
  28. late String fileUrl;
  29. CountryDetailCountryVisitVisaUrl();
  30. factory CountryDetailCountryVisitVisaUrl.fromJson(Map<String, dynamic> json) => $CountryDetailCountryVisitVisaUrlFromJson(json);
  31. Map<String, dynamic> toJson() => $CountryDetailCountryVisitVisaUrlToJson(this);
  32. @override
  33. String toString() {
  34. return jsonEncode(this);
  35. }
  36. }