Skip to content

Commit

Permalink
Merge pull request #5 from NadoYagsa/feat/2-user
Browse files Browse the repository at this point in the history
Feat/2 user
  • Loading branch information
youngniw authored Apr 15, 2022
2 parents 836ea72 + 45c0078 commit b335fca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/nadoyagsa/pillaroid/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ public class User {
private Long userIdx;

@JsonIgnore
@Column(nullable = false)
private String email;
@Column(name = "kakao_account_id", nullable = false)
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 +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

@Repository
public interface UserRepository extends JpaRepository <User, Long> {
Optional<User> findUserByEmail(String email);
Optional<User> findUserByKakaoAccountId(Long kakaoAccountId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public Optional<User> findUserById(Long userIdx) {
return userRepository.findById(userIdx);
}

public Optional<User> findUserByEmail(String email) {
return userRepository.findUserByEmail(email);
public Optional<User> findUserByKakaoAccountId(Long kakaoAccountId) {
return userRepository.findUserByKakaoAccountId(kakaoAccountId);
}

public User signUp(User user) {
Expand Down

0 comments on commit b335fca

Please sign in to comment.