Skip to content

Commit

Permalink
FIX : 예상 대기시간, 인원 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
gourderased authored Nov 6, 2024
1 parent 316f84e commit 2be88b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> "-";
};
}
Expand Down

0 comments on commit 2be88b6

Please sign in to comment.