Skip to content

Commit

Permalink
#30 fix: 재지원 탐색 메소드, 지원기간 판단 메소드
Browse files Browse the repository at this point in the history
  • Loading branch information
sycuuui committed Jan 31, 2024
1 parent 5c99ce1 commit 17d7fcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
public interface ApplyRepository extends JpaRepository<Apply,Long> {
long countApplyByPost(Post post);
List<Apply> findAllByPost(Post post);
List<Apply> findAllByMemberAndPost(Member member, Post post);
boolean existsApplyByMemberAndPost(Member member,Post post);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public Apply save(Member member, Long post_id, ApplyReq req){
throw new ApplicationException(ErrorCode.NOT_FOUND_POST_EXCEPTION);
}else {
//재지원 판단
if(applyRepository.findAllByMemberAndPost(member, post)==null){
if(!applyRepository.existsApplyByMemberAndPost(member, post)){
//지원 기간인지 판단
if(post.getEndDate().isAfter(LocalDateTime.now())){
if(post.getEndDate().isBefore(LocalDateTime.now())){
throw new ApplicationException(ErrorCode.NOT_APPLY_EXCEPTION);
}else {
Apply apply = req.toEntity(member, post);
Expand Down

0 comments on commit 17d7fcd

Please sign in to comment.