Skip to content

Commit

Permalink
refactor : 정적 팩토리 메서드로 변경
Browse files Browse the repository at this point in the history
- 생성자 대신 정적 팩토리 메서드로 수정
  • Loading branch information
seokho-1116 committed Jan 11, 2024
1 parent 130fb0a commit 650319f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

public record MemberInfo(Long memberId) {

public static MemberInfo from(Long memberId) {
return new MemberInfo(memberId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class TokenService {
*/
public TokenResponse createNewToken(final Long memberId) {
String key = String.valueOf(UUID.randomUUID());
memberInfoCacheRepository.save(key, new MemberInfo(memberId));
memberInfoCacheRepository.save(key, MemberInfo.from(memberId));

return createTokenResponse(memberId, key);
}
Expand Down

0 comments on commit 650319f

Please sign in to comment.