-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 템플릿 추천 로직 구현 * chore: 템플릿 추천 로직 구현으로 인한 서비스 로직 수정
- Loading branch information
Showing
5 changed files
with
67 additions
and
20 deletions.
There are no files selected for viewing
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
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
40 changes: 32 additions & 8 deletions
40
layer-domain/src/main/java/org/layer/domain/form/enums/FormTag.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
package org.layer.domain.form.enums; | ||
|
||
import java.util.EnumSet; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@Getter | ||
public enum FormTag { | ||
KPT("KPT"), | ||
FIVE_F("5F"), | ||
MAD_SAD_GLAD("Mad Sad Glad"), | ||
SSC("SSC"), | ||
PMI("PMI"), | ||
UNTITLED("무제"), | ||
CUSTOM("CUSTOM"); | ||
KPT("KPT"), | ||
FIVE_F("5F"), | ||
MAD_SAD_GLAD("Mad Sad Glad"), | ||
SSC("SSC"), | ||
PMI("PMI"), | ||
UNTITLED("무제"), | ||
CUSTOM("CUSTOM"); | ||
|
||
private final String tag; | ||
|
||
public static FormTag getRecommandFormTag(List<RetrospectPurpose> retrospectPurposes) { | ||
Map<FormTag, Integer> formTagIntegerMap = EnumSet.allOf(FormTag.class).stream() | ||
.collect(Collectors.toMap(tag -> tag, tag -> 0)); | ||
|
||
retrospectPurposes.forEach(purpose -> { | ||
formTagIntegerMap.put(KPT, formTagIntegerMap.get(KPT) + purpose.getKtpPoint()); | ||
formTagIntegerMap.put(FIVE_F, formTagIntegerMap.get(FIVE_F) + purpose.getFiveFPoint()); | ||
formTagIntegerMap.put(MAD_SAD_GLAD, formTagIntegerMap.get(MAD_SAD_GLAD) + purpose.getMadSadGladPoint()); | ||
formTagIntegerMap.put(SSC, formTagIntegerMap.get(SSC) +purpose.getSscPoint()); | ||
formTagIntegerMap.put(PMI, formTagIntegerMap.get(PMI) +purpose.getPmiPont()); | ||
}); | ||
|
||
private final String tag; | ||
return formTagIntegerMap.entrySet() | ||
.stream() | ||
.max(Map.Entry.comparingByValue()) | ||
.map(Map.Entry::getKey) | ||
.orElse(FormTag.UNTITLED); | ||
} | ||
} |
21 changes: 20 additions & 1 deletion
21
layer-domain/src/main/java/org/layer/domain/form/enums/RetrospectPurpose.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,24 @@ | ||
package org.layer.domain.form.enums; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
@Getter | ||
public enum RetrospectPurpose { | ||
CHECK_PROGRESS, PERSONAL_GROWTH, TEAM_GROWTH, IMPROVE_COMMUNICATION, SHARE_EXPERIENCE, IMPROVE_PROBLEM, SHARE_EMOTION, STRATEGY_SETTING | ||
CHECK_PROGRESS(1, 0, 0, 1, 0), | ||
PERSONAL_GROWTH(1, 0, 0, 0, 0), | ||
TEAM_GROWTH(1, 0, 1, 1, 1), | ||
IMPROVE_COMMUNICATION(0, 0, 1, 0, 1), | ||
SHARE_EXPERIENCE(0, 1, 0, 0, 1), | ||
IMPROVE_PROBLEM(1, 1, 0, 0, 0), | ||
SHARE_EMOTION(0, 1, 1, 0, 0), | ||
STRATEGY_SETTING(1, 0, 0, 1, 0); | ||
|
||
private final int ktpPoint; | ||
private final int fiveFPoint; | ||
private final int madSadGladPoint; | ||
private final int sscPoint; | ||
private final int pmiPont; | ||
|
||
} |
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