java.lang.Object
dev.fernando.user_authentication_api.model.User
All Implemented Interfaces:
Serializable, org.springframework.security.core.userdetails.UserDetails

@Entity public class User extends Object implements org.springframework.security.core.userdetails.UserDetails
Represents a user in the system. Implements UserDetails for Spring Security integration. Contains user information such as username, email, password, phone, cpf, birthday date, and user role. Provides methods to convert to DTOs and manage user roles.
Since:
1.0.0
Author:
Fernando Cruz Cavina
See Also:
  • Constructor Details

  • Method Details

    • getAuthorities

      public Collection<? extends org.springframework.security.core.GrantedAuthority> getAuthorities()
      Specified by:
      getAuthorities in interface org.springframework.security.core.userdetails.UserDetails
    • convertToUserEventDto

      public UserEventDto convertToUserEventDto()
      Converts the User entity to a UserEventDto. This method is used to prepare user data for event publishing, such as account creation or updates.
      Returns:
    • toViewUserDto

      public ViewUserDto toViewUserDto()
      Converts the User entity to a ViewUserDto. This method is used to prepare user data for API responses.
      Returns:
      a ViewUserDto object containing user details