Skip to content

Commit

Permalink
Merge pull request #112 from Likelion-YeungNam-Univ/feature-auth
Browse files Browse the repository at this point in the history
feat: auth sign-in 반환값 self-test 추가
  • Loading branch information
Jsplix authored Aug 6, 2024
2 parents bc878b7 + 27c5d74 commit 4b34d33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public ResponseEntity<SignInResponseDto> 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);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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()
);
}
}

0 comments on commit 4b34d33

Please sign in to comment.