Skip to content

Commit

Permalink
✨ FEAT. UserTTSSegment.java 사용자 음성 변환 Entity 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaa committed May 1, 2024
1 parent 50500e0 commit 8bd6b76
Showing 1 changed file with 54 additions and 0 deletions.
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;
}
}

0 comments on commit 8bd6b76

Please sign in to comment.