Update App Architecture
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
import de.fayard.refreshVersions.core.versionFor
|
||||
|
||||
plugins {
|
||||
id("com.android.library")
|
||||
id("kotlin-android")
|
||||
kotlin("plugin.serialization") version "1.5.20"
|
||||
kotlin("plugin.serialization") version "1.5.21"
|
||||
kotlin("kapt")
|
||||
}
|
||||
|
||||
@@ -41,6 +39,9 @@ dependencies {
|
||||
|
||||
api(Libs.ktor_client_core)
|
||||
api(Libs.ktor_serialization)
|
||||
api(Libs.ktor_client_android)
|
||||
api(Libs.ktor_client_cio)
|
||||
|
||||
api(Libs.joda_time)
|
||||
|
||||
testImplementation(Libs.junit_jupiter_api)
|
||||
|
||||
+7
-3
@@ -1,5 +1,6 @@
|
||||
package com.ericampire.android.androidstudycase.domain.entity
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import kotlinx.serialization.SerialName
|
||||
@@ -9,8 +10,10 @@ import kotlinx.serialization.Serializable
|
||||
@Serializable
|
||||
@Entity
|
||||
data class Animator(
|
||||
@ColumnInfo(name = "id_animator")
|
||||
@PrimaryKey
|
||||
var name: String = "",
|
||||
val id: Long? = null,
|
||||
val name: String = "",
|
||||
var avatarUrl: String = "",
|
||||
)
|
||||
|
||||
@@ -19,10 +22,11 @@ data class FeaturedAnimators(val results: List<Animator>)
|
||||
|
||||
@Serializable
|
||||
data class AnimatorData(
|
||||
val featuredAnimators: FeaturedAnimators
|
||||
@SerialName("featuredAnimators")
|
||||
val animators: FeaturedAnimators
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class AnimatorApiResponse(
|
||||
@SerialName("data") val animatorAnimatorData: AnimatorData
|
||||
@SerialName("data") val data: AnimatorData
|
||||
)
|
||||
+7
-14
@@ -2,20 +2,14 @@ package com.ericampire.android.androidstudycase.domain.entity
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import androidx.room.TypeConverters
|
||||
import com.ericampire.android.androidstudycase.domain.util.DateSerializer
|
||||
import com.ericampire.android.androidstudycase.util.room.DateConverter
|
||||
import kotlinx.serialization.Contextual
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import java.util.*
|
||||
|
||||
@Serializable
|
||||
data class BlogPage(
|
||||
val currentPage: Int,
|
||||
val from: Int,
|
||||
val perPage: Int,
|
||||
val blogs: List<Blog>,
|
||||
val results: List<Blog>,
|
||||
val to: Int,
|
||||
val total: Int,
|
||||
val totalPages: Int
|
||||
@@ -23,20 +17,19 @@ data class BlogPage(
|
||||
|
||||
@Serializable
|
||||
data class BlogData(
|
||||
@SerialName("blogs") val blogPage: BlogPage
|
||||
val blogs: BlogPage
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class BlogApiResponse(
|
||||
@SerialName("data") val blogBlogData: BlogData
|
||||
val data: BlogData
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@Entity
|
||||
data class Blog(
|
||||
// @TypeConverters(DateConverter::class)
|
||||
// @Serializable(with = DateSerializer::class)
|
||||
var postedAt: String = "",
|
||||
@PrimaryKey val imageUrl: String = "",
|
||||
var title: String
|
||||
@PrimaryKey val id: Long? = null,
|
||||
val postedAt: String = "",
|
||||
val imageUrl: String = "",
|
||||
val title: String
|
||||
)
|
||||
+7
-2
@@ -13,10 +13,14 @@ data class LottieFilesApiResponse(
|
||||
val lottieFilesLottieFilesData: LottieFilesData
|
||||
)
|
||||
|
||||
/**
|
||||
* You can avoid this duplication using @JsonNames annotation
|
||||
*/
|
||||
@Serializable
|
||||
data class LottieFilesData(
|
||||
@SerialName("recent")
|
||||
val page: LottieFilesPage
|
||||
val recent: LottieFilesPage? = null,
|
||||
val featured: LottieFilesPage? = null,
|
||||
val popular: LottieFilesPage? = null,
|
||||
)
|
||||
|
||||
|
||||
@@ -40,6 +44,7 @@ data class Lottiefile(
|
||||
var lottieUrl: String = "",
|
||||
var gifUrl: String? = "",
|
||||
var videoUrl: String? = "",
|
||||
var type: String = "", // For making difference between recent, popular and featured
|
||||
var imageUrl: String? = "",
|
||||
@ColumnInfo(name = "file_name") var name: String = "",
|
||||
var createdAt: String = "",
|
||||
|
||||
Reference in New Issue
Block a user