Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 버스 교통편 조회 대성 시간표 오류 수정 #1139

Merged
merged 1 commit into from
Dec 16, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public final class ExpressBusSchedule {
LocalTime.of(22, 5)
);

public static List<LocalTime> getExpressBusScheduleToKoreaTech() {
public static List<LocalTime> TerminalToKoreaTech() {
return KOREA_TECH_SCHEDULE;
}

public static List<LocalTime> getExpressBusScheduleToTerminal() {
public static List<LocalTime> KoreaTechToTerminal() {
return TERMINAL_SCHEDULE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ExpressBusRouteStrategy implements BusRouteStrategy {

@Override
public List<ScheduleInfo> findSchedule(BusRouteCommand command) {
if(validCourse(command.depart(), command.arrive())) return Collections.emptyList();
if(validRoute(command.depart(), command.arrive())) return Collections.emptyList();
BusDirection direction = getRouteDirection(command.depart(), command.arrive());

return getStaticExpressBusScheduleTimeList(direction).stream()
Expand All @@ -36,8 +36,8 @@ public boolean support(BusRouteType type) {

private List<LocalTime> getStaticExpressBusScheduleTimeList(BusDirection direction) {
return switch (direction) {
case NORTH -> ExpressBusSchedule.getExpressBusScheduleToKoreaTech();
case SOUTH -> ExpressBusSchedule.getExpressBusScheduleToTerminal();
case NORTH -> ExpressBusSchedule.KoreaTechToTerminal();
case SOUTH -> ExpressBusSchedule.TerminalToKoreaTech();
};
}

Expand All @@ -46,7 +46,7 @@ private BusDirection getRouteDirection(BusStation depart, BusStation arrive) {
? BusDirection.NORTH : BusDirection.SOUTH;
}

private boolean validCourse(BusStation depart, BusStation arrive) {
private boolean validRoute(BusStation depart, BusStation arrive) {
return (depart == BusStation.STATION || arrive == BusStation.STATION);
}
}
Loading