From 1d24467c09c343f5bbd453ddd38927a458274802 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 13 Jan 2024 14:29:58 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=BF=E3=83=95?= =?UTF-8?q?=E3=82=A7=E3=83=BC=E3=82=B9=E3=81=AE=E6=88=BB=E3=82=8A=E5=80=A4?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/src/main/java/one/nem/lacerta/data/LacertaSearch.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/LacertaSearch.java b/data/src/main/java/one/nem/lacerta/data/LacertaSearch.java index d8c337f0..04e27783 100644 --- a/data/src/main/java/one/nem/lacerta/data/LacertaSearch.java +++ b/data/src/main/java/one/nem/lacerta/data/LacertaSearch.java @@ -1,11 +1,13 @@ package one.nem.lacerta.data; +import java.util.ArrayList; + import one.nem.lacerta.model.ListItem; public interface LacertaSearch { - ListItem autoSearch(String query, int limit); + ArrayList autoSearch(String query, int limit); - ListItem autoSearch(String query, int limit, int offset); + ArrayList autoSearch(String query, int limit, int offset); } From dc340f1a965d8fba00d4415b4dff2ac6f4439a93 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 13 Jan 2024 14:30:30 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E7=B6=99=E6=89=BF,=20impl=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/impl/LacertaSearchStubImpl.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java new file mode 100644 index 00000000..a57be743 --- /dev/null +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java @@ -0,0 +1,19 @@ +package one.nem.lacerta.data.impl; + +import java.util.ArrayList; + +import one.nem.lacerta.data.LacertaSearch; +import one.nem.lacerta.model.ListItem; + +public class LacertaSearchStubImpl implements LacertaSearch { + + @Override + public ArrayList autoSearch(String query, int limit) { + return null; + } + + @Override + public ArrayList autoSearch(String query, int limit, int offset) { + return null; + } +} From 82d0187a11950f62fb1d997d14e96983581df041 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 13 Jan 2024 14:34:07 +0900 Subject: [PATCH 3/5] =?UTF-8?q?LacertaLibrary=E3=81=AE=E5=AE=9F=E8=A3=85?= =?UTF-8?q?=E3=82=92=E6=B5=81=E7=94=A8=E3=81=97=E3=81=A6=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/data/impl/LacertaSearchStubImpl.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java index a57be743..163f7e64 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java @@ -2,18 +2,30 @@ package one.nem.lacerta.data.impl; import java.util.ArrayList; +import javax.inject.Inject; + import one.nem.lacerta.data.LacertaSearch; import one.nem.lacerta.model.ListItem; +import one.nem.lacerta.data.LacertaLibrary; + public class LacertaSearchStubImpl implements LacertaSearch { + private LacertaLibrary library; + + + @Inject + public LacertaSearchStubImpl(LacertaLibrary library) { + this.library = library; + } + @Override public ArrayList autoSearch(String query, int limit) { - return null; + return library.getLibraryPage(limit).getListItems(); } @Override public ArrayList autoSearch(String query, int limit, int offset) { - return null; + return library.getLibraryPage(limit, offset).getListItems(); } } From 3c66480f0fe951fc845bc22fb656251d8d174da0 Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 13 Jan 2024 14:35:25 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E5=8F=97=E3=81=91=E5=8F=96=E3=81=A3?= =?UTF-8?q?=E3=81=9F=E3=82=AF=E3=82=A8=E3=83=AA=E3=82=92=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=82=BD=E3=83=BC=E3=83=AB=E3=81=AB=E5=90=90=E3=81=8D=E5=87=BA?= =?UTF-8?q?=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../one/nem/lacerta/data/impl/LacertaSearchStubImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java index 163f7e64..ff56abe4 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaSearchStubImpl.java @@ -8,24 +8,31 @@ import one.nem.lacerta.data.LacertaSearch; import one.nem.lacerta.model.ListItem; import one.nem.lacerta.data.LacertaLibrary; +import one.nem.lacerta.utils.LacertaLogger; public class LacertaSearchStubImpl implements LacertaSearch { private LacertaLibrary library; + private LacertaLogger logger; @Inject - public LacertaSearchStubImpl(LacertaLibrary library) { + public LacertaSearchStubImpl(LacertaLibrary library, LacertaLogger logger) { this.library = library; + this.logger = logger; } @Override public ArrayList autoSearch(String query, int limit) { + logger.debug("SearchStub", "autoSearch"); + logger.debug("SearchStub", "query: " + query); return library.getLibraryPage(limit).getListItems(); } @Override public ArrayList autoSearch(String query, int limit, int offset) { + logger.debug("SearchStub", "autoSearch"); + logger.debug("SearchStub", "query: " + query); return library.getLibraryPage(limit, offset).getListItems(); } } From 4ce83156781a5ebef5353d5edfcaed51e514bf3c Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 13 Jan 2024 14:36:59 +0900 Subject: [PATCH 5/5] =?UTF-8?q?HiltModule=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/data/module/LacertaSearchModule.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 data/src/main/java/one/nem/lacerta/data/module/LacertaSearchModule.java diff --git a/data/src/main/java/one/nem/lacerta/data/module/LacertaSearchModule.java b/data/src/main/java/one/nem/lacerta/data/module/LacertaSearchModule.java new file mode 100644 index 00000000..3357fb42 --- /dev/null +++ b/data/src/main/java/one/nem/lacerta/data/module/LacertaSearchModule.java @@ -0,0 +1,16 @@ +package one.nem.lacerta.data.module; + +import dagger.Binds; +import dagger.Module; +import dagger.hilt.InstallIn; +import dagger.hilt.android.components.FragmentComponent; +import one.nem.lacerta.data.LacertaSearch; +import one.nem.lacerta.data.impl.LacertaSearchStubImpl; + +@Module +@InstallIn(FragmentComponent.class) +abstract public class LacertaSearchModule { + + @Binds + public abstract LacertaSearch bindLacertaSearch(LacertaSearchStubImpl impl); +}