-
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
[♻️ refactor/#96] 스크랩 관련 API -> path variable 수정 및 color enum 필드 수정 #125
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.
기존에 scrapId로 데이터를 검색한 부분들을 InternshipAnnouncementId + userId로 받아오도록 수정되었네요!
기존 코드의 통일성을 해치지 않도록 수정한 좋은 리펙토링인 것 같습니다!
고생하셨어요:)
private Color findColor(String color) { | ||
return Arrays.stream(Color.values()) | ||
.filter(c-> c.getKey() == color) | ||
.filter(c-> c.getName().equals(color)) | ||
.findAny().get(); | ||
} | ||
|
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.
- .findAny().get() 을 사용하는 경우, Invalid한 color값이 요청으로 들어오면 오류가 발생할 수 있어 이부분에 대한 예외처리가 있으면 좋을 것 같습니다..!
- 색상 변경은 빈번하게 일어나는 기능이라고 생각이 드는데, Color.values()를 매번 순회하는 대신, Map을 사용해 캐싱을 하는 방식도 생각해보면 좋을 것 같아요!
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번에 대해서는
request dto
에서 유효성 검증을 하면 좋을 것 같다는 생각인데요!
저희가 아직validation exception
을GlobalExceptionHandler
에서 전역적으로 처리하지 않고 있어서 추후에 해당 처리가 된 후에 바로 적용하겠습니다!👉더 좋은 의견있다면 달아주세요 ㅎㅎ
-
2번은 저도 생각못했는데 한 번 찾아보고 적용해볼게요 감사합니다!
전체적으로 코드가 깔끔하게 리팩토링된 것 같습니다. 수고하셨습니다. |
📄 Work Description
⚙️ ISSUE
📷 Screenshot
- 스크랩 추가
💬 To Reviewers
리팩할 부분이나 보완할 부분은 편하게 코리 달아주세요~!
🔗 Reference
문제를 해결하면서 도움이 되었거나, 참고했던 사이트(코드링크)