Skip to content

Commit

Permalink
fix: 프로모션 코드 검증 request 수정 (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
easyhz committed Aug 31, 2024
1 parent dda0481 commit 05ba3d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.easyhz.noffice.core.network.api.promotion

import com.easyhz.noffice.core.network.model.request.promotion.PromotionRequest
import com.easyhz.noffice.core.network.util.NofficeResult
import retrofit2.http.GET
import retrofit2.http.Query
Expand All @@ -8,6 +9,6 @@ interface PromotionService {
/* 프로모션 코드 검증 */
@GET("/api/v1/promotion/verify")
suspend fun verifyPromotion(
@Query("promotionCode") promotionCode: String
@Query("promotionCode") promotionCode: PromotionRequest
): NofficeResult<Boolean>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.easyhz.noffice.core.network.model.request.promotion

data class PromotionRequest(
val code: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.easyhz.noffice.data.organization.repository.promotion
import com.easyhz.noffice.core.common.di.Dispatcher
import com.easyhz.noffice.core.common.di.NofficeDispatchers
import com.easyhz.noffice.core.network.api.promotion.PromotionService
import com.easyhz.noffice.core.network.model.request.promotion.PromotionRequest
import com.easyhz.noffice.core.network.util.toResult
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
Expand All @@ -14,6 +15,6 @@ class PromotionRepositoryImpl @Inject constructor(
) : PromotionRepository {
override suspend fun verifyPromotion(promotionCode: String): Result<Boolean> =
withContext(dispatcher) {
promotionService.verifyPromotion(promotionCode).toResult()
promotionService.verifyPromotion(PromotionRequest(promotionCode)).toResult()
}
}

0 comments on commit 05ba3d0

Please sign in to comment.