Skip to content

Commit

Permalink
♻️ Refactor: 다른 수강생 커리큘럼 조회 쿼리 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
yxhwxn committed Jun 13, 2024
1 parent 24b8623 commit 3cda0aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public LectureResponseDTO.LectureDetailDto findLectureDetail(Integer lectureId)
*/
public LectureResponseDTO.OtherStudentsDto findOtherStudents() {

List<PlatformStudent> platformStudents = platformStudentRepository.findAllWithUdemyUserId();
List<PlatformStudent> platformStudents = platformStudentRepository.findTop1000ByUdemyUserIdIsNotNull();

// 가져온 데이터를 List로 변환
List<PlatformStudent> studentList = platformStudents.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import khu.bigdata.infou.domain.PlatformStudent;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PlatformStudentRepository extends JpaRepository<PlatformStudent, Long> {
@Query("SELECT p FROM PlatformStudent p WHERE p.udemyUserId IS NOT NULL")
List<PlatformStudent> findAllWithUdemyUserId();
// @Query("SELECT p FROM PlatformStudent p WHERE p.udemyUserId IS NOT NULL")
List<PlatformStudent> findTop1000ByUdemyUserIdIsNotNull();
}

0 comments on commit 3cda0aa

Please sign in to comment.