Skip to content

Commit 4d22f16

Browse files
committed
feat: add 'x' to keyword set null
1 parent d6d1b16 commit 4d22f16

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/main/java/com/back/domain/chatbot/service/ChatbotService.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,18 @@ private StepRecommendationResponseDto getFinalRecommendationsWithMessage(
652652
List<AlcoholStrength> strengths = (alcoholStrength == null) ? null : List.of(alcoholStrength);
653653
List<AlcoholBaseType> baseTypes = (alcoholBaseType == null) ? null : List.of(alcoholBaseType);
654654

655+
// 'x', '없음' 입력 시 키워드 조건 무시
656+
String keyword = null;
657+
if (userMessage != null && !userMessage.trim().isEmpty()) {
658+
String trimmed = userMessage.trim().toLowerCase();
659+
if (!trimmed.equals("x") && !trimmed.equals("없음")) {
660+
keyword = userMessage;
661+
}
662+
}
663+
655664
// userMessage를 키워드로 사용하여 검색
656665
Page<Cocktail> cocktailPage = cocktailRepository.searchWithFilters(
657-
userMessage, // 사용자 입력 메시지를 키워드로 사용
666+
keyword, // 'x', '없음'이면 null, 아니면 사용자 입력 메시지
658667
strengths,
659668
null, // cocktailType 사용 안 함
660669
baseTypes,

0 commit comments

Comments
 (0)