mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
履歴を生成する内部メソッド作成
This commit is contained in:
parent
bb36458c4d
commit
c663d78e11
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user