インターフェース変更, Impl変更

This commit is contained in:
r-ca 2024-01-28 13:07:32 +09:00
parent ff5ef8611a
commit 0a96a9443d
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 13 additions and 5 deletions

View File

@ -10,6 +10,7 @@ import one.nem.lacerta.model.LibraryItemPage;
import one.nem.lacerta.model.PublicPath; import one.nem.lacerta.model.PublicPath;
import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.model.document.tag.DocumentTag; import one.nem.lacerta.model.document.tag.DocumentTag;
import one.nem.lacerta.model.pref.ToxiDocumentModel;
public interface LacertaLibrary { public interface LacertaLibrary {
@ -54,5 +55,5 @@ public interface LacertaLibrary {
// //
// CompletableFuture<Void> uncombineDocument(String parentId, ArrayList<String> childIdList); // CompletableFuture<Void> uncombineDocument(String parentId, ArrayList<String> childIdList);
CompletableFuture<ArrayList<String>> getCombinedDocumentIdList(String parentId); CompletableFuture<ArrayList<ToxiDocumentModel>> getCombinedDocumentToxiList(String parentId);
} }

View File

@ -22,6 +22,7 @@ import one.nem.lacerta.model.ListItemType;
import one.nem.lacerta.model.PublicPath; import one.nem.lacerta.model.PublicPath;
import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.model.document.tag.DocumentTag; 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.LacertaDatabase;
import one.nem.lacerta.source.database.common.DateTypeConverter; import one.nem.lacerta.source.database.common.DateTypeConverter;
import one.nem.lacerta.source.database.entity.DocumentEntity; import one.nem.lacerta.source.database.entity.DocumentEntity;
@ -341,14 +342,20 @@ public class LacertaLibraryImpl implements LacertaLibrary {
} }
@Override @Override
public CompletableFuture<ArrayList<String>> getCombinedDocumentIdList(String parentId) { public CompletableFuture<ArrayList<ToxiDocumentModel>> getCombinedDocumentToxiList(String parentId) {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {
List<ToxiDocumentEntity> toxiDocumentEntities = database.toxiDocumentDao().findByParentId(parentId); List<ToxiDocumentEntity> toxiDocumentEntities = database.toxiDocumentDao().findByParentId(parentId);
ArrayList<String> documentIdList = new ArrayList<>(); ArrayList<ToxiDocumentModel> toxiDocumentModels = new ArrayList<>();
for (ToxiDocumentEntity toxiDocumentEntity : toxiDocumentEntities) { 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;
}); });
} }