mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-22 16:03:15 +00:00
DocumentDetailを生成する内部メソッド作成
This commit is contained in:
parent
3cd1f50f34
commit
d2ebed3934
|
@ -6,6 +6,8 @@ import one.nem.lacerta.model.ListItem;
|
|||
import one.nem.lacerta.model.ListItemType;
|
||||
import one.nem.lacerta.model.document.DocumentDetail;
|
||||
|
||||
import one.nem.lacerta.model.document.DocumentMeta;
|
||||
import one.nem.lacerta.model.document.path.DocumentPath;
|
||||
import one.nem.lacerta.utils.LacertaLogger;
|
||||
|
||||
import com.github.javafaker.Faker;
|
||||
|
@ -113,6 +115,21 @@ public class LacertaLibraryStubImpl implements LacertaLibrary {
|
|||
return libraryItemPage;
|
||||
}
|
||||
|
||||
private DocumentDetail generateStubDocumentDetail() {
|
||||
DocumentMeta documentMeta = new DocumentMeta();
|
||||
documentMeta.setId(UUID.randomUUID().toString());
|
||||
documentMeta.setTitle("FakeDocument" + faker.book().title());
|
||||
documentMeta.setCreatedAt(faker.date().birthday());
|
||||
documentMeta.setUpdatedAt(faker.date().birthday()); // TODO-rca: 更新日のほうが古くなることがあるのでなんとかする?
|
||||
ArrayList<String> tagIds = new ArrayList<>();
|
||||
|
||||
DocumentDetail documentDetail = new DocumentDetail();
|
||||
documentDetail.setMeta(documentMeta);
|
||||
documentDetail.setPath(null); // TODO-rca: なんとかする
|
||||
documentDetail.setAuthor(faker.name().fullName());
|
||||
documentDetail.setRepository(null); // TODO-rca: なんとかする
|
||||
return documentDetail;
|
||||
}
|
||||
@Override
|
||||
public LibraryItemPage getRecentDocument(int limit) {
|
||||
return getRecentDocumentPage(limit);
|
||||
|
|
Loading…
Reference in New Issue
Block a user