From 884d5157a4fd062f9050af71f402ca7f1b3f8811 Mon Sep 17 00:00:00 2001 From: born-A Date: Wed, 1 Nov 2023 23:21:05 +0900 Subject: [PATCH] =?UTF-8?q?NABI-102-refsctor=20:=20=EB=B2=94=EB=AA=A8?= =?UTF-8?q?=EB=8B=98=20review=20comment=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/user/dto/response/UserResponseDTO.java | 3 +++ .../org/prgrms/nabimarketbe/domain/user/entity/User.java | 8 ++++++-- .../domain/user/repository/UserRepository.java | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/prgrms/nabimarketbe/domain/user/dto/response/UserResponseDTO.java b/src/main/java/org/prgrms/nabimarketbe/domain/user/dto/response/UserResponseDTO.java index ce8de8cf..cb767fe0 100644 --- a/src/main/java/org/prgrms/nabimarketbe/domain/user/dto/response/UserResponseDTO.java +++ b/src/main/java/org/prgrms/nabimarketbe/domain/user/dto/response/UserResponseDTO.java @@ -16,6 +16,8 @@ public class UserResponseDTO { private final Role role; + private final LocalDateTime createdDate; + private final LocalDateTime modifiedDate; public UserResponseDTO(User user) { @@ -23,6 +25,7 @@ public UserResponseDTO(User user) { this.accountId = user.getAccountId(); this.nickName = user.getNickname(); this.role = user.getRole(); + this.createdDate = user.getCreatedDate(); this.modifiedDate = user.getModifiedDate(); } } diff --git a/src/main/java/org/prgrms/nabimarketbe/domain/user/entity/User.java b/src/main/java/org/prgrms/nabimarketbe/domain/user/entity/User.java index 3c6933ea..abeb75e3 100644 --- a/src/main/java/org/prgrms/nabimarketbe/domain/user/entity/User.java +++ b/src/main/java/org/prgrms/nabimarketbe/domain/user/entity/User.java @@ -46,8 +46,12 @@ public class User extends BaseEntity implements UserDetails { @Column(name = "user_role") private Role role; - public User(String accountId, String nickname, String profileImageUrl, Role role) { - super(); + private User( + String accountId, + String nickname, + String profileImageUrl, + Role role + ) { } public void updateNickname(String nickname) { diff --git a/src/main/java/org/prgrms/nabimarketbe/domain/user/repository/UserRepository.java b/src/main/java/org/prgrms/nabimarketbe/domain/user/repository/UserRepository.java index f8154318..1ee1b5c2 100644 --- a/src/main/java/org/prgrms/nabimarketbe/domain/user/repository/UserRepository.java +++ b/src/main/java/org/prgrms/nabimarketbe/domain/user/repository/UserRepository.java @@ -9,7 +9,9 @@ @Repository public interface UserRepository extends JpaRepository { Optional findByNickname(String name); + Optional findByEmail(String email); + Optional findByAccountIdAndProvider(String accountId, String provider); Optional findByAccountId(String oauthId);