diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Gender.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Gender.java new file mode 100644 index 00000000..dcff9387 --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Gender.java @@ -0,0 +1,6 @@ +package org.sopt.makers.operation.user.domain; + +public enum Gender { + MALE, + FEMALE, +} diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Part.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Part.java new file mode 100644 index 00000000..8bfda204 --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Part.java @@ -0,0 +1,12 @@ +package org.sopt.makers.operation.user.domain; + +public enum Part { + + PLAN, + DESIGN, + WEB, + ANDROID, + IOS, + SERVER + +} diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Position.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Position.java new file mode 100644 index 00000000..da0d79c9 --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Position.java @@ -0,0 +1,10 @@ +package org.sopt.makers.operation.user.domain; + +public enum Position { + PRESIDENT, // 회장 + VICE_PRESIDENT, // 부회장 + GENERAL_AFFAIRS, // 총무 + TEAM_LEADER, // 팀장 + PART_LEADER, // 파트장 + MEMBER // 회원 +} diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/SocialType.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/SocialType.java new file mode 100644 index 00000000..b3274ddf --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/SocialType.java @@ -0,0 +1,6 @@ +package org.sopt.makers.operation.user.domain; + +public enum SocialType { + GOOGLE, + APPLE, +} diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Team.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Team.java new file mode 100644 index 00000000..0a0f4584 --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Team.java @@ -0,0 +1,6 @@ +package org.sopt.makers.operation.user.domain; + +public enum Team { + OPERATION, + MEDIA +} diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/User.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/User.java new file mode 100644 index 00000000..ceb6eb88 --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/User.java @@ -0,0 +1,61 @@ +package org.sopt.makers.operation.user.domain; + +import jakarta.persistence.Id; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.Enumerated; +import jakarta.persistence.EnumType; + +import java.time.LocalDate; + +import lombok.Getter; +import lombok.Builder; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.AccessLevel; + +import org.sopt.makers.operation.common.domain.BaseEntity; + +@Entity @Getter +@Table(name = "users") +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public class User extends BaseEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "email", nullable = false) + private String email; + + @Column(name = "phone", nullable = false) + private String phone; + + @Column(name = "gender", nullable = false) + @Enumerated(EnumType.STRING) + private Gender gender; + + @Column(name = "name", nullable = false) + private String name; + + @Column(name = "profile_image") + private String profileImage; + + @Column(name = "birthday") + private LocalDate birthday; + + + @Builder + public User(String email, String phone, Gender gender, String name, String profileImage, LocalDate birthday) { + this.email = email; + this.phone = phone; + this.gender = gender; + this.name = name; + this.profileImage = profileImage; + this.birthday = birthday; + } +} diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserGenerationHistory.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserGenerationHistory.java new file mode 100644 index 00000000..51ecb93e --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserGenerationHistory.java @@ -0,0 +1,54 @@ +package org.sopt.makers.operation.user.domain; + +import jakarta.persistence.Id; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.Enumerated; +import jakarta.persistence.EnumType; + +import lombok.Getter; +import lombok.Builder; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.AccessLevel; + +@Entity @Getter +@Table(name = "user_generation_history") +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public class UserGenerationHistory { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "user_id", nullable = false) + private Long userId; + + @Column(name = "generation", nullable = false) + private int generation; + + @Column(name = "part") + @Enumerated(value = EnumType.STRING) + private Part part; + + @Column(name = "team") + @Enumerated(value = EnumType.STRING) + private Team team; + + @Column(name = "position", nullable = false) + @Enumerated(value = EnumType.STRING) + private Position position; + + @Builder + public UserGenerationHistory(Long userId, int generation, Part part, Team team, Position position) { + this.userId = userId; + this.generation = generation; + this.part = part; + this.team = team; + this.position = position; + } +} diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserIdentityInfo.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserIdentityInfo.java new file mode 100644 index 00000000..bf96d34b --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserIdentityInfo.java @@ -0,0 +1,44 @@ +package org.sopt.makers.operation.user.domain; + +import jakarta.persistence.Id; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.Enumerated; +import jakarta.persistence.EnumType; + +import lombok.Getter; +import lombok.Builder; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.AccessLevel; + +@Entity @Getter +@Table(name = "user_identity_info") +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public class UserIdentityInfo { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "user_id", nullable = false) + private Long userId; + + @Column(name = "idp_type", nullable = false) + @Enumerated(value = EnumType.STRING) + private SocialType socialType; + + @Column(name = "auth_user_id", nullable = false) + private String socialId; + + @Builder + public UserIdentityInfo(Long userId, SocialType socialType, String socialId) { + this.userId = userId; + this.socialType = socialType; + this.socialId = socialId; + } +} diff --git a/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserRegisterInfo.java b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserRegisterInfo.java new file mode 100644 index 00000000..82de5273 --- /dev/null +++ b/operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserRegisterInfo.java @@ -0,0 +1,52 @@ +package org.sopt.makers.operation.user.domain; + +import jakarta.persistence.Id; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; +import jakarta.persistence.Column; +import jakarta.persistence.Enumerated; +import jakarta.persistence.EnumType; + +import lombok.Getter; +import lombok.Builder; +import lombok.NoArgsConstructor; +import lombok.AllArgsConstructor; +import lombok.AccessLevel; + +@Entity @Getter +@Table(name = "user_register_info") +@NoArgsConstructor(access = AccessLevel.PROTECTED) +@AllArgsConstructor(access = AccessLevel.PRIVATE) +public class UserRegisterInfo { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(name = "name") + private String name; + + @Column(name = "email") + private String email; + + @Column(name = "generation", nullable = false) + private int generation; + + @Column(name = "phone") + private String phone; + + @Column(name = "part") + @Enumerated(value = EnumType.STRING) + private Part part; + + @Builder + public UserRegisterInfo(String name, String email, String phone, Part part, Integer generation) { + this.name = name; + this.email = email; + this.phone = phone; + this.part = part; + this.generation = generation; + } +}