-
Notifications
You must be signed in to change notification settings - Fork 0
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
[fix] #243 - 공연 생성 및 수정 시 performancePeriod, scheduleNumber 부여 로직 추가 #244
Conversation
…ncePeriod, assignScheduleNumbers 하도록 수정
…iod, assignScheduleNumbers 하도록 수정
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.
고생하셨습니다 혜린님!
리뷰내용 반영하고 develop에 머지한 후 prod에 v1.1.1
로 배포하면 될 것 같습니다
@@ -79,7 +79,7 @@ public PerformanceResponse createPerformance(Long memberId, PerformanceRequest r | |||
request.performanceTeamName(), | |||
request.performanceVenue(), | |||
request.performanceContact(), | |||
request.performancePeriod(), | |||
" ", |
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.
1차 스프린트에 해당되는 내용이라 우선 dto 변경없이 하되, 2차 스프린트에 반영하도록 하겠습니다! 주석으로도 남겨두겠습니다.
if (startDate.toLocalDate().equals(endDate.toLocalDate())) { | ||
return startDate.toLocalDate().toString().replace("-", "."); | ||
} else { | ||
return startDate.toLocalDate().toString().replace("-", ".") | ||
+ "~" + endDate.toLocalDate().toString().replace("-", "."); | ||
} | ||
} |
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.
얼리 리턴으로 바꾸면, indent 1을 줄일 수 있을 것 같습니다!!
for (int i = 0; i < schedules.size(); i++) { | ||
ScheduleNumber scheduleNumber = ScheduleNumber.values()[i]; | ||
schedules.get(i).setScheduleNumber(scheduleNumber); | ||
} | ||
} |
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.
이 부분도 배열을 사용하는 것 보다 컬렉션(LIst)자료형을 사용하는게 나을 것 같아요!
(우테코 피드백 중 하나: 배열을 사용을 지양하고 컬렉션을 사용하라)
public void assignScheduleNumbers(List<Schedule> schedules) {
List<ScheduleNumber> scheduleNumbers = List.of(ScheduleNumber.values());
schedules.sort(Comparator.comparing(Schedule::getPerformanceDate));
for (int i = 0; i < schedules.size(); i++) {
if (i < scheduleNumbers.size()) {
schedules.get(i).setScheduleNumber(scheduleNumbers.get(i));
}
}
}
이렇게 코드를 짜봤는데, 로컬환경에서 한 번 더 돌려보셔서 제대로 작동하는 지 봐주시면 감사할 것 같아요!
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.
배열 사용 지양하는 것이 좋군요! 배워갑니다 :)
로컬 테스트 결과 코드 이상 없습니다!
@@ -8,22 +8,25 @@ | |||
@Getter | |||
@RequiredArgsConstructor | |||
public enum PerformanceErrorCode implements BaseErrorCode { |
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.
저는 지금 보니 ErrorCode를 관리할 때 주석을 다는게 좋아보이네요! (가독성)
/* 400 BadRequest */
MESSAGE()
이제부터 적용하는거에 대해서는 어떻게 생각하시나요?
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.
좋습니다! 모든 코드에 적용하겠습니다~
Related issue 🛠
Work Description ✏️
Trouble Shooting ⚽️
Related ScreenShot 📷
공연 생성
공연 수정
Uncompleted Tasks 😅
To Reviewers 📢