mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
Delete実装
This commit is contained in:
parent
29f745bb5c
commit
09c6d47a47
|
@ -114,6 +114,11 @@ public class DocumentImpl implements Document {
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<Void> deleteDocument(String documentId) {
|
public CompletableFuture<Void> deleteDocument(String documentId) {
|
||||||
return CompletableFuture.supplyAsync(() -> {
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
DocumentEntity documentEntity = database.documentDao().findById(documentId);
|
||||||
|
if (documentEntity == null) {
|
||||||
|
throw new IllegalArgumentException("documentId is not found");
|
||||||
|
}
|
||||||
|
database.documentDao().delete(documentEntity);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user