履歴を生成する内部メソッド作成

This commit is contained in:
ろむねこ 2024-01-12 10:59:16 +09:00
parent bb36458c4d
commit c663d78e11
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -94,6 +94,25 @@ public class LacertaLibraryStubImpl implements LacertaLibrary {
}
}
private LibraryItemPage getRecentDocumentPage(int limit) {
int itemTotal = faker.number().numberBetween(1, limit);
ArrayList<ListItem> 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;