diff --git a/src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java b/src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java index 3969edb..1e5761d 100644 --- a/src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java +++ b/src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java @@ -5,6 +5,7 @@ import org.springframework.stereotype.Repository; import java.util.ArrayList; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.regex.*; @@ -42,8 +43,11 @@ public ArrayList searchBooksByTitle(String title, int sortBy){ - ArrayList result = searchBooksByTitle(title); -// result.sort(Comparator.comparing(Book::)) + if(sortBy == 0){ + ArrayList result = searchBooksByTitle(title); + result.sort(Comparator.comparing(Book::getTime)); + return result; + } return null; }