From 2be88b652da418380ab75626afa7414fbcb03b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A7=80=EC=9A=B4?= <117848386+gourderased@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:27:40 +0900 Subject: [PATCH] =?UTF-8?q?FIX=20:=20=EC=98=88=EC=83=81=20=EB=8C=80?= =?UTF-8?q?=EA=B8=B0=EC=8B=9C=EA=B0=84,=20=EC=9D=B8=EC=9B=90=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/SensorDataResponse.java | 4 ++-- .../ohhanahana/service/SensorDataService.java | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/cloudcomputing/ohhanahana/dto/response/SensorDataResponse.java b/src/main/java/com/cloudcomputing/ohhanahana/dto/response/SensorDataResponse.java index 9b42381..a20f6a2 100644 --- a/src/main/java/com/cloudcomputing/ohhanahana/dto/response/SensorDataResponse.java +++ b/src/main/java/com/cloudcomputing/ohhanahana/dto/response/SensorDataResponse.java @@ -16,12 +16,12 @@ public class SensorDataResponse { private String currentLocation; private String currentDateTime; private Congestion congestion; - private String expectedWaitingTime; + private int expectedWaitingTime; private String expectedWaitingPeople; public static SensorDataResponse toDTO(String currentLocation, String currentDateTime, Congestion congestion, - String expectedWaitingTime, String expectedWaitingPeople) { + int expectedWaitingTime, String expectedWaitingPeople) { return SensorDataResponse.builder() .currentLocation(currentLocation) diff --git a/src/main/java/com/cloudcomputing/ohhanahana/service/SensorDataService.java b/src/main/java/com/cloudcomputing/ohhanahana/service/SensorDataService.java index e572ce3..80b809f 100644 --- a/src/main/java/com/cloudcomputing/ohhanahana/service/SensorDataService.java +++ b/src/main/java/com/cloudcomputing/ohhanahana/service/SensorDataService.java @@ -99,22 +99,22 @@ private Congestion determineCongestion(int sensor1Value, int sensor2Value, int s } } - private String calculateWaitingTime(Congestion congestion) throws JAXBException { + private int calculateWaitingTime(Congestion congestion) throws JAXBException { int remain511Minute = busService.get511BusRemainMinute(); return switch (congestion) { - case SPARE -> remain511Minute + "분"; - case NORMAL -> remain511Minute + 5 + "분"; - case CONGESTION -> remain511Minute + 10 + "분"; - default -> "-"; + case SPARE -> remain511Minute; + case NORMAL -> remain511Minute; + case CONGESTION -> remain511Minute + 10; + default -> 0; }; } private String calculatePeople(Congestion congestion) { return switch (congestion) { - case SPARE -> "15명"; - case NORMAL -> "25명"; - case CONGESTION -> "35명"; + case SPARE -> "15"; + case NORMAL -> "25"; + case CONGESTION -> "35"; default -> "-"; }; }