From b8a5b33d2e14d8f7e7799bc587f6016ab2aba852 Mon Sep 17 00:00:00 2001 From: bingbong Date: Fri, 26 Mar 2021 16:02:10 +0900 Subject: [PATCH] feat : add kotlin Serializable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IamPortRequest 에 반영 --- build.gradle | 1 + buildSrc/src/main/java/Dependencies.kt | 4 ++++ sdk/build.gradle | 4 ++++ sdk/src/main/java/com/iamport/sdk/data/sdk/CardQuota.kt | 2 ++ sdk/src/main/java/com/iamport/sdk/data/sdk/IamPortRequest.kt | 3 +++ sdk/src/main/java/com/iamport/sdk/data/sdk/ProductItem.kt | 2 ++ 6 files changed, 16 insertions(+) diff --git a/build.gradle b/build.gradle index adfb2044..fb11bafe 100644 --- a/build.gradle +++ b/build.gradle @@ -17,6 +17,7 @@ buildscript { classpath "com.android.tools.build:gradle:$gradle_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.koin:koin-gradle-plugin:$koin_version" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/buildSrc/src/main/java/Dependencies.kt b/buildSrc/src/main/java/Dependencies.kt index 9fba90be..52c66570 100644 --- a/buildSrc/src/main/java/Dependencies.kt +++ b/buildSrc/src/main/java/Dependencies.kt @@ -42,6 +42,8 @@ object Versions { // const val chuck = "1.1.0" const val robolectric = "4.3" + + const val serialization = "1.1.0" } object Libs { @@ -107,6 +109,8 @@ object Libs { // loading animation const val spinKit = "com.github.ybq:Android-SpinKit:${Versions.spinKit}" + const val serialization = "org.jetbrains.kotlinx:kotlinx-serialization-json:${Versions.serialization}" + // const val chuck = "com.readystatesoftware.chuck:library:${Versions.chuck}" // const val releaseChuck = "com.readystatesoftware.chuck:library-no-op:${Versions.chuck}" diff --git a/sdk/build.gradle b/sdk/build.gradle index 32e41347..d9e53591 100644 --- a/sdk/build.gradle +++ b/sdk/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlin-parcelize' +apply plugin: 'kotlinx-serialization' android { compileSdkVersion 30 @@ -122,4 +123,7 @@ dependencies { // debugImplementation Libs.chuck // releaseImplementation Libs.releaseChuck + + implementation Libs.serialization + } \ No newline at end of file diff --git a/sdk/src/main/java/com/iamport/sdk/data/sdk/CardQuota.kt b/sdk/src/main/java/com/iamport/sdk/data/sdk/CardQuota.kt index ff1acbaa..04c01500 100644 --- a/sdk/src/main/java/com/iamport/sdk/data/sdk/CardQuota.kt +++ b/sdk/src/main/java/com/iamport/sdk/data/sdk/CardQuota.kt @@ -2,8 +2,10 @@ package com.iamport.sdk.data.sdk import android.os.Parcelable import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable @Parcelize +@Serializable data class CardQuota(val card_quota : List?) : Parcelable //if (method === 'card' && cardQuota !== 0) { // params.display = { diff --git a/sdk/src/main/java/com/iamport/sdk/data/sdk/IamPortRequest.kt b/sdk/src/main/java/com/iamport/sdk/data/sdk/IamPortRequest.kt index 8d0c7fc6..747e93e4 100644 --- a/sdk/src/main/java/com/iamport/sdk/data/sdk/IamPortRequest.kt +++ b/sdk/src/main/java/com/iamport/sdk/data/sdk/IamPortRequest.kt @@ -5,12 +5,15 @@ import com.iamport.sdk.domain.utils.CONST import com.iamport.sdk.domain.utils.Util import kotlinx.parcelize.IgnoredOnParcel import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable /** * SDK 에 결제 요청할 데이터 * https://docs.iamport.kr/tech/imp?lang=ko#param */ + @Parcelize +@Serializable data class IamPortRequest( val pg: String, val pay_method: PayMethod = PayMethod.card, // 명세상 필수인지 불명확함, default card diff --git a/sdk/src/main/java/com/iamport/sdk/data/sdk/ProductItem.kt b/sdk/src/main/java/com/iamport/sdk/data/sdk/ProductItem.kt index 0c460985..e0c94fc4 100644 --- a/sdk/src/main/java/com/iamport/sdk/data/sdk/ProductItem.kt +++ b/sdk/src/main/java/com/iamport/sdk/data/sdk/ProductItem.kt @@ -2,12 +2,14 @@ package com.iamport.sdk.data.sdk import android.os.Parcelable import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable /** * for naverpay */ @Parcelize +@Serializable data class ProductItem( val categoryType: String, val categoryId: String,