hi-client/lib/app/model/response/kr_user_info.dart
speakeloudest f42a481452
Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / build (push) Has been cancelled
feat: 更新代码仓库全部修改
2025-10-30 04:47:53 -07:00

75 lines
1.9 KiB
Dart
Executable File

class KRAuthMethod {
final String authIdentifier;
final String authType;
final bool verified;
KRAuthMethod({
required this.authIdentifier,
required this.authType,
required this.verified,
});
factory KRAuthMethod.fromJson(Map<String, dynamic> json) {
return KRAuthMethod(
authIdentifier: json['auth_identifier'] ?? '',
authType: json['auth_type'] ?? '',
verified: json['verified'] ?? false,
);
}
}
class KRUserInfo {
final int id;
final String email;
final int refererId;
final String referCode;
final String avatar;
final String areaCode;
final String telephone;
final int balance;
final int commission;
final int referralPercentage;
final bool onlyFirstPurchase;
final int giftAmount;
// 新增 auth_methods 列表
final List<KRAuthMethod> authMethods;
KRUserInfo({
required this.id,
required this.email,
this.refererId = 0,
this.referCode = '',
this.avatar = '',
this.areaCode = '',
this.telephone = '',
this.balance = 0,
this.commission = 0,
this.referralPercentage = 0,
this.onlyFirstPurchase = false,
this.giftAmount = 0,
this.authMethods = const [],
});
factory KRUserInfo.fromJson(Map<String, dynamic> json) {
return KRUserInfo(
id: json['id'] ?? 0,
email: json['email'] ?? '',
refererId: json['referer_id'] ?? 0,
referCode: json['refer_code'] ?? '',
avatar: json['avatar'] ?? '',
areaCode: json['area_code'] ?? '',
telephone: json['telephone'] ?? '',
balance: json['balance'] ?? 0,
commission: json['commission'] ?? 0,
referralPercentage: json['referral_percentage'] ?? 0,
onlyFirstPurchase: json['only_first_purchase'] ?? false,
giftAmount: json['gift_amount'] ?? 0,
authMethods: (json['auth_methods'] as List<dynamic>?)
?.map((e) => KRAuthMethod.fromJson(e))
.toList() ??
[],
);
}
}