-
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
[#100] 사용자끼리 역량을 비교하는 기능 구현 #101
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
정렬기준이 score 하나만 있어서 user_id 도 정렬기준으로 두었다.
namewhat99
approved these changes
Jun 2, 2024
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.
확인했습니다~ 수고수고
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
이슈
체크리스트
고민한 내용
비교 방식
user1 과 user2를 비교하도록 하였다. 모든 경우에
user1의 값 - user2의 값
한 값을 반환하도록 했다.rank, score 두 부분을 비교했다.
-> rank는 score와 반대이다. 랭크는 작은 숫자가 더 높은 것이기 때문이다.
역량이 등록되지 않은 경우
user1 과. user2 둘 중 하나라도 특정 역량이 등록되지 않은 경우 비교 할수가 없기에 null 값이 반환된다.
그리고 scoreDifference 의 값이 null 이면 rank 도 비교 할 수 없기 때문에 rank 비교하는 함수가 실행되지 않는다.
가장 차이나는 역량
user1이 user2 에 비해 가장 떨어지는 역량을 찾도록 했다.
즉 scoreDifference가 음수 인 역량중에 찾는다. 모두 양수나 0인경우 떨어지는 역량이 없으므로 null이 반환된다.