feat: add Stream table & boilerplate
This commit is contained in:
31
src/main/java/com/ddf/vodsystem/entities/Stream.java
Normal file
31
src/main/java/com/ddf/vodsystem/entities/Stream.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.ddf.vodsystem.entities;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "streams")
|
||||
@Data
|
||||
public class Stream {
|
||||
@Id
|
||||
@Column(name = "id", nullable = false, unique = true)
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JsonIgnore
|
||||
@JoinColumn(name = "user_id", nullable = false)
|
||||
private User user;
|
||||
|
||||
@Column(name = "start_date")
|
||||
private LocalDateTime startDate;
|
||||
|
||||
@Column(name = "end_date")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
@Column(name = "last_seen")
|
||||
private LocalDateTime lastSeen;
|
||||
}
|
||||
@@ -34,5 +34,8 @@ public class User {
|
||||
|
||||
@Column(name = "created_at")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Column(name = "stream_key")
|
||||
private String streamKey;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user