From 0a96a9443d16b501edda83191fe993e820f0481b Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 28 Jan 2024 13:07:32 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=BF=E3=83=BC=E3=83=95?= =?UTF-8?q?=E3=82=A7=E3=83=BC=E3=82=B9=E5=A4=89=E6=9B=B4,=20Impl=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/data/LacertaLibrary.java | 3 ++- .../nem/lacerta/data/impl/LacertaLibraryImpl.java | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) 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; }); }