mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
DocumentDebugを削除
This commit is contained in:
parent
9245981233
commit
e026da96fa
|
@ -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);
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user