67 lines
1.3 KiB
Dart
67 lines
1.3 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
class UserEntity extends Equatable {
|
|
final String userId;
|
|
final String username;
|
|
final String nickname;
|
|
final String token;
|
|
final int orgId;
|
|
final String? avatar;
|
|
final String? email;
|
|
final String? phone;
|
|
final String? roleKey;
|
|
final int? siteId;
|
|
|
|
const UserEntity({
|
|
required this.userId,
|
|
required this.username,
|
|
required this.nickname,
|
|
required this.token,
|
|
required this.orgId,
|
|
this.avatar,
|
|
this.email,
|
|
this.phone,
|
|
this.roleKey,
|
|
this.siteId,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [
|
|
userId,
|
|
username,
|
|
nickname,
|
|
avatar,
|
|
token,
|
|
orgId,
|
|
email,
|
|
phone,
|
|
roleKey,
|
|
siteId,
|
|
];
|
|
|
|
UserEntity copyWith({
|
|
String? userId,
|
|
String? username,
|
|
String? nickname,
|
|
String? token,
|
|
int? orgId,
|
|
String? avatar,
|
|
String? email,
|
|
String? phone,
|
|
String? roleKey,
|
|
int? siteId,
|
|
}) {
|
|
return UserEntity(
|
|
userId: userId ?? this.userId,
|
|
username: username ?? this.username,
|
|
nickname: nickname ?? this.nickname,
|
|
token: token ?? this.token,
|
|
orgId: orgId ?? this.orgId,
|
|
avatar: avatar ?? this.avatar,
|
|
email: email ?? this.email,
|
|
phone: phone ?? this.phone,
|
|
roleKey: roleKey ?? this.roleKey,
|
|
siteId: siteId ?? this.siteId,
|
|
);
|
|
}
|
|
} |