From 8f1b47d4c4564996d45af1e9e56ce5b531325682 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 16 Dec 2023 16:39:23 +0900 Subject: [PATCH] Impl 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 86d15e67..d342cedb 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 @@ -19,6 +19,7 @@ import one.nem.lacerta.source.database.entity.LibraryEntity; import one.nem.lacerta.source.database.entity.TagEntity; import one.nem.lacerta.source.jgit.JGitRepository; +import one.nem.lacerta.utils.repository.DeviceInfoUtils; public class DocumentImpl implements Document{ @@ -33,6 +34,9 @@ public class DocumentImpl implements Document{ @Inject JGitRepository jGitRepository; + @Inject + DeviceInfoUtils deviceInfoUtils; + @Override public ArrayList getRecentDocumentMetas(int limit) { // ArrayList documentMetas = new ArrayList<>(); @@ -91,6 +95,10 @@ public class DocumentImpl implements Document{ @Override public DocumentDetail createDocumentByMeta(DocumentMeta meta) { - return null; + DocumentDetail documentDetail = new DocumentDetail(); + + documentDetail.setMeta(meta); + documentDetail.setAuthor("author"); // TODO-rca: SharedPrefを扱う機能を作ってそこから取得するようにする or Gitの設定を参照するようにする + documentDetail.setPath(new DocumentPath(deviceInfoUtils.getExternalStorageDirectory(), meta.getTitle())); // TODO-rca: パスの生成方法を考える } }