-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from wafflestudio/feat/feed
"내 동네생활 > 댓글 단 글" 에서 피드 목록을 불러오지 않던 문제를 수정하였음.
- Loading branch information
Showing
5 changed files
with
32 additions
and
43 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
17 changes: 1 addition & 16 deletions
17
src/main/kotlin/com/toyProject7/karrot/comment/persistence/CommentRepository.kt
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,22 +1,7 @@ | ||
package com.toyProject7.karrot.comment.persistence | ||
|
||
import com.toyProject7.karrot.feed.persistence.FeedEntity | ||
import com.toyProject7.karrot.user.persistence.UserEntity | ||
import org.springframework.data.jpa.repository.JpaRepository | ||
import org.springframework.data.jpa.repository.Query | ||
import org.springframework.data.repository.query.Param | ||
|
||
interface CommentRepository : JpaRepository<CommentEntity, Long> { | ||
@Query( | ||
""" | ||
SELECT DISTINCT c.feed | ||
FROM comments c | ||
WHERE c.user = :user AND c.feed.id < :feedId | ||
ORDER BY c.feed.id DESC | ||
""", | ||
) | ||
fun findFeedsByUserComments( | ||
@Param("user") user: UserEntity, | ||
@Param("feedId") feedId: Long, | ||
): List<FeedEntity> | ||
fun findByUserId(userId: String): List<CommentEntity> | ||
} |
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