Skip to content

Commit

Permalink
✨ feat: User 엔티티
Browse files Browse the repository at this point in the history
  • Loading branch information
strongmhk committed Jul 4, 2024
1 parent bf33da4 commit 6f26bed
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/main/java/com/umc/dream/domain/User.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.umc.dream.domain;

import com.umc.dream.domain.enums.Role;
import jakarta.persistence.*;
import lombok.*;

@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class User {

@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false, length = 10)
private String name;

@Column(nullable = false, length = 20)
private String account;

@Column(nullable = false, length = 20)
private String password;

@Enumerated(EnumType.STRING)
private Role role;

@Builder
public User(String name, String account, String password, Role role) {
this.name = name;
this.account = account;
this.password = password;
this.role = role;
}
}
5 changes: 5 additions & 0 deletions src/main/java/com/umc/dream/domain/enums/Role.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.umc.dream.domain.enums;

public enum Role {
NORMAL, PRO
}

0 comments on commit 6f26bed

Please sign in to comment.