Skip to content

Commit

Permalink
[RENAME/#220] InternInfoModel -> InternInfo 리네임
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Sep 6, 2024
1 parent 24fee25 commit 71fcac1
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.terning.data.mapper.intern

class InternInfoMapper {
}
Original file line number Diff line number Diff line change
@@ -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<InternInfoModel> =
override suspend fun getInternInfo(id: Long): Result<InternInfo> =
runCatching {
internDataSource.getInternInfo(id).result.toInternEntity()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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<InternInfoModel>
suspend fun getInternInfo(id: Long): Result<InternInfo>
}
36 changes: 18 additions & 18 deletions feature/src/main/java/com/terning/feature/intern/InternRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
}
Expand All @@ -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) {
Expand All @@ -107,7 +107,7 @@ fun InternScreen(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
)
loadUrl(internInfoModel.url)
loadUrl(internInfo.url)
}
},
)
Expand All @@ -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)
}
Expand All @@ -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))
Expand Down Expand Up @@ -222,7 +222,7 @@ fun InternScreen(
) {
SelectionContainer {
Text(
text = internInfoModel.detail.trimIndent(),
text = internInfo.detail.trimIndent(),
style = TerningTheme.typography.body3,
color = Grey400
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<InternInfoModel> = UiState.Loading,
val loadState: UiState<InternInfo> = UiState.Loading,
val isColorChange: Boolean = false,
val isPaletteOpen: Boolean = false,
val selectedColor: Color = CalRed,
Expand Down

0 comments on commit 71fcac1

Please sign in to comment.