diff --git a/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java b/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java index 22279cdd..7e8ba899 100644 --- a/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java +++ b/data/src/main/java/one/nem/lacerta/data/LacertaLibrary.java @@ -10,6 +10,7 @@ import one.nem.lacerta.model.LibraryItemPage; import one.nem.lacerta.model.PublicPath; import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.tag.DocumentTag; +import one.nem.lacerta.model.pref.ToxiDocumentModel; public interface LacertaLibrary { @@ -54,5 +55,5 @@ public interface LacertaLibrary { // // CompletableFuture uncombineDocument(String parentId, ArrayList childIdList); - CompletableFuture> getCombinedDocumentIdList(String parentId); + CompletableFuture> getCombinedDocumentToxiList(String parentId); } diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java index f072594d..c5b43060 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryImpl.java @@ -22,6 +22,7 @@ import one.nem.lacerta.model.ListItemType; import one.nem.lacerta.model.PublicPath; import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.tag.DocumentTag; +import one.nem.lacerta.model.pref.ToxiDocumentModel; import one.nem.lacerta.source.database.LacertaDatabase; import one.nem.lacerta.source.database.common.DateTypeConverter; import one.nem.lacerta.source.database.entity.DocumentEntity; @@ -341,14 +342,20 @@ public class LacertaLibraryImpl implements LacertaLibrary { } @Override - public CompletableFuture> getCombinedDocumentIdList(String parentId) { + public CompletableFuture> getCombinedDocumentToxiList(String parentId) { return CompletableFuture.supplyAsync(() -> { List toxiDocumentEntities = database.toxiDocumentDao().findByParentId(parentId); - ArrayList documentIdList = new ArrayList<>(); + ArrayList toxiDocumentModels = new ArrayList<>(); for (ToxiDocumentEntity toxiDocumentEntity : toxiDocumentEntities) { - documentIdList.add(toxiDocumentEntity.childDocumentId); + ToxiDocumentModel toxiDocumentModel = new ToxiDocumentModel(); + toxiDocumentModel.setParentDocumentId(toxiDocumentEntity.parentDocumentId); + toxiDocumentModel.setChildDocumentId(toxiDocumentEntity.childDocumentId); + toxiDocumentModel.setOrder(toxiDocumentEntity.order); + toxiDocumentModel.setActive(toxiDocumentEntity.isActive); + toxiDocumentModel.setTitleCache(toxiDocumentEntity.titleCache); + toxiDocumentModels.add(toxiDocumentModel); } - return documentIdList; + return toxiDocumentModels; }); }