change package,change message_code
Test Workflow / test (push) Waiting to run

This commit is contained in:
vladp
2025-12-10 19:12:54 +07:00
parent 76da2e94c9
commit a30b0488e8
60 changed files with 154 additions and 161 deletions
@@ -0,0 +1,79 @@
package ru.soune.nocopy.entity;
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 = "user_content")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
@EntityListeners(AuditingEntityListener.class)
public class UserContent {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long contentId;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
@ToString.Exclude
private User user;
@Column(name = "filename", nullable = false, length = 255)
private String filename;
@Column(name = "original_filename", nullable = false, length = 255)
private String originalFilename;
@Enumerated(EnumType.STRING)
@Column(name = "file_type", nullable = false, length = 20)
private FileType fileType;
@Column(name = "file_extension", nullable = false, length = 10)
private String fileExtension;
@Column(name = "file_size", nullable = false)
private Long fileSize;
@Column(name = "file_path", nullable = false, columnDefinition = "TEXT")
private String filePath;
@Column(name = "protection_level")
private Integer protectionLevel = 0;
@Column(name = "geometric_resistant")
private Boolean geometricResistant = false;
@Column(name = "watermark_applied")
private Boolean watermarkApplied = false;
@Column(name = "protection_hash", length = 64)
private String protectionHash;
@Column(name = "watermark_id", length = 50)
private String watermarkId;
@Enumerated(EnumType.STRING)
@Column(name = "status", nullable = false, length = 20)
private ContentStatus status = ContentStatus.PROCESSING;
@CreatedDate
@Column(name = "upload_date", nullable = false, updatable = false)
private LocalDateTime uploadDate;
public Double getFileSizeInGB() {
return fileSize != null ? fileSize / (1024.0 * 1024.0 * 1024.0) : 0.0;
}
public Boolean isProtected() {
return protectionLevel != null && protectionLevel > 0;
}
}