-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] 여행 후기 리뷰 작성 가능한 여부를 boolean 값(myRatingScore)으로 반환하는 기능 구현
- Loading branch information
1 parent
059d303
commit ad7dc54
Showing
4 changed files
with
42 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
src/main/java/com/haejwo/tripcometrue/domain/tripplan/repository/TripPlanRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
package com.haejwo.tripcometrue.domain.tripplan.repository; | ||
|
||
import com.haejwo.tripcometrue.domain.member.entity.Member; | ||
import com.haejwo.tripcometrue.domain.tripplan.entity.TripPlan; | ||
import java.util.List; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
import java.util.Optional; | ||
|
||
public interface TripPlanRepository extends JpaRepository<TripPlan, Long> { | ||
|
||
Page<TripPlan> findByMemberId(Long memberId, Pageable pageable); | ||
|
||
@Query("select tp from TripPlan tp where tp.member = :member and tp.referencedBy = :tripRecordId order by tp.tripEndDay asc limit 1") | ||
Optional<TripPlan> findByMemberIdAndTripRecordId(@Param("member") Member loginMember, @Param("tripRecordId") Long tripRecordId); | ||
} |