diff options
Diffstat (limited to 'app/src/main/java/xyz/adjutor/aniki/anime/search')
3 files changed, 56 insertions, 0 deletions
diff --git a/app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnime.kt b/app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnime.kt new file mode 100644 index 0000000..7771646 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnime.kt @@ -0,0 +1,31 @@ +package xyz.adjutor.aniki.anime.search + +import com.google.gson.annotations.SerializedName + +class SearchAnime { + + @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("episodes") + var episodes: 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/anime/search/SearchAnimeApi.kt b/app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimeApi.kt new file mode 100644 index 0000000..5512636 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimeApi.kt @@ -0,0 +1,12 @@ +package xyz.adjutor.aniki.anime.search + +import retrofit2.Call +import retrofit2.http.GET +import retrofit2.http.Query + +interface SearchAnimeApi { + + @GET("v3/search/anime") + fun getSearchAnimeData(@Query("q") q: String): Call<SearchAnimeResponse> + +}
\ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimeResponse.kt b/app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimeResponse.kt new file mode 100644 index 0000000..92100ba --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/anime/search/SearchAnimeResponse.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.anime.search + +import com.google.gson.annotations.SerializedName + +class SearchAnimeResponse { //only kept the infos I didn't have and that were interesting to me. + + @SerializedName("results") + private lateinit var results: List<SearchAnime> + + fun getResults(): List<SearchAnime> { + return results + } +} |