From ac929460d07e0d0ef8c6b4ea569a2b2c6daa3b13 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Tue, 23 Mar 2021 11:47:53 +0100 Subject: Refactoring into MVC --- app/src/main/java/xyz/adjutor/aniki/data/AnimeApi.kt | 13 +++++++++++++ app/src/main/java/xyz/adjutor/aniki/data/MangaApi.kt | 13 +++++++++++++ app/src/main/java/xyz/adjutor/aniki/data/SearchAnimeApi.kt | 13 +++++++++++++ app/src/main/java/xyz/adjutor/aniki/data/SearchMangaApi.kt | 13 +++++++++++++ app/src/main/java/xyz/adjutor/aniki/data/TopAnimeApi.kt | 13 +++++++++++++ app/src/main/java/xyz/adjutor/aniki/data/TopMangaApi.kt | 13 +++++++++++++ 6 files changed, 78 insertions(+) create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/AnimeApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/MangaApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/SearchAnimeApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/SearchMangaApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/TopAnimeApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/data/TopMangaApi.kt (limited to 'app/src/main/java/xyz/adjutor/aniki/data') diff --git a/app/src/main/java/xyz/adjutor/aniki/data/AnimeApi.kt b/app/src/main/java/xyz/adjutor/aniki/data/AnimeApi.kt new file mode 100644 index 0000000..d67d0ef --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/data/AnimeApi.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.data + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Path +import xyz.adjutor.aniki.presentation.model.AnimeResponse + +interface AnimeApi { + + @GET("v3/anime/{id}") + fun getAnimeData(@Path("id") id: String): Call + +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/data/MangaApi.kt b/app/src/main/java/xyz/adjutor/aniki/data/MangaApi.kt new file mode 100644 index 0000000..699efa4 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/data/MangaApi.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.data + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Path +import xyz.adjutor.aniki.presentation.model.MangaResponse + +interface MangaApi { + + @GET("v3/manga/{id}") + fun getMangaData(@Path("id") id: String): Call + +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/data/SearchAnimeApi.kt b/app/src/main/java/xyz/adjutor/aniki/data/SearchAnimeApi.kt new file mode 100644 index 0000000..1b0811b --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/data/SearchAnimeApi.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.data + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Query +import xyz.adjutor.aniki.presentation.model.SearchAnimeResponse + +interface SearchAnimeApi { + + @GET("v3/search/anime") + fun getSearchAnimeData(@Query("q") q: String): Call + +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/data/SearchMangaApi.kt b/app/src/main/java/xyz/adjutor/aniki/data/SearchMangaApi.kt new file mode 100644 index 0000000..3b26c1a --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/data/SearchMangaApi.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.data + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Query +import xyz.adjutor.aniki.presentation.model.SearchMangaResponse + +interface SearchMangaApi { + + @GET("v3/search/manga") + fun getSearchMangaData(@Query("q") q: String): Call + +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/data/TopAnimeApi.kt b/app/src/main/java/xyz/adjutor/aniki/data/TopAnimeApi.kt new file mode 100644 index 0000000..39bd78b --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/data/TopAnimeApi.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.data + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Path +import xyz.adjutor.aniki.presentation.model.TopAnimeResponse + +interface TopAnimeApi { + + @GET("v3/top/anime/{page}") + fun getTopAnimeData(@Path("page") page: Int): Call + +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/data/TopMangaApi.kt b/app/src/main/java/xyz/adjutor/aniki/data/TopMangaApi.kt new file mode 100644 index 0000000..8edab88 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/data/TopMangaApi.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.data + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Path +import xyz.adjutor.aniki.presentation.model.TopMangaResponse + +interface TopMangaApi { + + @GET("v3/top/manga/{page}") + fun getTopMangaData(@Path("page") page: Int): Call + +} \ No newline at end of file -- cgit v1.2.3