Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK-408] 메모, 멘토 관련 엔티티 생성 #14

Merged
merged 33 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9466dac
feat: create Mento Entity
beautiflow Apr 25, 2024
853d367
feat: create MentoCareer Entity
beautiflow Apr 25, 2024
f96e7e2
feat: create CareerLink Entity
beautiflow Apr 25, 2024
deb0be6
feat: create Memo Entity
beautiflow Apr 25, 2024
8c8658a
feat: create MentoringPossibleDate Entity
beautiflow Apr 25, 2024
ad24067
feat: modified MentoringPossibleDate Entity
beautiflow Apr 25, 2024
9cf3017
feat: 엔티티 생성 관련 수정
beautiflow Apr 26, 2024
6ff987b
feat: 엔티티 생성 정적 팩토리메소드 패턴 적용
beautiflow Apr 27, 2024
8c9fe38
feat: idDelete 에 nullable=false 추가
beautiflow Apr 28, 2024
364f24a
feat: create Member Entity
beautiflow Apr 28, 2024
6bafa1c
feat: create Mentor Entity
beautiflow Apr 28, 2024
09d1dbe
feat: create MentorCareer Entity
beautiflow Apr 28, 2024
e0912b9
feat: create MentoringApplication Entity
beautiflow Apr 28, 2024
a614aea
feat: create Review Entity
beautiflow Apr 28, 2024
a1e7121
feat: 어노테이션 수정 - @AllArgsConstructor
beautiflow Apr 28, 2024
31213b2
feat: 변경 클래스 삭제
beautiflow Apr 28, 2024
63e4dd2
feat: create enum class - MentorCareerPeriod, MentorGenre, MentoringA…
beautiflow Apr 29, 2024
7a13064
feat: enum class 생성으로 인해 타입 수정
beautiflow Apr 29, 2024
030af91
feat: 식별자 값 자동 생성부분 제거
beautiflow Apr 29, 2024
46141fc
chore: 공백 제거
beautiflow Apr 29, 2024
417b88f
feat: enum 클래스 필드 한글명으로 변경
beautiflow Apr 29, 2024
d0029b5
feat: CareerLink -> MentorHistory 변경 및 필드 추가
beautiflow Apr 29, 2024
d452712
feat: 필드명 간략하게 수정
beautiflow Apr 29, 2024
5ff1954
feat: 정적 팩토리 메서드 네이밍 규칙 of 적용
beautiflow Apr 29, 2024
a9ddd86
feat: MentorMentoringGenre 엔티티 생성
beautiflow Apr 29, 2024
0983cc1
feat: enum class 멘토링_장르 수정
beautiflow Apr 29, 2024
14048da
refactor: Member 관련 파일 주석 처리 및 이름 변경(User -> Member)으로 인한 삭제
beautiflow Apr 30, 2024
b29f984
refactor: Member 타입 수정으로 인한 User 타입 파일 주석 및 삭제
beautiflow Apr 30, 2024
7af37f1
refactor: User -> Member 타입 변경 및 관련 필드 수정
beautiflow Apr 30, 2024
d2139f2
Merge remote-tracking branch 'origin/feature/task-408-create_entity' …
beautiflow Apr 30, 2024
2368e6e
Merge branch 'develop' into feature/task-408-create_entity
beautiflow Apr 30, 2024
74334b4
refactor: MemoEntity - YoutubeVideo import 주소 수정
beautiflow Apr 30, 2024
9a1f825
Merge remote-tracking branch 'origin/feature/task-408-create_entity' …
beautiflow Apr 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public abstract class BaseEntity {
private LocalDateTime modifiedDate;

@ColumnDefault("false")
@Column(columnDefinition = "TINYINT(1)")
@Column(columnDefinition = "TINYINT(1)", nullable = false)
private boolean isDelete;
}
53 changes: 53 additions & 0 deletions src/main/java/com/speechpeach/speech/member/entity/Member.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.speechpeach.speech.member.entity;

import com.speechpeach.speech.global.entity.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;

import java.util.UUID;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Entity
@Table(name = "members")
public class Member extends BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.UUID)
@Column(name = "member_id")
private UUID memberId;

@Column(name = "member_nickname")
private String memberNickname;

@Column(name = "member_profile_image")
private String memberProfileImage;

@Column(name = "member_name")
private String memberName;

@Column(name = "member_email")
private String memberEmail;

private Member(UUID memberId, String memberNickname,
String memberProfileImage, String memberName, String memberEmail) {
this.memberId = memberId;
this.memberNickname = memberNickname;
this.memberProfileImage = memberProfileImage;
this.memberName = memberName;
this.memberEmail = memberEmail;
}

public static Member createMember(UUID memberId, String memberNickname,
String memberProfileImage, String memberName, String memberEmail) {
return new Member(memberId, memberNickname, memberProfileImage, memberName, memberEmail);
}
}

53 changes: 53 additions & 0 deletions src/main/java/com/speechpeach/speech/memo/entity/Memo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.speechpeach.speech.memo.entity;

import com.speechpeach.speech.global.entity.BaseEntity;
import com.speechpeach.speech.member.entity.Member;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Entity
@Table(name = "memos")
public class Memo extends BaseEntity {

@Id
@Column(name = "memo_id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long memoId;

@Column(name = "memo_title", nullable = false)
private String memoTitle;

@Column(name = "memo_content",columnDefinition = "TEXT", length = 500, nullable = false)
private String memoContent;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id", nullable = false)
private Member member;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "youtube_video_id", nullable = false)
private YoutubeVideo youtubeVideo;

private Memo(String memoTitle, String memoContent, Member member, YoutubeVideo youtubeVideo){
this.memoTitle = memoTitle;
this.memoContent = memoContent;
this.member = member;
this.youtubeVideo = youtubeVideo;
}

public static Memo createMemo(String memoTitle, String memoContent, Member member, YoutubeVideo youtubeVideo){
return new Memo(memoTitle, memoContent, member, youtubeVideo);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.speechpeach.speech.mentoring.entity;

import com.speechpeach.speech.global.entity.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Entity
@Table(name = "career_links")
public class CareerLink extends BaseEntity {

@Id
@Column(name = "career_link_id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long careerLinkId;

@Column(name ="career_link_content", nullable = false)
private String careerLinkContent;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "mentor_id", nullable = false)
private Mentor mentor;

private CareerLink(String careerLinkContent, Mentor mentor){
this.careerLinkContent = careerLinkContent;
this.mentor = mentor;
}

public static CareerLink createCareerLink (String careerLinkContent, Mentor mentor){
return new CareerLink(careerLinkContent, mentor);
}
}
95 changes: 95 additions & 0 deletions src/main/java/com/speechpeach/speech/mentoring/entity/Mentor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package com.speechpeach.speech.mentoring.entity;

import com.speechpeach.speech.global.entity.BaseEntity;
import com.speechpeach.speech.member.entity.Member;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Entity
@Table(name = "mentors")
public class Mentor extends BaseEntity {

@Id
@Column(name = "mentor_id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long mentorId;

@Column(name = "mentor_name", nullable = false)
private String mentorName;

@Column(name = "mentor_career_period", nullable = false)
private String mentorCareerPeriod;
Kim-AYoung marked this conversation as resolved.
Show resolved Hide resolved

@Column(name = "mentor_profile_image", nullable = false)
private String mentorProfileImage;

@Column(name = "mentor_genre", nullable = false)
private String mentorGenre;
Kim-AYoung marked this conversation as resolved.
Show resolved Hide resolved

@Column(name = "mentor_email", nullable = false)
private String mentorEmail;

@Column(name = "mentor_phone_number", nullable = false)
private String mentorPhoneNumber;

@Column(name = "mentor_title", nullable = false)
private String mentorTitle;

@Column(name = "mentor_content",columnDefinition = "TEXT", length = 500, nullable = false)
private String mentorContent;

@Column(name = "mentor_mentoring_method", nullable = false)
private String mentorMentoringMethod;

@Column(name = "mentor_mentoring_time", nullable = false)
private int mentorMentoringTime;

@Column(name = "mentor_mentoring_price", nullable = false)
private int mentorMentoringPrice;

@Column(name = "mentor_status_id", nullable = false)
private String mentorStatusId;
Kim-AYoung marked this conversation as resolved.
Show resolved Hide resolved

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id", nullable = false)
private Member member;

private Mentor(String mentorName, String mentorCareerPeriod, String mentorProfileImage, String mentorGenre,
String mentorEmail, String mentorPhoneNumber, String mentorTitle, String mentorContent, String mentorMentoringMethod,
int mentorMentoringTime, int mentorMentoringPrice, String mentorStatusId, Member member){
this.mentorName = mentorName;
this.mentorCareerPeriod = mentorCareerPeriod;
this.mentorProfileImage = mentorProfileImage;
this.mentorGenre = mentorGenre;
this.mentorEmail = mentorEmail;
this.mentorPhoneNumber = mentorPhoneNumber;
this.mentorTitle = mentorTitle;
this.mentorContent = mentorContent;
this.mentorMentoringMethod = mentorMentoringMethod;
this.mentorMentoringTime = mentorMentoringTime;
this.mentorMentoringPrice = mentorMentoringPrice;
this.mentorStatusId = mentorStatusId;
this.member = member;
}

public static Mentor createMento(String mentorName, String mentorCareerPeriod, String mentorProfileImage, String mentorGenre,
String mentorEmail, String mentorPhoneNumber, String mentorTitle, String mentorContent, String mentorMentoringMethod,
int mentorMentoringTime, int mentorMentoringPrice, String mentorStatusId, Member member){
return new Mentor(mentorName, mentorCareerPeriod, mentorProfileImage, mentorGenre, mentorEmail, mentorPhoneNumber,
mentorTitle, mentorContent, mentorMentoringMethod, mentorMentoringTime, mentorMentoringPrice,
mentorStatusId, member);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.speechpeach.speech.mentoring.entity;

import com.speechpeach.speech.global.entity.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Entity
@Table(name = "mentor_careers")
public class MentorCareer extends BaseEntity {

@Id
@Column(name = "mentor_career_id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long mentorCareerId;

@Column(name = "mentor_career_content", columnDefinition = "TEXT", length = 500, nullable = false)
private String mentorCareerContent;

@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "mentor_id", nullable = false)
private Mentor mentor;

private MentorCareer(String mentorCareerContent, Mentor mentor){
this.mentorCareerContent = mentorCareerContent;
this.mentor = mentor;
}

public static MentorCareer createMentoCareer(String mentorCareerContent, Mentor mentor){
return new MentorCareer(mentorCareerContent, mentor);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
package com.speechpeach.speech.mentoring.entity;

import com.speechpeach.speech.member.entity.Member;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import java.time.LocalDateTime;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Getter
@Entity
@Table(name = "mentoring_applications")
public class MentoringApplication {

@Id
@Column(name = "mentoring_apply_id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long mentoringApplyId;

@CreatedDate
@Column(nullable = false, updatable = false)
private LocalDateTime mentoringApplyDate;

@Column(name = "mentoring_apply_mentee_name", nullable = false)
private String mentoringApplyMenteeName;

@Column(name = "mentoring_apply_mentee_phone_number", nullable = false)
private String mentoringApplyMenteePhoneNumber;

@Column(name = "mentoring_apply_mentee_email", nullable = false)
private String mentoringApplyMenteeEmail;

@Column(name = "mentoring_apply_to_mentor_message", columnDefinition = "TEXT", length = 500, nullable = false)
private String mentoringApplyToMentorMessage;

@Column(name = "mentoring_apply_status", nullable = false)
private String mentoringApplyStatus;
Kim-AYoung marked this conversation as resolved.
Show resolved Hide resolved

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id", nullable = false)
private Member member;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "mentor_id", nullable = false)
private Mentor mentor;

private MentoringApplication(String mentoringApplyMenteeName,
String mentoringApplyMenteePhoneNumber,
String mentoringApplyMenteeEmail, String mentoringApplyToMentorMessage,
String mentoringApplyStatus,
Member member, Mentor mentor) {
this.mentoringApplyMenteeName = mentoringApplyMenteeName;
this.mentoringApplyMenteePhoneNumber = mentoringApplyMenteePhoneNumber;
this.mentoringApplyMenteeEmail = mentoringApplyMenteeEmail;
this.mentoringApplyToMentorMessage = mentoringApplyToMentorMessage;
this.mentoringApplyStatus = mentoringApplyStatus;
this.member = member;
this.mentor = mentor;
}

public static MentoringApplication createMentoringApplication(String mentoringApplyMenteeName,
String mentoringApplyMenteePhoneNumber,
String mentoringApplyMenteeEmail, String mentoringApplyToMentorMessage,
String mentoringApplyStatus,
Member member, Mentor mentor) {
return new MentoringApplication(mentoringApplyMenteeName, mentoringApplyMenteePhoneNumber,
mentoringApplyMenteeEmail,
mentoringApplyToMentorMessage, mentoringApplyStatus, member, mentor);
}

}
Loading
Loading