Package com.espacogeek.geek.services
Interface UserService
- All Known Implementing Classes:
UserServiceImpl
public interface UserService
This interface defines the contract for the User Service.
It provides methods to perform CRUD operations on UserModel objects.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteById(Integer id) Delete user by Id provide.Retrieves a UserModel object by its ID.findByIdOrUsernameContainsOrEmail(Integer id, String username, String email) Retrieves a UserModel object by its id, username (partial match) and Email.findUserByEmail(String email) Retrieve a user by email.Saves a new UserModel object to the database.
-
Method Details
-
save
Saves a new UserModel object to the database.- Parameters:
user- The UserModel object to be saved.- Returns:
- The saved UserModel object.
- Throws:
GenericException- If an error occurs during the save operation.
-
findByIdOrUsernameContainsOrEmail
Retrieves a UserModel object by its id, username (partial match) and Email.- Parameters:
id- The id of the UserModel object to be retrieved.username- The username (partial) of the UserModel object to be retrieved.email- The email of the UserModel object to be retrieved.- Returns:
- An Optional containing the UserModel object if found, otherwise an empty Optional.
-
findById
Retrieves a UserModel object by its ID.- Parameters:
id- The ID of the UserModel object to be retrieved.- Returns:
- An Optional containing the UserModel object if found, otherwise an empty Optional.
-
findUserByEmail
Retrieve a user by email.- Parameters:
email- user email- Returns:
- Optional with user
-
deleteById
Delete user by Id provide.- Parameters:
id-
-