Skip to content

Commit

Permalink
refactor: 가능시간 조회 기간 2주로 설정 (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxdjww authored Nov 6, 2024
1 parent cd4739e commit 4b7ba7d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static com.soongsil.CoffeeChat.controller.exception.enums.UserErrorCode.*;

import java.time.LocalDate;
import java.util.List;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -64,8 +65,13 @@ public List<PossibleDateCreateGetResponseDto> updatePossibleDate(List<PossibleDa
}

public List<PossibleDateCreateGetResponseDto> findPossibleDateListByMentor(Long mentorId) {
// 2주로 설정
LocalDate today = LocalDate.now();
LocalDate twoWeeksLater = today.plusWeeks(2);

return possibleDateRepository.getPossibleDatesByMentorId(mentorId)
.stream()
.filter(possibleDate -> !possibleDate.getDate().isBefore(today) && !possibleDate.getDate().isAfter(twoWeeksLater))
.map(possibleDate -> PossibleDateCreateGetResponseDto.builder()
.date(possibleDate.getDate())
.startTime(possibleDate.getStartTime())
Expand Down

0 comments on commit 4b7ba7d

Please sign in to comment.