Merged
Conversation
Comment on lines
+418
to
+424
| TreeSet<Integer> writtenRecordDays = new TreeSet<>(); | ||
| writtenRecordDays.addAll( | ||
| recordRepository.findAllByWriterAndCreatedAtBetween(member, start, end) | ||
| .stream().map( | ||
| record -> record.getCreatedAt().getDayOfMonth() | ||
| ).collect(Collectors.toSet()) | ||
| ); |
Contributor
There was a problem hiding this comment.
Suggested change
| TreeSet<Integer> writtenRecordDays = new TreeSet<>(); | |
| writtenRecordDays.addAll( | |
| recordRepository.findAllByWriterAndCreatedAtBetween(member, start, end) | |
| .stream().map( | |
| record -> record.getCreatedAt().getDayOfMonth() | |
| ).collect(Collectors.toSet()) | |
| ); | |
| TreeSet<Integer> writtenRecordDays = recordRepository.findAllByWriterAndCreatedAtBetween(member, start, end) | |
| .stream() | |
| .map(record -> record.getCreatedAt().getDayOfMonth()) | |
| .collect(Collectors.toCollection(TreeSet::new)); |
요렇게 줄일 수 있을 거 같네용
Comment on lines
+409
to
+416
| LocalDate standardDate = LocalDate.of( | ||
| writtenRecordDayRequestDto.getYearMonth().getYear(), | ||
| writtenRecordDayRequestDto.getYearMonth().getMonth(), | ||
| 1 | ||
| ); | ||
|
|
||
| LocalDateTime start = getStartOfDay(standardDate.withDayOfMonth(1)); | ||
| LocalDateTime end = getEndOfDay(standardDate.withDayOfMonth(standardDate.lengthOfMonth())); |
Contributor
There was a problem hiding this comment.
이 부분을 DateTimeUtil에 메소드를 정의해서 빼는 방법으로 가면 좋을거 같네요
Jaeyeop-Jung
approved these changes
Feb 14, 2023
- WrittenRecordDayRequestDto.java 파일 필드 값 YearMonth에서 LocalDateTime으로 통일 하였습니다 - RecordController.java 파일 getWrittenRecordDays 메서드 반환 값 Set<Integer>에서 WrittenRecordDayResponseDto로 변경하였습니다
LocalDateTime 필드에 `@DateTimeFormat(pattern = "yyyy-MM")`을 활용하여 yyyy-MM 형식으로 받아보려고 하였으나 IllegalArgumentException 발생하여 YearMonth로 다시 변경하였습니다. ErrorMessage: Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDateTime'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 이슈 번호
설명
달력 버튼을 클릭 했을 때 로그인 된 사용자의 레코드 쓴 날짜를 반환해주는 API 입니다.
입력받은 년도와 월의 1일 부터 ~ 입력받은 년도와 월의 마지막일까지 between으로 처리하였습니다
변경사항
질문사항