We will need DTOs to achieve maximal flexibility for all user-related operations that we will define. The first DTO will be the one we use when it returns a list of available users in the system. Define a new class called UserDetailsDTO:
package com.journaler.api.security import java.util.* data class UserDetailsDTO( val id: String, var email: String, var firstName: String, var lastName: String, var roles: String, var enabled: Boolean, var accountNonExpired: Boolean, var accountNonLocked: Boolean, var credentialsNonExpired: Boolean, var created: Date, var modified: Date )
UserDetailsDTO is a simple data class containing only mandatory fields. As you can see, we will not return back the password value. For saving ...