Package com.bytedesk.core.rbac.user
Class UserEntity
java.lang.Object
com.bytedesk.core.base.BaseEntityNoOrg
com.bytedesk.core.rbac.user.UserEntity
- All Implemented Interfaces:
Serializable
User entity for system authentication and authorization
Manages user accounts, roles, and organizational relationships
Database Table: bytedesk_core_user
Purpose: Stores user information, authentication details, and role assignments
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringURL of the user's avatar imageprivate StringCountry code for the user (default: 86 for China)private OrganizationEntityUser's current active organization Users can belong to multiple organizations but can only be active in one at a timeprivate Set<RoleEntity>Current roles assigned to the user in the active organizationprivate StringUser description or bioprivate @Email(message="email format error") StringUser's email address for communication and verificationprivate booleanWhether the user's email has been verifiedprivate booleanWhether the user account is enabledprivate Stringprivate StringUser's mobile phone numberprivate booleanWhether the user's mobile number has been verifiedprivate StringDisplay name of the userprivate StringUser number for searching and adding friendsprivate StringEncrypted password for user authenticationprivate ZonedDateTimePassword last modified time for security compliance Used for tracking password changes and prompting users to update passwords Defaults to account creation time when user is createdprivate static final longprivate StringUser's gender (MALE, FEMALE, UNKNOWN)private booleanWhether the user has super administrator privilegesprivate @NotBlank(message="username is required") StringUsername used in JWT authentication (required field)private Set<UserOrganizationRoleEntity>User's roles across all organizations One user can belong to multiple organizations with different roles in each -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontainsRole(RoleEntity role) Get formatted password modification time for displayvoidvoidtoString()Methods inherited from class com.bytedesk.core.base.BaseEntityNoOrg
getCreatedAtString, getUpdatedAtString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
num
User number for searching and adding friends -
username
@NotBlank(message="username is required") private @NotBlank(message="username is required") String usernameUsername used in JWT authentication (required field) -
nickname
Display name of the user -
password
Encrypted password for user authentication -
email
User's email address for communication and verification -
country
Country code for the user (default: 86 for China) -
mobile
User's mobile phone number -
avatar
URL of the user's avatar image -
description
User description or bio -
sex
User's gender (MALE, FEMALE, UNKNOWN) -
enabled
private boolean enabledWhether the user account is enabled -
superUser
private boolean superUserWhether the user has super administrator privileges -
emailVerified
private boolean emailVerifiedWhether the user's email has been verified -
mobileVerified
private boolean mobileVerifiedWhether the user's mobile number has been verified -
passwordModifiedAt
Password last modified time for security compliance Used for tracking password changes and prompting users to update passwords Defaults to account creation time when user is created -
currentOrganization
User's current active organization Users can belong to multiple organizations but can only be active in one at a time -
currentRoles
Current roles assigned to the user in the active organization -
userOrganizationRoles
User's roles across all organizations One user can belong to multiple organizations with different roles in each -
extra
-
-
Constructor Details
-
UserEntity
public UserEntity()
-
-
Method Details
-
addOrganizationRole
-
getRoleUids
-
containsRole
-
removeOrganizationRole
-
removeOrganizationRoles
public void removeOrganizationRoles() -
getOrgUid
-
getPasswordModifiedAtString
Get formatted password modification time for display- Returns:
- formatted date string
-
toProtobuf
-
toString
-