-
Notifications
You must be signed in to change notification settings - Fork 4
[feat] 소셜 로그인 회원가입 설문 및 추가 정보 등록 로직 통합 및 설문 question 필드 제거 #99
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
Changes from 4 commits
e11e8d5
2a2969f
9698bcf
7f2080d
01c86c5
6f2d33f
c09c78a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.arom.with_travel.domain.member.dto.request; | ||
|
|
||
|
|
||
| import com.arom.with_travel.domain.survey.dto.request.SurveyRequestDto; | ||
| import jakarta.validation.Valid; | ||
| import jakarta.validation.constraints.NotEmpty; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| public class SignupWithSurveyRequestDto { | ||
|
|
||
| @Valid @NotNull | ||
|
||
| private MemberSignupRequestDto extraInfo; // 닉네임·성별·생년월일 | ||
|
|
||
| @Valid @NotEmpty | ||
| private List<SurveyRequestDto> surveys; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package com.arom.with_travel.domain.member.service; | ||
|
|
||
| import com.arom.with_travel.domain.member.Member; | ||
| import com.arom.with_travel.domain.member.dto.request.SignupWithSurveyRequestDto; | ||
| import com.arom.with_travel.domain.member.dto.response.MemberSignupResponseDto; | ||
| import com.arom.with_travel.domain.member.repository.MemberRepository; | ||
| import com.arom.with_travel.domain.survey.service.SurveyService; | ||
| import com.arom.with_travel.global.security.token.service.TokenService; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
|
|
||
| @Service | ||
| @RequiredArgsConstructor | ||
| public class SignupFacadeService { | ||
|
|
||
| private final MemberSignupService memberSignupService; | ||
| private final SurveyService surveyService; | ||
| private final MemberRepository memberRepository; | ||
|
|
||
|
||
| @Transactional | ||
| public MemberSignupResponseDto fillExtraInfo(String email, | ||
| SignupWithSurveyRequestDto req) { | ||
| MemberSignupResponseDto memberDto = | ||
| memberSignupService.fillExtraInfo(email, req.getExtraInfo()); | ||
|
|
||
| req.getSurveys().forEach(dto -> surveyService.createSurvey(email, dto)); | ||
|
|
||
| Member member = memberRepository.findByEmail(email) | ||
| .orElseThrow(() -> new IllegalStateException("Member not found")); | ||
| member.markAdditionalDataChecked(); | ||
|
||
|
|
||
| return memberDto; | ||
| } | ||
| } | ||
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.
Setter는 제거해주세요