From 5a8c22508e08b00a31c8ebb4df13d9e108d29e1f Mon Sep 17 00:00:00 2001 From: Clyhtsuriva Date: Tue, 13 Apr 2021 13:22:04 +0200 Subject: Restructuring and README update. --- .../presentation/model/manga/MangaResponse.kt | 22 +++++++++++++ .../aniki/presentation/model/manga/SearchManga.kt | 34 ++++++++++++++++++++ .../model/manga/SearchMangaResponse.kt | 13 ++++++++ .../aniki/presentation/model/manga/TopManga.kt | 36 ++++++++++++++++++++++ .../presentation/model/manga/TopMangaResponse.kt | 13 ++++++++ 5 files changed, 118 insertions(+) create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt create mode 100644 app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt (limited to 'app/src/main/java/xyz/adjutor/aniki/presentation/model/manga') diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt new file mode 100644 index 0000000..06aeed0 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/MangaResponse.kt @@ -0,0 +1,22 @@ +package xyz.adjutor.aniki.presentation.model.manga + +import com.google.gson.annotations.SerializedName + +class MangaResponse { //only kept the infos I didn't have and that were interesting to me. + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("chapters") + var chapters: Int? = null + + @SerializedName("synopsis") + var synopsis: String? = null + + @SerializedName("rank") + var rank: Int? = null //added for the search feature (detail) + + @SerializedName("background") + var background: String? = null //a bit of background story about the manga + +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt new file mode 100644 index 0000000..d69227b --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchManga.kt @@ -0,0 +1,34 @@ +package xyz.adjutor.aniki.presentation.model.manga + +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 + +} \ No newline at end of file diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt new file mode 100644 index 0000000..942c071 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/SearchMangaResponse.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.presentation.model.manga + +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 + } +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt new file mode 100644 index 0000000..4fe3951 --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopManga.kt @@ -0,0 +1,36 @@ +package xyz.adjutor.aniki.presentation.model.manga + +import com.google.gson.annotations.SerializedName + +//model +//Content of the top field from the api of top manga +class TopManga { + + @SerializedName("mal_id") + var mal_id: Int? = null + + @SerializedName("rank") + var rank: Int? = null + + @SerializedName("title") + var title: String? = null + + @SerializedName("url") + var url: String? = null + + @SerializedName("volumes") + var volumes: Int? = null + + @SerializedName("start_date") + var start_date: String? = null + + @SerializedName("end_date") + var end_date: String? = null + + @SerializedName("score") + var score: Float? = null + + @SerializedName("image_url") + var image_url: String? = null + +} diff --git a/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt new file mode 100644 index 0000000..a0f6b8c --- /dev/null +++ b/app/src/main/java/xyz/adjutor/aniki/presentation/model/manga/TopMangaResponse.kt @@ -0,0 +1,13 @@ +package xyz.adjutor.aniki.presentation.model.manga + +import com.google.gson.annotations.SerializedName + +class TopMangaResponse { + + @SerializedName("top") + private lateinit var top: List + + fun getResults(): List { + return top + } +} \ No newline at end of file -- cgit v1.2.3