-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from sopt-makers/feat/T-10853
[FEAT] 분리 및 이관 User 도메인 데이터 생성
- Loading branch information
Showing
9 changed files
with
251 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Gender.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,6 @@ | ||
package org.sopt.makers.operation.user.domain; | ||
|
||
public enum Gender { | ||
MALE, | ||
FEMALE, | ||
} |
12 changes: 12 additions & 0 deletions
12
operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Part.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,12 @@ | ||
package org.sopt.makers.operation.user.domain; | ||
|
||
public enum Part { | ||
|
||
PLAN, | ||
DESIGN, | ||
WEB, | ||
ANDROID, | ||
IOS, | ||
SERVER | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Position.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 org.sopt.makers.operation.user.domain; | ||
|
||
public enum Position { | ||
PRESIDENT, // 회장 | ||
VICE_PRESIDENT, // 부회장 | ||
GENERAL_AFFAIRS, // 총무 | ||
TEAM_LEADER, // 팀장 | ||
PART_LEADER, // 파트장 | ||
MEMBER // 회원 | ||
} |
6 changes: 6 additions & 0 deletions
6
operation-domain/src/main/java/org/sopt/makers/operation/user/domain/SocialType.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,6 @@ | ||
package org.sopt.makers.operation.user.domain; | ||
|
||
public enum SocialType { | ||
GOOGLE, | ||
APPLE, | ||
} |
6 changes: 6 additions & 0 deletions
6
operation-domain/src/main/java/org/sopt/makers/operation/user/domain/Team.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,6 @@ | ||
package org.sopt.makers.operation.user.domain; | ||
|
||
public enum Team { | ||
OPERATION, | ||
MEDIA | ||
} |
61 changes: 61 additions & 0 deletions
61
operation-domain/src/main/java/org/sopt/makers/operation/user/domain/User.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,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; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...ion-domain/src/main/java/org/sopt/makers/operation/user/domain/UserGenerationHistory.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,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; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserIdentityInfo.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,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; | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
operation-domain/src/main/java/org/sopt/makers/operation/user/domain/UserRegisterInfo.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,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; | ||
} | ||
} |