feat(gift): 선물 신청 응답 계약을 추가한다
This commit is contained in:
@@ -27,7 +27,7 @@ interface GiftApi {
|
||||
fun createGift(
|
||||
@Body request: GiftCreateRequest,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<Any>>
|
||||
): Single<ApiResponse<GiftCreateResponse>>
|
||||
|
||||
@GET("/api/v2/gifts/{applicationNo}")
|
||||
fun getGiftDetail(
|
||||
|
||||
@@ -63,6 +63,15 @@ data class GiftCreateRequest(
|
||||
@SerializedName("damageWaiverAgreed") val damageWaiverAgreed: Boolean
|
||||
)
|
||||
|
||||
@Keep
|
||||
data class GiftCreateResponse(
|
||||
@SerializedName("applicationNo") val applicationNo: String,
|
||||
@SerializedName("status") val status: String,
|
||||
@SerializedName("statusName") val statusName: String,
|
||||
@SerializedName("priceCan") val priceCan: Int,
|
||||
@SerializedName("trackingDeadlineAt") val trackingDeadlineAt: String
|
||||
)
|
||||
|
||||
@Keep
|
||||
data class GiftDetailResponse(
|
||||
@SerializedName("applicationNo") val applicationNo: String,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package kr.co.vividnext.sodalive.v2.gift.data
|
||||
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||
|
||||
class GiftRepository(private val api: GiftApi) {
|
||||
fun getGiftInbox(page: Int, token: String) = api.getGiftInbox(
|
||||
type = "ALL",
|
||||
@@ -10,7 +13,7 @@ class GiftRepository(private val api: GiftApi) {
|
||||
|
||||
fun getFormOptions(token: String) = api.getFormOptions(authHeader = token)
|
||||
|
||||
fun createGift(request: GiftCreateRequest, token: String) = api.createGift(
|
||||
fun createGift(request: GiftCreateRequest, token: String): Single<ApiResponse<GiftCreateResponse>> = api.createGift(
|
||||
request = request,
|
||||
authHeader = token
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@ import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.v2.gift.data.GiftApi
|
||||
import kr.co.vividnext.sodalive.v2.gift.data.GiftCancelResponse
|
||||
import kr.co.vividnext.sodalive.v2.gift.data.GiftCreateRequest
|
||||
import kr.co.vividnext.sodalive.v2.gift.data.GiftCreateResponse
|
||||
import kr.co.vividnext.sodalive.v2.gift.data.GiftDetailResponse
|
||||
import kr.co.vividnext.sodalive.v2.gift.data.GiftFormOptionsResponse
|
||||
import kr.co.vividnext.sodalive.v2.gift.data.GiftInboxResponse
|
||||
@@ -227,7 +228,7 @@ internal class InboxFakeApi : GiftApi {
|
||||
override fun getFormOptions(authHeader: String): Single<ApiResponse<GiftFormOptionsResponse>> =
|
||||
Single.error(UnsupportedOperationException())
|
||||
|
||||
override fun createGift(request: GiftCreateRequest, authHeader: String): Single<ApiResponse<Any>> =
|
||||
override fun createGift(request: GiftCreateRequest, authHeader: String): Single<ApiResponse<GiftCreateResponse>> =
|
||||
Single.error(UnsupportedOperationException())
|
||||
|
||||
override fun getGiftDetail(applicationNo: String, authHeader: String): Single<ApiResponse<GiftDetailResponse>> =
|
||||
|
||||
@@ -277,7 +277,7 @@ private class RepositoryFakeGiftApi : GiftApi {
|
||||
override fun getFormOptions(authHeader: String): Single<ApiResponse<GiftFormOptionsResponse>> =
|
||||
Single.error(UnsupportedOperationException())
|
||||
|
||||
override fun createGift(request: GiftCreateRequest, authHeader: String): Single<ApiResponse<Any>> =
|
||||
override fun createGift(request: GiftCreateRequest, authHeader: String): Single<ApiResponse<GiftCreateResponse>> =
|
||||
Single.error(UnsupportedOperationException())
|
||||
|
||||
override fun getGiftDetail(
|
||||
|
||||
Reference in New Issue
Block a user