-
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 #27 from syyling/feat/22
[feat] 봤어요, 봤어요 플레이리스트 도메인 추가
- Loading branch information
Showing
4 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/main/java/com/mookive/mookive_backend/watched/domain/entity/Watched.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,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; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/mookive/mookive_backend/watched/domain/repository/WatchedRepository.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,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<Watched, Long> { | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/mookive/mookive_backend/watchedPlaylist/domain/entity/WatchedPlaylist.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,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; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
.../mookive/mookive_backend/watchedPlaylist/domain/repository/WatchedPlaylistRepository.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,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<WatchedPlaylist, Long> { | ||
} |