Package com.mindstore.backend.service
Class UserService
java.lang.Object
com.mindstore.backend.service.UserService
Service class for user entity
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteUserById(Long id) function: deletes a user from the user repofindAll()function: searches for all users in the user repofindUserById(Long id) function: find a specific user in the user repogetRecentUser(String email, LocalDateTime createdAt) function: search for a user with email that was created before a specific Datefunction: adds a new user to the user repo
-
Constructor Details
-
UserService
user service- Parameters:
userRepository- repository for user actions
-
-
Method Details
-
findAll
function: searches for all users in the user repo- Returns:
- a list of users available
-
save
function: adds a new user to the user repo- Parameters:
user- the user we want to save- Returns:
- the saved User
-
findUserById
function: find a specific user in the user repo- Parameters:
id- - the user id we are searching for- Returns:
- an Optional User
-
deleteUserById
function: deletes a user from the user repo- Parameters:
id- the id of the user we want to delete
-
getRecentUser
function: search for a user with email that was created before a specific Date- Parameters:
email- string of the user we are looking forcreatedAt- LocalDateTime of user creation- Returns:
- User that is found with that query
-