mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
getRevisionHistoryByDocumentId実装
This commit is contained in:
parent
b13f048c7e
commit
07e14eb90c
|
@ -1,5 +1,10 @@
|
||||||
package one.nem.lacerta.vcs;
|
package one.nem.lacerta.vcs;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
import one.nem.lacerta.model.VcsRevModel;
|
||||||
|
|
||||||
public interface LacertaVcs {
|
public interface LacertaVcs {
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
|
@ -13,6 +18,8 @@ public interface LacertaVcs {
|
||||||
|
|
||||||
public void generateRevisionAtCurrent(String message);
|
public void generateRevisionAtCurrent(String message);
|
||||||
|
|
||||||
|
public CompletableFuture<ArrayList<VcsRevModel>> getRevisionHistoryByDocumentId(String documentId);
|
||||||
|
|
||||||
|
|
||||||
// debug
|
// debug
|
||||||
public void printLog();
|
public void printLog();
|
||||||
|
|
|
@ -3,11 +3,13 @@ package one.nem.lacerta.vcs.impl;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.assisted.Assisted;
|
import dagger.assisted.Assisted;
|
||||||
import dagger.assisted.AssistedInject;
|
import dagger.assisted.AssistedInject;
|
||||||
|
import one.nem.lacerta.model.VcsRevModel;
|
||||||
import one.nem.lacerta.source.database.LacertaDatabase;
|
import one.nem.lacerta.source.database.LacertaDatabase;
|
||||||
import one.nem.lacerta.source.database.entity.VcsLogEntity;
|
import one.nem.lacerta.source.database.entity.VcsLogEntity;
|
||||||
import one.nem.lacerta.source.database.entity.VcsRevEntity;
|
import one.nem.lacerta.source.database.entity.VcsRevEntity;
|
||||||
|
@ -122,6 +124,26 @@ public class LacertaVcsImpl implements LacertaVcs {
|
||||||
logger.debug(TAG, "New revision inserted: " + vcsRevEntity.id);
|
logger.debug(TAG, "New revision inserted: " + vcsRevEntity.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<ArrayList<VcsRevModel>> getRevisionHistoryByDocumentId(String documentId) {
|
||||||
|
return CompletableFuture.supplyAsync(() -> {
|
||||||
|
logger.debug(TAG, "getRevisionHistoryByDocumentId");
|
||||||
|
ArrayList<VcsRevModel> vcsRevModels = new ArrayList<>();
|
||||||
|
|
||||||
|
List<VcsRevEntity> vcsRevEntities = database.vcsRevDao().findByDocumentId(documentId);
|
||||||
|
vcsRevEntities.forEach(vcsRevEntity -> {
|
||||||
|
VcsRevModel vcsRevModel = new VcsRevModel();
|
||||||
|
vcsRevModel.setDocumentId(vcsRevEntity.documentId);
|
||||||
|
vcsRevModel.setBranchName(vcsRevEntity.branchName);
|
||||||
|
vcsRevModel.setCommitMessage(vcsRevEntity.commitMessage);
|
||||||
|
vcsRevModel.setLogIds(vcsRevEntity.logIds);
|
||||||
|
vcsRevModels.add(vcsRevModel);
|
||||||
|
});
|
||||||
|
|
||||||
|
return vcsRevModels;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void printLog() {
|
public void printLog() {
|
||||||
logger.debug(TAG, "printLog");
|
logger.debug(TAG, "printLog");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user