class UserInfoDto {
  UserInfoDto({
    required this.accountType,
    required this.extraInfo,
    required this.name,
    required this.tel,
    required this.id,
    required this.avatar,
  });

  /// 1学生 2老师
  int accountType;
  ExtraInfo extraInfo;
  String name;
  String tel;
  int id;
  String avatar;

  factory UserInfoDto.fromJson(Map<dynamic, dynamic> json) => UserInfoDto(
    accountType: json["account_type"],
    extraInfo: ExtraInfo.fromJson(json["extra_info"]),
    name: json["name"],
    tel: json["tel"],
    id: json["id"],
    avatar: json["avatar"],
  );

  Map<dynamic, dynamic> toJson() => {
    "account_type": accountType,
    "extra_info": extraInfo.toJson(),
    "name": name,
    "tel": tel,
    "id": id,
    "avatar": avatar,
  };
}

class ExtraInfo {
  ExtraInfo({
    required this.vipEndTime,
    required this.vipStartTime,
    required this.vipStatus,
  });

  String vipEndTime;
  String vipStartTime;
  int vipStatus; // 0:普通用户 1:VIP

  factory ExtraInfo.fromJson(Map<dynamic, dynamic> json) => ExtraInfo(
    vipEndTime: json["vip_end_time"],
    vipStartTime: json["vip_start_time"],
    vipStatus: json["vip_status"],
  );

  Map<dynamic, dynamic> toJson() => {
    "vip_end_time": vipEndTime,
    "vip_start_time": vipStartTime,
    "vip_status": vipStatus,
  };
}
