メソッド追加

This commit is contained in:
r-ca 2024-01-24 15:38:29 +09:00
parent 895cf64a15
commit 904ae8d39f
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9
2 changed files with 24 additions and 1 deletions

View File

@ -6,7 +6,6 @@ import java.util.concurrent.CompletableFuture;
import one.nem.lacerta.model.VcsLogModel; import one.nem.lacerta.model.VcsLogModel;
import one.nem.lacerta.model.VcsRevModel; import one.nem.lacerta.model.VcsRevModel;
import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.source.database.entity.VcsLogEntity;
public interface LacertaVcs { public interface LacertaVcs {
@ -25,6 +24,8 @@ public interface LacertaVcs {
public CompletableFuture<ArrayList<VcsLogModel>> getLogHistory(); public CompletableFuture<ArrayList<VcsLogModel>> getLogHistory();
public CompletableFuture<ArrayList<VcsLogModel>> getLogHistoryInRev(String revId);
public CompletableFuture<ArrayList<DocumentDetail>> getDocumentDetailAtRev(String revId); public CompletableFuture<ArrayList<DocumentDetail>> getDocumentDetailAtRev(String revId);

View File

@ -154,6 +154,28 @@ public class LacertaVcsImpl implements LacertaVcs {
return null; return null;
} }
@Override
public CompletableFuture<ArrayList<VcsLogModel>> getLogHistoryInRev(String revId) {
return CompletableFuture.supplyAsync(() -> {
logger.debug(TAG, "getLogHistoryAtRev");
ArrayList<VcsLogModel> 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 @Override
public CompletableFuture<ArrayList<DocumentDetail>> getDocumentDetailAtRev(String revId) { public CompletableFuture<ArrayList<DocumentDetail>> getDocumentDetailAtRev(String revId) {
return null; return null;