diff --git a/.github/workflows/CICD-main.yml b/.github/workflows/CICD-main.yml index 2a210631..a4ec2608 100644 --- a/.github/workflows/CICD-main.yml +++ b/.github/workflows/CICD-main.yml @@ -1,4 +1,4 @@ -name: CICD +name: CICD-MAIN on: push: diff --git a/dateroad-api/src/main/java/org/dateroad/course/service/CourseService.java b/dateroad-api/src/main/java/org/dateroad/course/service/CourseService.java index d5251444..9c8a3596 100644 --- a/dateroad-api/src/main/java/org/dateroad/course/service/CourseService.java +++ b/dateroad-api/src/main/java/org/dateroad/course/service/CourseService.java @@ -42,6 +42,7 @@ import org.springframework.context.ApplicationEventPublisher; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -270,7 +271,7 @@ public CourseGetDetailRes getCourseDetail(final Long userId, final Long courseId imageList.getSequence()) ).toList(); - List foundCoursePlaces = coursePlaceRepository.findAllCoursePlacesByCourseId(foundCourse.getId()); + List foundCoursePlaces = coursePlaceRepository.findAllCoursePlacesByCourseId(foundCourse.getId(), Sort.by(Sort.Direction.ASC, "sequence")); validateCoursePlace(foundCoursePlaces); List places = foundCoursePlaces.stream() diff --git a/dateroad-domain/src/main/java/org/dateroad/place/repository/CoursePlaceRepository.java b/dateroad-domain/src/main/java/org/dateroad/place/repository/CoursePlaceRepository.java index e8c89bb8..5f493321 100644 --- a/dateroad-domain/src/main/java/org/dateroad/place/repository/CoursePlaceRepository.java +++ b/dateroad-domain/src/main/java/org/dateroad/place/repository/CoursePlaceRepository.java @@ -2,6 +2,7 @@ import java.util.List; import org.dateroad.place.domain.CoursePlace; +import org.springframework.data.domain.Sort; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; @@ -14,7 +15,7 @@ public interface CoursePlaceRepository extends JpaRepository { @Query("SELECT SUM(p.duration) FROM CoursePlace p WHERE p.course.id = :courseId") Integer findTotalDurationByCourseId(@Param("courseId") Long courseId); - List findAllCoursePlacesByCourseId(Long courseId); + List findAllCoursePlacesByCourseId(Long courseId, Sort sort); @Modifying @Transactional