Skip to content

Commit

Permalink
feat: 이수 구분 반환값 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Soundbar91 committed Dec 18, 2024
1 parent 2b7fc15 commit 2af5b15
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;

import in.koreatech.koin.domain.graduation.model.CourseType;
import in.koreatech.koin.domain.timetable.model.Lecture;
import in.koreatech.koin.domain.timetableV2.exception.TimetableLectureClassTimeNullException;
import in.koreatech.koin.domain.timetableV2.model.TimetableFrame;
Expand Down Expand Up @@ -91,11 +92,13 @@ public TimetableLecture toTimetableLecture(TimetableFrame timetableFrame) {
memo,
false,
null,
timetableFrame
timetableFrame,
null
);
}

public TimetableLecture toTimetableLecture(TimetableFrame timetableFrame, Lecture lecture) {
public TimetableLecture toTimetableLecture(TimetableFrame timetableFrame, Lecture lecture,
CourseType courseType) {
return new TimetableLecture(
classTitle,
getClassTimeToString(),
Expand All @@ -105,7 +108,8 @@ public TimetableLecture toTimetableLecture(TimetableFrame timetableFrame, Lectur
memo,
false,
lecture,
timetableFrame
timetableFrame,
courseType
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ public record InnerTimetableLectureResponse(
String professor,

@Schema(description = "학부", example = "디자인ㆍ건축공학부", requiredMode = NOT_REQUIRED)
String department
String department,

@Schema(description = "이수 구분", example = "전공필수", requiredMode = NOT_REQUIRED)
String courseType
) {
@JsonNaming(value = SnakeCaseStrategy.class)
public record ClassInfo(
Expand Down Expand Up @@ -156,6 +159,7 @@ public static List<InnerTimetableLectureResponse> from(List<TimetableLecture> ti
null,
null,
timetableLecture.getProfessor(),
null,
null
);
} else {
Expand All @@ -172,7 +176,8 @@ public static List<InnerTimetableLectureResponse> from(List<TimetableLecture> ti
lecture.getLectureClass(),
lecture.getTarget(),
getProfessor(timetableLecture, lecture),
lecture.getDepartment()
lecture.getDepartment(),
timetableLecture.getCourseType().getName()
);
}
timetableLectureList.add(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.hibernate.annotations.Where;

import in.koreatech.koin.domain.graduation.model.CourseType;
import in.koreatech.koin.domain.timetable.dto.TimetableUpdateRequest;
import in.koreatech.koin.domain.timetable.model.Lecture;
import in.koreatech.koin.global.domain.BaseEntity;
Expand Down Expand Up @@ -71,9 +72,14 @@ public class TimetableLecture extends BaseEntity {
@JoinColumn(name = "frame_id")
private TimetableFrame timetableFrame;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "course_type_id")
private CourseType courseType;

@Builder
public TimetableLecture(String classTitle, String classTime, String classPlace, String professor,
String grades, String memo, boolean isDeleted, Lecture lecture, TimetableFrame timetableFrame) {
String grades, String memo, boolean isDeleted, Lecture lecture, TimetableFrame timetableFrame,
CourseType courseType) {
this.classTitle = classTitle;
this.classTime = classTime;
this.classPlace = classPlace;
Expand All @@ -83,6 +89,7 @@ public TimetableLecture(String classTitle, String classTime, String classPlace,
this.isDeleted = isDeleted;
this.lecture = lecture;
this.timetableFrame = timetableFrame;
this.courseType = courseType;
}

public void update(
Expand Down

0 comments on commit 2af5b15

Please sign in to comment.