From 848c8bf1ba4f0f3ecf2eeae0b9be2d6a664db2b4 Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Tue, 2 Mar 2021 10:46:48 +0100 Subject: Creating the APIs and the responses. --- .../xyz/adjutor/aniki/manga/search/SearchManga.kt | 34 ++++++++++++++++++++++ .../adjutor/aniki/manga/search/SearchMangaApi.kt | 12 ++++++++ .../aniki/manga/search/SearchMangaResponse.kt | 13 +++++++++ 3 files changed, 59 insertions(+) create mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/SearchManga.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaApi.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaResponse.kt (limited to 'app/src/main/java/xyz/adjutor/aniki/manga/search') diff --git a/app/src/main/java/xyz/adjutor/aniki/manga/search/SearchManga.kt b/app/src/main/java/xyz/adjutor/aniki/manga/search/SearchManga.kt new file mode 100644 index 0000000..53899e2 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/manga/search/SearchManga.kt @@ -0,0 +1,34 @@ +package xyz.adjutor.aniki.manga.search + +import com.google.gson.annotations.SerializedName + +class SearchManga { + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("url") + var url: String? = null + + @SerializedName("image_url") + var image_url: String? = null + + @SerializedName("title") + var title: String? = null + + @SerializedName("chapters") + var chapters: Int? = null + + @SerializedName("volumes") + var volumes: Int? = null + + @SerializedName("score") + var score: Float? = null + + @SerializedName("start_date") //we'll maybe remove this later + var start_date: String? = null + + @SerializedName("end_date") //we'll maybe remove this later + var end_date: String? = null + +} diff --git a/app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaApi.kt b/app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaApi.kt new file mode 100644 index 0000000..6f3e63d --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaApi.kt @@ -0,0 +1,12 @@ +package xyz.adjutor.aniki.manga.search + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Query + +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/manga/search/SearchMangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaResponse.kt new file mode 100644 index 0000000..7721258 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaResponse.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.manga.search + +import com.google.gson.annotations.SerializedName + +class SearchMangaResponse { //only kept the infos I didn't have and that were interesting to me. + + @SerializedName("results") + private lateinit var results: List + + fun getResults(): List { + return results + } +} -- cgit v1.2.3