@@ -422,25 +422,25 @@ private ChatResponseDto handleStepRecommendation(ChatRequestDto requestDto) {
422422 break ;
423423
424424 case 2 :
425- stepData = getAlcoholBaseTypeOptions (requestDto .getSelectedAlcoholStrength ());
425+ stepData = getAlcoholBaseTypeOptions (parseAlcoholStrength ( requestDto .getSelectedAlcoholStrength () ));
426426 message = "좋은 선택이네요! 이제 베이스가 될 술을 선택해주세요 🍸" ;
427427 type = MessageType .RADIO_OPTIONS ;
428428 break ;
429429
430430 case 3 :
431431 stepData = getCocktailTypeOptions (
432- requestDto .getSelectedAlcoholStrength (),
433- requestDto .getSelectedAlcoholBaseType ()
432+ parseAlcoholStrength ( requestDto .getSelectedAlcoholStrength () ),
433+ parseAlcoholBaseType ( requestDto .getSelectedAlcoholBaseType () )
434434 );
435435 message = "완벽해요! 마지막으로 어떤 스타일로 즐기실 건가요? 🥃" ;
436436 type = MessageType .RADIO_OPTIONS ;
437437 break ;
438438
439439 case 4 :
440440 stepData = getFinalRecommendations (
441- requestDto .getSelectedAlcoholStrength (),
442- requestDto .getSelectedAlcoholBaseType (),
443- requestDto .getSelectedCocktailType ()
441+ parseAlcoholStrength ( requestDto .getSelectedAlcoholStrength () ),
442+ parseAlcoholBaseType ( requestDto .getSelectedAlcoholBaseType () ),
443+ parseCocktailType ( requestDto .getSelectedCocktailType () )
444444 );
445445 message = stepData .getStepTitle ();
446446 type = MessageType .CARD_LIST ; // 최종 추천은 카드 리스트
@@ -470,6 +470,43 @@ private ChatResponseDto handleStepRecommendation(ChatRequestDto requestDto) {
470470 }
471471
472472 // ============ 단계별 추천 관련 메서드들 ============
473+ // "ALL" 또는 null/빈값은 null로 처리하여 전체 선택 의미
474+
475+ private AlcoholStrength parseAlcoholStrength (String value ) {
476+ if (value == null || value .trim ().isEmpty () || "ALL" .equalsIgnoreCase (value )) {
477+ return null ;
478+ }
479+ try {
480+ return AlcoholStrength .valueOf (value );
481+ } catch (IllegalArgumentException e ) {
482+ log .warn ("Invalid AlcoholStrength value: {}" , value );
483+ return null ;
484+ }
485+ }
486+
487+ private AlcoholBaseType parseAlcoholBaseType (String value ) {
488+ if (value == null || value .trim ().isEmpty () || "ALL" .equalsIgnoreCase (value )) {
489+ return null ;
490+ }
491+ try {
492+ return AlcoholBaseType .valueOf (value );
493+ } catch (IllegalArgumentException e ) {
494+ log .warn ("Invalid AlcoholBaseType value: {}" , value );
495+ return null ;
496+ }
497+ }
498+
499+ private CocktailType parseCocktailType (String value ) {
500+ if (value == null || value .trim ().isEmpty () || "ALL" .equalsIgnoreCase (value )) {
501+ return null ;
502+ }
503+ try {
504+ return CocktailType .valueOf (value );
505+ } catch (IllegalArgumentException e ) {
506+ log .warn ("Invalid CocktailType value: {}" , value );
507+ return null ;
508+ }
509+ }
473510
474511 private StepRecommendationResponseDto getAlcoholStrengthOptions () {
475512 List <StepRecommendationResponseDto .StepOption > options = new ArrayList <>();
0 commit comments