country_detail_entity.dart 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import 'package:fuwei/generated/json/base/json_field.dart';
  2. import 'package:fuwei/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) =>
  17. $CountryDetailEntityFromJson(json);
  18. Map<String, dynamic> toJson() => $CountryDetailEntityToJson(this);
  19. @override
  20. String toString() {
  21. return jsonEncode(this);
  22. }
  23. }
  24. @JsonSerializable()
  25. class CountryDetailCountryVisitVisaUrl {
  26. @JSONField(name: "file_name")
  27. late String fileName;
  28. @JSONField(name: "file_url")
  29. late String fileUrl;
  30. CountryDetailCountryVisitVisaUrl();
  31. factory CountryDetailCountryVisitVisaUrl.fromJson(
  32. Map<String, dynamic> json) =>
  33. $CountryDetailCountryVisitVisaUrlFromJson(json);
  34. Map<String, dynamic> toJson() =>
  35. $CountryDetailCountryVisitVisaUrlToJson(this);
  36. @override
  37. String toString() {
  38. return jsonEncode(this);
  39. }
  40. }