diff --git a/data/src/main/java/com/terning/data/dto/response/InternResponseDto.kt b/data/src/main/java/com/terning/data/dto/response/InternResponseDto.kt index 39ef0832e..c6d8faf77 100644 --- a/data/src/main/java/com/terning/data/dto/response/InternResponseDto.kt +++ b/data/src/main/java/com/terning/data/dto/response/InternResponseDto.kt @@ -1,6 +1,6 @@ package com.terning.data.dto.response -import com.terning.domain.entity.intern.InternInfoModel +import com.terning.domain.entity.intern.InternInfo import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -37,8 +37,8 @@ data class InternResponseDto( @SerialName("scrapId") val scrapId: Long? = null, ) { - fun toInternEntity(): InternInfoModel { - return InternInfoModel( + fun toInternEntity(): InternInfo { + return InternInfo( dDay = dDay, title = title, deadline = deadline, diff --git a/data/src/main/java/com/terning/data/mapper/intern/InternInfoMapper.kt b/data/src/main/java/com/terning/data/mapper/intern/InternInfoMapper.kt new file mode 100644 index 000000000..dc7014ba0 --- /dev/null +++ b/data/src/main/java/com/terning/data/mapper/intern/InternInfoMapper.kt @@ -0,0 +1,4 @@ +package com.terning.data.mapper.intern + +class InternInfoMapper { +} \ No newline at end of file diff --git a/data/src/main/java/com/terning/data/repositoryimpl/InternRepositoryImpl.kt b/data/src/main/java/com/terning/data/repositoryimpl/InternRepositoryImpl.kt index 7db146206..aae0c9daa 100644 --- a/data/src/main/java/com/terning/data/repositoryimpl/InternRepositoryImpl.kt +++ b/data/src/main/java/com/terning/data/repositoryimpl/InternRepositoryImpl.kt @@ -1,14 +1,14 @@ package com.terning.data.repositoryimpl import com.terning.data.datasource.InternDataSource -import com.terning.domain.entity.intern.InternInfoModel +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 = + override suspend fun getInternInfo(id: Long): Result = runCatching { internDataSource.getInternInfo(id).result.toInternEntity() } diff --git a/domain/src/main/java/com/terning/domain/entity/intern/InternInfoModel.kt b/domain/src/main/java/com/terning/domain/entity/intern/InternInfo.kt similarity index 94% rename from domain/src/main/java/com/terning/domain/entity/intern/InternInfoModel.kt rename to domain/src/main/java/com/terning/domain/entity/intern/InternInfo.kt index fc79cbcb4..77e70f12c 100644 --- a/domain/src/main/java/com/terning/domain/entity/intern/InternInfoModel.kt +++ b/domain/src/main/java/com/terning/domain/entity/intern/InternInfo.kt @@ -1,6 +1,6 @@ package com.terning.domain.entity.intern -data class InternInfoModel( +data class InternInfo( val dDay: String, val title: String, val deadline: String, diff --git a/domain/src/main/java/com/terning/domain/repository/InternRepository.kt b/domain/src/main/java/com/terning/domain/repository/InternRepository.kt index 1221e9390..3bdd6d60a 100644 --- a/domain/src/main/java/com/terning/domain/repository/InternRepository.kt +++ b/domain/src/main/java/com/terning/domain/repository/InternRepository.kt @@ -1,7 +1,7 @@ package com.terning.domain.repository -import com.terning.domain.entity.intern.InternInfoModel +import com.terning.domain.entity.intern.InternInfo interface InternRepository { - suspend fun getInternInfo(id: Long): Result + suspend fun getInternInfo(id: Long): Result } \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt index 8d398f417..1a9994fa0 100644 --- a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt +++ b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt @@ -30,7 +30,7 @@ import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.customShadow import com.terning.core.extension.toast import com.terning.core.state.UiState -import com.terning.domain.entity.intern.InternInfoModel +import com.terning.domain.entity.intern.InternInfo import com.terning.feature.R import com.terning.feature.intern.component.InternBottomBar import com.terning.feature.intern.component.InternCompanyInfo @@ -71,7 +71,7 @@ fun InternRoute( is UiState.Success -> { InternScreen( internUiState = internState, - internInfoModel = (internState.loadState as UiState.Success).data, + internInfo = (internState.loadState as UiState.Success).data, navController = navController ) } @@ -84,19 +84,19 @@ fun InternScreen( navController: NavHostController, viewModel: InternViewModel = hiltViewModel(), internUiState: InternUiState, - internInfoModel: InternInfoModel, + internInfo: InternInfo, ) { val decimal = DecimalFormat("#,###") val internInfoList = listOf( - stringResource(id = R.string.intern_info_d_day) to internInfoModel.deadline, - stringResource(id = R.string.intern_info_working) to internInfoModel.workingPeriod, - stringResource(id = R.string.intern_info_start_date) to internInfoModel.startDate, + stringResource(id = R.string.intern_info_d_day) to internInfo.deadline, + stringResource(id = R.string.intern_info_working) to internInfo.workingPeriod, + stringResource(id = R.string.intern_info_start_date) to internInfo.startDate, ) val qualificationList = listOf( - stringResource(id = R.string.intern_recruitment_target) to internInfoModel.qualification, - stringResource(id = R.string.intern_info_work) to internInfoModel.jobType, + stringResource(id = R.string.intern_recruitment_target) to internInfo.qualification, + stringResource(id = R.string.intern_info_work) to internInfo.jobType, ) if (internUiState.showWeb) { @@ -107,7 +107,7 @@ fun InternScreen( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, ) - loadUrl(internInfoModel.url) + loadUrl(internInfo.url) } }, ) @@ -130,8 +130,8 @@ fun InternScreen( bottomBar = { InternBottomBar( modifier = modifier, - scrapCount = decimal.format(internInfoModel.scrapCount), - scrapId = internInfoModel.scrapId, + scrapCount = decimal.format(internInfo.scrapCount), + scrapId = internInfo.scrapId, onScrapClick = { viewModel.updateScrapDialogVisible(true) } @@ -154,18 +154,18 @@ fun InternScreen( InternCompanyInfo( modifier = modifier, - companyImage = internInfoModel.companyImage, - company = internInfoModel.company, - companyCategory = internInfoModel.companyCategory + companyImage = internInfo.companyImage, + company = internInfo.company, + companyCategory = internInfo.companyCategory ) Spacer(modifier = modifier.padding(top = 20.dp)) InternTitle( modifier = modifier, - dDay = internInfoModel.dDay, - title = internInfoModel.title, - viewCount = decimal.format(internInfoModel.viewCount) + dDay = internInfo.dDay, + title = internInfo.title, + viewCount = decimal.format(internInfo.viewCount) ) Spacer(modifier = modifier.padding(top = 16.dp)) @@ -222,7 +222,7 @@ fun InternScreen( ) { SelectionContainer { Text( - text = internInfoModel.detail.trimIndent(), + text = internInfo.detail.trimIndent(), style = TerningTheme.typography.body3, color = Grey400 ) diff --git a/feature/src/main/java/com/terning/feature/intern/model/InternUiState.kt b/feature/src/main/java/com/terning/feature/intern/model/InternUiState.kt index cea7ed2a1..a9b094007 100644 --- a/feature/src/main/java/com/terning/feature/intern/model/InternUiState.kt +++ b/feature/src/main/java/com/terning/feature/intern/model/InternUiState.kt @@ -3,10 +3,10 @@ package com.terning.feature.intern.model import androidx.compose.ui.graphics.Color import com.terning.core.designsystem.theme.CalRed import com.terning.core.state.UiState -import com.terning.domain.entity.intern.InternInfoModel +import com.terning.domain.entity.intern.InternInfo data class InternUiState( - val loadState: UiState = UiState.Loading, + val loadState: UiState = UiState.Loading, val isColorChange: Boolean = false, val isPaletteOpen: Boolean = false, val selectedColor: Color = CalRed,