Class UserServiceImpl
java.lang.Object
org.example.crmedu.domain.service.user.UserServiceImpl
- All Implemented Interfaces:
UserService
Implementation of the
UserService
interface. Provides business logic for managing User
entities.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new user.void
Deletes a user by its unique identifier.findAll
(int pageNumber, int pageSize) Retrieves a paginated list of users.findByEmail
(String email) Retrieves a user by its email.Retrieves an user by its unique identifier.findByVerificationToken
(String token) Retrieves a user by its token.void
Updates an existing user.void
Verifies user in system by his verification token.
-
Constructor Details
-
UserServiceImpl
public UserServiceImpl()
-
-
Method Details
-
create
Description copied from interface:UserService
Creates a new user. If user has role 'tutor', a tutor corresponding to that user is also created.- Specified by:
create
in interfaceUserService
- Parameters:
user
- the user to create- Returns:
- the created
User
-
findById
Description copied from interface:UserService
Retrieves an user by its unique identifier.- Specified by:
findById
in interfaceUserService
- Parameters:
id
- the unique identifier of the user- Returns:
- the found
User
-
findByEmail
Description copied from interface:UserService
Retrieves a user by its email.- Specified by:
findByEmail
in interfaceUserService
- Parameters:
email
- the email of the user- Returns:
- the found
User
-
findByVerificationToken
Description copied from interface:UserService
Retrieves a user by its token.- Specified by:
findByVerificationToken
in interfaceUserService
- Parameters:
token
- the verification token of the user- Returns:
- the found
User
-
findAll
Description copied from interface:UserService
Retrieves a paginated list of users.- Specified by:
findAll
in interfaceUserService
- Parameters:
pageNumber
- the page number (starting from 0)pageSize
- the number of users per page- Returns:
- a
Page
containing the requested users
-
update
Description copied from interface:UserService
Updates an existing user.- Specified by:
update
in interfaceUserService
- Parameters:
user
- the updated user dataid
- the unique identifier of the user to update
-
delete
Description copied from interface:UserService
Deletes a user by its unique identifier.- Specified by:
delete
in interfaceUserService
- Parameters:
id
- the unique identifier of the user to delete
-
verifyUserByVerificationToken
Description copied from interface:UserService
Verifies user in system by his verification token.- Specified by:
verifyUserByVerificationToken
in interfaceUserService
- Parameters:
token
- verification token of the user
-