From 06e402a8f272856ca8f96a8d7885da5b685542e1 Mon Sep 17 00:00:00 2001 From: _Bastler Date: Wed, 6 Oct 2021 13:16:30 +0200 Subject: [PATCH] fix usercomments --- .../board/businesslogic/CommentManager.java | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/src/main/java/de/bstly/board/businesslogic/CommentManager.java b/src/main/java/de/bstly/board/businesslogic/CommentManager.java index be2fd20..2563504 100644 --- a/src/main/java/de/bstly/board/businesslogic/CommentManager.java +++ b/src/main/java/de/bstly/board/businesslogic/CommentManager.java @@ -45,12 +45,12 @@ public class CommentManager { /** * Fetch by ranking. * - * @param target the target - * @param parent the parent - * @param date the date + * @param target the target + * @param parent the parent + * @param date the date * @param gravity the gravity - * @param page the page - * @param size the size + * @param page the page + * @param size the size * @return the page */ @@ -70,10 +70,10 @@ public class CommentManager { * * @param target the target * @param parent the parent - * @param date the date - * @param page the page - * @param size the size - * @param desc the desc + * @param date the date + * @param page the page + * @param size the size + * @param desc the desc * @return the page */ public Page fetchByDate(Long target, Long parent, Instant date, int page, int size, @@ -95,21 +95,19 @@ public class CommentManager { * Fetch by username. * * @param username the username - * @param orElse the or else - * @param date the date - * @param page the page - * @param size the size - * @param asc the asc + * @param orElse the or else + * @param date the date + * @param page the page + * @param size the size + * @param asc the asc * @return the page */ public Page fetchByUsername(String username, Long orElse, Instant date, int page, int size, boolean asc) { Sort sort = Sort.by(asc ? Order.asc("created") : Order.desc("created")); - return commentRepository - .findAll( - qComment.author.equalsIgnoreCase(username).and(qComment.parent.isNull()) - .and(qComment.created.before(date)), - PageRequest.of(page, size, sort)); + return commentRepository.findAll( + qComment.author.equalsIgnoreCase(username).and(qComment.created.before(date)), + PageRequest.of(page, size, sort)); } /** @@ -141,8 +139,8 @@ public class CommentManager { * Apply metadata. * * @param username the username - * @param comment the comment - * @param ignore the ignore + * @param comment the comment + * @param ignore the ignore */ public void applyMetadata(String username, Comment comment, List ignore) { @@ -193,8 +191,8 @@ public class CommentManager { * Apply metadata. * * @param username the username - * @param entries the entries - * @param ignore the ignore + * @param entries the entries + * @param ignore the ignore */ public void applyMetadata(String username, List entries, List ignore) { for (Comment comment : entries) {