Skip to content

Commit

Permalink
Merge branch 'common/dev/refactor-presentation-date#1691' of github.c…
Browse files Browse the repository at this point in the history
…om:innovationacademy-kr/Cabi into common/dev/refactor-presentation-date#1691
  • Loading branch information
chyo1 committed Oct 11, 2024
2 parents 8eda651 + c2d15f0 commit a32b7db
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@Transactional(readOnly = true)
public class PresentationService {

private static final Integer START_DAY = 1;
private static final Integer PRESENTATION_PERIOD = 3;
private static final Integer DEFAULT_PAGE = 0;
// 쿼리로 받?
private static final Integer MAX_MONTH = 3;
Expand Down Expand Up @@ -287,9 +287,10 @@ public List<LocalDateTime> getDummyPresentationFormsDate(LocalDate nowDate) {
}

public AbleDateResponseDto getAbleDate() {
LocalDateTime now = LocalDateTime.now();
LocalDateTime firstDateOfMonth = generateFirstLocalDateTime();
List<Presentation> dummyDates =
presentationQueryService.getDummyDateBetweenMonth(now, now.plusMonths(3));
presentationQueryService.getDummyDateBetweenMonth(firstDateOfMonth,
firstDateOfMonth.plusMonths(PRESENTATION_PERIOD));

List<LocalDateTime> result =
dummyDates.stream()
Expand All @@ -298,4 +299,12 @@ public AbleDateResponseDto getAbleDate() {

return new AbleDateResponseDto(result);
}

private LocalDateTime generateFirstLocalDateTime() {
return LocalDateTime.now()
.withDayOfMonth(1)
.withHour(0)
.withMinute(0)
.withSecond(0);
}
}

0 comments on commit a32b7db

Please sign in to comment.