From 648447753e1beacb993c5afc9c0493aecba1429a Mon Sep 17 00:00:00 2001 From: rlarltj123 Date: Fri, 26 Jul 2024 00:19:37 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=94=94=EB=B2=84=EA=B9=85=EC=9D=84?= =?UTF-8?q?=20=EC=9C=84=ED=95=9C=20=EB=A1=9C=EA=B7=B8=EB=A5=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=ED=95=9C=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../moneymong/domain/user/service/UserFacadeService.java | 7 +++++++ .../global/security/oauth/dto/OAuthUserDataRequest.java | 2 ++ .../moneymong/global/security/oauth/dto/OAuthUserInfo.java | 1 + .../moneymong/global/security/service/OAuthService.java | 5 ++++- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/moneymong/domain/user/service/UserFacadeService.java b/src/main/java/com/moneymong/domain/user/service/UserFacadeService.java index 885d6f7..ab6a9ea 100644 --- a/src/main/java/com/moneymong/domain/user/service/UserFacadeService.java +++ b/src/main/java/com/moneymong/domain/user/service/UserFacadeService.java @@ -10,10 +10,13 @@ import com.moneymong.global.security.token.dto.Tokens; import com.moneymong.global.security.token.service.TokenService; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service +@Slf4j @RequiredArgsConstructor public class UserFacadeService { private final UserService userService; @@ -25,7 +28,11 @@ public class UserFacadeService { public LoginSuccessResponse login(LoginRequest loginRequest) { OAuthUserDataResponse oAuthUserData = oAuthService.login(loginRequest); + log.info("Token = {}", loginRequest.getAccessToken()); + log.info("Code = {}", loginRequest.getCode()); + OAuthUserInfo oAuthUserInfo = OAuthUserInfo.from(oAuthUserData); + log.info("OAuthUserInfo = {}", oAuthUserInfo); AuthUserInfo registerResult = userService.getOrRegister(oAuthUserInfo); diff --git a/src/main/java/com/moneymong/global/security/oauth/dto/OAuthUserDataRequest.java b/src/main/java/com/moneymong/global/security/oauth/dto/OAuthUserDataRequest.java index e9265e6..0cca58b 100644 --- a/src/main/java/com/moneymong/global/security/oauth/dto/OAuthUserDataRequest.java +++ b/src/main/java/com/moneymong/global/security/oauth/dto/OAuthUserDataRequest.java @@ -2,8 +2,10 @@ import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.ToString; @Getter +@ToString @AllArgsConstructor public class OAuthUserDataRequest { private String accessToken; diff --git a/src/main/java/com/moneymong/global/security/oauth/dto/OAuthUserInfo.java b/src/main/java/com/moneymong/global/security/oauth/dto/OAuthUserInfo.java index 7468856..10c6352 100644 --- a/src/main/java/com/moneymong/global/security/oauth/dto/OAuthUserInfo.java +++ b/src/main/java/com/moneymong/global/security/oauth/dto/OAuthUserInfo.java @@ -6,6 +6,7 @@ @Builder @AllArgsConstructor @NoArgsConstructor +@ToString public class OAuthUserInfo { private String provider; private String oauthId; diff --git a/src/main/java/com/moneymong/global/security/service/OAuthService.java b/src/main/java/com/moneymong/global/security/service/OAuthService.java index 11a0cf5..691231c 100644 --- a/src/main/java/com/moneymong/global/security/service/OAuthService.java +++ b/src/main/java/com/moneymong/global/security/service/OAuthService.java @@ -18,7 +18,10 @@ import static com.moneymong.global.exception.enums.ErrorCode.USER_NOT_FOUND; +import lombok.extern.slf4j.Slf4j; + @Service +@Slf4j public class OAuthService { private final Map oAuthAuthenticationHandlers; @@ -41,7 +44,7 @@ public OAuthUserDataResponse login(LoginRequest loginRequest) { loginRequest.getCode(), loginRequest.getName() ); - + log.info("[OAuthService OAuthUserDataRequest] = {}", request); return oAuthHandler.getOAuthUserData(request); }