-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate from moshi to kotlinx serialization
- Loading branch information
1 parent
8e0ccbb
commit eea73bd
Showing
8 changed files
with
84 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package com.debk007.template.model | ||
|
||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@JsonClass(generateAdapter = true) | ||
@Serializable | ||
data class Dimensions( | ||
@Json(name = "width") | ||
val width: Double, | ||
@Json(name = "height") | ||
@SerialName("depth") | ||
val depth: Double, | ||
@SerialName("height") | ||
val height: Double, | ||
@Json(name = "depth") | ||
val depth: Double | ||
@SerialName("width") | ||
val width: Double | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package com.debk007.template.model | ||
|
||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@JsonClass(generateAdapter = true) | ||
@Serializable | ||
data class Meta( | ||
@Json(name = "createdAt") | ||
val createdAt: String, | ||
@Json(name = "updatedAt") | ||
val updatedAt: String, | ||
@Json(name = "barcode") | ||
@SerialName("barcode") | ||
val barcode: String, | ||
@Json(name = "qrCode") | ||
val qrCode: String | ||
@SerialName("createdAt") | ||
val createdAt: String, | ||
@SerialName("qrCode") | ||
val qrCode: String, | ||
@SerialName("updatedAt") | ||
val updatedAt: String | ||
) |
82 changes: 41 additions & 41 deletions
82
app/src/main/java/com/debk007/template/model/ProductDetailsDto.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
package com.debk007.template.model | ||
|
||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@JsonClass(generateAdapter = true) | ||
@Serializable | ||
data class ProductDetailsDto( | ||
@Json(name = "id") | ||
val id: Int, | ||
@Json(name = "title") | ||
val title: String, | ||
@Json(name = "description") | ||
val description: String, | ||
@Json(name = "category") | ||
@SerialName("availabilityStatus") | ||
val availabilityStatus: String, | ||
@SerialName("brand") | ||
val brand: String, | ||
@SerialName("category") | ||
val category: String, | ||
@Json(name = "price") | ||
val price: Double, | ||
@Json(name = "discountPercentage") | ||
@SerialName("description") | ||
val description: String, | ||
@SerialName("dimensions") | ||
val dimensions: Dimensions, | ||
@SerialName("discountPercentage") | ||
val discountPercentage: Double, | ||
@Json(name = "rating") | ||
@SerialName("id") | ||
val id: Int, | ||
@SerialName("images") | ||
val images: List<String>, | ||
@SerialName("meta") | ||
val meta: Meta, | ||
@SerialName("minimumOrderQuantity") | ||
val minimumOrderQuantity: Int, | ||
@SerialName("price") | ||
val price: Double, | ||
@SerialName("rating") | ||
val rating: Double, | ||
@Json(name = "stock") | ||
@SerialName("returnPolicy") | ||
val returnPolicy: String, | ||
@SerialName("reviews") | ||
val reviews: List<Review>, | ||
@SerialName("shippingInformation") | ||
val shippingInformation: String, | ||
@SerialName("sku") | ||
val sku: String, | ||
@SerialName("stock") | ||
val stock: Int, | ||
@Json(name = "tags") | ||
@SerialName("tags") | ||
val tags: List<String>, | ||
@Json(name = "brand") | ||
val brand: String, | ||
@Json(name = "sku") | ||
val sku: String, | ||
@Json(name = "weight") | ||
val weight: Int, | ||
@Json(name = "dimensions") | ||
val dimensions: Dimensions, | ||
@Json(name = "warrantyInformation") | ||
@SerialName("thumbnail") | ||
val thumbnail: String, | ||
@SerialName("title") | ||
val title: String, | ||
@SerialName("warrantyInformation") | ||
val warrantyInformation: String, | ||
@Json(name = "shippingInformation") | ||
val shippingInformation: String, | ||
@Json(name = "availabilityStatus") | ||
val availabilityStatus: String, | ||
@Json(name = "reviews") | ||
val reviews: List<Review>, | ||
@Json(name = "returnPolicy") | ||
val returnPolicy: String, | ||
@Json(name = "minimumOrderQuantity") | ||
val minimumOrderQuantity: Int, | ||
@Json(name = "meta") | ||
val meta: Meta, | ||
@Json(name = "images") | ||
val images: List<String>, | ||
@Json(name = "thumbnail") | ||
val thumbnail: String | ||
@SerialName("weight") | ||
val weight: Int | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
package com.debk007.template.model | ||
|
||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@JsonClass(generateAdapter = true) | ||
@Serializable | ||
data class Review( | ||
@Json(name = "rating") | ||
val rating: Int, | ||
@Json(name = "comment") | ||
@SerialName("comment") | ||
val comment: String, | ||
@Json(name = "date") | ||
@SerialName("date") | ||
val date: String, | ||
@Json(name = "reviewerName") | ||
val reviewerName: String, | ||
@Json(name = "reviewerEmail") | ||
val reviewerEmail: String | ||
@SerialName("rating") | ||
val rating: Int, | ||
@SerialName("reviewerEmail") | ||
val reviewerEmail: String, | ||
@SerialName("reviewerName") | ||
val reviewerName: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters