@@ -1,57 +0,0 @@
|
||||
package ru.soune.nocopy.entity.file;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import ru.soune.nocopy.entity.user.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "violations")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
@EntityListeners(AuditingEntityListener.class)
|
||||
public class Violation {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long violationId;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "user_id", nullable = false)
|
||||
@ToString.Exclude
|
||||
private User user;
|
||||
|
||||
@Column(name = "violation_type", nullable = false, length = 50)
|
||||
private String violationType;
|
||||
|
||||
@Column(name = "description", columnDefinition = "TEXT")
|
||||
private String description;
|
||||
|
||||
@Column(name = "content_id")
|
||||
private Long contentId;
|
||||
|
||||
@Column(name = "status", nullable = false, length = 20)
|
||||
private String status = "new";
|
||||
|
||||
@Column(name = "severity", length = 20)
|
||||
private String severity;
|
||||
|
||||
@Column(name = "resolved_at")
|
||||
private LocalDateTime resolvedAt;
|
||||
|
||||
@Column(name = "resolved_by")
|
||||
private Long resolvedBy;
|
||||
|
||||
@Column(name = "resolution_notes", columnDefinition = "TEXT")
|
||||
private String resolutionNotes;
|
||||
|
||||
@CreatedDate
|
||||
@Column(name = "created_at", nullable = false, updatable = false)
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
@@ -23,10 +23,5 @@ public class GlobalSearchResult {
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String thumbnail;
|
||||
|
||||
private String fileStatus;
|
||||
|
||||
@Column(length = 5000)
|
||||
private String searchResults;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import org.hibernate.annotations.ColumnDefault;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
|
||||
import ru.soune.nocopy.entity.company.Company;
|
||||
import ru.soune.nocopy.entity.file.Violation;
|
||||
import ru.soune.nocopy.entity.tarif.TariffInfo;
|
||||
import ru.soune.nocopy.entity.tarif.TariffStatus;
|
||||
|
||||
@@ -81,11 +80,6 @@ public class User {
|
||||
@ToString.Exclude
|
||||
private List<UserContent> userContents = new ArrayList<>();
|
||||
|
||||
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JsonIgnore
|
||||
@ToString.Exclude
|
||||
private List<Violation> violations = new ArrayList<>();
|
||||
|
||||
@OneToOne(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
@JsonIgnore
|
||||
private ProtectedFileCheck protectedFileCheck;
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package ru.soune.nocopy.entity.violation;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import ru.soune.nocopy.entity.file.FileEntity;
|
||||
import ru.soune.nocopy.entity.search.GlobalSearchResult;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Entity
|
||||
@Table(name = "violation")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Violation {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "url", nullable = false, unique = true)
|
||||
private String url;
|
||||
|
||||
@Column(name = "page_url")
|
||||
private String pageUrl;
|
||||
|
||||
@Column(name = "title")
|
||||
private String pageTitle;
|
||||
|
||||
@Column(name = "host")
|
||||
private String host;
|
||||
|
||||
@Column(name = "status")
|
||||
private String status;
|
||||
|
||||
@CreatedDate
|
||||
@Column(name = "created_at", updatable = false)
|
||||
private LocalDateTime createdDate;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "file")
|
||||
@ToString.Exclude
|
||||
@JsonIgnore
|
||||
private FileEntity fileEntity;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "global_search_result")
|
||||
@ToString.Exclude
|
||||
@JsonIgnore
|
||||
private GlobalSearchResult globalSearchResult;
|
||||
}
|
||||
Reference in New Issue
Block a user