Skip to content

Commit

Permalink
[MERGE] #220 -> develop
Browse files Browse the repository at this point in the history
[REFACTOR/#220] 공고 상세 뷰 / 리팩토링
  • Loading branch information
boiledEgg-s authored Sep 9, 2024
2 parents 47cc383 + 435cac6 commit c326c31
Show file tree
Hide file tree
Showing 14 changed files with 223 additions and 477 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.terning.data.dto.response

import com.terning.domain.entity.response.InternInfoModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand Down Expand Up @@ -36,24 +35,4 @@ data class InternResponseDto(
val url: String,
@SerialName("scrapId")
val scrapId: Long? = null,
) {
fun toInternEntity(): InternInfoModel {
return InternInfoModel(
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
)
}
}
)
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
)
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()
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.terning.domain.entity.response
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.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>
}
Loading

0 comments on commit c326c31

Please sign in to comment.