Skip to content

Commit

Permalink
[add] : ReqresRepository 생성(추후에 impl로 리팩토링)
Browse files Browse the repository at this point in the history
  • Loading branch information
chanubc committed Jan 2, 2024
1 parent f11a2f1 commit 4926d40
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.sopt.dosopttemplate.data.repositoryimpl

import org.sopt.dosopttemplate.data.service.ReqresService
import org.sopt.dosopttemplate.domain.entity.ReqresEntity
import org.sopt.dosopttemplate.domain.repository.ReqresRepository

// 외부 데이터 소스(ReqresDataSource)로부터 데이터를 가져오고, 필요한 형태로 변환하여 비즈니스 로직 계층에게 제공
class ReqresRepositoryImpl constructor(private val reqresService: ReqresService) :
ReqresRepository {
override suspend fun getReqresList(page: Int): Result<List<ReqresEntity>> {
return runCatching {
reqresService.getUserList(page).toReqresList()
}
}
}

0 comments on commit 4926d40

Please sign in to comment.