custom_config_info.dart 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import 'package:json_annotation/json_annotation.dart';
  2. part 'custom_config_info.g.dart';
  3. @JsonSerializable()
  4. class CustomConfigInfo {
  5. //爱好列表
  6. @JsonKey(name: 'hobbies')
  7. List<Hobbies>? hobbies;
  8. //是否可自定义爱好标签
  9. @JsonKey(name: 'customHobby')
  10. bool? customHobby;
  11. // 爱好最小选择数量
  12. @JsonKey(name: 'minHobbyNum')
  13. int? minHobbyNum;
  14. // 爱好最大选择数量
  15. @JsonKey(name: 'maxHobbyNum')
  16. int? maxHobbyNum;
  17. //爱好最大字符数
  18. @JsonKey(name: 'maxHobbyWords')
  19. int? maxHobbyWords;
  20. // 男生头像列表
  21. @JsonKey(name: 'boyAvatars')
  22. List<String>? boyAvatars;
  23. // 女生头像列表
  24. @JsonKey(name: 'girlAvatars')
  25. List<String>? girlAvatars;
  26. // 性格列表
  27. @JsonKey(name: 'characters')
  28. List<CharactersList>? characters;
  29. // 是否可自定义性格标签
  30. @JsonKey(name: 'customCharacter')
  31. bool? customCharacter;
  32. // 性格最小选择数量
  33. @JsonKey(name: 'minCharacterNum')
  34. int? minCharacterNum;
  35. // 性格最大选择数量
  36. @JsonKey(name: 'maxCharacterNum')
  37. int? maxCharacterNum;
  38. // 性格最大字符数
  39. @JsonKey(name: 'maxCharacterWords')
  40. int? maxCharacterWords;
  41. CustomConfigInfo({this.hobbies, this.customHobby, this.minHobbyNum,
  42. this.maxHobbyNum, this.maxHobbyWords, this.boyAvatars, this.girlAvatars,
  43. this.characters, this.customCharacter, this.minCharacterNum,
  44. this.maxCharacterNum, this.maxCharacterWords});
  45. factory CustomConfigInfo.fromJson(Map<String, dynamic> json) =>
  46. _$CustomConfigInfoFromJson(json);
  47. Map<String, dynamic> toJson() => _$CustomConfigInfoToJson(this);
  48. }
  49. @JsonSerializable()
  50. class Hobbies {
  51. int? id;
  52. String? name;
  53. String? emoji;
  54. Hobbies({this.id, this.name,this.emoji});
  55. factory Hobbies.fromJson(Map<String, dynamic> json) =>
  56. _$HobbiesFromJson(json);
  57. Map<String, dynamic> toJson() => _$HobbiesToJson(this);
  58. }
  59. @JsonSerializable()
  60. class CharactersList {
  61. int? id;
  62. String? name;
  63. String? emoji;
  64. CharactersList({this.id, this.name, this.emoji});
  65. factory CharactersList.fromJson(Map<String, dynamic> json) =>
  66. _$CharactersListFromJson(json);
  67. Map<String, dynamic> toJson() => _$CharactersListToJson(this);
  68. }