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
3 changes: 3 additions & 0 deletions src/main/java/com/example/enjoy/dto/CourseDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ public class CourseDto {

private String courseName; // 현재 과목명
private String courseAlias; // 과거 과목명 (없으면 null)
private String courseCode;
private String academicYear;
private String academicSemester;
}
8 changes: 4 additions & 4 deletions src/main/java/com/example/enjoy/service/TrackService.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.example.enjoy.service;

import ch.qos.logback.core.joran.sanity.Pair;
import com.example.enjoy.dto.CourseDto;
import com.example.enjoy.dto.CourseStatusDto;
import com.example.enjoy.dto.TrackDetailDto;
Expand Down Expand Up @@ -29,7 +28,8 @@ public class TrackService {

private final TrackRepository trackRepository;
private final StudentCourseRepository studentCourseRepository;

private final UserRepository userRepository;
private final FavoriteCourseRepository favoriteCourseRepository;

//진척률 계산
public List<TrackProgressDto> calculateTrackProgress(String studentId) {
Expand All @@ -44,7 +44,8 @@ public List<TrackProgressDto> calculateTrackProgress(String studentId) {
List<CourseDto> remaining = new ArrayList<>();

for (TrackCourse course : courses) {
CourseDto dto = new CourseDto(course.getCourseName(), course.getCourseAlias());
CourseDto dto = new CourseDto(course.getCourseName(), course.getCourseAlias(),
course.getCourseCode(), course.getAcademicYear(), course.getAcademicSemester());
if (isCourseCompleted(course, completedCourseNames)) {
completed.add(dto);
} else {
Expand Down Expand Up @@ -84,7 +85,6 @@ public TrackDetailDto getTrackDetails(String studentId, String trackName) {
// 4. [수정] DTO 객체 생성 및 실제 필드에 맞게 데이터 세팅
CourseStatusDto dto = new CourseStatusDto();
dto.setTitle(trackCourse.getCourseName());
// (TrackCourse 엔티티에 getCourseCode, getYear, getSemester가 있다고 가정합니다)
dto.setCode(trackCourse.getCourseCode());
dto.setYear(trackCourse.getAcademicYear());
dto.setSemester(trackCourse.getAcademicSemester());
Expand Down
Loading