feat: 完成v10.1.0版本大更新,新增密保系统、勋章、任务、排行榜等功能
### 变更详情 1. 新增密保问题系统,支持8种预置验证问题,多场景支持多验证方式 2. 新增勋章管理模块,包含勋章配置、用户勋章关联管理 3. 新增每日任务系统,支持任务配置和用户进度追踪 4. 新增赛季排行榜功能,支持周/月赛季排行与奖励结算 5. 新增信息流推荐权重配置管理 6. 重构服务路径分层,按设备/网络/数据分类管理服务 7. 优化Feed请求参数截断逻辑,避免URL过长 8. 新增等级工具类,统一处理等级颜色与称号展示 9. 新增屏幕共享共享信令Provider,复用传输服务实例 10. 新增Android/iOS分享适配与桌面小组件支持 11. 清理旧版测试脚本,新增部署维护脚本 12. 完善用户注销关联数据清理逻辑
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/// ============================================================
|
||||
/// 闲言APP — 用户数据模型
|
||||
/// 创建时间: 2026-04-28
|
||||
/// 更新时间: 2026-05-11
|
||||
/// 更新时间: 2026-05-15
|
||||
/// 作用: 用户信息数据模型,对应后端 tool_user 表
|
||||
/// 上次更新: v10.0.0 UserDevice新增ipCity/ipRange字段
|
||||
/// 上次更新: v10.1.0 UserModel新增secQuestion/secQuestionText字段
|
||||
/// ============================================================
|
||||
|
||||
class UserModel {
|
||||
@@ -16,6 +16,10 @@ class UserModel {
|
||||
this.email = '',
|
||||
this.mobile = '',
|
||||
this.score = 0,
|
||||
this.level = 1,
|
||||
this.exp = 0,
|
||||
this.expToNext = 0,
|
||||
this.expProgress = 0.0,
|
||||
this.money = '0.00',
|
||||
this.titleId = 1,
|
||||
this.signinDays = 0,
|
||||
@@ -32,6 +36,8 @@ class UserModel {
|
||||
this.devices = const [],
|
||||
this.extra,
|
||||
this.profileSlug = '',
|
||||
this.secQuestion = 0,
|
||||
this.secQuestionText = '',
|
||||
});
|
||||
|
||||
final int id;
|
||||
@@ -42,6 +48,10 @@ class UserModel {
|
||||
final String email;
|
||||
final String mobile;
|
||||
final int score;
|
||||
final int level;
|
||||
final int exp;
|
||||
final int expToNext;
|
||||
final double expProgress;
|
||||
final String money;
|
||||
final int titleId;
|
||||
final int signinDays;
|
||||
@@ -59,6 +69,10 @@ class UserModel {
|
||||
final List<UserDevice> devices;
|
||||
final UserExtra? extra;
|
||||
final String profileSlug;
|
||||
final int secQuestion;
|
||||
final String secQuestionText;
|
||||
|
||||
bool get hasSecQuestion => secQuestion > 0;
|
||||
|
||||
String get displayName => nickname.isNotEmpty ? nickname : username;
|
||||
|
||||
@@ -92,6 +106,10 @@ class UserModel {
|
||||
email: json['email'] as String? ?? '',
|
||||
mobile: json['mobile'] as String? ?? '',
|
||||
score: json['score'] as int? ?? 0,
|
||||
level: json['level'] as int? ?? 1,
|
||||
exp: json['exp'] as int? ?? 0,
|
||||
expToNext: json['exp_to_next'] as int? ?? 0,
|
||||
expProgress: (json['exp_progress'] as num?)?.toDouble() ?? 0.0,
|
||||
money: json['money']?.toString() ?? '0.00',
|
||||
titleId: json['title_id'] as int? ?? 1,
|
||||
signinDays: json['signin_days'] as int? ?? 0,
|
||||
@@ -124,6 +142,8 @@ class UserModel {
|
||||
? UserExtra.fromJson(json['extra'] as Map<String, dynamic>)
|
||||
: null,
|
||||
profileSlug: json['profile_slug'] as String? ?? '',
|
||||
secQuestion: json['sec_question'] as int? ?? 0,
|
||||
secQuestionText: json['sec_question_text'] as String? ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -137,6 +157,10 @@ class UserModel {
|
||||
'email': email,
|
||||
'mobile': mobile,
|
||||
'score': score,
|
||||
'level': level,
|
||||
'exp': exp,
|
||||
'exp_to_next': expToNext,
|
||||
'exp_progress': expProgress,
|
||||
'money': money,
|
||||
'title_id': titleId,
|
||||
'signin_days': signinDays,
|
||||
@@ -153,6 +177,8 @@ class UserModel {
|
||||
'devices': devices.map((e) => e.toJson()).toList(),
|
||||
'extra': extra?.toJson(),
|
||||
'profile_slug': profileSlug,
|
||||
'sec_question': secQuestion,
|
||||
'sec_question_text': secQuestionText,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -165,6 +191,10 @@ class UserModel {
|
||||
String? email,
|
||||
String? mobile,
|
||||
int? score,
|
||||
int? level,
|
||||
int? exp,
|
||||
int? expToNext,
|
||||
double? expProgress,
|
||||
String? money,
|
||||
int? titleId,
|
||||
int? signinDays,
|
||||
@@ -181,6 +211,8 @@ class UserModel {
|
||||
List<UserDevice>? devices,
|
||||
UserExtra? extra,
|
||||
String? profileSlug,
|
||||
int? secQuestion,
|
||||
String? secQuestionText,
|
||||
}) {
|
||||
return UserModel(
|
||||
id: id ?? this.id,
|
||||
@@ -191,6 +223,10 @@ class UserModel {
|
||||
email: email ?? this.email,
|
||||
mobile: mobile ?? this.mobile,
|
||||
score: score ?? this.score,
|
||||
level: level ?? this.level,
|
||||
exp: exp ?? this.exp,
|
||||
expToNext: expToNext ?? this.expToNext,
|
||||
expProgress: expProgress ?? this.expProgress,
|
||||
money: money ?? this.money,
|
||||
titleId: titleId ?? this.titleId,
|
||||
signinDays: signinDays ?? this.signinDays,
|
||||
@@ -207,6 +243,8 @@ class UserModel {
|
||||
devices: devices ?? this.devices,
|
||||
extra: extra ?? this.extra,
|
||||
profileSlug: profileSlug ?? this.profileSlug,
|
||||
secQuestion: secQuestion ?? this.secQuestion,
|
||||
secQuestionText: secQuestionText ?? this.secQuestionText,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user