-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat/#15] 결제하기 서버통신을 위한 Service 인터페이스와 Dto를 정의합니다.
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/sopt/korailtalk/data/remote/model/request/TicketBuyingRequestDto.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.sopt.korailtalk.data.remote.model.request | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class TicketBuyingRequestDto( | ||
@SerialName("ticketId") val ticketId: Long, | ||
@SerialName("totalPrice") val totalPrice: Int, | ||
@SerialName("usedPoint") val usedPoint: Int | ||
) |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/sopt/korailtalk/data/remote/model/response/LPointResponseDto.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.sopt.korailtalk.data.remote.model.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class LPointResponseDto( | ||
@SerialName("isValid") val isValid: Boolean, | ||
@SerialName("point") val point: Int | ||
) |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/sopt/korailtalk/data/remote/service/PaymentService.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.sopt.korailtalk.data.remote.service | ||
|
||
import com.sopt.korailtalk.data.remote.model.base.ApiResponse | ||
import com.sopt.korailtalk.data.remote.model.request.TicketBuyingRequestDto | ||
import com.sopt.korailtalk.data.remote.model.response.LPointResponseDto | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.Header | ||
import retrofit2.http.PATCH | ||
import retrofit2.http.Query | ||
|
||
interface PaymentService { | ||
@GET("/users/points") | ||
suspend fun getLpoint( | ||
@Header("userId") userId: Long, | ||
@Query("pointPassword") pointPassword: Int | ||
): ApiResponse<LPointResponseDto> | ||
|
||
@PATCH("/tickets") | ||
suspend fun buyTicket( | ||
@Body ticketBuyingRequestDto: TicketBuyingRequestDto | ||
): ApiResponse<Unit> | ||
} |