-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eefee8f
commit ee20102
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/main/java/com/project/mapdagu/domain/member/entity/Member.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.project.mapdagu.domain.member.entity; | ||
|
||
import com.project.mapdagu.common.entity.BaseTimeEntity; | ||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
@Entity | ||
public class Member extends BaseTimeEntity { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
private String email; | ||
private String password; | ||
private String name; | ||
@Enumerated(EnumType.STRING) | ||
private Role role; | ||
@Enumerated(EnumType.STRING) | ||
private SocialType socialType; // KAKAO, NAVER, GOOGLE | ||
private String socialId; // 로그인한 소셜 타입 식별자 값 (일반 로그인의 경우 null) | ||
private String nickname; | ||
private String imageNum; | ||
|
||
@Builder | ||
public Member(String email, String password, String name, Role role, SocialType socialType, String socialId, String nickname, String imageNum) { | ||
this.email = email; | ||
this.password = password; | ||
this.name = name; | ||
this.role = role; | ||
this.socialType = socialType; | ||
this.socialId = socialId; | ||
this.nickname = nickname; | ||
this.imageNum = imageNum; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/com/project/mapdagu/domain/member/entity/Role.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.project.mapdagu.domain.member.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Getter | ||
@RequiredArgsConstructor | ||
public enum Role { | ||
|
||
// 첫 로그인 구분 | ||
GUEST("ROLE_GUEST"), USER("ROLE_USER"); | ||
|
||
private final String key; // 스프링 시큐리티 권한 코드에 ROLE_ 접두사가 붙어야 함 | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/project/mapdagu/domain/member/entity/SocialType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.project.mapdagu.domain.member.entity; | ||
|
||
public enum SocialType { | ||
KAKAO, NAVER, GOOGLE | ||
} |