-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT] 온보딩에서 진행한 선택질문에 따라 사용자에게 맞춘 질문 리스트 생성 기능 구현 #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
진짜.. 너무너무 수고하셨습니다..
|
||
private List<OnboardingAnswer> onboardingAnswerList; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 이거 각각 변수가 아니라 리스트로 관리했구나 확인했음!!
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) | ||
public class OnboardingReceiveRequestDto { | ||
|
||
@NotBlank(message = "부모자식 관계 아이디는 필수 입력 값입니다.") | ||
@NonNull |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 둘다 있구나 근데 어떤거 쓰는게 더 좋을라나
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
실수였어용 NotNull로 변경완!
@GetMapping("/qna/dummy") | ||
@ResponseStatus(HttpStatus.OK) | ||
public ApiResponse dummy() { | ||
qnAService.createQnA(); | ||
|
||
return ApiResponse.success(SuccessType.GET_TODAY_QNA_SUCCESS); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
더미 없애준 이유가 실제 필터링 로직으로 바꿔줘서 그런거 맞지??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
맞앙
|
||
YES("응"), | ||
NO("아니"), | ||
SKIP("잘 모르겠어"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스킵 이름 너무 좋은데요
|
||
List<Question> findBySectionAndGroup(QuestionSection section, QuestionGroup group); | ||
|
||
default List<Question> findBySectionAndGroupRandom(QuestionSection section, QuestionGroup group, int size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default 키워드의 용도에 대해 처음 알았다!! 또 배워갑니다
List<Question> matchingQuestions = findBySectionAndGroup(section, group); | ||
List<Question> selectedQuestions = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
온보딩 추가질문에서 분류한 그룹으로 질문 필터링한 거 맞지??? (이해한 내용이 맞는지 그냥 확인..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
글고 첨에 질문 7개 리스트를 다 뽑아두고 시작하는 걸 여기서 처리하는거지?
parentchild.changeChildOnboardingAnswerList(onboardingAnswerList); | ||
} else { | ||
parentchild.changeParentOnboardingAnswerList(onboardingAnswerList); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change해야 하는 상황이 구체적으로 어떤 부분을 말하는거야??
for (Question question : selectedQuestions) { | ||
QnA newQnA = QnA.builder() | ||
.question(question) | ||
.isParentAnswer(false) | ||
.isChildAnswer(false) | ||
.build(); | ||
qnARepository.save(newQnA); | ||
parentchild.addQnA(newQnA); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
처음에 질문을 필터링해서 Question에 대한 QnA리스트 구성하고 시작하는 거구나! 좋다좋다
private QuestionGroup selectGroup(List<OnboardingAnswer> childList, List<OnboardingAnswer> parentList) { | ||
|
||
// 그룹 선택 알고리즘 | ||
if (childList.get(0) == YES && parentList.get(0) == YES) { | ||
return GROUP1; | ||
} | ||
if (childList.get(1) == YES && parentList.get(1) == YES) { | ||
return GROUP2; | ||
} | ||
if (childList.get(2) == YES && parentList.get(2) == YES) { | ||
return GROUP3; | ||
} | ||
if (childList.get(3) == YES && parentList.get(3) == YES) { | ||
return GROUP4; | ||
} | ||
if (childList.get(4) == YES && parentList.get(4) == YES) { | ||
return GROUP5; | ||
} | ||
if (childList.get(5) == YES && parentList.get(5) == YES) { | ||
return GROUP6; | ||
} | ||
return GROUP7; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 진짜 ㅋㅋㅋㅋㅋ 수고했다.... 기획 구체화되면 다시 제대로 값 넣어보자
3aa055c
to
3801d40
Compare
📌 관련 이슈
closed #36
✨ 어떤 이유로 변경된 내용인지
🙏 검토 혹은 리뷰어에게 남기고 싶은 말