-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPostRepository.java
More file actions
38 lines (23 loc) · 1.17 KB
/
PostRepository.java
File metadata and controls
38 lines (23 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.chooz.post.domain;
import com.chooz.post.application.dto.FeedDto;
import com.chooz.post.application.dto.PostWithVoteCount;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
@Repository
public interface PostRepository {
Optional<Post> findById(Long postId);
Post save(Post post);
Slice<Post> findAllByUserId(Long userId, Long postId, Pageable pageable);
Optional<Post> findByIdFetchPollChoices(Long postId);
Optional<Post> findByIdFetchPollChoicesWithLock(Long postId);
Slice<FeedDto> findFeed(Long postId, Pageable pageable);
Optional<Post> findByShareUrlFetchPollChoices(String shareUrl);
List<Post> findPostsNeedToClose();
Optional<CommentActive> findCommentActiveByPostId(Long postId);
Slice<PostWithVoteCount> findPostsWithVoteCountByUserId(Long userId, Long authorId, Long postId, Pageable pageable);
Slice<PostWithVoteCount> findVotedPostsWithVoteCount(Long userId, Long authorId, Long postId, Pageable pageable);
Optional<Post> findByIdAndUserId(Long postId, Long userId);
}