import 'package:json_annotation/json_annotation.dart';

part 'custom_config_info.g.dart';

@JsonSerializable()
class CustomConfigInfo {
  //爱好列表
  @JsonKey(name: 'hobbies')
  List<Hobbies>? hobbies;

  //是否可自定义爱好标签
  @JsonKey(name: 'customHobby')
  bool? customHobby;


  // 爱好最小选择数量
  @JsonKey(name: 'minHobbyNum')
  int? minHobbyNum;

  // 爱好最大选择数量
  @JsonKey(name: 'maxHobbyNum')
  int? maxHobbyNum;

  //爱好最大字符数
  @JsonKey(name: 'maxHobbyWords')
  int? maxHobbyWords;

  // 男生头像列表
  @JsonKey(name: 'boyAvatars')
  List<String>? boyAvatars;

  // 女生头像列表
  @JsonKey(name: 'girlAvatars')
  List<String>? girlAvatars;

  // 性格列表
  @JsonKey(name: 'characters')
  List<CharactersList>? characters;

  // 是否可自定义性格标签
  @JsonKey(name: 'customCharacter')
  bool? customCharacter;

  // 性格最小选择数量
  @JsonKey(name: 'minCharacterNum')
  int? minCharacterNum;

  // 性格最大选择数量
  @JsonKey(name: 'maxCharacterNum')
  int? maxCharacterNum;

  // 性格最大字符数
  @JsonKey(name: 'maxCharacterWords')
  int? maxCharacterWords;


  CustomConfigInfo({this.hobbies, this.customHobby, this.minHobbyNum,
      this.maxHobbyNum, this.maxHobbyWords, this.boyAvatars, this.girlAvatars,
      this.characters, this.customCharacter, this.minCharacterNum,
      this.maxCharacterNum, this.maxCharacterWords});

  factory CustomConfigInfo.fromJson(Map<String, dynamic> json) =>
      _$CustomConfigInfoFromJson(json);

  Map<String, dynamic> toJson() => _$CustomConfigInfoToJson(this);
}

@JsonSerializable()
class Hobbies {
  int? id;
  String? name;
  String? emoji;

  Hobbies({this.id, this.name,this.emoji});

  factory Hobbies.fromJson(Map<String, dynamic> json) =>
      _$HobbiesFromJson(json);

  Map<String, dynamic> toJson() => _$HobbiesToJson(this);
}
@JsonSerializable()
class CharactersList {
  int? id;
  String? name;
  String? emoji;

  CharactersList({this.id, this.name, this.emoji});

  factory CharactersList.fromJson(Map<String, dynamic> json) =>
      _$CharactersListFromJson(json);

  Map<String, dynamic> toJson() => _$CharactersListToJson(this);
}
