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: timetableLecture 오류 수정 #1096

Merged
merged 14 commits into from
Nov 28, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import in.koreatech.koin.domain.timetableV2.model.TimetableFrame;
import in.koreatech.koin.domain.timetableV2.model.TimetableLecture;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;

@JsonNaming(value = SnakeCaseStrategy.class)
public record TimetableLectureResponse(
Expand Down Expand Up @@ -98,11 +97,15 @@ public static List<ClassInfo> of(String classTime, String classPlace) {
int parseInt = Integer.parseInt(segment);
if (parseInt == -1) {
if (!currentTimes.isEmpty()) {
classInfos.add(new ClassInfo(new ArrayList<>(currentTimes), classPlaceSegment[index++]));
if (classPlaceSegment.length <= index + 1) {
classInfos.add(new ClassInfo(new ArrayList<>(currentTimes), ""));
} else {
classInfos.add(
new ClassInfo(new ArrayList<>(currentTimes), classPlaceSegment[index++]));
}
currentTimes.clear();
}
}
else {
} else {
currentTimes.add(parseInt);
}
}
Expand All @@ -115,7 +118,8 @@ public static List<ClassInfo> of(String classTime, String classPlace) {
}

private static List<Integer> parseClassTimes(String classTime) {
if (classTime == null) return null;
if (classTime == null)
return null;

String classTimeWithoutBrackets = classTime.substring(INITIAL_BRACE_INDEX, classTime.length() - 1);
return Arrays.stream(classTimeWithoutBrackets.split(SEPARATOR))
Expand Down
Loading