Interface CommentReactionsService

All Known Implementing Classes:
DefaultCommentReactionsService

@Internal public interface CommentReactionsService
Service for manipulating comment reactions.
Since:
8.17
  • Method Details

    • getReactions

      @Nonnull ServiceOutcome<Collection<ReactionSummary>> getReactions(@Nonnull ApplicationUser loggedInUser, Collection<Long> commentIds)
      Gets all reactions for a given comment.
      Parameters:
      loggedInUser - the user performing operation
      commentIds - comments ids
      Returns:
      a collection of ReactionSummary
    • getDetailedReaction

      @Nonnull ServiceOutcome<ReactionSummary> getDetailedReaction(@Nonnull ApplicationUser loggedInUser, Long commentId, String emojiId)
      Gets the details of the reaction containing Unicode of the emoji and a list of users who reacted with it.
      Parameters:
      loggedInUser - the user performing operation
      commentId - the ID of the comment
      emojiId - Unicode of the emoji
      Returns:
      the ReactionSummary object
    • addReaction

      @Nonnull ServiceOutcome<ReactionSummary> addReaction(@Nonnull ApplicationUser loggedInUser, long commentId, String emojiId)
      Checks whether the user already reacted to the comment with given emoji, and if not, adds a reaction.
      Parameters:
      loggedInUser - the user performing operation
      commentId - the ID of the comment
      emojiId - Unicode of the emoji
      Returns:
      the updated ReactionSummary for given emoji and given comment
    • deleteReaction

      @Nonnull ServiceOutcome<ReactionSummary> deleteReaction(@Nonnull ApplicationUser loggedInUser, Long commentId, String emojiId)
      Deletes a reaction. If there are duplicated reactions in the database, all matching records will be deleted.
      Parameters:
      loggedInUser - the user performing operation
      commentId - the ID of the comment
      emojiId - Unicode of the emoji
      Returns:
      the updated ReactionSummary for given emoji and given comment