From 7d158bf3e216cc5512b213ec530a98e6181c7c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 11 Dec 2023 13:48:21 +0900 Subject: [PATCH] =?UTF-8?q?List=E3=81=8B=E3=82=89ArrayList=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4,=20=E3=82=B9=E3=82=BF=E3=83=96=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/data/impl/DocumentsImpl.java | 18 ++++++++- .../lacerta/data/impl/stub/DocumentsImpl.java | 40 +++++++++++++++++++ .../lacerta/data/repository/Documents.java | 9 +++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 data/src/main/java/one/nem/lacerta/data/impl/stub/DocumentsImpl.java 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); + + }