Class ReactionServiceImpl
java.lang.Object
com.example.blogs.app.api.reaction.service.ReactionServiceImpl
- All Implemented Interfaces:
ReactionService
Orchestrates reaction operations by coordinating with repository adapters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsetReaction(Long postId, Long userId, ReactionType reactionType) Sets or updates a user's reaction on a post.
-
Constructor Details
-
ReactionServiceImpl
public ReactionServiceImpl()
-
-
Method Details
-
setReaction
Sets or updates a user's reaction on a post. Attempts to find an existing reaction and update it. If not found, creates a new reaction.- Specified by:
setReactionin interfaceReactionService- Parameters:
postId- the ID of the post to react touserId- the ID of the user making the reactionreactionType- the type of reaction (LIKE or DISLIKE)- Returns:
- the created or updated reaction as DTO
-