Skip to content

Commit

Permalink
Merge pull request #85 from Team-Going/feature/83
Browse files Browse the repository at this point in the history
[refactor] 여행 친구 전체 조회 비즈니스 로직 리팩터링
  • Loading branch information
SunwoongH authored Jan 14, 2024
2 parents 2505330 + fef166d commit 928cbbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
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);
}
}

0 comments on commit 928cbbd

Please sign in to comment.