From 6e7f2a313fafb50ab390eedb803c1074fde53795 Mon Sep 17 00:00:00 2001 From: yummygyudon Date: Tue, 7 Jan 2025 14:02:10 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT]=20Sign=20Up=20API=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 회원가입 성공에 대한 Success Code 정의 - Auth - SignUpUsecase 정의 - SignUpCommand 타입 파라미터 선언 - 정의한 API 구현 --- .../application/auth/api/AuthApiController.java | 9 +++++++++ .../support/code/domain/success/AuthSuccess.java | 1 + .../usecase/auth/port/in/SignUpUsecase.java | 10 ++++++++++ 3 files changed, 20 insertions(+) create mode 100644 src/main/java/sopt/makers/authentication/usecase/auth/port/in/SignUpUsecase.java diff --git a/src/main/java/sopt/makers/authentication/application/auth/api/AuthApiController.java b/src/main/java/sopt/makers/authentication/application/auth/api/AuthApiController.java index 7b92a6a..681949d 100644 --- a/src/main/java/sopt/makers/authentication/application/auth/api/AuthApiController.java +++ b/src/main/java/sopt/makers/authentication/application/auth/api/AuthApiController.java @@ -9,6 +9,7 @@ import sopt.makers.authentication.usecase.auth.port.in.AuthenticateSocialAccountUsecase; import sopt.makers.authentication.usecase.auth.port.in.AuthenticateSocialAccountUsecase.AuthenticateTokenInfo; import sopt.makers.authentication.usecase.auth.port.in.CreatePhoneVerificationUsecase; +import sopt.makers.authentication.usecase.auth.port.in.SignUpUsecase; import sopt.makers.authentication.usecase.auth.port.in.VerifyPhoneVerificationUsecase; import org.springframework.http.HttpHeaders; @@ -28,6 +29,7 @@ public class AuthApiController implements AuthApi { private final CreatePhoneVerificationUsecase createVerificationUsecase; private final VerifyPhoneVerificationUsecase verifyVerificationUsecase; private final AuthenticateSocialAccountUsecase authenticateSocialAccountUsecase; + private final SignUpUsecase signUpUsecase; private final CookieUtil cookieUtil; @Override @@ -74,4 +76,11 @@ public ResponseEntity> authenticateSocialAuthInfoFromApp( AuthResponse.AuthenticateSocialAuthInfoForApp.of( tokenInfo.accessToken(), tokenInfo.refreshToken())); } + + @Override + @PostMapping("/signup") + public ResponseEntity> signUp(AuthRequest.SignUp signUp) { + signUpUsecase.signUp(signUp.toCommand()); + return ResponseUtil.success(AuthSuccess.CREATE_SIGN_UP_USER); + } } diff --git a/src/main/java/sopt/makers/authentication/support/code/domain/success/AuthSuccess.java b/src/main/java/sopt/makers/authentication/support/code/domain/success/AuthSuccess.java index 4b0907a..a16bf65 100644 --- a/src/main/java/sopt/makers/authentication/support/code/domain/success/AuthSuccess.java +++ b/src/main/java/sopt/makers/authentication/support/code/domain/success/AuthSuccess.java @@ -18,6 +18,7 @@ public enum AuthSuccess implements SuccessCode { // 201 CREATE_PHONE_VERIFICATION(HttpStatus.CREATED, "번호 인증 생성에 성공했습니다."), + CREATE_SIGN_UP_USER(HttpStatus.CREATED, "회원 가입에 성공했습니다."), ; private final HttpStatus status; diff --git a/src/main/java/sopt/makers/authentication/usecase/auth/port/in/SignUpUsecase.java b/src/main/java/sopt/makers/authentication/usecase/auth/port/in/SignUpUsecase.java new file mode 100644 index 0000000..c457e6e --- /dev/null +++ b/src/main/java/sopt/makers/authentication/usecase/auth/port/in/SignUpUsecase.java @@ -0,0 +1,10 @@ +package sopt.makers.authentication.usecase.auth.port.in; + +import sopt.makers.authentication.domain.auth.AuthPlatform; + +public interface SignUpUsecase { + + void signUp(SignUpCommand command); + + record SignUpCommand(String name, String phone, String authCode, AuthPlatform authPlatform) {} +}