From 12537b35064133487b3cd97aec86ebba98febf24 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 16 Dec 2023 16:28:30 +0900 Subject: [PATCH] WIP --- .../java/one/nem/lacerta/data/impl/DocumentImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java index 540e38d0..35a4eb85 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DocumentImpl.java @@ -18,6 +18,8 @@ import one.nem.lacerta.source.database.entity.DocumentEntity; import one.nem.lacerta.source.database.entity.LibraryEntity; import one.nem.lacerta.source.database.entity.TagEntity; +import one.nem.lacerta.source.jgit.JGitRepository; + public class DocumentImpl implements Document{ @@ -28,6 +30,8 @@ public class DocumentImpl implements Document{ this.database = database; } + @Inject + JGitRepository jGitRepository; @Override public ArrayList getRecentDocumentMetas(int limit) { @@ -60,14 +64,18 @@ public class DocumentImpl implements Document{ LibraryEntity libraryEntity = database.libraryDao().findById(id); DocumentPath documentPath = new DocumentPath(libraryEntity.rootPath, libraryEntity.path); + // リポジトリ取得 + jGitRepository.getRepository(id); + // 組み立て処理 - // TODO-rca: 切り出すべきかも? + // 可読性が終わるのでコンストラクタはつかわないほうがいいかも? DocumentMeta documentMeta = new DocumentMeta(); documentMeta.setId(documentEntity.id); documentMeta.setTitle(documentEntity.title); documentMeta.setCreatedAt(documentEntity.createdAt); documentMeta.setUpdatedAt(documentEntity.updatedAt); documentMeta.setTags(documentTags); + documentDetail.setMeta(documentMeta); documentDetail.setAuthor(documentEntity.author); documentDetail.setPath(documentPath);