From 904ae8d39f4085e1f4e828d81ec087e45f6fc06c Mon Sep 17 00:00:00 2001 From: r-ca Date: Wed, 24 Jan 2024 15:38:29 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/one/nem/lacerta/vcs/LacertaVcs.java | 3 ++- .../nem/lacerta/vcs/impl/LacertaVcsImpl.java | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/vcs/src/main/java/one/nem/lacerta/vcs/LacertaVcs.java b/vcs/src/main/java/one/nem/lacerta/vcs/LacertaVcs.java index 20b3c6bd..5231f294 100644 --- a/vcs/src/main/java/one/nem/lacerta/vcs/LacertaVcs.java +++ b/vcs/src/main/java/one/nem/lacerta/vcs/LacertaVcs.java @@ -6,7 +6,6 @@ import java.util.concurrent.CompletableFuture; import one.nem.lacerta.model.VcsLogModel; import one.nem.lacerta.model.VcsRevModel; import one.nem.lacerta.model.document.DocumentDetail; -import one.nem.lacerta.source.database.entity.VcsLogEntity; public interface LacertaVcs { @@ -25,6 +24,8 @@ public interface LacertaVcs { public CompletableFuture> getLogHistory(); + public CompletableFuture> getLogHistoryInRev(String revId); + public CompletableFuture> getDocumentDetailAtRev(String revId); diff --git a/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java b/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java index 6779df46..2bb23258 100644 --- a/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java +++ b/vcs/src/main/java/one/nem/lacerta/vcs/impl/LacertaVcsImpl.java @@ -154,6 +154,28 @@ public class LacertaVcsImpl implements LacertaVcs { return null; } + @Override + public CompletableFuture> getLogHistoryInRev(String revId) { + return CompletableFuture.supplyAsync(() -> { + logger.debug(TAG, "getLogHistoryAtRev"); + ArrayList vcsLogModels = new ArrayList<>(); + + VcsRevEntity vcsRevEntity = database.vcsRevDao().findById(revId); + vcsRevEntity.logIds.forEach(logId -> { + VcsLogEntity vcsLogEntity = database.vcsLogDao().findById(logId); + VcsLogModel vcsLogModel = new VcsLogModel(); + vcsLogModel.setId(vcsLogEntity.id); + vcsLogModel.setDocumentId(vcsLogEntity.documentId); + vcsLogModel.setBranchName(vcsLogEntity.branchName); + vcsLogModel.setCreatedAt(vcsLogEntity.createdAt); + vcsLogModel.setAction(vcsLogEntity.action); + vcsLogModels.add(vcsLogModel); + }); + + return vcsLogModels; + }); + } + @Override public CompletableFuture> getDocumentDetailAtRev(String revId) { return null;