All Known Implementing Classes:
UserServiceFacade

public interface UserService

USER SERVICE

Interface that manages the interactions between the controller and the database.

  • Method Details

    • saveUser

      AppUser saveUser​(AppUser user)

      SAVE USER

      Save a user on the database. It makes sure if the user's email is unique on the database. If the email is already taken or any other error is detected, the user won't be created.

      Parameters:
      user - The user that is going to be added.
      Returns:
      The user that has been added on the database, with an encrypted password.
    • getUser

      AppUser getUser​(java.lang.Long id)

      GET USER BY ID

      Get a user form the database using it's user ID.

      Parameters:
      id - The ID of the user that is going to be searched.
      Returns:
      The user from the database.
    • getUser

      AppUser getUser​(java.lang.String username)

      GET USER BY USERNAME

      Get a user form the database using its email.

      Parameters:
      username - The email of the user that is going to be searched.
      Returns:
      The user from the database.
    • deleteUser

      AppUser deleteUser​(AppUser user)

      DELETE USER

      Remove a user from the database. If the user doesn't exist won't it return anything.

      Parameters:
      user - The user that is going to be removed.
      Returns:
      The user that has been removed from the database.