feat(gift): 배송지 API 계약을 추가한다
This commit is contained in:
@@ -42,6 +42,13 @@ interface GiftApi {
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<GiftTrackingResponse>>
|
||||
|
||||
@POST("/api/v2/gifts/{applicationNo}/recipient-address")
|
||||
fun registerRecipientAddress(
|
||||
@Path("applicationNo") applicationNo: String,
|
||||
@Body request: GiftRecipientAddressRequest,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<GiftRecipientAddressResponse>>
|
||||
|
||||
@POST("/api/v2/gifts/{applicationNo}/cancel")
|
||||
fun cancelGift(
|
||||
@Path("applicationNo") applicationNo: String,
|
||||
|
||||
@@ -130,6 +130,25 @@ data class GiftTrackingResponse(
|
||||
@SerializedName("recipientAddressDeadlineAt") val recipientAddressDeadlineAt: String
|
||||
)
|
||||
|
||||
@Keep
|
||||
data class GiftRecipientAddressRequest(
|
||||
@SerializedName("recipientName") val recipientName: String,
|
||||
@SerializedName("recipientPhoneNumber") val recipientPhoneNumber: String,
|
||||
@SerializedName("recipientZipCode") val recipientZipCode: String,
|
||||
@SerializedName("recipientAddress") val recipientAddress: String,
|
||||
@SerializedName("recipientAddressDetail") val recipientAddressDetail: String,
|
||||
@SerializedName("recipientTermsAgreed") val recipientTermsAgreed: Boolean,
|
||||
@SerializedName("recipientPrivacyAgreed") val recipientPrivacyAgreed: Boolean
|
||||
)
|
||||
|
||||
@Keep
|
||||
data class GiftRecipientAddressResponse(
|
||||
@SerializedName("applicationNo") val applicationNo: String,
|
||||
@SerializedName("status") val status: String,
|
||||
@SerializedName("statusName") val statusName: String,
|
||||
@SerializedName("recipientAddressRegisteredAt") val recipientAddressRegisteredAt: String
|
||||
)
|
||||
|
||||
@Keep
|
||||
data class GiftCancelResponse(
|
||||
@SerializedName("applicationNo") val applicationNo: String,
|
||||
|
||||
@@ -27,6 +27,13 @@ class GiftRepository(private val api: GiftApi) {
|
||||
authHeader = token
|
||||
)
|
||||
|
||||
fun registerRecipientAddress(applicationNo: String, request: GiftRecipientAddressRequest, token: String) =
|
||||
api.registerRecipientAddress(
|
||||
applicationNo = applicationNo,
|
||||
request = request,
|
||||
authHeader = token
|
||||
)
|
||||
|
||||
fun cancelGift(applicationNo: String, token: String) = api.cancelGift(
|
||||
applicationNo = applicationNo,
|
||||
authHeader = token
|
||||
|
||||
Reference in New Issue
Block a user