mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
uncombineDocument実装
This commit is contained in:
parent
cd784cad15
commit
0a98cfd8a5
|
@ -321,8 +321,24 @@ public class LacertaLibraryImpl implements LacertaLibrary {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<Void> uncombineDocument(String parentId, String childId) {
|
public CompletableFuture<Void> uncombineDocument(String parentId, String childId) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
DocumentEntity parentDocumentEntity = database.documentDao().findById(parentId);
|
||||||
|
DocumentEntity childDocumentEntity = database.documentDao().findById(childId);
|
||||||
|
if (parentDocumentEntity == null || childDocumentEntity == null) {
|
||||||
|
logger.warn("LacertaLibraryImpl", "DocumentEntity is not found.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
parentDocumentEntity.isCombineParent = false;
|
||||||
|
childDocumentEntity.isCombineChild = false;
|
||||||
|
database.documentDao().update(parentDocumentEntity);
|
||||||
|
database.documentDao().update(childDocumentEntity);
|
||||||
|
logger.debug("LacertaLibraryImpl", "Database Query: Updated DocumentEntity");
|
||||||
|
|
||||||
|
database.toxiDocumentDao().deleteByParentIdAndChildId(parentId, childId);
|
||||||
|
logger.debug("LacertaLibraryImpl", "Database Query: Deleted ToxiDocumentEntity");
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<ArrayList<DocumentDetail>> getCombinedDocumentList(String parentId) {
|
public CompletableFuture<ArrayList<DocumentDetail>> getCombinedDocumentList(String parentId) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user