Class UserEntity

java.lang.Object
com.bytedesk.core.base.BaseEntityNoOrg
com.bytedesk.core.rbac.user.UserEntity
All Implemented Interfaces:
Serializable

@Entity public class UserEntity extends BaseEntityNoOrg
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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • num

      private String num
      User number for searching and adding friends
    • username

      @NotBlank(message="username is required") private @NotBlank(message="username is required") String username
      Username used in JWT authentication (required field)
    • nickname

      private String nickname
      Display name of the user
    • password

      private String password
      Encrypted password for user authentication
    • email

      @Email(message="email format error") private @Email(message="email format error") String email
      User's email address for communication and verification
    • country

      private String country
      Country code for the user (default: 86 for China)
    • mobile

      private String mobile
      User's mobile phone number
    • avatar

      private String avatar
      URL of the user's avatar image
    • description

      private String description
      User description or bio
    • sex

      private String sex
      User's gender (MALE, FEMALE, UNKNOWN)
    • enabled

      private boolean enabled
      Whether the user account is enabled
    • superUser

      private boolean superUser
      Whether the user has super administrator privileges
    • emailVerified

      private boolean emailVerified
      Whether the user's email has been verified
    • mobileVerified

      private boolean mobileVerified
      Whether the user's mobile number has been verified
    • passwordModifiedAt

      private ZonedDateTime 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

      private OrganizationEntity currentOrganization
      User's current active organization Users can belong to multiple organizations but can only be active in one at a time
    • currentRoles

      private Set<RoleEntity> currentRoles
      Current roles assigned to the user in the active organization
    • userOrganizationRoles

      private Set<UserOrganizationRoleEntity> userOrganizationRoles
      User's roles across all organizations One user can belong to multiple organizations with different roles in each
    • extra

      private String extra
  • Constructor Details

    • UserEntity

      public UserEntity()
  • Method Details

    • addOrganizationRole

      public void addOrganizationRole(RoleEntity role)
    • getRoleUids

      public Set<String> getRoleUids()
    • containsRole

      public Boolean containsRole(RoleEntity role)
    • removeOrganizationRole

      public void removeOrganizationRole(RoleEntity role)
    • removeOrganizationRoles

      public void removeOrganizationRoles()
    • getOrgUid

      public String getOrgUid()
    • getPasswordModifiedAtString

      public String getPasswordModifiedAtString()
      Get formatted password modification time for display
      Returns:
      formatted date string
    • toProtobuf

      public UserProtobuf toProtobuf()
    • toString

      public String toString()
      Overrides:
      toString in class Object