-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: SuccessResponse 적용, 페이징 처리 (#5)
- Loading branch information
Showing
3 changed files
with
48 additions
and
42 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
18 changes: 0 additions & 18 deletions
18
src/main/java/com/api/TaveShot/domain/Comment/domain/CommentRepository.java
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
src/main/java/com/api/TaveShot/domain/Comment/repository/CommentRepository.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.api.TaveShot.domain.Comment.repository; | ||
|
||
import com.api.TaveShot.domain.Comment.domain.Comment; | ||
import com.api.TaveShot.domain.Post.domain.Post; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public interface CommentRepository extends JpaRepository<Comment,Long> { | ||
/* 게시글 댓글 목록 가져오기 */ | ||
List<Comment> getCommentByPost(Post post); | ||
|
||
List<Comment> findByParentCommentIsNull(Post post); | ||
|
||
List<Comment> findByParentComment(Comment parentComment); | ||
|
||
Optional<Comment> findByPostIdAndId(Long postId, Long commentId); | ||
|
||
Page<Comment> findByParentCommentIsNull(Post post, Pageable pageable); | ||
} |