mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2025-02-17 00:03:15 +00:00
CompletableFeatureを使用して処理するように
This commit is contained in:
parent
1d2f3345df
commit
acc5b166d5
|
@ -3,6 +3,7 @@ package one.nem.lacerta.data.impl;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
// Hilt
|
// Hilt
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
@ -49,13 +50,11 @@ public class DocumentImpl implements Document {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentDetail createDocument(DocumentMeta meta) {
|
public CompletableFuture<DocumentDetail> createDocument(DocumentMeta meta) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
DocumentDetail detail = new DocumentDetail();
|
DocumentDetail detail = new DocumentDetail();
|
||||||
detail.setMeta(meta);
|
detail.setMeta(meta);
|
||||||
detail.setPages(new ArrayList<>());
|
detail.setPages(new ArrayList<>());
|
||||||
|
|
||||||
// TODO-rca: UIスレッドから追い出す
|
|
||||||
|
|
||||||
// Create DocumentEntity
|
// Create DocumentEntity
|
||||||
DocumentEntity documentEntity = new DocumentEntity();
|
DocumentEntity documentEntity = new DocumentEntity();
|
||||||
documentEntity.id = meta.getId();
|
documentEntity.id = meta.getId();
|
||||||
|
@ -74,6 +73,7 @@ public class DocumentImpl implements Document {
|
||||||
vcs.createDocument(meta.getId());
|
vcs.createDocument(meta.getId());
|
||||||
|
|
||||||
return detail;
|
return detail;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -102,6 +102,6 @@ public class DocumentImpl implements Document {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DocumentDetail getDocument(String documentId) {
|
public DocumentDetail getDocument(String documentId) {
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user