Skip to content

Commit

Permalink
fix : calender endDate->finishDate로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sycuuui committed Apr 9, 2024
1 parent 6113af4 commit f0192ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
public record ScrapPost(
long postId,
String title,
LocalDateTime endDate,
LocalDateTime finishDate,
Boolean postType
) {
public static ScrapPost of(Post post){
return new ScrapPost(post.getPostId(),post.getTitle(),post.getEndDate(),post.isPostType());
return new ScrapPost(post.getPostId(),post.getTitle(),post.getFinishDate(),post.isPostType());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
Post findByPostId(Long postId);

Optional<Post> findByPostIdAndDeletedAtIsNull(Long postId);
List<Post> findAllByEndDateBetweenAndPostIdIn(LocalDateTime endDate, LocalDateTime endDate2, List<Long> postIdList);
List<Post> findAllByFinishDateBetweenAndPostIdIn(LocalDateTime finishDate, LocalDateTime finishDate2, List<Long> postIdList);
/*
내가 모집 중인 공모전 공고 개수
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class CalendarService {
public CalendarRes findScrapPost(Member member, int year, int month){
List<PostScrap> postScraps = postScrapRepository.findByMemberAndScrapStatus(member,true);
List<Long> postIdList = postScraps.stream().map(postScrap -> postScrap.getPost().getPostId()).toList();
List<Post> posts = postRepository.findAllByEndDateBetweenAndPostIdIn(getFirstDayOfMonth(year,month),getLastDayOfMonth(year,month), postIdList);
List<Post> posts = postRepository.findAllByFinishDateBetweenAndPostIdIn(getFirstDayOfMonth(year,month),getLastDayOfMonth(year,month), postIdList);
List<ScrapPost> scrapPosts = posts.stream().map(ScrapPost::of)
.collect(Collectors.toList());
return CalendarRes.of(scrapPosts);
Expand Down

0 comments on commit f0192ff

Please sign in to comment.