From d95dbb5b3a3daf0e6507e774d7eba61c0eb55a48 Mon Sep 17 00:00:00 2001 From: Lee junbeom Date: Sun, 7 Jul 2024 11:27:37 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20period=20=EB=B0=98=ED=99=98=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/inputMessage/dto/ResponseHarmonyDto.java | 2 +- .../fiurinee/domain/inputMessage/dto/ResponseMentDto.java | 2 +- .../domain/matchingFlower/dto/HarmonyRecentDto.java | 2 +- .../domain/recommendFlower/dto/RecommendFlowerDto.java | 8 +------- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/example/fiurinee/domain/inputMessage/dto/ResponseHarmonyDto.java b/src/main/java/com/example/fiurinee/domain/inputMessage/dto/ResponseHarmonyDto.java index 4b03f72..de3a35a 100644 --- a/src/main/java/com/example/fiurinee/domain/inputMessage/dto/ResponseHarmonyDto.java +++ b/src/main/java/com/example/fiurinee/domain/inputMessage/dto/ResponseHarmonyDto.java @@ -19,7 +19,7 @@ public ResponseHarmonyDto(){} public ResponseHarmonyDto(Flower flower) { this.id = flower.getFlowerId(); this.harmonyFlower = flower.getName(); - this.period = flower.getPeriod().toString(); + this.period = String.format("%02d", flower.getPeriod() / 100); this.explain = flower.getExplain(); this.flower_language = flower.getFlowerLanguage(); this.image = flower.getImage(); diff --git a/src/main/java/com/example/fiurinee/domain/inputMessage/dto/ResponseMentDto.java b/src/main/java/com/example/fiurinee/domain/inputMessage/dto/ResponseMentDto.java index 5be25cd..6d6daf8 100644 --- a/src/main/java/com/example/fiurinee/domain/inputMessage/dto/ResponseMentDto.java +++ b/src/main/java/com/example/fiurinee/domain/inputMessage/dto/ResponseMentDto.java @@ -19,7 +19,7 @@ public ResponseMentDto(){} public ResponseMentDto(Flower flower) { this.id = flower.getFlowerId(); this.recommendFlower = flower.getName(); - this.period = flower.getPeriod().toString(); + this.period = String.format("%02d", flower.getPeriod() / 100); this.explain = flower.getExplain(); this.flower_language = flower.getFlowerLanguage(); this.image = flower.getImage(); diff --git a/src/main/java/com/example/fiurinee/domain/matchingFlower/dto/HarmonyRecentDto.java b/src/main/java/com/example/fiurinee/domain/matchingFlower/dto/HarmonyRecentDto.java index 911adc2..42102fb 100644 --- a/src/main/java/com/example/fiurinee/domain/matchingFlower/dto/HarmonyRecentDto.java +++ b/src/main/java/com/example/fiurinee/domain/matchingFlower/dto/HarmonyRecentDto.java @@ -48,7 +48,7 @@ public static List of(Long order, Member member){ Flower flower = matchingFlowers.get(i).getFlower(); harmonyRecentDto.harmonyFlower = flower.getName(); harmonyRecentDto.order = order; - harmonyRecentDto.period = flower.getPeriod().toString(); + harmonyRecentDto.period = String.format("%02d", flower.getPeriod() / 100); harmonyRecentDto.explain = flower.getExplain(); harmonyRecentDto.image = flower.getImage(); harmonyRecentDto.flower_language = flower.getFlowerLanguage(); diff --git a/src/main/java/com/example/fiurinee/domain/recommendFlower/dto/RecommendFlowerDto.java b/src/main/java/com/example/fiurinee/domain/recommendFlower/dto/RecommendFlowerDto.java index d6648f2..0cfb532 100644 --- a/src/main/java/com/example/fiurinee/domain/recommendFlower/dto/RecommendFlowerDto.java +++ b/src/main/java/com/example/fiurinee/domain/recommendFlower/dto/RecommendFlowerDto.java @@ -50,13 +50,7 @@ public static RecommendFlowerDto of(Long order, Member member){ RecommendFlowerDto recommendFlowerDto = new RecommendFlowerDto(); recommendFlowerDto.order = order; recommendFlowerDto.recommendFlower = flower.getName(); - if(flower.getPeriod() < 1000){ - Long p = flower.getPeriod() / 10; - }else{ - Long p = flower.getPeriod() / 100; - } - - recommendFlowerDto.period = flower.getPeriod().toString(); + recommendFlowerDto.period = String.format("%02d", flower.getPeriod() / 100); recommendFlowerDto.flower_language = flower.getFlowerLanguage(); recommendFlowerDto.explain = flower.getExplain(); recommendFlowerDto.image = flower.getImage();