diff --git a/src/main/kotlin/dnd11th/blooming/api/dto/guide/PlantRecommendedPeriodResponse.kt b/src/main/kotlin/dnd11th/blooming/api/dto/guide/PlantRecommendedPeriodResponse.kt index ea7d40dc..3d8f0f5f 100644 --- a/src/main/kotlin/dnd11th/blooming/api/dto/guide/PlantRecommendedPeriodResponse.kt +++ b/src/main/kotlin/dnd11th/blooming/api/dto/guide/PlantRecommendedPeriodResponse.kt @@ -24,8 +24,10 @@ data class PlantRecommendedPeriodResponse( val waterInfo = when (season) { + Season.SPRING -> plant.springWater + Season.SUMMER -> plant.summerWater + Season.FALL -> plant.fallWater Season.WINTER -> plant.winterWater - else -> plant.springSummerFallWater } return PlantRecommendedPeriodResponse( diff --git a/src/main/kotlin/dnd11th/blooming/api/service/guide/provider/StaticPlantSimpleMessageProvider.kt b/src/main/kotlin/dnd11th/blooming/api/service/guide/provider/StaticPlantSimpleMessageProvider.kt index 9ba5fec5..28479115 100644 --- a/src/main/kotlin/dnd11th/blooming/api/service/guide/provider/StaticPlantSimpleMessageProvider.kt +++ b/src/main/kotlin/dnd11th/blooming/api/service/guide/provider/StaticPlantSimpleMessageProvider.kt @@ -97,8 +97,10 @@ class StaticPlantSimpleMessageProvider { ): String { val water = when (Season.getSeason(month)) { + Season.SPRING -> plant.springWater + Season.SUMMER -> plant.summerWater + Season.FALL -> plant.fallWater Season.WINTER -> plant.winterWater - else -> plant.springSummerFallWater } return "${water.waterPerWeek},\n${water.description}할 것" diff --git a/src/main/kotlin/dnd11th/blooming/api/service/guide/provider/WaterDetailProvider.kt b/src/main/kotlin/dnd11th/blooming/api/service/guide/provider/WaterDetailProvider.kt index d5f2b762..83eb2252 100644 --- a/src/main/kotlin/dnd11th/blooming/api/service/guide/provider/WaterDetailProvider.kt +++ b/src/main/kotlin/dnd11th/blooming/api/service/guide/provider/WaterDetailProvider.kt @@ -25,8 +25,8 @@ class WaterDetailProvider { } private fun makeDetailSpringSummerFallDescription(plant: Plant): String { - val waterDescription = "${plant.springSummerFallWater.description}해주세요." - val perWeekDescription = "일주일에 ${plant.springSummerFallWater.waterPerWeek}번 정도가 적당해요." + val waterDescription = "${plant.summerWater.description}해주세요." + val perWeekDescription = "일주일에 ${plant.summerWater.waterPerWeek}번 정도가 적당해요." return "$waterDescription $perWeekDescription" } diff --git a/src/main/kotlin/dnd11th/blooming/domain/entity/plant/Plant.kt b/src/main/kotlin/dnd11th/blooming/domain/entity/plant/Plant.kt index 773b8fc0..99994875 100644 --- a/src/main/kotlin/dnd11th/blooming/domain/entity/plant/Plant.kt +++ b/src/main/kotlin/dnd11th/blooming/domain/entity/plant/Plant.kt @@ -16,7 +16,13 @@ class Plant( var engName: String, @Column @Enumerated(EnumType.STRING) - var springSummerFallWater: Water, + var springWater: Water, + @Column + @Enumerated(EnumType.STRING) + var summerWater: Water, + @Column + @Enumerated(EnumType.STRING) + var fallWater: Water, @Column @Enumerated(EnumType.STRING) var winterWater: Water, diff --git a/src/test/kotlin/dnd11th/blooming/api/service/myplant/MyPlantServiceTest.kt b/src/test/kotlin/dnd11th/blooming/api/service/myplant/MyPlantServiceTest.kt index ad53eb8a..b1a3dad4 100644 --- a/src/test/kotlin/dnd11th/blooming/api/service/myplant/MyPlantServiceTest.kt +++ b/src/test/kotlin/dnd11th/blooming/api/service/myplant/MyPlantServiceTest.kt @@ -555,6 +555,8 @@ class MyPlantServiceTest : DescribeSpec( "", Water.MOIST, Water.MOIST, + Water.MOIST, + Water.MOIST, 100, 100, Light.MEDIUM,