mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
getRecentDocumentを非同期に
This commit is contained in:
parent
4ab13508c4
commit
4e5aab276a
|
@ -2,7 +2,9 @@ package one.nem.lacerta.data.impl;
|
|||
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
|
@ -28,7 +30,8 @@ public class LacertaLibraryImpl implements LacertaLibrary {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ListItem> getRecentDocument(int limit) {
|
||||
public CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit) {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
List<DocumentEntity> documentEntities = database.documentDao().getRecentDocument(limit);
|
||||
|
||||
ArrayList<ListItem> listItems = new ArrayList<>();
|
||||
|
@ -40,11 +43,13 @@ public class LacertaLibraryImpl implements LacertaLibrary {
|
|||
listItem.setItemId(documentEntity.id);
|
||||
listItems.add(listItem);
|
||||
}
|
||||
|
||||
return listItems;
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ListItem> getRecentDocument(int limit, int offset) {
|
||||
public CompletableFuture<ArrayList<ListItem>> getRecentDocument(int limit, int offset) {
|
||||
return null; // TODO-rca: Implement
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user