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
4 changes: 3 additions & 1 deletion src/main/java/B1G4/bookmark/repository/PlaceRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ Page<Place> findByBoundingBox(
"OR (LOWER(p.address) LIKE LOWER(CONCAT('%', :search, '%')))")
Page<Place> findByNameContainingOrAddressContaining(@Param("search") String search, PageRequest pageRequest);

Page<Place> findByMood1OrMood2(Mood mood1, Mood mood2, Pageable pageable);
@Query("SELECT p FROM Place p WHERE (p.mood1 = :mood OR p.mood2 = :mood) AND (p.mood1 IS NOT NULL AND p.mood2 IS NOT NULL)")
Page<Place> findByMood(Pageable pageable, @Param("mood") Mood mood);

}
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ public PlaceResponseDTO.PlacePreviewListDTO getRecommendedPlaces(Member member,
PageRequest pageable = PageRequest.of((page-1), 10);

// 사용자의 선호 분위기와 일치하는 장소를 조회
Page<Place> places = placeRepository.findByMood1OrMood2(member.getMood(), member.getMood(), pageable);

Page<Place> places = placeRepository.findByMood(pageable, member.getMood());
// `PlaceConverter`를 사용하여 `PlacePreviewListDTO`로 변환
return PlaceConverter.toPlacePreviewList(places, member, memberService, placeImgRepository);
}
Expand Down
Loading