Skip to content

Commit

Permalink
Merge pull request #39 from rework-kr/Bugfix/38-dailyagenda
Browse files Browse the repository at this point in the history
FIX:: dailyagenda 조건추가
  • Loading branch information
OneK-2 authored Jul 5, 2024
2 parents 2251eb5 + 856d92b commit a65af4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public CreateDailyAgendaResponseDto createDailyAgenda(CreateDailyAgendaRequestDt
LocalDateTime startOfDay = createDailyAgendaRequestDto.getCreatedAt().atStartOfDay();
LocalDateTime endOfDay = createDailyAgendaRequestDto.getCreatedAt().atTime(LocalTime.MAX);

if (dailyAgendaRepository.existsByPagingIdAndCreatedAtBetween(createDailyAgendaRequestDto.getPagingId(), startOfDay, endOfDay)) {
if (dailyAgendaRepository.existsByMemberIdAndPagingIdAndCreatedAtBetween(currentUserId,createDailyAgendaRequestDto.getPagingId(), startOfDay, endOfDay)) {
throw new AlreadyPagingIdException("이미 등록된 페이징번호입니다");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ public interface DailyAgendaRepository extends JpaRepository<DailyAgenda, Long>

Optional<DailyAgenda> findByPagingIdAndCreatedAtBetween(Long pagingId, LocalDateTime start, LocalDateTime end);

boolean existsByPagingIdAndCreatedAtBetween(Long pagingId, LocalDateTime startOfDay, LocalDateTime endOfDay);
boolean existsByMemberIdAndPagingIdAndCreatedAtBetween(Long memberId, Long pagingId, LocalDateTime createdAt, LocalDateTime createdAt2);
}

0 comments on commit a65af4d

Please sign in to comment.