@@ -1,76 +0,0 @@
|
||||
package ru.soune.nocopy.entity.monitoring;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import ru.soune.nocopy.entity.file.FileEntity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Entity
|
||||
@Table(name = "found_violations",
|
||||
indexes = {
|
||||
@Index(name = "idx_file_id", columnList = "file_id"),
|
||||
@Index(name = "idx_found_at", columnList = "found_at")
|
||||
})
|
||||
public class FoundViolationEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
private String id;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "file_id", nullable = false)
|
||||
private FileEntity file;
|
||||
|
||||
@Column(name = "user_id", nullable = false)
|
||||
private Long userId;
|
||||
|
||||
@Column(name = "file_id_copy", nullable = false)
|
||||
private String fileId;
|
||||
|
||||
@Column(name = "file_name_copy")
|
||||
private String fileName;
|
||||
|
||||
@Column(name = "found_url", nullable = false, length = 2048)
|
||||
private String foundUrl;
|
||||
|
||||
@Column(name = "page_url", length = 2048)
|
||||
private String pageUrl;
|
||||
|
||||
@Column(name = "page_title")
|
||||
private String pageTitle;
|
||||
|
||||
@Column(name = "host")
|
||||
private String host;
|
||||
|
||||
@Column(name = "image_width")
|
||||
private Integer imageWidth;
|
||||
|
||||
@Column(name = "image_height")
|
||||
private Integer imageHeight;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "search_engine", nullable = false)
|
||||
private SearchEngine searchEngine;
|
||||
|
||||
@Column(name = "search_session_id")
|
||||
private String searchSessionId;
|
||||
|
||||
@Column(name = "found_at", nullable = false)
|
||||
private LocalDateTime foundAt;
|
||||
|
||||
@Column(name = "is_new", nullable = false)
|
||||
private boolean isNew = true;
|
||||
|
||||
@Column(name = "is_notified", nullable = false)
|
||||
private boolean isNotified = false;
|
||||
|
||||
@PrePersist
|
||||
public void prePersist() {
|
||||
this.foundAt = LocalDateTime.now();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user