From 27c5d747056cdb3e36c5d41b308cd161121390e4 Mon Sep 17 00:00:00 2001 From: iampingu99 <154869950+iampingu99@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:50:40 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20auth=20sign-in=20=EB=B0=98=ED=99=98?= =?UTF-8?q?=EA=B0=92=20self-test=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/controller/AuthController.java | 2 +- .../bounded_context/auth/dto/SignInResponseDto.java | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/example/holing/bounded_context/auth/controller/AuthController.java b/src/main/java/com/example/holing/bounded_context/auth/controller/AuthController.java index 89b0103..e17fa75 100644 --- a/src/main/java/com/example/holing/bounded_context/auth/controller/AuthController.java +++ b/src/main/java/com/example/holing/bounded_context/auth/controller/AuthController.java @@ -76,7 +76,7 @@ public ResponseEntity signIn(@RequestBody SignInRequestDto re String accessToken = jwtProvider.generatorAccessToken(user.getEmail(), user.getId()); - SignInResponseDto response = SignInResponseDto.of(accessToken, user.getSocialId()); + SignInResponseDto response = SignInResponseDto.of(accessToken, user); return ResponseEntity.ok().body(response); } diff --git a/src/main/java/com/example/holing/bounded_context/auth/dto/SignInResponseDto.java b/src/main/java/com/example/holing/bounded_context/auth/dto/SignInResponseDto.java index 4183f91..4b5f4f1 100644 --- a/src/main/java/com/example/holing/bounded_context/auth/dto/SignInResponseDto.java +++ b/src/main/java/com/example/holing/bounded_context/auth/dto/SignInResponseDto.java @@ -1,10 +1,17 @@ package com.example.holing.bounded_context.auth.dto; +import com.example.holing.bounded_context.user.entity.User; + public record SignInResponseDto( String accessToken, - Long socialId + Long socialId, + Boolean isSelfTested ) { - public static SignInResponseDto of(String accessToken, Long socialId) { - return new SignInResponseDto(accessToken, socialId); + public static SignInResponseDto of(String accessToken, User user) { + return new SignInResponseDto( + accessToken, + user.getSocialId(), + user.getIsSelfTested() + ); } }