// 用户详细信息实体类 import 'package:dating_touchme_app/model/home/marriage_data.dart'; class UserData { String? id; String? nickName; String? name; String? profilePhoto; String? identityCard; int? genderCode; Map? auditProfilePhoto; bool? hasUploadProfilePhoto; final String? genderValue; final String? homeCountryCode; final String? homeCountry; final int? provinceCode; final String? provinceName; final int? cityCode; final String? cityName; final int? districtCode; final String? districtName; final String? birthYear; final String? birthDate; final int? constellationCode; final String? constellation; final int? chineseZodiacCode; final String? chineseZodiac; final int? height; final int? weight; int? educationCode; String? education; final int? maritalStatusCode; final String? maritalStatusName; final int? minimumIncome; final int? maximumIncome; final int? incomeCode; final String? income; final String? describeInfo; final int? domicilePlaceProvinceCode; final String? domicilePlaceProvinceName; final int? domicilePlaceCityCode; final String? domicilePlaceCityName; final int? nationCode; final String? nation; final int? bodilyFormCode; final String? bodilyForm; final int? accountTypeCode; final String? accountTypeName; final int? nationalityCode; final String? nationality; final int? nativePlaceCode; final String? nativePlaceName; final int? industryCode; final String? industry; final int? occupationCode; final String? occupation; final int? onlyChild; final int? carPurchaseSituationCode; final String? carPurchaseSituation; final int? propertyPermitsCode; final String? propertyPermits; final int? hometownProvinceCode; final String? hometownProvinceName; final int? hometownCityCode; final String? hometownCityName; String? phone; String? realName; bool? matchmakerFlag; int? matchmakerType; List? photoList; UserData({ this.id, this.nickName, this.name, this.profilePhoto, this.identityCard, this.genderCode, this.auditProfilePhoto, this.genderValue, this.homeCountryCode, this.homeCountry, this.provinceCode, this.provinceName, this.cityCode, this.cityName, this.districtCode, this.districtName, this.birthYear, this.birthDate, this.constellationCode, this.constellation, this.chineseZodiacCode, this.chineseZodiac, this.height, this.weight, this.educationCode, this.education, this.maritalStatusCode, this.maritalStatusName, this.minimumIncome, this.maximumIncome, this.incomeCode, this.income, this.describeInfo, this.domicilePlaceProvinceCode, this.domicilePlaceProvinceName, this.domicilePlaceCityCode, this.domicilePlaceCityName, this.nationCode, this.nation, this.bodilyFormCode, this.bodilyForm, this.accountTypeCode, this.accountTypeName, this.nationalityCode, this.nationality, this.nativePlaceCode, this.nativePlaceName, this.industryCode, this.industry, this.occupationCode, this.occupation, this.onlyChild, this.carPurchaseSituationCode, this.carPurchaseSituation, this.propertyPermitsCode, this.propertyPermits, this.hometownProvinceCode, this.hometownProvinceName, this.hometownCityCode, this.hometownCityName, this.phone, this.realName, this.matchmakerFlag, this.photoList, this.matchmakerType, this.hasUploadProfilePhoto }); // 从JSON映射创建实例 factory UserData.fromJson(Map json) { return UserData( id: json['id'] ?? '', nickName: json['nickName'] ?? '', name: json['name'], profilePhoto: json['profilePhoto'], identityCard: json['identityCard'], genderCode: json['genderCode'] ?? 0, hasUploadProfilePhoto: json['hasUploadProfilePhoto'] ?? false, auditProfilePhoto: json['auditProfilePhoto'] ?? null, genderValue: json['genderValue'] ?? '', homeCountryCode: json['homeCountryCode'], homeCountry: json['homeCountry'], provinceCode: json['provinceCode'], provinceName: json['provinceName'], cityCode: json['cityCode'], cityName: json['cityName'], districtCode: json['districtCode'], districtName: json['districtName'], birthYear: json['birthYear'], birthDate: json['birthDate'], constellationCode: json['constellationCode'], constellation: json['constellation'], chineseZodiacCode: json['chineseZodiacCode'], chineseZodiac: json['chineseZodiac'], height: json['height'], weight: json['weight'], educationCode: json['educationCode'], education: json['education'], maritalStatusCode: json['maritalStatusCode'], maritalStatusName: json['maritalStatusName'], minimumIncome: json['minimumIncome'], maximumIncome: json['maximumIncome'], incomeCode: json['incomeCode'], income: json['income'], describeInfo: json['describeInfo'], domicilePlaceProvinceCode: json['domicilePlaceProvinceCode'], domicilePlaceProvinceName: json['domicilePlaceProvinceName'], domicilePlaceCityCode: json['domicilePlaceCityCode'], domicilePlaceCityName: json['domicilePlaceCityName'], nationCode: json['nationCode'], nation: json['nation'], bodilyFormCode: json['bodilyFormCode'], bodilyForm: json['bodilyForm'], accountTypeCode: json['accountTypeCode'], accountTypeName: json['accountTypeName'], nationalityCode: json['nationalityCode'], nationality: json['nationality'], nativePlaceCode: json['nativePlaceCode'], nativePlaceName: json['nativePlaceName'], industryCode: json['industryCode'], industry: json['industry'], occupationCode: json['occupationCode'], occupation: json['occupation'], onlyChild: json['onlyChild'], carPurchaseSituationCode: json['carPurchaseSituationCode'], carPurchaseSituation: json['carPurchaseSituation'], propertyPermitsCode: json['propertyPermitsCode'], propertyPermits: json['propertyPermits'], hometownProvinceCode: json['hometownProvinceCode'], hometownProvinceName: json['hometownProvinceName'], hometownCityCode: json['hometownCityCode'], hometownCityName: json['hometownCityName'], photoList: (json['photoList'] as List?)?.map((e) => PhotoItem.fromJson(e as Map)).toList() ?? [], ); } // 转换为JSON映射 Map toJson() { return { 'id': id, 'nickName': nickName, 'name': name, 'profilePhoto': profilePhoto, 'identityCard': identityCard, 'genderCode': genderCode, 'hasUploadProfilePhoto': hasUploadProfilePhoto, 'auditProfilePhoto': auditProfilePhoto, 'genderValue': genderValue, 'homeCountryCode': homeCountryCode, 'homeCountry': homeCountry, 'provinceCode': provinceCode, 'provinceName': provinceName, 'cityCode': cityCode, 'cityName': cityName, 'districtCode': districtCode, 'districtName': districtName, 'birthYear': birthYear, 'birthDate': birthDate, 'constellationCode': constellationCode, 'constellation': constellation, 'chineseZodiacCode': chineseZodiacCode, 'chineseZodiac': chineseZodiac, 'height': height, 'weight': weight, 'educationCode': educationCode, 'education': education, 'maritalStatusCode': maritalStatusCode, 'maritalStatusName': maritalStatusName, 'minimumIncome': minimumIncome, 'maximumIncome': maximumIncome, 'incomeCode': incomeCode, 'income': income, 'describeInfo': describeInfo, 'domicilePlaceProvinceCode': domicilePlaceProvinceCode, 'domicilePlaceProvinceName': domicilePlaceProvinceName, 'domicilePlaceCityCode': domicilePlaceCityCode, 'domicilePlaceCityName': domicilePlaceCityName, 'nationCode': nationCode, 'nation': nation, 'bodilyFormCode': bodilyFormCode, 'bodilyForm': bodilyForm, 'accountTypeCode': accountTypeCode, 'accountTypeName': accountTypeName, 'nationalityCode': nationalityCode, 'nationality': nationality, 'nativePlaceCode': nativePlaceCode, 'nativePlaceName': nativePlaceName, 'industryCode': industryCode, 'industry': industry, 'occupationCode': occupationCode, 'occupation': occupation, 'onlyChild': onlyChild, 'carPurchaseSituationCode': carPurchaseSituationCode, 'carPurchaseSituation': carPurchaseSituation, 'propertyPermitsCode': propertyPermitsCode, 'propertyPermits': propertyPermits, 'hometownProvinceCode': hometownProvinceCode, 'hometownProvinceName': hometownProvinceName, 'hometownCityCode': hometownCityCode, 'hometownCityName': hometownCityName, 'photoList': photoList, }; } @override String toString() { return 'UserData(id: $id, nickName: $nickName, genderCode: $genderCode, auditProfilePhoto: $auditProfilePhoto, genderValue: $genderValue, birthYear: $birthYear, photoList: $photoList)'; } bool isPhotoAudited(){ if(hasUploadProfilePhoto! && profilePhoto != null){ return hasUploadProfilePhoto! && profilePhoto!.isNotEmpty; } return false; } }