Skip to content

Commit

Permalink
remove : 일반, sns 회원가입 시 디바이스토큰 필드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
thalals committed Sep 18, 2024
1 parent dc95f10 commit 5d64c7d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class UserJoinFacade {
private final UserProfilePhotoService userProfilePhotoService;
private final UserInterestsService userInterestsService;
private final UserIdealTypeService userIdealTypeService;
private final UserDeviceKeyService userDeviceKeyService;
private final UserSnsService userSnsService;
private final UserAlarmAgreementService userAlarmAgreementService;
private final UserTokenService userTokenService;
Expand All @@ -57,7 +56,6 @@ public TokenDto signUp(final UserSignUpRequest request) {
userProfilePhotoService.createOf(request.makeUserProfilePhotoList(user.getUserUuid()));
userInterestsService.createOf(request.makeUserInterestsList(user.getUserUuid()));
userIdealTypeService.createOf(request.makeUserIdealTypeList(user.getUserUuid()));
userDeviceKeyService.update(user.getUserUuid(), request.deviceKey());

if (request.snsType().isSns()) {
userSnsService.create(user.getUserUuid(), request.snsType(), request.snsUniqueId(),
Expand Down Expand Up @@ -91,7 +89,6 @@ public TokenDto integratedSnsId(final UserSnsSignUpRequest request) {

userSnsService.create(user.getUserUuid(), request.snsType(), request.snsUniqueId(),
request.email());
userDeviceKeyService.update(user.getUserUuid(), request.deviceKey());

return getUserSignUpResponse(user);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public record UserSignUpRequest(
Gender gender,
Gender preferGender,
@NotNull(message = "introduction 는 null 이어서는 안됩니다.") String introduction,
@NotBlank(message = "deviceKey 는 비어있을 수 없습니다.") String deviceKey,
@NotNull(message = "agreement 는 null 이어서는 안됩니다.") @Valid UserAgreementRequest agreement,
@NotNull(message = "locationRequest 는 null 이어서는 안됩니다.") @Valid UserLocationRequest locationRequest,
@Size(min = 2, max = 3, message = "사진은 최소 2장, 최대 3장을 등록해야합니다.")
Expand Down Expand Up @@ -67,7 +66,7 @@ public record UserSignUpRequest(

public UserSignUpRequest(final String phoneNumber, final String username, final String email,
final String birthDay, final String gender, final String preferGender,
final String introduction, final String deviceKey,
final String introduction,
final UserAgreementRequest agreement, final UserLocationRequest locationRequest,
final List<String> photoList, final List<Integer> interestList,
final List<Integer> idealTypeList, final String snsType, final String snsUniqueId,
Expand All @@ -81,7 +80,6 @@ public UserSignUpRequest(final String phoneNumber, final String username, final
Gender.toConverter(gender),
Gender.toConverter(preferGender),
introduction,
deviceKey,
agreement,
locationRequest,
photoList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
public record UserSnsSignUpRequest(

@NotBlank(message = "phoneNumber 는 비어있을 수 없습니다.") String phoneNumber,
@NotBlank(message = "deviceKey 는 비어있을 수 없습니다.") String deviceKey,
@NotNull(message = "smsType 을 적어주세요") SNSType snsType,
@NotNull(message = "sns unique id 가 필수값입니다.") String snsUniqueId,
@NotBlank(message = "sns email 은 필수값입니다.") String email
Expand All @@ -21,13 +20,11 @@ public record UserSnsSignUpRequest(
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
public UserSnsSignUpRequest(
@JsonProperty("phoneNumber") final String phoneNumber,
@JsonProperty("deviceKey") final String deviceKey,
@JsonProperty("snsType") final String snsType,
@JsonProperty("snsUniqueId") final String snsUniqueId,
@JsonProperty("email") final String email) {

this(phoneNumber.replaceAll(removeHyphenRegex, ""),
deviceKey,
SNSType.toSNSConverter(snsType),
snsUniqueId,
email
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ void normalUserJoin() throws Exception {
fieldWithPath("introduction").description("자기소개"),
fieldWithPath("gender").description("성별"),
fieldWithPath("preferGender").description("선호 성별"),
fieldWithPath("deviceKey").description("유저 디바이스 키"),

fieldWithPath("agreement").description("약관 동의 내역"),
fieldWithPath("agreement.serviceUseAgree").description("서비스 약관 동의"),
Expand Down Expand Up @@ -269,7 +268,6 @@ void integratedUserJoin() throws Exception {
.description("유저 SNS 아이디 통합 회원 가입")
.requestFields(
fieldWithPath("phoneNumber").description("전화번호"),
fieldWithPath("deviceKey").description("유저 디바이스 키"),

fieldWithPath("snsType").type(JsonFieldType.STRING)
.description("회원가입 타입 - KAKAO, NAVER, GOOGLE"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class UserJoinFacadeTest {
@Mock
UserIdealTypeService userIdealTypeService;
@Mock
UserDeviceKeyService userDeviceKeyService;
@Mock
UserSnsService userSnsService;
@Mock
TokenProvider tokenProvider;
Expand Down Expand Up @@ -80,8 +78,6 @@ void userJoinFacadeTest() {
verify(userInterestsService).createOf(request.makeUserInterestsList(any()));
//이상형
verify(userIdealTypeService).createOf(request.makeUserIdealTypeList(any()));
//디바이스 키
verify(userDeviceKeyService).update(anyString(), anyString());

verify(userSnsService, times(0)).create(anyString(), any(), anyString(), anyString());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public class UserSignUpRequestFixture {

private final static String introduction = "자기소개 ~~";

private final static String deviceKey = "device-key-value";

private final static UserAgreementRequest agreement = UserAgreementRequestFixture.make();

private final static UserLocationRequest locationRequest = UserLocationRequestFixture.make();
Expand Down Expand Up @@ -65,31 +63,31 @@ private UserSignUpRequestFixture() {}

public static UserSignUpRequest make() {
return new UserSignUpRequest(phoneNumber, username, email, birthDay, gender, preferGender,
introduction, deviceKey, agreement, locationRequest, photoList, interestList,
introduction, agreement, locationRequest, photoList, interestList,
idealTypeList, snsType.name(), snsUniqueId, tall, smoking, drinking, religion);
}

public static UserSignUpRequest ofInterest(final List<Integer> interestList) {
return new UserSignUpRequest(phoneNumber, username, email, birthDay, gender, preferGender,
introduction, deviceKey, agreement, locationRequest, photoList, interestList,
introduction, agreement, locationRequest, photoList, interestList,
idealTypeList, snsType.name(), snsUniqueId, tall, smoking, drinking, religion);
}

public static UserSignUpRequest ofIdealType(final List<Integer> idealTypeList) {
return new UserSignUpRequest(phoneNumber, username, email, birthDay, gender, preferGender,
introduction, deviceKey, agreement, locationRequest, photoList, interestList,
introduction, agreement, locationRequest, photoList, interestList,
idealTypeList, snsType.name(), snsUniqueId, tall, smoking, drinking, religion);
}

public static UserSignUpRequest ofPhoto(final List<String> photoList) {
return new UserSignUpRequest(phoneNumber, username, email, birthDay, gender, preferGender,
introduction, deviceKey, agreement, locationRequest, photoList, interestList,
introduction, agreement, locationRequest, photoList, interestList,
idealTypeList, snsType.name(), snsUniqueId, tall, smoking, drinking, religion);
}

public static UserSignUpRequest ofSNSType(final String snsType) {
return new UserSignUpRequest(phoneNumber, username, email, birthDay, gender, preferGender,
introduction, deviceKey, agreement, locationRequest, photoList, interestList,
introduction, agreement, locationRequest, photoList, interestList,
idealTypeList, snsType, snsUniqueId, tall, smoking, drinking, religion);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
public class UserSnsSignUpRequestFixture {

private static final String phoneNumber = "01012341234";
private static final String deviceKey = "device-key";
private static final SNSType naverType = SNSType.NAVER;
private static final String snsUniqueId = "sns unique id";
private static final String email = "email@email.com";


public static UserSnsSignUpRequest makeSNSType() {
return new UserSnsSignUpRequest(phoneNumber, deviceKey, naverType, snsUniqueId, email);
return new UserSnsSignUpRequest(phoneNumber, naverType, snsUniqueId, email);
}
}

0 comments on commit 5d64c7d

Please sign in to comment.