From 10f7a051c4496d69072fdbf8c22173acdbc9f924 Mon Sep 17 00:00:00 2001 From: dongchyeon Date: Sat, 12 Oct 2024 15:03:25 +0900 Subject: [PATCH] =?UTF-8?q?Feat=20:=20=EB=B6=84=EC=84=9D=ED=95=98=EA=B8=B0?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=8A=A4=ED=8C=8C=ED=81=B4=EB=A7=81=20?= =?UTF-8?q?=EC=99=80=EC=9D=B8=EC=9D=BC=20=EC=8B=9C=20=EC=95=8C=EC=BD=94?= =?UTF-8?q?=EC=98=AC=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=ED=83=84=EC=82=B0?= =?UTF-8?q?=EA=B0=90=20=EB=85=B8=EC=B6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/network/model/response/TasteAnalysis.kt | 14 +------------- .../com/teamwiney/analysis/AnalysisResultScreen.kt | 14 +++++++++++++- .../component/pagercontent/WineTasteContent.kt | 3 +++ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/data/src/main/java/com/teamwiney/data/network/model/response/TasteAnalysis.kt b/data/src/main/java/com/teamwiney/data/network/model/response/TasteAnalysis.kt index cd6d5b5..e883003 100644 --- a/data/src/main/java/com/teamwiney/data/network/model/response/TasteAnalysis.kt +++ b/data/src/main/java/com/teamwiney/data/network/model/response/TasteAnalysis.kt @@ -48,7 +48,7 @@ fun TasteAnalysis.toDomain() = TasteAnalysis( avgPrice = this.avgPrice, recommendCountry = this.recommendCountry, recommendVarietal = this.recommendVarietal, - recommendWineType = convertTypeToSpecies(this.recommendWineType), + recommendWineType = this.recommendWineType, taste = this.taste, top3Type = this.top3Type.map { top3Type -> Top3Type(convertTypeToColor(top3Type.type), top3Type.percent) @@ -60,18 +60,6 @@ fun TasteAnalysis.toDomain() = TasteAnalysis( buyAgainCnt = this.buyAgainCnt ) -private fun convertTypeToSpecies(type: String): String { - return when (type) { - "RED" -> "레드 와인" - "ROSE" -> "로제 와인" - "WHITE" -> "화이트 와인" - "SPARKLING" -> "스파클링 와인" - "FORTIFIED" -> "포트 와인" - "OTHER" -> "기타 와인" - else -> "기타 와인" - } -} - private fun convertTypeToColor(type: String): String { return when (type) { "RED" -> "레드" diff --git a/feature/home/src/main/java/com/teamwiney/analysis/AnalysisResultScreen.kt b/feature/home/src/main/java/com/teamwiney/analysis/AnalysisResultScreen.kt index fe57b64..eaaf8d1 100644 --- a/feature/home/src/main/java/com/teamwiney/analysis/AnalysisResultScreen.kt +++ b/feature/home/src/main/java/com/teamwiney/analysis/AnalysisResultScreen.kt @@ -107,7 +107,7 @@ fun AnalysisResultScreen( ) Text( - text = "\"${analysisData.recommendCountry}의 ${analysisData.recommendVarietal} 품종으로 만든 ${analysisData.recommendWineType}\"", + text = "\"${analysisData.recommendCountry}의 ${analysisData.recommendVarietal} 품종으로 만든 ${convertTypeToSpecies(analysisData.recommendWineType)}\"", style = WineyTheme.typography.title2, color = WineyTheme.colors.main_3, textAlign = TextAlign.Center, @@ -203,3 +203,15 @@ fun AnalysisResultScreen( } } } + +private fun convertTypeToSpecies(type: String): String { + return when (type) { + "RED" -> "레드 와인" + "ROSE" -> "로제 와인" + "WHITE" -> "화이트 와인" + "SPARKLING" -> "스파클링 와인" + "FORTIFIED" -> "포트 와인" + "OTHER" -> "기타 와인" + else -> "기타 와인" + } +} \ No newline at end of file diff --git a/feature/home/src/main/java/com/teamwiney/analysis/component/pagercontent/WineTasteContent.kt b/feature/home/src/main/java/com/teamwiney/analysis/component/pagercontent/WineTasteContent.kt index ea3dc58..667080d 100644 --- a/feature/home/src/main/java/com/teamwiney/analysis/component/pagercontent/WineTasteContent.kt +++ b/feature/home/src/main/java/com/teamwiney/analysis/component/pagercontent/WineTasteContent.kt @@ -1,5 +1,6 @@ package com.teamwiney.analysis.component.pagercontent +import android.util.Log import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -31,6 +32,8 @@ fun WineTasteContent( wineType: WineType, tastes: Taste ) { + Log.d("WineTasteContent", "wineType: $wineType, progress: $progress, tastes: $tastes") + Column( modifier = Modifier.fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally