Delete実装

This commit is contained in:
r-ca 2024-01-23 04:20:59 +09:00
parent 29f745bb5c
commit 09c6d47a47
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -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;
}); });
} }