-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTrack.java
More file actions
65 lines (52 loc) · 1.72 KB
/
Track.java
File metadata and controls
65 lines (52 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package umc.codeplay.domain;
import jakarta.persistence.*;
import lombok.AccessLevel;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Comment;
import umc.codeplay.domain.common.BaseEntity;
@Entity
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Track extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
// TODO: 추후 BigInteger로 변환
private Long id;
@Column(nullable = false, length = 100)
private String title;
@Column(columnDefinition = "TEXT")
@Comment("보컬 url")
private String vocalUrl;
@Column(columnDefinition = "TEXT")
@Comment("반주 url")
private String instrumentalUrl;
@Column(columnDefinition = "TEXT")
@Comment("베이스 url")
private String bassUrl;
@Column(columnDefinition = "TEXT")
@Comment("드럼 url")
private String drumsUrl;
@ManyToOne(fetch = FetchType.LAZY)
@Comment("입력 음악 ID")
@JoinColumn(name = "music_id", nullable = false)
private Music music;
@Builder
public Track(
String vocalUrl, String instrumentalUrl, String bassUrl, String drumsUrl, Music music) {
this.title = music.getTitle() + "_스템분리 결과";
this.vocalUrl = vocalUrl;
this.instrumentalUrl = instrumentalUrl;
this.bassUrl = bassUrl;
this.drumsUrl = drumsUrl;
this.music = music;
}
public void updateTrackResult(
String vocalUrl, String instrumentalUrl, String bassUrl, String drumsUrl) {
this.vocalUrl = vocalUrl;
this.instrumentalUrl = instrumentalUrl;
this.bassUrl = bassUrl;
this.drumsUrl = drumsUrl;
}
}