-
Notifications
You must be signed in to change notification settings - Fork 0
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 #6 from GDSC-Hongik/feature/domain
domain 생성
- Loading branch information
Showing
13 changed files
with
328 additions
and
7 deletions.
There are no files selected for viewing
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
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/gdgoc/study_group/answer/domain/Answer.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,27 @@ | ||
package com.gdgoc.study_group.answer.domain; | ||
|
||
import com.gdgoc.study_group.member.domain.Member; | ||
import com.gdgoc.study_group.study.domain.Study; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
|
||
@Entity | ||
public class Answer { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "member_id") | ||
private Member member; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "study_id") | ||
private Study study; | ||
|
||
private String answer; | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/gdgoc/study_group/comment/domain/Comment.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,27 @@ | ||
package com.gdgoc.study_group.comment.domain; | ||
|
||
import com.gdgoc.study_group.member.domain.Member; | ||
import com.gdgoc.study_group.round.domain.Round; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
|
||
@Entity | ||
public class Comment { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "round_id") | ||
private Round round; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "member_id") | ||
private Member member; | ||
|
||
private String comment; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/gdgoc/study_group/curriculum/domain/Curriculum.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,23 @@ | ||
package com.gdgoc.study_group.curriculum.domain; | ||
|
||
import com.gdgoc.study_group.study.domain.Study; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
|
||
@Entity | ||
public class Curriculum { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "study_id", nullable = false) | ||
private Study study; | ||
|
||
private Integer week; | ||
private String subject; // 해당 회차의 주제 | ||
} |
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,24 @@ | ||
package com.gdgoc.study_group.day.domain; | ||
|
||
import com.gdgoc.study_group.study.domain.Study; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import java.time.LocalTime; | ||
|
||
@Entity | ||
public class Day { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "study_id", nullable = false) | ||
private Study study; | ||
|
||
private String day; | ||
private LocalTime startTime; | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/gdgoc/study_group/member/domain/Member.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,28 @@ | ||
package com.gdgoc.study_group.member.domain; | ||
|
||
import com.gdgoc.study_group.roundMember.domain.RoundMember; | ||
import com.gdgoc.study_group.studyMember.domain.StudyMember; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.OneToMany; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Entity | ||
public class Member { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@OneToMany(mappedBy = "member") | ||
private List<StudyMember> studyMembers = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "member") | ||
private List<RoundMember> roundMembers = new ArrayList<>(); | ||
|
||
private String name; | ||
private String github; | ||
private String studentNumber; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/gdgoc/study_group/round/domain/Round.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,39 @@ | ||
package com.gdgoc.study_group.round.domain; | ||
|
||
import com.gdgoc.study_group.comment.domain.Comment; | ||
import com.gdgoc.study_group.roundMember.domain.RoundMember; | ||
import com.gdgoc.study_group.study.domain.Study; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.OneToMany; | ||
import java.time.LocalDate; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Entity | ||
public class Round { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "study_id") | ||
private Study study; | ||
|
||
@OneToMany(mappedBy = "round") | ||
private List<RoundMember> roundMembers = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "round") | ||
private List<RoundThumbnail> images = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "round") | ||
private List<Comment> comments = new ArrayList<>(); | ||
|
||
private String goal; // 학습 목표 | ||
private String studyDetail; // 학습 내용 | ||
private LocalDate roundDate; // 회차 진행한 날짜 | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/gdgoc/study_group/round/domain/RoundThumbnail.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,31 @@ | ||
package com.gdgoc.study_group.round.domain; | ||
|
||
import com.gdgoc.study_group.member.domain.Member; | ||
import jakarta.persistence.Entity; | ||
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; | ||
|
||
@Entity | ||
@Table(name = "ROUND_THUMBNAIL") | ||
public class RoundThumbnail { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "round_id") | ||
private Round round; | ||
|
||
@OneToOne | ||
@JoinColumn(name = "member_id") | ||
private Member member; | ||
|
||
private String fileName; | ||
private String filePath; // 파일의 이름을 제외한 저장 위치 | ||
private String type; // jpeg, png... | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/gdgoc/study_group/roundMember/domain/RoundMember.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,29 @@ | ||
package com.gdgoc.study_group.roundMember.domain; | ||
|
||
import com.gdgoc.study_group.member.domain.Member; | ||
import com.gdgoc.study_group.round.domain.Round; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "ROUND_MEMBER") | ||
public class RoundMember { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "round_id") | ||
private Round round; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "member_id") | ||
private Member member; | ||
|
||
private String retrospect; // 후기 내용 | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/com/gdgoc/study_group/study/domain/Study.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,43 @@ | ||
package com.gdgoc.study_group.study.domain; | ||
|
||
import com.gdgoc.study_group.answer.domain.Answer; | ||
import com.gdgoc.study_group.curriculum.domain.Curriculum; | ||
import com.gdgoc.study_group.day.domain.Day; | ||
import com.gdgoc.study_group.round.domain.Round; | ||
import com.gdgoc.study_group.studyMember.domain.StudyMember; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.OneToMany; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Entity | ||
public class Study { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@OneToMany(mappedBy = "study") | ||
private List<StudyMember> studyMembers = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "study") | ||
private List<Round> rounds = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "study") | ||
private List<Curriculum> curriculums = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "study") | ||
private List<Day> days = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "study") | ||
private List<Answer> answers = new ArrayList<>(); | ||
|
||
private String name; | ||
private String description; | ||
private boolean isOffline; | ||
private boolean isActive; | ||
private Integer participants; // 현재 스터디 참여 인원 | ||
private Integer maxParticipants; // null == 인원 제한 X | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/gdgoc/study_group/studyMember/domain/Status.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,8 @@ | ||
package com.gdgoc.study_group.studyMember.domain; | ||
|
||
public enum Status { | ||
LEADER, | ||
PARTICIPANT, | ||
WAITING, | ||
CANCELED; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/gdgoc/study_group/studyMember/domain/StudyMember.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,32 @@ | ||
package com.gdgoc.study_group.studyMember.domain; | ||
|
||
import com.gdgoc.study_group.member.domain.Member; | ||
import com.gdgoc.study_group.study.domain.Study; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.ManyToOne; | ||
import jakarta.persistence.Table; | ||
|
||
@Entity | ||
@Table(name = "STUDY_MEMBER") | ||
public class StudyMember { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "member_id") | ||
private Member member; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "study_id") | ||
private Study study; | ||
|
||
@Enumerated(EnumType.STRING) | ||
private Status status; | ||
} |