Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# server
IoT기술을 활용한 실시간 버스 정류장 대기줄 파악 및 대체 노선 추천 어플리케이션
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