aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/xyz/adjutor/aniki/manga/search
diff options
context:
space:
mode:
authorClyhtsuriva <aimeric@adjutor.xyz>2021-03-02 10:46:48 +0100
committerClyhtsuriva <aimeric@adjutor.xyz>2021-03-02 10:46:48 +0100
commit848c8bf1ba4f0f3ecf2eeae0b9be2d6a664db2b4 (patch)
tree7bb4ae9a74d637364a19955bc44bff8811cdbe2e /app/src/main/java/xyz/adjutor/aniki/manga/search
parentf9f079eea806454d49d6088089511d72e1c28f86 (diff)
Creating the APIs and the responses.
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki/manga/search')
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/manga/search/SearchManga.kt34
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaApi.kt12
-rw-r--r--app/src/main/java/xyz/adjutor/aniki/manga/search/SearchMangaResponse.kt13
3 files changed, 59 insertions, 0 deletions
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<SearchMangaResponse>
+
+} \ 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<SearchManga>
+
+ fun getResults(): List<SearchManga> {
+ return results
+ }
+}