mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
WIP
This commit is contained in:
parent
9c30879084
commit
e033eb754d
|
@ -9,10 +9,12 @@ import one.nem.lacerta.data.Document;
|
|||
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;
|
||||
import one.nem.lacerta.source.database.LacertaDatabase;
|
||||
|
||||
import one.nem.lacerta.source.database.entity.DocumentEntity;
|
||||
import one.nem.lacerta.source.database.entity.LibraryEntity;
|
||||
import one.nem.lacerta.source.database.entity.TagEntity;
|
||||
|
||||
|
||||
|
@ -43,7 +45,21 @@ public class DocumentImpl implements Document{
|
|||
DocumentDetail documentDetail = new DocumentDetail();
|
||||
DocumentEntity documentEntity = database.documentDao().findById(id);
|
||||
|
||||
// タグデータ作成
|
||||
ArrayList<TagEntity> tagEntities = database.tagDao().findByIds(documentEntity.tagIds);
|
||||
ArrayList<DocumentTag> documentTags = new ArrayList<>();
|
||||
for (TagEntity tagEntity : tagEntities) {
|
||||
DocumentTag documentTag = new DocumentTag();
|
||||
documentTag.setId(tagEntity.id);
|
||||
documentTag.setName(tagEntity.tagName);
|
||||
documentTag.setColor(tagEntity.color);
|
||||
documentTags.add(documentTag);
|
||||
}
|
||||
|
||||
// パス取得
|
||||
LibraryEntity libraryEntity = database.libraryDao().findById(id)
|
||||
DocumentPath documentPath = new DocumentPath(libraryEntity.rootPath, libraryEntity.path);
|
||||
|
||||
// 組み立て処理
|
||||
// TODO-rca: 切り出すべきかも?
|
||||
DocumentMeta documentMeta = new DocumentMeta();
|
||||
|
@ -51,6 +67,10 @@ public class DocumentImpl implements Document{
|
|||
documentMeta.setTitle(documentEntity.title);
|
||||
documentMeta.setCreatedAt(documentEntity.createdAt);
|
||||
documentMeta.setUpdatedAt(documentEntity.updatedAt);
|
||||
documentMeta.setTags(documentTags);
|
||||
documentDetail.setMeta(documentMeta);
|
||||
documentDetail.setAuthor(documentEntity.author);
|
||||
documentDetail.setPath(new DocumentPath(documentEntity.defaultBranch));
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user