-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from uswLectureEvaluation/feat/lecture
시간표 생성시 현재 학기 강의 검색
- Loading branch information
Showing
25 changed files
with
731 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/usw/suwiki/domain/lecture/controller/dto/LectureWithScheduleResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package usw.suwiki.domain.lecture.controller.dto; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import usw.suwiki.domain.lecture.domain.Lecture; | ||
|
||
@Getter | ||
@Builder | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class LectureWithScheduleResponse { | ||
private long id; | ||
private String name; | ||
private String type; | ||
private String major; | ||
private int grade; | ||
private String professorName; | ||
|
||
private final List<OriginalLectureCellResponse> originalCellList = new ArrayList<>(); | ||
|
||
public static LectureWithScheduleResponse of( | ||
Lecture lecture | ||
) { | ||
return LectureWithScheduleResponse.builder() | ||
.id(lecture.getId()) | ||
.name(lecture.getName()) | ||
.professorName(lecture.getProfessor()) | ||
.type(lecture.getType()) | ||
.major(lecture.getMajorType()) | ||
.grade(lecture.getLectureDetail().getGrade()) | ||
.build(); | ||
} | ||
|
||
public void addOriginalCellResponse(OriginalLectureCellResponse cellResponse) { | ||
this.originalCellList.add(cellResponse); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/usw/suwiki/domain/lecture/controller/dto/OriginalLectureCellResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package usw.suwiki.domain.lecture.controller.dto; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import usw.suwiki.domain.timetable.entity.TimetableCellSchedule; | ||
|
||
@Builder | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Getter | ||
public class OriginalLectureCellResponse { | ||
private String location; | ||
private String day; | ||
private Integer startPeriod; | ||
private Integer endPeriod; | ||
|
||
public static OriginalLectureCellResponse of(TimetableCellSchedule schedule) { | ||
return OriginalLectureCellResponse.builder() | ||
.location(schedule.getLocation()) | ||
.day(schedule.getDay().getValue()) | ||
.startPeriod(schedule.getStartPeriod()) | ||
.endPeriod(schedule.getEndPeriod()) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 15 additions & 6 deletions
21
...in/repository/LectureQueryRepository.java → ...n/repository/LectureCustomRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
package usw.suwiki.domain.lecture.domain.repository; | ||
|
||
import org.springframework.data.jpa.repository.Query; | ||
import java.util.List; | ||
import org.springframework.data.domain.Slice; | ||
import usw.suwiki.domain.lecture.controller.dto.LectureFindOption; | ||
import usw.suwiki.domain.lecture.domain.Lecture; | ||
import usw.suwiki.domain.lecture.domain.repository.dao.LecturesAndCountDao; | ||
|
||
import java.util.List; | ||
|
||
public interface LectureCustomRepository { | ||
Slice<Lecture> findCurrentSemesterLectures( | ||
final Long cursorId, | ||
final int limit, | ||
final String keyword, | ||
final String majorType, | ||
final Integer grade | ||
); | ||
|
||
public interface LectureQueryRepository { | ||
// | ||
Lecture verifyJsonLecture(String lectureName, String ProfessorName, String majorType); | ||
// | ||
|
||
List<String> findAllMajorType(); | ||
// | ||
|
||
LecturesAndCountDao findLectureByFindOption(String searchValue, LectureFindOption lectureFindOption); | ||
|
||
LecturesAndCountDao findLectureByMajorType(String searchValue, LectureFindOption lectureFindOption); | ||
|
||
LecturesAndCountDao findAllLectureByFindOption(LectureFindOption lectureFindOption); | ||
|
||
LecturesAndCountDao findAllLectureByMajorType(LectureFindOption lectureFindOption); | ||
} |
Oops, something went wrong.