diff --git a/core/network/src/main/java/com/sample/network/reponse/DevelopersDetailResponse.kt b/core/network/src/main/java/com/sample/network/reponse/DevelopersDetailResponse.kt index 7bc878a..25d3cf7 100644 --- a/core/network/src/main/java/com/sample/network/reponse/DevelopersDetailResponse.kt +++ b/core/network/src/main/java/com/sample/network/reponse/DevelopersDetailResponse.kt @@ -9,40 +9,50 @@ data class DevelopersDetailResponse( val id: Int, @SerialName("name") val name: String, - @SerialName("imageLink") - val imageLink: String, - @SerialName("developerList") - val developerList: List, @SerialName("shortIntro") val shortIntro: String, - @SerialName("longIntro") - val longIntro: String, - @SerialName("category") - val category: String, + @SerialName("university") + val university: String, + @SerialName("major") + val major: String, + @SerialName("studentNumber") + val studentNumber: String, + @SerialName("email") + val email: String, @SerialName("hits") val hits: Int, + @SerialName("kakaoId") + val kakaoId: String, @SerialName("githubLink") val githubLink: String, - @SerialName("infoPageLink") - val infoPageLink: String, - @SerialName("webLink") - val webLink: String, - @SerialName("appLink") - val appLink: String, + @SerialName("projectList") + val projectsListInDevelopersDetail: List, @SerialName("languageList") val languageList: List, @SerialName("devToolList") val devToolList: List, @SerialName("techStackList") val techStackList: List, + @SerialName("part1") + val part1: String?, + @SerialName("part2") + val part2: String?, + @SerialName("developer") + val developer: Boolean, ) { @Serializable - data class DeveloperInfoInDevelopersDetail( + data class ProjectsListInDevelopersDetail( @SerialName("id") val id: Int, @SerialName("name") val name: String, - @SerialName("partList") - val partList: List, + @SerialName("imageLink") + val imageLink: String, + @SerialName("shortIntro") + val shortIntro: String, + @SerialName("category") + val category: String, + @SerialName("hits") + val hits: Int, ) } diff --git a/core/network/src/main/java/com/sample/network/reponse/DevelopersListResponse.kt b/core/network/src/main/java/com/sample/network/reponse/DevelopersListResponse.kt index 1d3f465..be4eaf3 100644 --- a/core/network/src/main/java/com/sample/network/reponse/DevelopersListResponse.kt +++ b/core/network/src/main/java/com/sample/network/reponse/DevelopersListResponse.kt @@ -21,9 +21,9 @@ data class DevelopersListResponse( @SerialName("name") val name: String, @SerialName("part1") - val part1: String, + val part1: String?, @SerialName("part2") - val part2: String, + val part2: String?, @SerialName("githubLink") val githubLink: String, @SerialName("hits") diff --git a/core/network/src/main/java/com/sample/network/service/DevelopersService.kt b/core/network/src/main/java/com/sample/network/service/DevelopersService.kt index 620ed67..b91c530 100644 --- a/core/network/src/main/java/com/sample/network/service/DevelopersService.kt +++ b/core/network/src/main/java/com/sample/network/service/DevelopersService.kt @@ -4,6 +4,7 @@ import com.sample.network.model.BaseResponse import com.sample.network.reponse.DevelopersDetailResponse import com.sample.network.reponse.DevelopersListResponse import retrofit2.http.GET +import retrofit2.http.Path import retrofit2.http.Query interface DevelopersService { @@ -17,6 +18,6 @@ interface DevelopersService { @GET("/api/developers/{developerId}") suspend fun getDevelopersDetailData( - developerId: Int, + @Path("developerId") developerId: Int, ): BaseResponse } diff --git a/data/src/main/java/com/zucchini/mapper/DevelopersDetail.kt b/data/src/main/java/com/zucchini/mapper/DevelopersDetail.kt index 359664c..d1cd7a0 100644 --- a/data/src/main/java/com/zucchini/mapper/DevelopersDetail.kt +++ b/data/src/main/java/com/zucchini/mapper/DevelopersDetail.kt @@ -5,29 +5,34 @@ import com.zucchini.domain.model.DeveloperInfoInDetailModel import com.zucchini.domain.model.DevelopersDetailModel internal fun DevelopersDetailResponse.toDevelopersDetailModel(): DevelopersDetailModel { - val developerList = developerList.map { developerInfo -> + val projectsListInDevelopersDetail = projectsListInDevelopersDetail.map { developerInfo -> DeveloperInfoInDetailModel( id = developerInfo.id, name = developerInfo.name, - partList = developerInfo.partList, + imageLink = developerInfo.imageLink, + shortIntro = developerInfo.shortIntro, + category = developerInfo.category, + hits = developerInfo.hits, ) } return DevelopersDetailModel( id = id, name = name, - imageLink = imageLink, - developerList = developerList, shortIntro = shortIntro, - longIntro = longIntro, - category = category, + university = university, + major = major, + studentNumber = studentNumber, + email = email, hits = hits, + kakaoId = kakaoId, githubLink = githubLink, - infoPageLink = infoPageLink, - webLink = webLink, - appLink = appLink, + projectList = projectsListInDevelopersDetail, languageList = languageList, devToolList = devToolList, techStackList = techStackList, + part1 = part1, + part2 = part2, + developer = developer, ) } diff --git a/domain/src/main/java/com/zucchini/domain/model/DevelopersDetailModel.kt b/domain/src/main/java/com/zucchini/domain/model/DevelopersDetailModel.kt index ed1ef4a..c70c346 100644 --- a/domain/src/main/java/com/zucchini/domain/model/DevelopersDetailModel.kt +++ b/domain/src/main/java/com/zucchini/domain/model/DevelopersDetailModel.kt @@ -3,24 +3,28 @@ package com.zucchini.domain.model data class DevelopersDetailModel( val id: Int, val name: String, - val imageLink: String, - val developerList: List, val shortIntro: String, - val longIntro: String, - val category: String, + val university: String, + val major: String, + val studentNumber: String, + val email: String, val hits: Int, + val kakaoId: String, val githubLink: String, - val infoPageLink: String, - val webLink: String, - val appLink: String, + val projectList: List, val languageList: List, val devToolList: List, - val techStackList: List + val techStackList: List, + val part1: String?, + val part2: String?, + val developer: Boolean, ) data class DeveloperInfoInDetailModel( val id: Int, val name: String, - val partList: List + val imageLink: String, + val shortIntro: String, + val category: String, + val hits: Int, ) - diff --git a/domain/src/main/java/com/zucchini/domain/model/DevelopersListModel.kt b/domain/src/main/java/com/zucchini/domain/model/DevelopersListModel.kt index 63dc99b..ad40ca3 100644 --- a/domain/src/main/java/com/zucchini/domain/model/DevelopersListModel.kt +++ b/domain/src/main/java/com/zucchini/domain/model/DevelopersListModel.kt @@ -10,8 +10,8 @@ data class DevelopersListModel( data class DeveloperDetailInfoInListModel( val id: Int, val name: String, - val part1: String, - val part2: String, + val part1: String?, + val part2: String?, val githubLink: String, val hits: Int, ) diff --git a/feature/projects/src/main/java/com/zucchini/projects/developer/DevDetailViewModel.kt b/feature/projects/src/main/java/com/zucchini/projects/developer/DevDetailViewModel.kt index b9f8845..1261fcf 100644 --- a/feature/projects/src/main/java/com/zucchini/projects/developer/DevDetailViewModel.kt +++ b/feature/projects/src/main/java/com/zucchini/projects/developer/DevDetailViewModel.kt @@ -28,7 +28,7 @@ class DevDetailViewModel @Inject constructor( _developersDetail.value = it Timber.tag("DevDetailViewModel").d(it.toString()) }.onFailure { - // handle error + Timber.tag("DevDetailViewModel Fail").d(it.toString()) } } }