Files
customer-im-client-dev/apps/im_app/lib/domain/entities/user.dart
Happi (哈比) a066e9d2dc 1)修改数据库命名,不和业务使用重合。
2)修改user 表,uid为unique, 聊天室文件夹name unique移除
2026-03-07 17:29:32 +08:00

94 lines
2.4 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/// 用户 Domain 实体
///
/// 全局共享实体,被 auth / chat / contact 等多个 Feature 共用。
/// 纯 Dart 类,零 Flutter / 零网络 / 零 DB 依赖。
///
/// ## 数据流位置
///
/// ```
/// 服务端 JSON
/// → LoginDataResponse DTOdata/remote/login_request.dart
/// → LoginData.toEntity()
/// → ★ User ★ ← 你在这里
/// → ViewModel.state
/// → View 渲染
/// ```
class User {
final int uid;
final String? uuid;
final int? lastOnline;
final String? profilePic;
final String? profilePicGaussian;
final String? nickname;
final String? contact;
final String? countryCode;
final String? email;
final String? recoveryEmail;
final String? username;
final String? bio;
final int? relationship;
final String? userAlias;
final int? channelId;
final int? channelGroupId;
final String? hint;
const User({
required this.uid,
this.uuid,
this.lastOnline,
this.profilePic,
this.profilePicGaussian,
this.nickname,
this.contact,
this.countryCode,
this.email,
this.recoveryEmail,
this.username,
this.bio,
this.relationship,
this.userAlias,
this.channelId,
this.channelGroupId,
this.hint,
});
User copyWith({
int? uid,
String? uuid,
int? lastOnline,
String? profilePic,
String? profilePicGaussian,
String? nickname,
String? contact,
String? countryCode,
String? email,
String? recoveryEmail,
String? username,
String? bio,
int? relationship,
String? userAlias,
int? channelId,
int? channelGroupId,
String? hint,
}) {
return User(
uid: uid ?? this.uid,
uuid: uuid ?? this.uuid,
lastOnline: lastOnline ?? this.lastOnline,
profilePic: profilePic ?? this.profilePic,
profilePicGaussian: profilePicGaussian ?? this.profilePicGaussian,
nickname: nickname ?? this.nickname,
contact: contact ?? this.contact,
countryCode: countryCode ?? this.countryCode,
email: email ?? this.email,
recoveryEmail: recoveryEmail ?? this.recoveryEmail,
username: username ?? this.username,
bio: bio ?? this.bio,
relationship: relationship ?? this.relationship,
userAlias: userAlias ?? this.userAlias,
channelId: channelId ?? this.channelId,
channelGroupId: channelGroupId ?? this.channelGroupId,
hint: hint ?? this.hint,
);
}
}