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 String
URL of the user's avatar imageprivate String
Country code for the user (default: 86 for China)private OrganizationEntity
User'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 String
User description or bioprivate @Email(message="email format error") String
User's email address for communication and verificationprivate boolean
Whether the user's email has been verifiedprivate boolean
Whether the user account is enabledprivate String
private String
User's mobile phone numberprivate boolean
Whether the user's mobile number has been verifiedprivate String
Display name of the userprivate String
User number for searching and adding friendsprivate String
Encrypted password for user authenticationprivate ZonedDateTime
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 createdprivate static final long
private String
User's gender (MALE, FEMALE, UNKNOWN)private boolean
Whether the user has super administrator privilegesprivate @NotBlank(message="username is required") String
Username 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 TypeMethodDescriptionvoid
containsRole
(RoleEntity role) Get formatted password modification time for displayvoid
void
toString()
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
-