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 -> "-"; }; }