diff --git a/src/main/java/com/umc/dream/domain/User.java b/src/main/java/com/umc/dream/domain/User.java new file mode 100644 index 0000000..86cecb3 --- /dev/null +++ b/src/main/java/com/umc/dream/domain/User.java @@ -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; + } +} diff --git a/src/main/java/com/umc/dream/domain/enums/Role.java b/src/main/java/com/umc/dream/domain/enums/Role.java new file mode 100644 index 0000000..81d962b --- /dev/null +++ b/src/main/java/com/umc/dream/domain/enums/Role.java @@ -0,0 +1,5 @@ +package com.umc.dream.domain.enums; + +public enum Role { + NORMAL, PRO +}