Skip to content

Commit

Permalink
[chore] : rename
Browse files Browse the repository at this point in the history
[chore] : rename
  • Loading branch information
chanubc committed Jan 3, 2024
1 parent bfc726e commit 5ebd6ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package org.sopt.dosopttemplate.data.repositoryimpl

import org.sopt.dosopttemplate.data.datasource.remote.ReqresDataSource
import org.sopt.dosopttemplate.domain.entity.ReqresEntity
import org.sopt.dosopttemplate.domain.repository.ReqresRepository
import org.sopt.dosopttemplate.domain.repository.ReqresDomainRepository

// 외부 데이터 소스(ReqresDataSource)로부터 데이터를 가져오고, 필요한 형태로 변환하여 비즈니스 로직 계층에게 제공
class ReqresRepositoryImpl(private val reqresDataSource: ReqresDataSource) :
ReqresRepository {
ReqresDomainRepository {
override suspend fun getReqresList(page: Int): Result<List<ReqresEntity>> {
return runCatching {
reqresDataSource.getReqresList(page).toReqresList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import org.sopt.dosopttemplate.domain.entity.ReqresEntity

/*ReqresRepository 인터페이스는 도메인(Domain) 레이어에서 사용되며,
원격 데이터 소스(ReqresDataSource)로부터 Reqres 사용자 리스트를 가져오는 기능을 정의*/
interface ReqresRepository {
interface ReqresDomainRepository {
suspend fun getReqresList(page: Int): Result<List<ReqresEntity>>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
import org.sopt.dosopttemplate.domain.entity.ReqresEntity
import org.sopt.dosopttemplate.domain.repository.ReqresRepository
import org.sopt.dosopttemplate.domain.repository.ReqresDomainRepository
import org.sopt.dosopttemplate.utils.UiState

class DoAndroidViewModel(val reqresRepository: ReqresRepository) : ViewModel() {
class DoAndroidViewModel(val reqresRepository: ReqresDomainRepository) : ViewModel() {

private val _reqresUserState = MutableStateFlow<UiState<List<ReqresEntity>>>(UiState.Loading)
val reqresUserState get() = _reqresUserState.asStateFlow()
Expand Down

0 comments on commit 5ebd6ba

Please sign in to comment.