-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from makevook/issue/166
feat,refactor,chore: 유저 닉네임 입력 시 앞뒤 공백 문자 무시 로직 추가
- Loading branch information
Showing
47 changed files
with
441 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...user/logic/dto/UserOnboardingCommand.java → ...ain/user/logic/UserOnboardingCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/user/logic/dto/UserRegisterCommand.java → ...omain/user/logic/UserRegisterCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
server/api/src/main/java/vook/server/api/domain/user/logic/UserSignUpFromSocialCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package vook.server.api.domain.user.logic; | ||
|
||
import jakarta.validation.constraints.Email; | ||
import lombok.Builder; | ||
import vook.server.api.domain.user.model.social_user.SocialUser; | ||
import vook.server.api.domain.user.model.social_user.SocialUserFactory; | ||
import vook.server.api.domain.user.model.user.User; | ||
import vook.server.api.domain.user.model.user.UserFactory; | ||
|
||
@Builder | ||
public record UserSignUpFromSocialCommand( | ||
String provider, | ||
String providerUserId, | ||
|
||
String email | ||
) { | ||
public User toNewUser(UserFactory factory) { | ||
return factory.createForSignUpFromSocialOf(email); | ||
} | ||
|
||
public SocialUser toSocialUser(SocialUserFactory factory, User user) { | ||
return factory.createForNewOf(provider, providerUserId, user); | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
.../api/src/main/java/vook/server/api/domain/user/logic/dto/UserSignUpFromSocialCommand.java
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
...src/main/java/vook/server/api/domain/user/model/social_user/DefaultSocialUserFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package vook.server.api.domain.user.model.social_user; | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
import jakarta.validation.constraints.NotNull; | ||
import vook.server.api.domain.user.model.user.User; | ||
import vook.server.api.globalcommon.annotation.ModelFactory; | ||
|
||
@ModelFactory | ||
public class DefaultSocialUserFactory implements SocialUserFactory { | ||
|
||
@Override | ||
public SocialUser createForNewOf( | ||
@NotEmpty String provider, | ||
@NotEmpty String providerUserId, | ||
@NotNull User user | ||
) { | ||
SocialUser socialUser = SocialUser.builder() | ||
.provider(provider) | ||
.providerUserId(providerUserId) | ||
.user(user) | ||
.build(); | ||
|
||
user.addSocialUser(socialUser); | ||
return socialUser; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...er/api/src/main/java/vook/server/api/domain/user/model/social_user/SocialUserFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package vook.server.api.domain.user.model.social_user; | ||
|
||
import jakarta.validation.constraints.NotEmpty; | ||
import jakarta.validation.constraints.NotNull; | ||
import vook.server.api.domain.user.model.user.User; | ||
|
||
public interface SocialUserFactory { | ||
|
||
SocialUser createForNewOf( | ||
@NotEmpty String provider, | ||
@NotEmpty String providerUserId, | ||
@NotNull User user | ||
); | ||
} |
2 changes: 1 addition & 1 deletion
2
...main/user/model/SocialUserRepository.java → ...del/social_user/SocialUserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
server/api/src/main/java/vook/server/api/domain/user/model/user/DefaultUserFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package vook.server.api.domain.user.model.user; | ||
|
||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotEmpty; | ||
import vook.server.api.globalcommon.annotation.ModelFactory; | ||
|
||
import java.util.ArrayList; | ||
import java.util.UUID; | ||
|
||
@ModelFactory | ||
public class DefaultUserFactory implements UserFactory { | ||
|
||
@Override | ||
public User createForSignUpFromSocialOf(@NotEmpty @Email String email) { | ||
return User.builder() | ||
.uid(UUID.randomUUID().toString()) | ||
.email(email) | ||
.status(UserStatus.SOCIAL_LOGIN_COMPLETED) | ||
.onboardingCompleted(false) | ||
.socialUsers(new ArrayList<>()) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
server/api/src/main/java/vook/server/api/domain/user/model/user/UserFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package vook.server.api.domain.user.model.user; | ||
|
||
import jakarta.validation.constraints.Email; | ||
import jakarta.validation.constraints.NotEmpty; | ||
|
||
public interface UserFactory { | ||
User createForSignUpFromSocialOf(@NotEmpty @Email String email); | ||
} |
Oops, something went wrong.