mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
moveDocumentを定義, 実装
This commit is contained in:
parent
d5ebc2c498
commit
44edd1c23e
|
@ -23,6 +23,8 @@ public interface Document {
|
||||||
|
|
||||||
CompletableFuture<Void> deleteDocument(String documentId);
|
CompletableFuture<Void> deleteDocument(String documentId);
|
||||||
|
|
||||||
|
CompletableFuture<Void> moveDocument(String documentId, String parentId);
|
||||||
|
|
||||||
CompletableFuture<Void> updateDocument(DocumentDetail detail);
|
CompletableFuture<Void> updateDocument(DocumentDetail detail);
|
||||||
|
|
||||||
CompletableFuture<DocumentDetail> getDocument(String documentId);
|
CompletableFuture<DocumentDetail> getDocument(String documentId);
|
||||||
|
|
|
@ -123,6 +123,19 @@ public class DocumentImpl implements Document {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<Void> moveDocument(String documentId, String parentId) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
DocumentEntity documentEntity = database.documentDao().findById(documentId);
|
||||||
|
if (documentEntity == null) {
|
||||||
|
throw new IllegalArgumentException("documentId is not found");
|
||||||
|
}
|
||||||
|
documentEntity.parentId = parentId;
|
||||||
|
database.documentDao().update(documentEntity);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<Void> updateDocument(DocumentDetail detail) {
|
public CompletableFuture<Void> updateDocument(DocumentDetail detail) {
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user