feat(chat): 채팅방 목록 API와 저장소를 추가한다
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package kr.co.vividnext.sodalive.v2.main.chat.data
|
||||
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Header
|
||||
import retrofit2.http.Query
|
||||
|
||||
interface ChatRoomApi {
|
||||
@GET("/api/v2/chat/rooms")
|
||||
fun getChatRooms(
|
||||
@Header("Authorization") authHeader: String,
|
||||
@Query("filter") filter: String,
|
||||
@Query("cursor") cursor: String?
|
||||
): Single<ApiResponse<ChatRoomListPageResponse>>
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package kr.co.vividnext.sodalive.v2.main.chat.data
|
||||
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
import kr.co.vividnext.sodalive.common.ApiResponse
|
||||
|
||||
class ChatRoomRepository(private val api: ChatRoomApi) {
|
||||
fun getChatRooms(
|
||||
token: String,
|
||||
filter: String,
|
||||
cursor: String?
|
||||
): Single<ApiResponse<ChatRoomListPageResponse>> = api.getChatRooms(
|
||||
authHeader = token,
|
||||
filter = filter,
|
||||
cursor = cursor
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user