Skip to content

Commit

Permalink
fix [#109] 지난 페스티벌을 제외하고 타임테이블에 추가된 페스티벌을 조회하는 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1hyun committed Jan 18, 2025
1 parent 51f0d4a commit 793cfb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class TimetableFestivalService {

@Transactional(readOnly = true)
public List<TimetableFestival> getFetivalList(long userId){
return timetableFestivalRepository.findByUserId(userId);
return timetableFestivalRepository.findByUserIdWhereEndAtLENow(userId);
}

@Transactional(readOnly = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package org.sopt.confeti.domain.timetablefestival.infra.repository;

import java.time.LocalDate;
import org.sopt.confeti.domain.timetablefestival.TimetableFestival;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface TimetableFestivalRepository extends JpaRepository<TimetableFestival, Long> {
List<TimetableFestival> findByUserId(Long userId);
@Query("select tf from TimetableFestival tf join fetch tf.festival f where tf.user.id = :userId and f.festivalEndAt <= CURRENT_DATE")
List<TimetableFestival> findByUserIdWhereEndAtLENow(@Param("userId") Long userId);

boolean existsByUserIdAndFestivalId(final long userId, final long festivalId);

Expand Down

0 comments on commit 793cfb2

Please sign in to comment.