diff options
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki/manga/search')
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 + } +} |