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

[refactor] 여행 친구 전체 조회 비즈니스 로직 리팩터링 #85

Merged
merged 2 commits into from
Jan 14, 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
3 changes: 2 additions & 1 deletion doorip-api/src/main/java/org/doorip/common/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public abstract class Constants {
public static final String STYLE_D = "style_d";
public static final String STYLE_E = "style_e";
public static final int MIN_STYLE_RATE = 0;
public static final int MAX_STYLE_RATE = 4;
public static final int MAX_STYLE_RATE = 100;
public static final int PROPENSITY_WEIGHT = 25;
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ private void calculateAndSetPropensityAverageRate(List<String> keys, Map<String,
}

private void setDefaultPropensity(Participant participant, Map<String, Integer> propensity) {
propensity.put(STYLE_A, propensity.get(STYLE_A) + participant.getStyleA());
propensity.put(STYLE_B, propensity.get(STYLE_B) + participant.getStyleB());
propensity.put(STYLE_C, propensity.get(STYLE_C) + participant.getStyleC());
propensity.put(STYLE_D, propensity.get(STYLE_D) + participant.getStyleD());
propensity.put(STYLE_E, propensity.get(STYLE_E) + participant.getStyleE());
propensity.put(STYLE_A, propensity.get(STYLE_A) + participant.getStyleA() * PROPENSITY_WEIGHT);
propensity.put(STYLE_B, propensity.get(STYLE_B) + participant.getStyleB() * PROPENSITY_WEIGHT);
propensity.put(STYLE_C, propensity.get(STYLE_C) + participant.getStyleC() * PROPENSITY_WEIGHT);
propensity.put(STYLE_D, propensity.get(STYLE_D) + participant.getStyleD() * PROPENSITY_WEIGHT);
propensity.put(STYLE_E, propensity.get(STYLE_E) + participant.getStyleE() * PROPENSITY_WEIGHT);
}
}