forked from KNU-HAEDAL/Birthday_Funding_BE
-
Notifications
You must be signed in to change notification settings - Fork 0
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
29cf3f2
commit 3c1f969
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
32 changes: 32 additions & 0 deletions
32
src/main/java/team/haedal/gifticionfunding/domain/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,32 @@ | ||
package team.haedal.gifticionfunding.domain; | ||
|
||
import jakarta.annotation.Nullable; | ||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.NoArgsConstructor; | ||
import team.haedal.gifticionfunding.domain.enums.Role; | ||
|
||
import java.time.LocalDate; | ||
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor | ||
@Builder | ||
public class Member { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
@Column(unique = true) | ||
private String email; | ||
@Column(unique = true) | ||
private String nickname; | ||
private Long point; | ||
private LocalDate birthdate; | ||
@Nullable | ||
private String profileImageUrl; | ||
@Enumerated(EnumType.STRING) | ||
private Role role; | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/team/haedal/gifticionfunding/domain/enums/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,5 @@ | ||
package team.haedal.gifticionfunding.domain.enums; | ||
|
||
public enum Role { | ||
MEMBER, ADMIN, GUEST | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/team/haedal/gifticionfunding/repository/MemberRepository.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,10 @@ | ||
package team.haedal.gifticionfunding.repository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import team.haedal.gifticionfunding.domain.Member; | ||
|
||
import java.util.Optional; | ||
|
||
public interface MemberRepository extends JpaRepository<Member, Long> { | ||
Optional<Member> findByNickname(String nickname); | ||
} |