mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
一部廃止
This commit is contained in:
parent
df3edbf354
commit
fc6cbb9d37
|
@ -15,9 +15,7 @@ public interface LacertaLibrary {
|
||||||
CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit);
|
CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit);
|
||||||
CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit, int offset);
|
CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit, int offset);
|
||||||
|
|
||||||
// Get Library page
|
// Get Library Page
|
||||||
CompletableFuture<LibraryItemPage> getLibraryPage(int limit);
|
|
||||||
CompletableFuture<LibraryItemPage> getLibraryPage(int limit, int offset);
|
|
||||||
CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit);
|
CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit);
|
||||||
CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit, int offset);
|
CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit, int offset);
|
||||||
|
|
||||||
|
|
|
@ -64,74 +64,6 @@ public class LacertaLibraryImpl implements LacertaLibrary {
|
||||||
return null; // TODO-rca: Implement
|
return null; // TODO-rca: Implement
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal
|
|
||||||
private CompletableFuture<List<FolderEntity>> getFolderEntitiesByPublicPath(String publicPath) {
|
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
|
||||||
return database.folderDao().findByPublicPathWithLimit(publicPath, 10); // TODO-rca: ハードコーディングやめる
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private CompletableFuture<List<DocumentEntity>> getDocumentEntitiesByPublicPath(String publicPath) {
|
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
|
||||||
return database.documentDao().findByPublicPathWithLimit(publicPath, 10); // TODO-rca: ハードコーディングやめる
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CompletableFuture<LibraryItemPage> getLibraryPage(int limit) {
|
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
|
||||||
|
|
||||||
// 5秒フリーズさせる
|
|
||||||
try {
|
|
||||||
Thread.sleep(1000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
LibraryItemPage libraryItemPage = new LibraryItemPage();
|
|
||||||
|
|
||||||
List<FolderEntity> folderEntities = getFolderEntitiesByPublicPath("/").join();
|
|
||||||
logger.debug("LacertaLibraryImpl", "folderEntities.size(): " + folderEntities.size());
|
|
||||||
List<DocumentEntity> documentEntities = getDocumentEntitiesByPublicPath("/").join();
|
|
||||||
logger.debug("LacertaLibraryImpl", "documentEntities.size(): " + documentEntities.size());
|
|
||||||
|
|
||||||
ArrayList<ListItem> listItems = new ArrayList<>();
|
|
||||||
for (FolderEntity folderEntity : folderEntities) {
|
|
||||||
logger.debug("LacertaLibraryImpl", "folderEntity.name: " + folderEntity.name);
|
|
||||||
ListItem listItem = new ListItem();
|
|
||||||
listItem.setItemType(ListItemType.ITEM_TYPE_FOLDER);
|
|
||||||
listItem.setTitle(folderEntity.name);
|
|
||||||
listItem.setDescription("フォルダ"); // TODO-rca: ハードコーディングやめる
|
|
||||||
listItem.setItemId(folderEntity.id);
|
|
||||||
listItems.add(listItem);
|
|
||||||
}
|
|
||||||
for (DocumentEntity documentEntity : documentEntities) {
|
|
||||||
logger.debug("LacertaLibraryImpl", "documentEntity.title: " + documentEntity.title);
|
|
||||||
ListItem listItem = new ListItem();
|
|
||||||
listItem.setItemType(ListItemType.ITEM_TYPE_DOCUMENT);
|
|
||||||
listItem.setTitle(documentEntity.title);
|
|
||||||
// listItem.setDescription(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm").format(documentEntity.updatedAt.toInstant()));
|
|
||||||
listItem.setItemId(documentEntity.id);
|
|
||||||
listItems.add(listItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
libraryItemPage.setPageTitle("/");
|
|
||||||
libraryItemPage.setPageId("root");
|
|
||||||
libraryItemPage.setListItems(listItems);
|
|
||||||
|
|
||||||
logger.debug("LacertaLibraryImpl", "libraryItemPage.getListItems().size(): " + libraryItemPage.getListItems().size());
|
|
||||||
|
|
||||||
return libraryItemPage;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CompletableFuture<LibraryItemPage> getLibraryPage(int limit, int offset) {
|
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit) {
|
public CompletableFuture<LibraryItemPage> getLibraryPage(String pageId, int limit) {
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user