From 744a2bef65dca60307ba56cf5be110fa75d00d00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Wed, 17 Jan 2024 11:25:41 +0900 Subject: [PATCH] =?UTF-8?q?action=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/vcs/impl/LacertaVcsImpl.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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 dabcbfed..89cd8d2d 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 @@ -12,7 +12,10 @@ import one.nem.lacerta.source.database.LacertaDatabase; import one.nem.lacerta.source.database.entity.VcsLogEntity; import one.nem.lacerta.source.database.entity.VcsRevEntity; import one.nem.lacerta.utils.LacertaLogger; +import one.nem.lacerta.vcs.ActionType; import one.nem.lacerta.vcs.LacertaVcs; +import one.nem.lacerta.vcs.internal.JsonUtils; +import one.nem.lacerta.vcs.model.action.InsertPage; public class LacertaVcsImpl implements LacertaVcs { @@ -41,12 +44,17 @@ public class LacertaVcsImpl implements LacertaVcs { @Override public void insertPage(int index, String fileName) { logger.debug(TAG, "insertPage"); + + // InsertPage + InsertPage insertPage = new InsertPage(index, fileName); + insertPage.setActionType(ActionType.INSERT_PAGE); + VcsLogEntity vcsLogEntity = new VcsLogEntity(); vcsLogEntity.id = UUID.randomUUID().toString(); vcsLogEntity.documentId = documentId; vcsLogEntity.branchName = "master"; vcsLogEntity.createdAt = new java.util.Date(); - vcsLogEntity.action = "placeholder"; + vcsLogEntity.action = JsonUtils.toJson(insertPage); database.vcsLogDao().insert(vcsLogEntity); } @@ -58,12 +66,13 @@ public class LacertaVcsImpl implements LacertaVcs { @Override public void createDocument(String documentId) { logger.debug(TAG, "createDocument"); + VcsLogEntity vcsLogEntity = new VcsLogEntity(); vcsLogEntity.id = UUID.randomUUID().toString(); vcsLogEntity.documentId = documentId; vcsLogEntity.branchName = "master"; vcsLogEntity.createdAt = new java.util.Date(); - vcsLogEntity.action = "placeholder"; + vcsLogEntity.action = "ph-createDocument"; database.vcsLogDao().insert(vcsLogEntity); } @@ -118,6 +127,8 @@ public class LacertaVcsImpl implements LacertaVcs { logger.debug(TAG, "printLog"); database.vcsLogDao().findAll().forEach(vcsLog -> { logger.debug(TAG, vcsLog.id); + logger.debug(TAG, vcsLog.documentId + " " + vcsLog.branchName); + logger.debug(TAG, vcsLog.action); }); } @@ -126,6 +137,9 @@ public class LacertaVcsImpl implements LacertaVcs { logger.debug(TAG, "printRev"); database.vcsRevDao().findAll().forEach(vcsRev -> { logger.debug(TAG, vcsRev.id); + logger.debug(TAG, vcsRev.documentId + " " + vcsRev.branchName); + logger.debug(TAG, vcsRev.commitMessage); + logger.debug(TAG, vcsRev.logIds.toString()); }); } }