-
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.
- Loading branch information
Showing
10 changed files
with
179 additions
and
2 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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/mju/course/domain/model/lecture/LectureAnswer.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,37 @@ | ||
package com.mju.course.domain.model.lecture; | ||
|
||
import com.mju.course.domain.model.BaseTimeEntity; | ||
import com.mju.course.domain.model.User; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
public class LectureAnswer extends BaseTimeEntity { | ||
|
||
@Id | ||
@Column(name = "lecture_answer_index") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="lecture_question_index") | ||
private LectureQuestion lectureQuestion; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "user_index") | ||
private User user; | ||
|
||
@Column(name = "lecture_answer") | ||
private String lectureAnswer; | ||
|
||
// 양방향 매핑 | ||
@OneToMany(mappedBy = "lectureAnswer") | ||
private List<LectureAnswerPhoto> lectureAnswerPhotoList = new ArrayList<>(); | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/mju/course/domain/model/lecture/LectureAnswerPhoto.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,26 @@ | ||
package com.mju.course.domain.model.lecture; | ||
|
||
import com.mju.course.domain.model.BaseTimeEntity; | ||
import com.mju.course.domain.model.User; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
public class LectureAnswerPhoto extends BaseTimeEntity { | ||
|
||
@Id | ||
@Column(name = "lecture_answer_photo_index") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="lecture_answer_index") | ||
private LectureAnswer lectureAnswer; | ||
|
||
@Column(name = "lecture_answer_photo_key") | ||
private String lectureAnswerPhotoKey; | ||
|
||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/com/mju/course/domain/model/lecture/LectureQuestion.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,42 @@ | ||
package com.mju.course.domain.model.lecture; | ||
|
||
import com.mju.course.domain.model.BaseTimeEntity; | ||
import com.mju.course.domain.model.User; | ||
import com.mju.course.domain.model.course.Course; | ||
import com.mju.course.domain.model.course.Skill; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
public class LectureQuestion extends BaseTimeEntity { | ||
|
||
@Id | ||
@Column(name = "lecture_question_index") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="lecture_index") | ||
private Lecture lecture; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "user_index") | ||
private User user; | ||
|
||
@Column(name = "lecture_question") | ||
private String lectureQuestion; | ||
|
||
// 양방향 매핑 | ||
@OneToMany(mappedBy = "lectureQuestion") | ||
private List<LectureAnswer> lectureAnswerList = new ArrayList<>(); | ||
|
||
@OneToMany(mappedBy = "lectureQuestion") | ||
private List<LectureQuestionPhoto> lectureQuestionPhotoList = new ArrayList<>(); | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/mju/course/domain/model/lecture/LectureQuestionPhoto.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,25 @@ | ||
package com.mju.course.domain.model.lecture; | ||
|
||
import com.mju.course.domain.model.BaseTimeEntity; | ||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor | ||
public class LectureQuestionPhoto extends BaseTimeEntity { | ||
|
||
@Id | ||
@Column(name = "lecture_question_photo_index") | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name="lecture_question_index") | ||
private LectureQuestion lectureQuestion; | ||
|
||
@Column(name = "lecture_question_photo_key") | ||
private String lectureQuestionPhotoKey; | ||
|
||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/com/mju/course/domain/repository/course/CourseRepositoryImpl.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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/mju/course/domain/repository/lecture/LectureAnswerPhotoRepository.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 com.mju.course.domain.repository.lecture; | ||
|
||
import com.mju.course.domain.model.lecture.LectureAnswerPhoto; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface LectureAnswerPhotoRepository extends JpaRepository<LectureAnswerPhoto, Long> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/mju/course/domain/repository/lecture/LectureAnswerRepository.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 com.mju.course.domain.repository.lecture; | ||
|
||
import com.mju.course.domain.model.lecture.LectureAnswer; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface LectureAnswerRepository extends JpaRepository<LectureAnswer, Long> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/mju/course/domain/repository/lecture/LectureQuestionPhotoRepository.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 com.mju.course.domain.repository.lecture; | ||
|
||
import com.mju.course.domain.model.lecture.LectureQuestionPhoto; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface LectureQuestionPhotoRepository extends JpaRepository<LectureQuestionPhoto, Long> { | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/mju/course/domain/repository/lecture/LectureQuestionRepository.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 com.mju.course.domain.repository.lecture; | ||
|
||
import com.mju.course.domain.model.lecture.LectureQuestion; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface LectureQuestionRepository extends JpaRepository<LectureQuestion, Long> { | ||
|
||
} |