Skip to content

Commit

Permalink
[feat/#15] 결제하기 서버통신을 위한 Service 인터페이스와 Dto를 정의합니다.
Browse files Browse the repository at this point in the history
  • Loading branch information
SYAAINN committed Nov 28, 2024
1 parent 780130d commit f32ed45
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
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
)
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
)
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>
}

0 comments on commit f32ed45

Please sign in to comment.