import 'package:json_annotation/json_annotation.dart';

part 'mine_profile_model.g.dart';

@JsonSerializable()
class MineProfileModel extends Object {
  @JsonKey(name: 'username')
  String username;

  @JsonKey(name: 'avatar')
  String avatar;

  @JsonKey(name: 'InviteCode')
  String inviteCode;

  @JsonKey(name: 'user_lv_name')
  String userLvName;

  @JsonKey(name: 'user_lv_icon')
  String userLvIcon;

  @JsonKey(name: 'total')
  String total;

  @JsonKey(name: 'grid_views')
  List<MineProfileDataModel> datas;

  MineProfileModel(this.username,
      this.avatar,
      this.inviteCode,
      this.userLvName,
      this.userLvIcon,
      this.total,
      this.datas,);

  factory MineProfileModel.fromJson(Map<String, dynamic> srcJson) =>
      _$MineProfileModelFromJson(srcJson);

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

@JsonSerializable()
class MineProfileDataModel extends Object {
  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'value')
  String value;

  MineProfileDataModel(this.name,
      this.value,);

  factory MineProfileDataModel.fromJson(Map<String, dynamic> srcJson) =>
      _$MineProfileDataModelFromJson(srcJson);

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