From c663d78e11dc8fdec07d5b2cad88a47b18644fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 12 Jan 2024 10:59:16 +0900 Subject: [PATCH] =?UTF-8?q?=E5=B1=A5=E6=AD=B4=E3=82=92=E7=94=9F=E6=88=90?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=86=85=E9=83=A8=E3=83=A1=E3=82=BD=E3=83=83?= =?UTF-8?q?=E3=83=89=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/impl/LacertaLibraryStubImpl.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryStubImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryStubImpl.java index 5adf85ad..edda1b14 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryStubImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryStubImpl.java @@ -94,6 +94,25 @@ public class LacertaLibraryStubImpl implements LacertaLibrary { } } + private LibraryItemPage getRecentDocumentPage(int limit) { + int itemTotal = faker.number().numberBetween(1, limit); + ArrayList listItems = new ArrayList<>(); + for (int i = 0; i < itemTotal; i++) { + listItems.add(generateStubListItem(ListItemType.ITEM_TYPE_DOCUMENT)); + } + // DescriptionからDateを抽出して新しい順にソート + listItems.sort((a, b) -> { + String aDate = a.getDescription().substring(11); + String bDate = b.getDescription().substring(11); + return bDate.compareTo(aDate); + }); + LibraryItemPage libraryItemPage = new LibraryItemPage(); + libraryItemPage.setListItems(listItems); + libraryItemPage.setPageId(UUID.randomUUID().toString()); + libraryItemPage.setPageTitle("RecentDocument"); + return libraryItemPage; + } + @Override public LibraryItemPage getRecentDocument(int limit) { return null;