From 9a34d271511a703bb25ea134005b2fe514af6288 Mon Sep 17 00:00:00 2001 From: syyling Date: Wed, 1 May 2024 15:15:11 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[feat]=20=EB=B4=A4=EC=96=B4=EC=9A=94=20?= =?UTF-8?q?=EB=8F=84=EB=A9=94=EC=9D=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../watched/domain/entity/Watched.java | 33 ++++++++++++++++++ .../domain/entity/WatchedPlaylist.java | 34 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.java create mode 100644 src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.java diff --git a/src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.java b/src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.java new file mode 100644 index 0000000..a962ff5 --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.java @@ -0,0 +1,33 @@ +package com.mookive.mookive_backend.watched.domain.entity; + +import com.mookive.mookive_backend.common.BaseTimeEntity; +import com.mookive.mookive_backend.movie.domain.entity.Movie; +import com.mookive.mookive_backend.user.domain.entity.User; +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Watched extends BaseTimeEntity { + + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + @JoinColumn(name = "movie_id") + private Movie movie; + + @ManyToOne + @JoinColumn(name = "user_id") + private User user; + + @Builder + public Watched(Movie movie, User user) { + this.movie = movie; + this.user = user; + } +} diff --git a/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.java b/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.java new file mode 100644 index 0000000..7804c8f --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.java @@ -0,0 +1,34 @@ +package com.mookive.mookive_backend.watchedPlaylist.domain.entity; + +import com.mookive.mookive_backend.common.BaseTimeEntity; +import com.mookive.mookive_backend.playlist.domain.entity.Playlist; +import com.mookive.mookive_backend.user.domain.entity.User; +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class WatchedPlaylist extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @OneToOne + @JoinColumn(name = "user_id") + private User user; + + @OneToOne + @JoinColumn(name = "playlist_id") + private Playlist playlist; + + @Builder + public WatchedPlaylist(User user, Playlist playlist) { + this.user = user; + this.playlist = playlist; + } +} \ No newline at end of file From acae6a2ebc22724ce746e1dda0f63d1822176b8f Mon Sep 17 00:00:00 2001 From: syyling Date: Wed, 1 May 2024 15:15:11 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[feat]=20=EB=B4=A4=EC=96=B4=EC=9A=94,=20?= =?UTF-8?q?=EB=B4=A4=EC=96=B4=EC=9A=94=20=ED=94=8C=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=97=94=ED=8B=B0=ED=8B=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../watched/domain/entity/Watched.java | 33 ++++++++++++++++++ .../domain/entity/WatchedPlaylist.java | 34 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.java create mode 100644 src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.java diff --git a/src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.java b/src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.java new file mode 100644 index 0000000..a962ff5 --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.java @@ -0,0 +1,33 @@ +package com.mookive.mookive_backend.watched.domain.entity; + +import com.mookive.mookive_backend.common.BaseTimeEntity; +import com.mookive.mookive_backend.movie.domain.entity.Movie; +import com.mookive.mookive_backend.user.domain.entity.User; +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class Watched extends BaseTimeEntity { + + @Id @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + @JoinColumn(name = "movie_id") + private Movie movie; + + @ManyToOne + @JoinColumn(name = "user_id") + private User user; + + @Builder + public Watched(Movie movie, User user) { + this.movie = movie; + this.user = user; + } +} diff --git a/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.java b/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.java new file mode 100644 index 0000000..7804c8f --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.java @@ -0,0 +1,34 @@ +package com.mookive.mookive_backend.watchedPlaylist.domain.entity; + +import com.mookive.mookive_backend.common.BaseTimeEntity; +import com.mookive.mookive_backend.playlist.domain.entity.Playlist; +import com.mookive.mookive_backend.user.domain.entity.User; +import jakarta.persistence.*; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class WatchedPlaylist extends BaseTimeEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @OneToOne + @JoinColumn(name = "user_id") + private User user; + + @OneToOne + @JoinColumn(name = "playlist_id") + private Playlist playlist; + + @Builder + public WatchedPlaylist(User user, Playlist playlist) { + this.user = user; + this.playlist = playlist; + } +} \ No newline at end of file From 8d73dacd0539a4ad60169efd3d235cae5b53d503 Mon Sep 17 00:00:00 2001 From: syyling Date: Wed, 1 May 2024 15:17:34 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[feat]=20=EB=B4=A4=EC=96=B4=EC=9A=94,=20?= =?UTF-8?q?=EB=B4=A4=EC=96=B4=EC=9A=94=20=ED=94=8C=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20repo=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../watched/domain/repository/WatchedRepository.java | 7 +++++++ .../domain/repository/WatchedPlaylistRepository.java | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 src/main/java/com/mookive/mookive_backend/watched/domain/repository/WatchedRepository.java create mode 100644 src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/repository/WatchedPlaylistRepository.java diff --git a/src/main/java/com/mookive/mookive_backend/watched/domain/repository/WatchedRepository.java b/src/main/java/com/mookive/mookive_backend/watched/domain/repository/WatchedRepository.java new file mode 100644 index 0000000..470092f --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/watched/domain/repository/WatchedRepository.java @@ -0,0 +1,7 @@ +package com.mookive.mookive_backend.watched.domain.repository; + +import com.mookive.mookive_backend.watched.domain.entity.Watched; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface WatchedRepository extends JpaRepository { +} diff --git a/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/repository/WatchedPlaylistRepository.java b/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/repository/WatchedPlaylistRepository.java new file mode 100644 index 0000000..6c2873a --- /dev/null +++ b/src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/repository/WatchedPlaylistRepository.java @@ -0,0 +1,7 @@ +package com.mookive.mookive_backend.watchedPlaylist.domain.repository; + +import com.mookive.mookive_backend.watchedPlaylist.domain.entity.WatchedPlaylist; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface WatchedPlaylistRepository extends JpaRepository { +}