From 16c1d891353ee8ba0be1fb5aed6e2b034ea346ae Mon Sep 17 00:00:00 2001 From: youngniw <1999julie@naver.com> Date: Fri, 15 Apr 2022 21:59:02 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[refactor]=20user=20=EA=B0=9D=EC=B2=B4=20?= =?UTF-8?q?=EC=BB=AC=EB=9F=BC=20=EC=88=98=EC=A0=95=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nadoyagsa/pillaroid/entity/User.java | 8 ++++---- .../nadoyagsa/pillaroid/repository/UserRepository.java | 2 +- .../java/com/nadoyagsa/pillaroid/service/UserService.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/nadoyagsa/pillaroid/entity/User.java b/src/main/java/com/nadoyagsa/pillaroid/entity/User.java index 41e8666..8ffb640 100644 --- a/src/main/java/com/nadoyagsa/pillaroid/entity/User.java +++ b/src/main/java/com/nadoyagsa/pillaroid/entity/User.java @@ -20,17 +20,17 @@ public class User { @JsonIgnore @Column(nullable = false) - private String email; + private Long kakaoAccountId; - public User(String email) { - this.email = email; + public User(Long kakaoAccountId) { + this.kakaoAccountId = kakaoAccountId; } @Override public String toString() { return "User{" + "userIdx=" + userIdx + - ", email='" + email + '\'' + + ", kakaoAccountId='" + kakaoAccountId + '\'' + '}'; } } diff --git a/src/main/java/com/nadoyagsa/pillaroid/repository/UserRepository.java b/src/main/java/com/nadoyagsa/pillaroid/repository/UserRepository.java index 4f77627..5551d0e 100644 --- a/src/main/java/com/nadoyagsa/pillaroid/repository/UserRepository.java +++ b/src/main/java/com/nadoyagsa/pillaroid/repository/UserRepository.java @@ -8,5 +8,5 @@ @Repository public interface UserRepository extends JpaRepository { - Optional findUserByEmail(String email); + Optional findUserByKakaoAccountId(Long kakaoAccountId); } diff --git a/src/main/java/com/nadoyagsa/pillaroid/service/UserService.java b/src/main/java/com/nadoyagsa/pillaroid/service/UserService.java index e809f9d..b2124bb 100644 --- a/src/main/java/com/nadoyagsa/pillaroid/service/UserService.java +++ b/src/main/java/com/nadoyagsa/pillaroid/service/UserService.java @@ -26,8 +26,8 @@ public Optional findUserById(Long userIdx) { return userRepository.findById(userIdx); } - public Optional findUserByEmail(String email) { - return userRepository.findUserByEmail(email); + public Optional findUserByKakaoAccountId(Long kakaoAccountId) { + return userRepository.findUserByKakaoAccountId(kakaoAccountId); } public User signUp(User user) { From 45c0078cd0becd05f62cb33119ea682ed5916896 Mon Sep 17 00:00:00 2001 From: youngniw <1999julie@naver.com> Date: Fri, 15 Apr 2022 22:05:43 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[refactor]=20user=20=EA=B0=9D=EC=B2=B4=20?= =?UTF-8?q?=EC=BB=AC=EB=9F=BC=20=EC=88=98=EC=A0=952=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nadoyagsa/pillaroid/entity/User.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nadoyagsa/pillaroid/entity/User.java b/src/main/java/com/nadoyagsa/pillaroid/entity/User.java index 8ffb640..e1d44df 100644 --- a/src/main/java/com/nadoyagsa/pillaroid/entity/User.java +++ b/src/main/java/com/nadoyagsa/pillaroid/entity/User.java @@ -19,7 +19,7 @@ public class User { private Long userIdx; @JsonIgnore - @Column(nullable = false) + @Column(name = "kakao_account_id", nullable = false) private Long kakaoAccountId; public User(Long kakaoAccountId) { @@ -30,7 +30,7 @@ public User(Long kakaoAccountId) { public String toString() { return "User{" + "userIdx=" + userIdx + - ", kakaoAccountId='" + kakaoAccountId + '\'' + + ", kakaoAccountId=" + kakaoAccountId + '}'; } }