-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] 메인 다가올 일정(1개) 조회 API - #58 #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다!!1
@@ -10,7 +10,7 @@ public record DateCreateReq( | |||
String title, | |||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy.MM.dd", timezone = "Asia/Seoul") | |||
LocalDate date, | |||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm", timezone = "Asia/Seoul") | |||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "hh:mm a", timezone = "Asia/Seoul") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
date에서 a값도 불필요하게 받아야 하는것 같습니다!
a를 빼주셔도 좋을 것 같아요!
String dateName, | ||
int month, | ||
int day, | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "hh:mm a", timezone = "Asia/Seoul") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 a를 안받아주셔도 12:00 이렇게 매핑될 것 같습니다!
@@ -10,7 +10,7 @@ public record DateCreateReq( | |||
String title, | |||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy.MM.dd", timezone = "Asia/Seoul") | |||
LocalDate date, | |||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "hh:mm a", timezone = "Asia/Seoul") | |||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm", timezone = "Asia/Seoul") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엇 빼셨군요? 순서대로 읽다보니 못봤습니다 ㅎㅅㅎ..!
굿! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ㅋㅋㅋㅋㅋㅋㅋ굿!
Optional<Date> findFirstByUserIdAndDateAfterOrDateAndStartAtAfterOrderByDateAscStartAtAsc( | ||
Long userId, LocalDate currentDate, LocalDate sameDay, LocalTime currentTime); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JPA 응용 좋아요 ! 👍
private int calculateDDay(LocalDate eventDate, LocalDate currentDate) { | ||
if (eventDate.isEqual(currentDate)) { | ||
return 0; | ||
} else { | ||
return (int) ChronoUnit.DAYS.between(currentDate, eventDate); | ||
} | ||
} | ||
|
||
//가장 가까운 데이트 가져오기 | ||
private Date findNearestDate(final Long userId, final LocalDate now) { | ||
return dateRepository.findTopByUserIdAndDateAfterOrderByDateAscStartAtAsc(userId, now) | ||
.orElseThrow(() -> new EntityNotFoundException(FailureCode.NEAREST_DATE_NOT_FOUND)); | ||
private Date findNearestDate(Long userId, LocalDate currentDate, LocalTime currentTime) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
혹시 final 키워드 붙여주시면 감사하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다~!
# Conflicts: # dateroad-api/src/main/java/org/dateroad/date/api/DateController.java # dateroad-api/src/main/java/org/dateroad/date/service/DateRepository.java # dateroad-api/src/main/java/org/dateroad/date/service/DateService.java # dateroad-common/src/main/java/org/dateroad/code/FailureCode.java
🔥Pull requests
⛳️ 작업한 브랜치
👷 작업한 내용
📟 관련 이슈