-
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
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/main/java/com/mookive/mookive_backend/ranking/domain/entity/Ranking.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,35 @@ | ||
package com.mookive.mookive_backend.ranking.domain.entity; | ||
|
||
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 Ranking { | ||
|
||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "movie_id") | ||
private Movie movie; | ||
|
||
@ManyToOne | ||
@JoinColumn(name = "user_id") | ||
private User user; | ||
|
||
private int rankingNumber; | ||
|
||
@Builder | ||
public Ranking(Movie movie, User user, int rankingNumber) { | ||
this.movie = movie; | ||
this.user = user; | ||
this.rankingNumber = rankingNumber; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/mookive/mookive_backend/ranking/domain/respository/RankingRepository.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.ranking.domain.respository; | ||
|
||
import com.mookive.mookive_backend.ranking.domain.entity.Ranking; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface RankingRepository extends JpaRepository<Ranking, Long> { | ||
} |