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);