Skip to content

Commit

Permalink
KNU-HAEDAL#1 Feat: 사용자 관련 엔티티 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonssshyeon committed Apr 5, 2024
1 parent 29cf3f2 commit 3c1f969
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ dependencies {
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'

//security
implementation 'org.springframework.boot:spring-boot-starter-security'

//oauth
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
}

tasks.named('test') {
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/team/haedal/gifticionfunding/domain/Member.java
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;

}
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
}
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);
}

0 comments on commit 3c1f969

Please sign in to comment.