|
|
|
@ -1,4 +1,6 @@ |
|
|
|
// 数据模型类 - 根据真实API返回格式调整 |
|
|
|
import 'user_info_data.dart'; |
|
|
|
|
|
|
|
class MarriageData { |
|
|
|
final String miId; |
|
|
|
final String userId; |
|
|
|
@ -66,6 +68,32 @@ class MarriageData { |
|
|
|
photoList: (json['photoList'] as List<dynamic>?)?.map((e) => PhotoItem.fromJson(e as Map<String, dynamic>)).toList() ?? [], |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/// 从 UserInfoData 转换为 MarriageData |
|
|
|
factory MarriageData.fromUserInfoData(UserInfoData userInfo) { |
|
|
|
return MarriageData( |
|
|
|
miId: userInfo.miId ?? '', |
|
|
|
userId: userInfo.userId ?? '', |
|
|
|
profilePhoto: userInfo.profilePhoto ?? '', |
|
|
|
nickName: userInfo.nickName ?? '', |
|
|
|
isRealNameCertified: userInfo.identityCard != null && userInfo.identityCard!.isNotEmpty, |
|
|
|
birthYear: userInfo.birthYear ?? '', |
|
|
|
birthDate: userInfo.birthDate ?? '', |
|
|
|
age: userInfo.age?.toInt() ?? 0, |
|
|
|
provinceCode: userInfo.provinceCode?.toInt() ?? 0, |
|
|
|
provinceName: userInfo.provinceName ?? '', |
|
|
|
cityCode: userInfo.cityCode?.toInt() ?? 0, |
|
|
|
cityName: userInfo.cityName ?? '', |
|
|
|
districtCode: userInfo.districtCode?.toInt() ?? 0, |
|
|
|
districtName: userInfo.districtName ?? '', |
|
|
|
describeInfo: userInfo.describeInfo ?? '', |
|
|
|
createTime: userInfo.createTime ?? '', |
|
|
|
photoList: (userInfo.photoList ?? []).map((photo) => PhotoItem( |
|
|
|
photoUrl: photo.photoUrl ?? '', |
|
|
|
auditStatus: photo.auditStatus, |
|
|
|
)).toList(), |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 照片项数据模型 |
|
|
|
|