Package api.mpba.rastvdmy.service
Interface UserProfileService
- All Known Implementing Classes:
 UserProfileServiceImpl
public interface UserProfileService
Service interface for managing user profiles within the application.
- 
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteUser(jakarta.servlet.http.HttpServletRequest request) Deletes the currently authenticated user's profile.voiddeleteUserByEmail(jakarta.servlet.http.HttpServletRequest request, UUID userId) Deletes a user profile identified by their email.org.springframework.data.domain.Page<UserProfile> filterAndSortUsers(jakarta.servlet.http.HttpServletRequest request, org.springframework.data.domain.Pageable pageable) Filters and sorts user profiles based on the provided criteria.generateToken(UserProfile userProfile) Generates an authentication token for the specified user profile.getUser(jakarta.servlet.http.HttpServletRequest request) Retrieves the user profile of the currently authenticated user.getUserById(jakarta.servlet.http.HttpServletRequest request, UUID userId) Retrieves a user profile by its unique identifier.getUsers(jakarta.servlet.http.HttpServletRequest request) Retrieves a list of all user profiles.voidremoveUserAvatar(jakarta.servlet.http.HttpServletRequest request) Removes the avatar image of the currently authenticated user.updateUser(jakarta.servlet.http.HttpServletRequest request, UserUpdateRequest userRequest) Updates the user profile with the provided information.voidupdateUserRole(jakarta.servlet.http.HttpServletRequest request, UUID userId) Updates the role of a user identified by their unique ID.updateUserSpecificCredentials(jakarta.servlet.http.HttpServletRequest request, UUID userId, @Valid AdminUpdateUserRequest userRequest) Updates specific credentials of a user identified by their unique ID.voidupdateUserStatus(jakarta.servlet.http.HttpServletRequest request, UUID userId) Updates the status of a user identified by their unique ID.voiduploadUserAvatar(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile userAvatar) Uploads an avatar image for the specified user.org.springframework.security.core.userdetails.UserDetailsServiceRetrieves the user details service associated with the user profiles. 
- 
Method Details
- 
getUsers
Retrieves a list of all user profiles.- Parameters:
 request- the HTTP request containing context information- Returns:
 - a list of UserProfile objects representing all users
 
 - 
filterAndSortUsers
org.springframework.data.domain.Page<UserProfile> filterAndSortUsers(jakarta.servlet.http.HttpServletRequest request, org.springframework.data.domain.Pageable pageable) Filters and sorts user profiles based on the provided criteria.- Parameters:
 request- the HTTP request containing context informationpageable- the pagination and sorting information- Returns:
 - a page of UserProfile objects that match the filter criteria
 
 - 
getUser
Retrieves the user profile of the currently authenticated user.- Parameters:
 request- the HTTP request containing context information- Returns:
 - the UserProfile object of the authenticated user
 
 - 
getUserById
Retrieves a user profile by its unique identifier.- Parameters:
 request- the HTTP request containing context informationuserId- the unique identifier of the user- Returns:
 - the UserProfile object corresponding to the specified user ID
 
 - 
updateUser
UserProfile updateUser(jakarta.servlet.http.HttpServletRequest request, UserUpdateRequest userRequest) throws Exception Updates the user profile with the provided information.- Parameters:
 request- the HTTP request containing context informationuserRequest- the updated user profile data- Returns:
 - the updated UserProfile object
 - Throws:
 Exception- if there is an error while updating the user profile
 - 
updateUserSpecificCredentials
UserProfile updateUserSpecificCredentials(jakarta.servlet.http.HttpServletRequest request, UUID userId, @Valid @Valid AdminUpdateUserRequest userRequest) Updates specific credentials of a user identified by their unique ID.- Parameters:
 request- the HTTP request containing context informationuserId- the unique identifier of the useruserRequest- the updated specific user credentials- Returns:
 - the updated UserProfile object
 
 - 
uploadUserAvatar
void uploadUserAvatar(jakarta.servlet.http.HttpServletRequest request, org.springframework.web.multipart.MultipartFile userAvatar) Uploads an avatar image for the specified user.- Parameters:
 request- the HTTP request containing context informationuserAvatar- the image file to be uploaded as the user's avatar
 - 
removeUserAvatar
void removeUserAvatar(jakarta.servlet.http.HttpServletRequest request) Removes the avatar image of the currently authenticated user.- Parameters:
 request- the HTTP request containing context information
 - 
updateUserRole
Updates the role of a user identified by their unique ID.- Parameters:
 request- the HTTP request containing context informationuserId- the unique identifier of the user
 - 
updateUserStatus
Updates the status of a user identified by their unique ID.- Parameters:
 request- the HTTP request containing context informationuserId- the unique identifier of the user
 - 
deleteUser
void deleteUser(jakarta.servlet.http.HttpServletRequest request) Deletes the currently authenticated user's profile.- Parameters:
 request- the HTTP request containing context information
 - 
deleteUserByEmail
Deletes a user profile identified by their email.- Parameters:
 request- the HTTP request containing context informationuserId- the unique identifier of the user to be deleted
 - 
userDetailsService
org.springframework.security.core.userdetails.UserDetailsService userDetailsService()Retrieves the user details service associated with the user profiles.- Returns:
 - the UserDetailsService instance
 
 - 
generateToken
Generates an authentication token for the specified user profile.- Parameters:
 userProfile- the user profile for which the token is generated- Returns:
 - the generated token as a String
 
 
 -