Skip to content

Commit

Permalink
feat: TOP-62 코드 리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
taewooyo committed Sep 15, 2023
1 parent 93383fe commit 1f9afca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ object THTApiConstant {
}

object Chat {
const val CHATLIST = "/chat/rooms"
const val CHAT_LIST = "/chat/rooms"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import com.tht.tht.data.remote.response.chat.ChatListResponse
import retrofit2.http.GET

interface ChatService {
@GET(THTApiConstant.Chat.CHATLIST)
@GET(THTApiConstant.Chat.CHAT_LIST)
suspend fun getChatList(): ThtResponse<List<ChatListResponse>>
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
package com.tht.tht.data.repository

import com.tht.tht.data.di.IODispatcher
import com.tht.tht.data.remote.datasource.chat.ChatDataSource
import com.tht.tht.data.remote.mapper.chat.toModel
import com.tht.tht.domain.chat.model.ChatListModel
import com.tht.tht.domain.chat.repository.ChatRepository
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
import javax.inject.Inject

class ChatRepositoryImpl @Inject constructor(
private val chatDataSource: ChatDataSource,
@IODispatcher private val dispatcher: CoroutineDispatcher,
) : ChatRepository {

override suspend fun getChatList(): List<ChatListModel> {
return withContext(dispatcher) {
chatDataSource.getChatList().map { it.toModel() }
}
return chatDataSource.getChatList().map { it.toModel() }
}
}

0 comments on commit 1f9afca

Please sign in to comment.