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 index fc57d5fc..a90f9aac 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentDebugImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DocumentDebugImpl.java @@ -1,4 +1,32 @@ package one.nem.lacerta.data.impl; -public class DocumentDebugImpl { +import java.util.List; + +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; + +public class DocumentDebugImpl implements DocumentDebug{ + 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"; + + } }