2025-12-10 19:12:54 +07:00
|
|
|
package ru.soune.nocopy.entity;
|
2025-11-26 15:49:51 +07:00
|
|
|
|
|
|
|
|
import jakarta.persistence.*;
|
|
|
|
|
import lombok.*;
|
|
|
|
|
import org.springframework.data.annotation.CreatedDate;
|
|
|
|
|
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
|
|
|
|
@Entity
|
|
|
|
|
@Table(name = "image_protection")
|
|
|
|
|
@Getter
|
|
|
|
|
@Setter
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
@AllArgsConstructor
|
|
|
|
|
@ToString
|
|
|
|
|
@EntityListeners(AuditingEntityListener.class)
|
|
|
|
|
public class ImageProtection {
|
|
|
|
|
|
|
|
|
|
@Id
|
|
|
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
|
|
private Long protectionId;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
|
|
|
|
@JoinColumn(name = "user_id", nullable = false)
|
|
|
|
|
@ToString.Exclude
|
|
|
|
|
private User user;
|
|
|
|
|
|
|
|
|
|
@ManyToOne(fetch = FetchType.LAZY)
|
|
|
|
|
@JoinColumn(name = "content_id", nullable = false)
|
|
|
|
|
@ToString.Exclude
|
|
|
|
|
private UserContent content;
|
|
|
|
|
|
|
|
|
|
@Column(name = "protection_method", nullable = false, length = 50)
|
|
|
|
|
private String protectionMethod;
|
|
|
|
|
|
|
|
|
|
@Column(name = "protection_level", nullable = false)
|
|
|
|
|
private Integer protectionLevel;
|
|
|
|
|
|
|
|
|
|
@Column(name = "is_active", nullable = false)
|
|
|
|
|
private Boolean isActive = true;
|
|
|
|
|
|
|
|
|
|
@CreatedDate
|
|
|
|
|
@Column(name = "applied_at", nullable = false, updatable = false)
|
|
|
|
|
private LocalDateTime appliedAt;
|
|
|
|
|
|
|
|
|
|
@Column(name = "metadata", columnDefinition = "JSON")
|
|
|
|
|
private String metadata;
|
|
|
|
|
}
|