-
Notifications
You must be signed in to change notification settings - Fork 2
[feature] 외부 지원서 링크를 추가할 수 있게한다 -BE #882
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
[feature] 외부 지원서 링크를 추가할 수 있게한다 -BE #882
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded@lepitaaar has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 11 minutes and 18 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (10)
Warning
|
Test Results68 tests 65 ✅ 14s ⏱️ Results for commit 042940a. ♻️ This comment has been updated with latest results. |
seongwon030
left a comment
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.
고생하셨습니당 슬쩍 리뷰해봤어요
|
|
||
| public void updateExternalApplicationUrl(String externalApplicationUrl) { | ||
| boolean allowed = Arrays.stream(externalApplicationUrlAllowed) | ||
| .anyMatch(externalApplicationUrl::startsWith); |
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.
startsWith 보단 hostname으로 비교하는 건 어떨까요 ?
추가로 Array로 순회하는건 현재는 괜찮을 것 같은데 추후 성능 문제를 고려해봐도 좋을 부분인 것 같습니다.
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.
허용하는 호스트가 많지않아서 성능적인 문제가 생길꺼라 생각이 들진않았습니다!. 만약 Array를 순환하는 구조가 아니면 어떻게 구현할 수 있을까요?
또한 url에서 hostname을 어떻게 추출할 수 있을지도 같이생각해보면 좋을꺼같네요!
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.
생각해보니 배열 순회 이외엔 최적화할 부분이 필요한가 하는 생각이 드네요.. 가장 실용적인 방법 같아서 따로 변경할 필요는 없을 것 같습니다.
hostname은 /나 ?로 끝나는지 정규식으로 검사하는 방법이 있을 것 같아요.
| Set<ClubApplyQuestion.QuestionItem> distinctQuestionItemList = new HashSet<>(question.items()); | ||
| if (distinctQuestionItemList.size() != question.items().size()) throw new RestApiException(ErrorCode.DUPLICATE_QUESTIONS_ITEMS); |
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.
JS에선 중복요소 없앨 때 set을 쓰는데 java에서 쓰는 HashSet은 어떤 차이가 있나요
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.
단순히 HashSet은 java내에서 Set 자료형을 기능을 구현한 구현체입니다. JS와 Java모두 기본적으로 hash table 기반이라 기능적인 차이는없습니다~
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.
둘 다 비슷하군여 감사합니다
alsdddk
left a comment
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.
수고하셨습니다!!
@AssertTrue 활용한 부분 정말 좋은 것 같아요.
외부 지원서 형식 검증이 강화돼서 전체 서비스 품질도 더 올라간 느낌이고,
보안(?) 측면에서도 한층 더 안심할 수 있게 된 것 같아요 🙌
| @Getter | ||
| @Builder(toBuilder = true) | ||
| public class ClubApplicationForm implements Persistable<String> { | ||
| private static String[] externalApplicationUrlAllowed = {"https://forms.gle", "https://docs.google.com/forms", "https://form.naver.com", "https://naver.me"}; |
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.
좋네요 👍
| SemesterTerm semesterTerm | ||
| ) { | ||
|
|
||
| @AssertTrue(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.
옹 저 이건 처음 써보는 거 같아요. 이런게 있었다니,, 몰랐는데 두개 이상의 필드를 검증하는데 매우매우 유용하군요 좋습니다~
| ClubApplicationForm clubApplicationForm = clubApplicationFormsRepository.findByClubIdAndId(clubId, applicationFormId).orElseThrow(() -> new RestApiException(ErrorCode.APPLICATION_NOT_FOUND)); | ||
|
|
||
| if (clubApplicationForm.getFormMode() == ApplicationFormMode.EXTERNAL) | ||
| throw new RestApiException(ErrorCode.APPLICATION_NOT_FOUND); |
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.
아예 위 코드에서 clubApplicationForm 을 조회할 때부터 INTERNAL 폼만 가져오도록
findByClubIdAndIdOnFormModeINTERNAL 같은 메서드를 쓰는 건 어떨까용? (메서드 명은 예시입니다)
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.
오 내부지원서만 가져오게 변경하면 좋을꺼같네요~ 추후 리팩토링해보죠
seongwon030
left a comment
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.
고생하셨습니다
#️⃣연관된 이슈
#864
📝작업 내용
지원서 양식에 ApplicationFormMode 필드와 externalApplicationUrl이 추가되었습니다.
clubDetail에 존재하던 externalApplicationUrl은 기능 추가이후 나중에 삭제하면 될것 같습니다.
바뀐 필드에 맞게 mode와 question, externalurl을 응답해주게 변경하였고 기존에 dto에 있던 검증 어노테이션들이 조건에 따라 바뀌는 상황이 존재해 AsserTrue를 이용해 수동검사로 옮겼습니다.
또한 외부지원서는 구글폼, 네이버 폼 형식으로 시작하는지 검사합니다.
추가로 지원서 생성시에 중복된 응답 필드가 존재하는지 검사하는 로직이 빠져있어 중복된 필드를 검증하는 로직이 추가되었습니다
중점적으로 리뷰받고 싶은 부분(선택)
논의하고 싶은 부분(선택)
🫡 참고사항