mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 07:53:15 +00:00
Delete実装
This commit is contained in:
parent
29f745bb5c
commit
09c6d47a47
|
@ -114,6 +114,11 @@ public class DocumentImpl implements Document {
|
|||
@Override
|
||||
public CompletableFuture<Void> deleteDocument(String documentId) {
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user