class UserInfo {
  int userId;
  String headimgurl;
  String nickName;
  String meetPlace;
  String birthday;
  String occupation;
  String program;
  String hopeObject;
  double height;
  double weight;
  String ownMsg;
  bool isAttestation;
  bool isVipAttestation;
  int invisibleStatus;
  int distanceStatus;
  int accountStatus;
  int chatStatus;
  int photoAut;
  int infoAut;
  String loginDate;
  int onlineStatus;
  int sex;
  int applyStatus;
  int payStatus;
  String city;
  String country;
  int constellation;
  int price;
  int burnNum;
  int accessNum;
  int distince;
  String wechat;
  String facebook;
  int isMember = 0;
  bool isAuthority;
  int freeNum;
  int usedNum;
  int publishNum;
  int usedPublishNum;
  bool isBlackList;//你是否拉黑别人
  bool isLike;
  int followNum;
  int fans;
  int dynamicNum;
  bool isCanStrangerNews;
  bool isBlackened; //对方是否拉黑你
  int isAddFriends;

  UserInfo(
      {this.userId,
      this.headimgurl,
      this.nickName = "",
      this.meetPlace,
      this.birthday,
      this.occupation,
      this.program,
      this.hopeObject,
      this.height,
      this.weight,
      this.ownMsg,
      this.isAttestation = false,
      this.isVipAttestation = false,
      this.invisibleStatus,
      this.distanceStatus,
      this.accountStatus,
      this.chatStatus,
      this.photoAut,
      this.infoAut,
      this.loginDate,
      this.onlineStatus,
      this.payStatus,
      this.applyStatus,
      this.sex,
      this.city,
      this.constellation,
      this.price,
      this.burnNum,
      this.accessNum,
      this.distince: 0,
      this.wechat: '',
      this.country,
      this.facebook: '',
      this.isMember = 0,
      this.isAuthority: false,
      this.freeNum = 0,
      this.usedNum = 0,
      this.publishNum = 0,
      this.usedPublishNum = 0,
      this.isBlackList: false,
      this.isLike: false,
      this.fans: 0,
      this.followNum: 0,
      this.dynamicNum: 0,
      this.isCanStrangerNews: true,
      this.isAddFriends: 3,
      this.isBlackened = false});
  UserInfo.fromJson(Map<String, dynamic> json) {
    userId = json['UserId'];
    headimgurl = json['Headimgurl'];
    nickName = json['NickName'];
    meetPlace = json['MeetPlace'];
    birthday = json['Birthday'];
    occupation = json['Occupation'];
    program = json['Program'];
    hopeObject = json['HopeObject'];
    height = double.parse(json['Height']);
    weight = double.parse(json['Weight']);
    ownMsg = json['OwnMsg'];
    isAttestation = json['IsAttestation'] > 0;
    isVipAttestation = json['IsAttestation'] == 2;
    invisibleStatus = json['InvisibleStatus'];
    distanceStatus = json['DistanceStatus'];
    accountStatus = json['AccountStatus'];
    chatStatus = json['ChatStatus'];
    photoAut = json['PhotoAut'];
    infoAut = json['InfoAut'];
    loginDate = json['LoginDate'];
    onlineStatus = json['OnlineStatus'];
    applyStatus = json['ApplyStatus'];
    payStatus = json['PayStatus'];
    sex = json['Sex'];
    city = json['City'];
    constellation = int.parse(json['Constellation']);
    price = json['Price'];
    burnNum = json['BurnNum'];
    accessNum = json['AccessNum'];
    distince = json['Distance'];
    wechat = json['WxAcount'];
    facebook = json['FbAcount'];
    isMember = json['IsMember'] ?? 0;
    isAuthority = json['IsAuthority'] == 1;
    freeNum = json['FreeNum'];
    usedNum = json['UsedNum'];
    publishNum = json['PublishNum'];
    usedPublishNum = json['UsedPublishNum'];
    isBlackList = json['IsBlackList'] == 1;
    country = json['Country'];
    isLike = json['IsLike'] == 0;
    followNum = json['FollowNum'];
    fans = json['Fans'];
    dynamicNum = json['DynamicNum'];
    isCanStrangerNews = json['StrangerNews'] == 1;
    isAddFriends = json['IsAddFriends'];
    isBlackened = json['IsBlackened'] == 1;
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = new Map<String, dynamic>();
    json['userId'] = userId;
    json['headimgurl'] = headimgurl;
    json['nickName'] = nickName;
    json['meetPlace'] = meetPlace;
    json['birthday'] = birthday;
    json['occupation'] = occupation;
    json['program'] = program;
    json['hopeObject'] = hopeObject;
    json['height'] = height;
    json['weight'] = weight;
    json['ownMsg'] = ownMsg;
    json['isAttestation'] = isAttestation;
    json['isVipAttestation'] = isVipAttestation;
    json['invisibleStatus'] = invisibleStatus;
    json['distanceStatus'] = distanceStatus;
    json['accountStatus'] = accountStatus;
    json['chatStatus'] = chatStatus;
    json['photoAut'] = photoAut;
    json['infoAut'] = infoAut;
    json['loginDate'] = loginDate;
    json['onlineStatus'] = onlineStatus;
    json['applyStatus'] = applyStatus;
    json['payStatus'] = payStatus;
    json['sex'] = sex;
    json['city'] = city;
    json['constellation'] = constellation;
    json['price'] = price;
    json['burnNum'] = burnNum;
    json['accessNum'] = accessNum;
    json['distince'] = distince;
    json['wechat'] = wechat;
    json['facebook'] = facebook;
    json['isMember'] = isMember;
    json['isAuthority'] = isAuthority;
    json['freeNum'] = freeNum;
    json['usedNum'] = usedNum;
    json['publishNum'] = publishNum;
    json['usedPublishNum'] = usedPublishNum;
    json['isBlackList'] = isBlackList;
    json['country'] = country;
    json['isLike'] = isLike;
    json['followNum'] = followNum;
    json['fans'] = fans;
    json['dynamicNum'] = dynamicNum;
    json['isCanStrangerNews'] = isCanStrangerNews;
    json['isAddFriends'] = isAddFriends;
    json['isBlackened'] = isBlackened;
    return json;
  }

  UserInfo.fromLocalJson(Map<String, dynamic> json) {
    userId = json['userId'];
    headimgurl = json['headimgurl'];
    nickName = json['nickName'];
    meetPlace = json['meetPlace'];
    birthday = json['birthday'];
    occupation = json['occupation'];
    program = json['program'];
    hopeObject = json['hopeObject'];
    height = json['height'];
    weight = json['weight'];
    ownMsg = json['ownMsg'];
    isAttestation = json['isAttestation'];
    isVipAttestation = json['isVipAttestation'];
    invisibleStatus = json['invisibleStatus'];
    distanceStatus = json['distanceStatus'];
    accountStatus = json['accountStatus'];
    chatStatus = json['chatStatus'];
    photoAut = json['photoAut'];
    infoAut = json['infoAut'];
    loginDate = json['loginDate'];
    onlineStatus = json['onlineStatus'];
    applyStatus = json['applyStatus'];
    payStatus = json['payStatus'];
    sex = json['sex'];
    city = json['city'];
    constellation = json['constellation'];
    price = json['price'];
    burnNum = json['burnNum'];
    accessNum = json['accessNum'];
    distince = json['distince'];
    wechat = json['wechat'];
    facebook = json['facebook'];
    isMember = json['isMember'];
    isAuthority = json['isAuthority'];
    freeNum = json['freeNum'];
    usedNum = json['usedNum'];
    publishNum = json['publishNum'];
    usedPublishNum = json['usedPublishNum'];
    isBlackList = json['isBlackList'];
    country = json['country'];
    isLike = json['isLike'];
    followNum = json['followNum'];
    fans = json['fans'];
    dynamicNum = json['dynamicNum'];
    isCanStrangerNews = json['isCanStrangerNews'];
    isAddFriends = json['isAddFriends'];
    isBlackened = json['isBlackened'];//
  }


 Map<String, dynamic> toDbJson() {
    Map<String, dynamic> json = new Map<String, dynamic>();
    json['userId'] = userId;
    json['headimgurl'] = headimgurl;
    json['nickName'] = nickName;
    json['meetPlace'] = meetPlace;
    json['birthday'] = birthday;
    json['occupation'] = occupation;
    json['program'] = program;
    json['hopeObject'] = hopeObject;
    json['height'] = height.toInt();
    json['weight'] = weight.toInt();
    json['ownMsg'] = ownMsg;
    json['isAttestation'] = isAttestation ? 1 : 0;
    json['isVipAttestation'] = isVipAttestation ? 2 : 0;
    json['invisibleStatus'] = invisibleStatus;
    json['distanceStatus'] = distanceStatus;
    json['accountStatus'] = accountStatus;
    json['chatStatus'] = chatStatus;
    json['photoAut'] = photoAut;
    json['infoAut'] = infoAut;
    json['loginDate'] = loginDate;
    json['onlineStatus'] = onlineStatus;
    json['applyStatus'] = applyStatus;
    json['payStatus'] = payStatus;
    json['sex'] = sex;
    json['city'] = city;
    json['constellation'] = constellation;
    json['price'] = price;
    json['burnNum'] = burnNum;
    json['accessNum'] = accessNum;
    json['distince'] = distince;
    json['wechat'] = wechat;
    json['facebook'] = facebook;
    json['isMember'] = isMember;
    json['isAuthority'] = isAuthority ? 1: 0;
    json['freeNum'] = freeNum;
    json['usedNum'] = usedNum;
    json['publishNum'] = publishNum;
    json['usedPublishNum'] = usedPublishNum;
    json['isBlackList'] = isBlackList ? 1 : 0;
    json['country'] = country;
    json['isLike'] = isLike ? 0 : 1;
    json['followNum'] = followNum;
    json['fans'] = fans;
    json['dynamicNum'] = dynamicNum;
    json['isCanStrangerNews'] = isCanStrangerNews ? 1 : 0;
    json['isAddFriends'] = isAddFriends;
    json['isBlackened'] = isBlackened ? 1 : 0;
    return json;
  }

  UserInfo.fromLocalDB(Map<String, dynamic> json) {
    userId = json['userId'];
    headimgurl = json['headimgurl'];
    nickName = json['nickName'];
    meetPlace = json['meetPlace'];
    birthday = json['birthday'];
    occupation = json['occupation'];
    program = json['program'];
    hopeObject = json['hopeObject'];
    height = json['height'].toDouble();
    weight = json['weight'].toDouble();
    ownMsg = json['ownMsg'];
    isAttestation = json['isAttestation'] > 0;
    isVipAttestation = json['isVipAttestation'] == 2;
    invisibleStatus = json['invisibleStatus'];
    distanceStatus = json['distanceStatus'];
    accountStatus = json['accountStatus'];
    chatStatus = json['chatStatus'];
    photoAut = json['photoAut'];
    infoAut = json['infoAut'];
    loginDate = json['loginDate'];
    onlineStatus = json['onlineStatus'];
    applyStatus = json['applyStatus'];
    payStatus = json['payStatus'];
    sex = json['sex'];
    city = json['city'];
    constellation = json['constellation'];
    price = json['price'];
    burnNum = json['burnNum'];
    accessNum = json['accessNum'];
    distince = json['distince'];
    wechat = json['wechat'];
    facebook = json['facebook'];
    isMember = json['isMember'];
    isAuthority = json['isAuthority'] == 1;
    freeNum = json['freeNum'];
    usedNum = json['usedNum'];
    publishNum = json['publishNum'];
    usedPublishNum = json['usedPublishNum'];
    isBlackList = json['isBlackList'] == 1;
    country = json['country'];
    isLike = json['isLike'] == 0;
    followNum = json['followNum'];
    fans = json['fans'];
    dynamicNum = json['dynamicNum'];
    isCanStrangerNews = json['isCanStrangerNews'] == 1;
    isAddFriends = json['isAddFriends'];
    isBlackened = json['isBlackened'] == 1;
  }
}
