DefaultUserService

Default UserService implementation.

Author

Jan Müller
class DefaultUserService(userRepository: UserRepository) : UserService

Constructors

<init>
Link copied to clipboard
fun <init>(userRepository: UserRepository)

Functions

createUser
Link copied to clipboard
Creates a User. Must validate that the User does not exist and the data is valid. Must hash the password.
open suspend override fun createUser(partialUser: PartialUser): Result<String>
deleteUserById
Link copied to clipboard
Deletes a User by id. Must validate that the User exists.
open suspend override fun deleteUserById(id: String): Result<String>
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getAllUsers
Link copied to clipboard
Returns all Users.
open suspend override fun getAllUsers(): Result<List<UserListEntry>>
getUserById
Link copied to clipboard
Returns the User with the given id. Must validate that the User exists.
open suspend override fun getUserById(id: String): Result<UserProfile>
hashCode
Link copied to clipboard
open override fun hashCode(): Int
login
Link copied to clipboard
Performs a login using the given Credentials. Must validate that the User exists and that the credentials are valid.
open suspend override fun login(credentials: Credentials): Result<Token>
toString
Link copied to clipboard
open override fun toString(): String
updateUser
Link copied to clipboard
Updates a User. Must validate that the User exists and the data is valid. Must hash the password.
open suspend override fun updateUser(partialUser: PartialUser): Result<String>