Skip to content

Commit

Permalink
feat: Member 필드 수정, MemberRepository 추가 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeong-hyeok committed Jul 30, 2023
1 parent ee20102 commit b5b9e98
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ public class Member extends BaseTimeEntity {
private Long id;
private String email;
private String password;
private String name;
private String nickname;
@Enumerated(EnumType.STRING)
private Role role;
@Enumerated(EnumType.STRING)
private SocialType socialType; // KAKAO, NAVER, GOOGLE
private String socialId; // 로그인한 소셜 타입 식별자 값 (일반 로그인의 경우 null)
private String nickname;
private String userName;
private String imageNum;

@Builder
public Member(String email, String password, String name, Role role, SocialType socialType, String socialId, String nickname, String imageNum) {
public Member(String email, String password, String nickname, Role role, SocialType socialType, String socialId, String userName, String imageNum) {
this.email = email;
this.password = password;
this.name = name;
this.nickname = nickname;
this.role = role;
this.socialType = socialType;
this.socialId = socialId;
this.nickname = nickname;
this.userName = userName;
this.imageNum = imageNum;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.project.mapdagu.domain.member.repository;

import com.project.mapdagu.domain.member.entity.Member;
import com.project.mapdagu.domain.member.entity.SocialType;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

public interface MemberRepository extends JpaRepository<Member, Long> {

Optional<Member> findByEmail(String email);

Boolean existsByUserName(String name);

// 소셜 타입과 소셜의 식별값으로 회원 찾는 메소드 -> 추가 정보를 입력받아 회원가입 진행 시 이용
Optional<Member> findBySocialTypeAndSocialId(SocialType socialType, String socialId);

}

0 comments on commit b5b9e98

Please sign in to comment.