Package app.YUP.service
Class ExternalUserService
java.lang.Object
app.YUP.service.ExternalUserService
Service class for managing external users.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateExternalUser(jakarta.servlet.http.HttpServletResponse response, ExternalProviderUser externalProviderUser) Creates a new external user or updates an existing one.booleanexistsById(String userId) Checks if a user exists by their userId.getUserById(String userId) Retrieves a user by their userId.voidupdateUser(ExternalUser externalUser, UserUpdateRequest userUpdateRequest)
-
Constructor Details
-
ExternalUserService
public ExternalUserService()
-
-
Method Details
-
createExternalUser
public void createExternalUser(jakarta.servlet.http.HttpServletResponse response, ExternalProviderUser externalProviderUser) Creates a new external user or updates an existing one.- Parameters:
response- The HTTP response to set the JWT cookie.externalProviderUser- The external user details from the provider.
-
updateUser
-
getUserById
Retrieves a user by their userId.- Parameters:
userId- The userId of the user to retrieve.- Returns:
- The user with the given userId.
- Throws:
ResourceNotFoundException- If the user is not found.
-
existsById
Checks if a user exists by their userId.- Parameters:
userId- The userId of the user to check.- Returns:
- True if the user exists, false otherwise.
-