-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
14 changed files
with
223 additions
and
477 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
data/src/main/java/com/terning/data/mapper/intern/InternInfoMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.terning.data.mapper.intern | ||
|
||
import com.terning.data.dto.response.InternResponseDto | ||
import com.terning.domain.entity.intern.InternInfo | ||
|
||
fun InternResponseDto.toInternInfo(): InternInfo = | ||
InternInfo( | ||
dDay = dDay, | ||
title = title, | ||
deadline = deadline, | ||
workingPeriod = workingPeriod, | ||
startDate = startDate, | ||
scrapCount = scrapCount, | ||
viewCount = viewCount, | ||
company = company, | ||
companyCategory = companyCategory, | ||
companyImage = companyImage, | ||
qualification = qualification, | ||
jobType = jobType, | ||
detail = detail, | ||
url = url, | ||
scrapId = scrapId | ||
) |
10 changes: 5 additions & 5 deletions
10
data/src/main/java/com/terning/data/repositoryimpl/InternRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package com.terning.data.repositoryimpl | ||
|
||
import com.terning.data.datasource.InternDataSource | ||
import com.terning.domain.entity.response.InternInfoModel | ||
import com.terning.data.mapper.intern.toInternInfo | ||
import com.terning.domain.entity.intern.InternInfo | ||
import com.terning.domain.repository.InternRepository | ||
import javax.inject.Inject | ||
|
||
class InternRepositoryImpl @Inject constructor( | ||
private val internDataSource: InternDataSource, | ||
) : InternRepository { | ||
override suspend fun getInternInfo(id: Long): Result<InternInfoModel> = | ||
runCatching { | ||
internDataSource.getInternInfo(id).result.toInternEntity() | ||
} | ||
override suspend fun getInternInfo(id: Long): Result<InternInfo> = runCatching { | ||
internDataSource.getInternInfo(id).result.toInternInfo() | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...domain/entity/response/InternInfoModel.kt → ...erning/domain/entity/intern/InternInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
domain/src/main/java/com/terning/domain/repository/InternRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.terning.domain.repository | ||
|
||
import com.terning.domain.entity.response.InternInfoModel | ||
import com.terning.domain.entity.intern.InternInfo | ||
|
||
interface InternRepository { | ||
suspend fun getInternInfo(id: Long): Result<InternInfoModel> | ||
suspend fun getInternInfo(id: Long): Result<InternInfo> | ||
} |
Oops, something went wrong.