Package su.onno.ui.comments
Class CommentController
java.lang.Object
su.onno.ui.comments.CommentController
The discussion-thread endpoint. A thread hangs off any catalog or document detail page and is
addressed by the same
{kind}/{name}/{id} triple the UI routes use. Reading and posting
are gated on read access to the target entity — if you can open the record you can
comment on it (see UiAccessService); deleting is limited to the author or an ADMIN.
Authorship is stamped from the authenticated principal via CurrentUserResolver, so the
client never asserts who it is.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe request body for posting a comment.static final recordThe request body for toggling a reaction. -
Constructor Summary
ConstructorsConstructorDescriptionCommentController(CommentService comments, UiAccessService access, CurrentUserResolver currentUser, CommentAuthorAvatars authorAvatars, CommentProperties properties, UiViewResolver viewResolver, CatalogQueryService catalogQuery, DocumentQueryService documentQuery, MentionResolver mentions, org.springframework.context.ApplicationEventPublisher events) -
Method Summary
Modifier and TypeMethodDescriptionadd(String kind, String name, UUID id, CommentController.CommentRequest request, Principal principal) org.springframework.http.ResponseEntity<Void> toggleReaction(UUID commentId, CommentController.ReactionRequest request, Principal principal)
-
Constructor Details
-
CommentController
public CommentController(CommentService comments, UiAccessService access, CurrentUserResolver currentUser, CommentAuthorAvatars authorAvatars, CommentProperties properties, UiViewResolver viewResolver, CatalogQueryService catalogQuery, DocumentQueryService documentQuery, MentionResolver mentions, org.springframework.context.ApplicationEventPublisher events)
-
-
Method Details
-
list
-
add
-
toggleReaction
-
delete
-