Skip to content

Commit

Permalink
[fix] : 조건 판단 로직 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chahyunsoo committed Jun 7, 2024
1 parent 599eb5c commit 393ef2d
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@ private List<ConditionCheckResponse> evaluateConditions(MemberPrivateInfo member

// 학교지역 평가
if (announcementConditionEntity.getSchoolRegion() != null) {
String result = (memberInfo.getSchoolLocation() != null && memberInfo.getSchoolLocation().contains(announcementConditionEntity.getSchoolRegion()) ? "초록불" : "빨간불");
List<String> allowedRegions = Arrays.asList(announcementConditionEntity.getSchoolRegion().split(","));
String result;
if (memberInfo.getSchoolLocation() != null) {
boolean isRegionMatched = allowedRegions.stream().anyMatch(region -> memberInfo.getSchoolLocation().contains(region));
result = isRegionMatched ? "초록불" : "빨간불";
} else {
result = "회색불";
}
responses.add(new ConditionCheckResponse(announcementConditionEntity.getSchoolRegion() + " 소제 대학", memberInfo.getSchoolLocation() != null ? result : "회색불"));

// compareExcept.add(announcementConditionEntity.getIncomeQuality() + "분위 이내");
}

Expand Down

0 comments on commit 393ef2d

Please sign in to comment.