-
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
Feat(Problem): 문제 상세 조회 API, 유사 문제 조회 API 구현 #62
Conversation
- jdk1.5부터 단순한 문자열의 연결 연산은 컴파일될 때 내부적으로 StringBuilder로 변환된다. - 따라서 Loop를 제외한 단순한 문자열 연결은 StringBuilder를 굳이 사용하지 않아도 된다. - https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000093250-Convert-StringBuilder-to-String-concatenation-suggestion
- 개발자가 의도한 400 등의 에러는 info 레벨로 조정 - 의도하지 않은 Exception은 error 레벨로 유지
- AWS opensearch를 활용 - 관련 의존성 및 환경 변수 추가 - SimilarProblemId는 Redis를 활용한 캐싱 처리
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.
LGTM
.requestMatchers( | ||
Arrays.stream(REGEX_WHITE_LIST) | ||
.map(RegexRequestMatcher::regexMatcher) | ||
.toArray(RegexRequestMatcher[]::new) | ||
).permitAll() |
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.
정규표현식분리한건 너무 좋음
String errorMessage = e.getMessage() + | ||
" " + | ||
CommonErrorCode.INTERNAL_SERVER_ERROR.getMessage(); |
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.
이거 저번에 말한거같은데 Builder 대신 쓰는 이유가 있는지?
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.
그 떄 말한 거 때문에 좀 더 자세히 검색해보고 바꿨어. 커밋 메시지에도 써놨는데
- jdk1.5부터 단순한 문자열의 연결 연산은 컴파일될 때 내부적으로 StringBuilder로 변환된다.
- 따라서 Loop를 제외한 단순한 문자열 연결은 StringBuilder를 굳이 사용하지 않아도 된다.
- https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000093250-Convert-StringBuilder-to-String-concatenation-suggestion
요거 참고해도 좋을 듯
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.
굳이 사용하지 않아도 된다구나 오키요
PR 변경된 내용
문제 상세 조회 API
유사 문제 조회 API
AWS OpenSearch 사용
OpenSearch 구성 완료
SimilarProblemsProvider 클래스를 통해 AWS와 통신
검색 대상 문제의 벡터값을 가져옴. 이 때, 유사 문제 검색 메소드의 벡터 입력값이 float[]이므로 벡터값을 가져와서 float[] 으로 변환.
검색 대상 문제 벡터값을 사용해 유사 문제 ID를 조회. 이 때 쿼리를 날리면 유사도가 가장 높은 문제는 자기 자신이므로, (가져올 문제 개수 + 1)만큼에 대한 쿼리를 날리고 첫 번째 원소는 스킵하도록 구현
추가 내용
참조
Closes #60