Skip to content
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

set precedence default value #192

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public record CareerInfoRequest(
@Schema(description = "ํšŒ์‚ฌ", allowableValues = {"๋น„๊ณต๊ฐœ", "๋Œ€๊ธฐ์—…", "์ค‘๊ฒฌ๊ธฐ์—…", "์ค‘์†Œ๊ธฐ์—…", "์Šคํƒ€ํŠธ์—…", "์™ธ๊ตญ๊ณ„", "์ทจ์ค€์ƒ/์ธํ„ด"})
@NotBlank String company,

@Schema(description = "์—ฐ์ฐจ", allowableValues = {"1๋…„ ์ฐจ ๋ฏธ๋งŒ", "1~2๋…„ ์ฐจ", "2~3๋…„ ์ฐจ", "3~4๋…„ ์ฐจ", "4~5๋…„ ์ฐจ", "5๋…„ ์ฐจ ์ด์ƒ", "์ทจ์ค€์ƒ/์ธํ„ด", "๋น„๊ณต๊ฐœ"})
@Schema(description = "์—ฐ์ฐจ", allowableValues = {"๋น„๊ณต๊ฐœ", "1๋…„ ์ฐจ ๋ฏธ๋งŒ", "1~2๋…„ ์ฐจ", "2~3๋…„ ์ฐจ", "3~4๋…„ ์ฐจ", "4~5๋…„ ์ฐจ", "5๋…„ ์ฐจ ์ด์ƒ"})
@NotBlank String experience
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ public Long getTotalMyScore(AuthAccountInfo info) {
.mapToLong(this::calculateTotalScore)
.sum();

if (userTotalScore == 0) {
return 100L;
}

Long averagePeopleScore = calculateAveragePeopleScore();

return (averagePeopleScore == 0) ? 0 : (userTotalScore * 100) / averagePeopleScore;
return (averagePeopleScore == 0) ? 100 : (userTotalScore * 100) / averagePeopleScore;
}

/**
Expand Down
Loading