6 changed files with 366 additions and 2 deletions
Split View
Diff Options
-
47lib/model/mine/user_base_data.dart
-
259lib/model/mine/user_data.dart
-
1lib/network/api_urls.dart
-
4lib/network/user_api.dart
-
32lib/network/user_api.g.dart
-
25lib/pages/mine/login_controller.dart
@ -0,0 +1,47 @@ |
|||
// 用户基础信息实体类 |
|||
class UserBaseData { |
|||
final bool matchmakerFlag; |
|||
final bool matchmakingCornerFlag; |
|||
final String nickName; |
|||
final String phone; |
|||
final String realName; |
|||
final String userId; |
|||
|
|||
UserBaseData({ |
|||
required this.matchmakerFlag, |
|||
required this.matchmakingCornerFlag, |
|||
required this.nickName, |
|||
required this.phone, |
|||
required this.realName, |
|||
required this.userId, |
|||
}); |
|||
|
|||
// 从JSON映射创建实例 |
|||
factory UserBaseData.fromJson(Map<String, dynamic> json) { |
|||
return UserBaseData( |
|||
matchmakerFlag: json['matchmakerFlag'] ?? false, |
|||
matchmakingCornerFlag: json['matchmakingCornerFlag'] ?? false, |
|||
nickName: json['nickName'] ?? '', |
|||
phone: json['phone'] ?? '', |
|||
realName: json['realName'] ?? '', |
|||
userId: json['userId'] ?? '', |
|||
); |
|||
} |
|||
|
|||
// 转换为JSON映射 |
|||
Map<String, dynamic> toJson() { |
|||
return { |
|||
'matchmakerFlag': matchmakerFlag, |
|||
'matchmakingCornerFlag': matchmakingCornerFlag, |
|||
'nickName': nickName, |
|||
'phone': phone, |
|||
'realName': realName, |
|||
'userId': userId, |
|||
}; |
|||
} |
|||
|
|||
@override |
|||
String toString() { |
|||
return 'UserBaseData(matchmakerFlag: $matchmakerFlag, matchmakingCornerFlag: $matchmakingCornerFlag, nickName: $nickName, phone: $phone, realName: $realName, userId: $userId)'; |
|||
} |
|||
} |
|||
@ -0,0 +1,259 @@ |
|||
// 用户详细信息实体类 |
|||
class UserData { |
|||
final String id; |
|||
final String nickName; |
|||
final String? name; |
|||
final String? profilePhoto; |
|||
final String? identityCard; |
|||
final int genderCode; |
|||
final String genderValue; |
|||
final String? homeCountryCode; |
|||
final String? homeCountry; |
|||
final String? provinceCode; |
|||
final String? provinceName; |
|||
final String? cityCode; |
|||
final String? cityName; |
|||
final String? districtCode; |
|||
final String? districtName; |
|||
final String? birthYear; |
|||
final String? birthDate; |
|||
final String? constellationCode; |
|||
final String? constellation; |
|||
final String? chineseZodiacCode; |
|||
final String? chineseZodiac; |
|||
final String? height; |
|||
final String? weight; |
|||
final int? educationCode; |
|||
final String? education; |
|||
final String? maritalStatusCode; |
|||
final String? maritalStatusName; |
|||
final String? minimumIncome; |
|||
final String? maximumIncome; |
|||
final String? incomeCode; |
|||
final String? income; |
|||
final String? describeInfo; |
|||
final String? domicilePlaceProvinceCode; |
|||
final String? domicilePlaceProvinceName; |
|||
final String? domicilePlaceCityCode; |
|||
final String? domicilePlaceCityName; |
|||
final String? nationCode; |
|||
final String? nation; |
|||
final String? bodilyFormCode; |
|||
final String? bodilyForm; |
|||
final String? accountTypeCode; |
|||
final String? accountTypeName; |
|||
final String? nationalityCode; |
|||
final String? nationality; |
|||
final String? nativePlaceCode; |
|||
final String? nativePlaceName; |
|||
final String? industryCode; |
|||
final String? industry; |
|||
final String? occupationCode; |
|||
final String? occupation; |
|||
final String? onlyChild; |
|||
final String? carPurchaseSituationCode; |
|||
final String? carPurchaseSituation; |
|||
final String? propertyPermitsCode; |
|||
final String? propertyPermits; |
|||
final String? hometownProvinceCode; |
|||
final String? hometownProvinceName; |
|||
final String? hometownCityCode; |
|||
final String? hometownCityName; |
|||
|
|||
UserData({ |
|||
required this.id, |
|||
required this.nickName, |
|||
this.name, |
|||
this.profilePhoto, |
|||
this.identityCard, |
|||
required this.genderCode, |
|||
required 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, |
|||
}); |
|||
|
|||
// 从JSON映射创建实例 |
|||
factory UserData.fromJson(Map<String, dynamic> json) { |
|||
return UserData( |
|||
id: json['id'] ?? '', |
|||
nickName: json['nickName'] ?? '', |
|||
name: json['name'], |
|||
profilePhoto: json['profilePhoto'], |
|||
identityCard: json['identityCard'], |
|||
genderCode: json['genderCode'] ?? 0, |
|||
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'], |
|||
); |
|||
} |
|||
|
|||
// 转换为JSON映射 |
|||
Map<String, dynamic> toJson() { |
|||
return { |
|||
'id': id, |
|||
'nickName': nickName, |
|||
'name': name, |
|||
'profilePhoto': profilePhoto, |
|||
'identityCard': identityCard, |
|||
'genderCode': genderCode, |
|||
'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, |
|||
}; |
|||
} |
|||
|
|||
@override |
|||
String toString() { |
|||
return 'UserData(id: $id, nickName: $nickName, genderCode: $genderCode, genderValue: $genderValue, birthYear: $birthYear)'; |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save