-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ FEAT. UserTTSSegment.java 사용자 음성 변환 Entity 추가
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
src/main/java/fairytale/tbd/domain/voice/entity/UserTTSSegment.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,54 @@ | ||
package fairytale.tbd.domain.voice.entity; | ||
|
||
import fairytale.tbd.domain.user.entity.User; | ||
import fairytale.tbd.global.entity.BaseEntity; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.FetchType; | ||
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; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Builder | ||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Table(name = "user_text_to_speech_segment") | ||
public class UserTTSSegment extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "uset_text_to_speech_segment_id") | ||
private Long id; | ||
|
||
@Column(name = "history_id", nullable = false) | ||
private String historyId; | ||
|
||
@Column(name = "user_text_to_speech_segment_url") | ||
private String url; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "user_id") | ||
private User user; | ||
|
||
@OneToOne(fetch = FetchType.EAGER) | ||
@JoinColumn(name = "fairytale_segment_id") | ||
private Segment segment; | ||
|
||
// 연관 관계 편의 메서드 | ||
public void setUser(User user) { | ||
this.user = user; | ||
} | ||
|
||
public void setSegment(Segment segment) { | ||
this.segment = segment; | ||
} | ||
} |