feat: 라이브 30분 연속 청취시 트래킹 API 호출 기능 추가
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package kr.co.vividnext.sodalive.tracking
|
||||
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.POST
|
||||
|
||||
interface UserEventApi {
|
||||
@POST("/user-action")
|
||||
fun trackEvent(
|
||||
@Body request: UserEventRequest,
|
||||
@Header("Authorization") authHeader: String
|
||||
): Single<ApiResponse<Any>>
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package kr.co.vividnext.sodalive.tracking
|
||||
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||
|
||||
class UserEventRepository(private val api: UserEventApi) {
|
||||
fun trackEvent(eventType: UserEventType, token: String): Single<ApiResponse<Any>> {
|
||||
return api.trackEvent(
|
||||
request = UserEventRequest(actionType = eventType),
|
||||
authHeader = token
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package kr.co.vividnext.sodalive.tracking
|
||||
|
||||
import androidx.annotation.Keep
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
@Keep
|
||||
data class UserEventRequest(
|
||||
@SerializedName("actionType") val actionType: UserEventType
|
||||
)
|
||||
|
||||
@Keep
|
||||
enum class UserEventType {
|
||||
@SerializedName("LIVE_CONTINUOUS_LISTEN_30")
|
||||
LIVE_CONTINUOUS_LISTEN_30
|
||||
}
|
||||
Reference in New Issue
Block a user