diff --git a/data/src/main/java/one/nem/lacerta/data/impl/DocumentsImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/DocumentsImpl.java index 86dc7014..c0384c46 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/DocumentsImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/DocumentsImpl.java @@ -1,4 +1,20 @@ package one.nem.lacerta.data.impl; -public class DocumentsImpl { +import java.util.ArrayList; +import java.util.List; + +import javax.inject.Inject; + +import one.nem.lacerta.data.model.documents.DocumentMeta; +import one.nem.lacerta.data.repository.Documents; + +public class DocumentsImpl implements Documents { + + @Inject + public DocumentsImpl() { + } + + public ArrayList getRecentDocuments(int limit) { + return null; // TODO-rca: + } } diff --git a/data/src/main/java/one/nem/lacerta/data/impl/stub/DocumentsImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/stub/DocumentsImpl.java new file mode 100644 index 00000000..0926e8eb --- /dev/null +++ b/data/src/main/java/one/nem/lacerta/data/impl/stub/DocumentsImpl.java @@ -0,0 +1,40 @@ +package one.nem.lacerta.data.impl.stub; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.UUID; + +import java.util.Date; + +import javax.inject.Inject; + +import one.nem.lacerta.data.model.documents.DocumentMeta; + +import one.nem.lacerta.data.model.documents.enums.DocumentType; + +import one.nem.lacerta.data.repository.Documents; + +public class DocumentsImpl implements Documents { + + @Inject + public DocumentsImpl() { + } + + public ArrayList getRecentDocuments(int limit) { // Generate dummy data + ArrayList documentMetaList = new ArrayList<>(); + for (int i = 0; i < limit; i++) { + DocumentMeta documentMeta = new DocumentMeta(); + documentMeta.id = UUID.randomUUID().toString(); + documentMeta.name = "Document " + i; + documentMeta.created = new Date(); + documentMeta.type = new Random(i).nextInt()/2 == 0 ? DocumentType.OTHER : DocumentType.NOTEBOOK; + documentMeta.tags = new String[] {"tag1", "tag2", "tag3"}; + documentMeta.categories = new String[] {"category1", "category2", "category3"}; + documentMetaList.add(documentMeta); + } + + return documentMetaList; + } + +} diff --git a/data/src/main/java/one/nem/lacerta/data/repository/Documents.java b/data/src/main/java/one/nem/lacerta/data/repository/Documents.java index 6f1517f0..91a98777 100644 --- a/data/src/main/java/one/nem/lacerta/data/repository/Documents.java +++ b/data/src/main/java/one/nem/lacerta/data/repository/Documents.java @@ -1,5 +1,14 @@ package one.nem.lacerta.data.repository; +import java.util.ArrayList; +import java.util.List; + +import one.nem.lacerta.data.model.documents.DocumentDetail; +import one.nem.lacerta.data.model.documents.DocumentMeta; + public interface Documents { + ArrayList getRecentDocuments(int limit); + + }