Skip to content

Commit

Permalink
Merge pull request #257 from sopt-makers/feat/T-10853
Browse files Browse the repository at this point in the history
[FEAT] 분리 및 이관 User 도메인 데이터 생성
  • Loading branch information
yummygyudon authored May 28, 2024
2 parents a75c418 + 3f0d229 commit fdcb577
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 0 deletions.
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,
}
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

}
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 // 회원
}
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,
}
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
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}

0 comments on commit fdcb577

Please sign in to comment.