From e026da96fadc87885c1ca422620ef6d3baa78590 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sun, 14 Jan 2024 17:27:43 +0900 Subject: [PATCH] =?UTF-8?q?DocumentDebug=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/data/DocumentDebug.java | 12 ----- .../lacerta/data/impl/DocumentDebugImpl.java | 47 ------------------- .../data/module/DocumentDebugModule.java | 16 ------- 3 files changed, 75 deletions(-) delete mode 100644 data/src/main/java/one/nem/lacerta/data/DocumentDebug.java delete mode 100644 data/src/main/java/one/nem/lacerta/data/impl/DocumentDebugImpl.java delete mode 100644 data/src/main/java/one/nem/lacerta/data/module/DocumentDebugModule.java diff --git a/data/src/main/java/one/nem/lacerta/data/DocumentDebug.java b/data/src/main/java/one/nem/lacerta/data/DocumentDebug.java deleted file mode 100644 index 94ae5b42..00000000 --- a/data/src/main/java/one/nem/lacerta/data/DocumentDebug.java +++ /dev/null @@ -1,12 +0,0 @@ -package one.nem.lacerta.data; - -import one.nem.lacerta.model.document.DocumentMeta; -import one.nem.lacerta.model.document.DocumentDetail; -import one.nem.lacerta.model.document.path.DocumentPath; -import one.nem.lacerta.model.document.tag.DocumentTag; - -public interface DocumentDebug { - - void insertDocument(DocumentMeta meta, DocumentDetail detail); - -} diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentDebugImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentDebugImpl.java deleted file mode 100644 index 0985436f..00000000 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentDebugImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package one.nem.lacerta.data.impl; - -import java.util.List; - -import javax.inject.Inject; - -import one.nem.lacerta.data.DocumentDebug; -import one.nem.lacerta.model.document.DocumentDetail; -import one.nem.lacerta.model.document.DocumentMeta; - -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.database.LacertaDatabase; - -public class DocumentDebugImpl implements DocumentDebug{ - - @Inject - LacertaDatabase database; - - @Inject - public DocumentDebugImpl() { - } - - - public void insertDocument(DocumentMeta meta, DocumentDetail detail) { - DocumentEntity documentEntity = new DocumentEntity(); - LibraryEntity libraryEntity = new LibraryEntity(); - - documentEntity.id = meta.getId(); - documentEntity.title = meta.getTitle(); - documentEntity.createdAt = meta.getCreatedAt(); - documentEntity.updatedAt = meta.getUpdatedAt(); - documentEntity.author = detail.getAuthor(); - documentEntity.defaultBranch = detail.getDefaultBranch(); - // ArrayListからListに変換 - documentEntity.tagIds = meta.getTagIds(); - - libraryEntity.id = meta.getId(); - libraryEntity.path = "Placeholder"; - libraryEntity.rootPath = "Placeholder"; - - database.documentDao().insert(documentEntity); - database.libraryDao().insert(libraryEntity); - } -} diff --git a/data/src/main/java/one/nem/lacerta/data/module/DocumentDebugModule.java b/data/src/main/java/one/nem/lacerta/data/module/DocumentDebugModule.java deleted file mode 100644 index bcf5c7c5..00000000 --- a/data/src/main/java/one/nem/lacerta/data/module/DocumentDebugModule.java +++ /dev/null @@ -1,16 +0,0 @@ -package one.nem.lacerta.data.module; - -import dagger.Binds; -import dagger.Module; -import dagger.hilt.InstallIn; -import dagger.hilt.components.SingletonComponent; -import one.nem.lacerta.data.DocumentDebug; -import one.nem.lacerta.data.impl.DocumentDebugImpl; - -@Module -@InstallIn(SingletonComponent.class) // TODO-rca: Singletonでいいのか検討する -abstract public class DocumentDebugModule { - - @Binds - public abstract DocumentDebug bindDocumentDebug(DocumentDebugImpl documentDebugImpl); -}