на 3 готово
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
package org.example.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Entity
|
||||
@@ -19,32 +21,50 @@ public class Attachment {
|
||||
@Id
|
||||
private UUID id;
|
||||
|
||||
@Column(name = "chat_id", nullable = false)
|
||||
@Column(name = "chat_id")
|
||||
@JsonProperty("chat_id")
|
||||
private UUID chatId;
|
||||
|
||||
@Column(name = "uploader_id", nullable = false)
|
||||
private UUID uploaderId;
|
||||
@Column(name = "uploader_id")
|
||||
@JsonProperty("owner_id")
|
||||
private UUID ownerId;
|
||||
|
||||
@Column(name = "object_key", nullable = false, length = 512)
|
||||
private String objectKey;
|
||||
@Column(name = "original_filename")
|
||||
@JsonProperty("filename")
|
||||
private String filename;
|
||||
|
||||
@Column(name = "original_filename", nullable = false)
|
||||
private String originalFilename;
|
||||
|
||||
@Column(name = "content_type", nullable = false, length = 128)
|
||||
@Column(name = "content_type")
|
||||
@JsonProperty("content_type")
|
||||
private String contentType;
|
||||
|
||||
@Column(name = "size_bytes", nullable = false)
|
||||
@Column(name = "size_bytes")
|
||||
@JsonProperty("size_bytes")
|
||||
private long sizeBytes;
|
||||
|
||||
@Column(name = "checksum_sha256", nullable = false, length = 64)
|
||||
private String checksumSha256;
|
||||
@Column(name = "checksum_sha256")
|
||||
@JsonProperty("sha256")
|
||||
private String sha256;
|
||||
|
||||
private Integer width;
|
||||
@Column(name = "status")
|
||||
@JsonProperty("status")
|
||||
private String status;
|
||||
|
||||
private Integer height;
|
||||
@Transient
|
||||
@JsonProperty("variants")
|
||||
private List<VariantResponse> variants;
|
||||
|
||||
@CreationTimestamp
|
||||
@Column(name = "created_at", nullable = false, updatable = false)
|
||||
@Column(name = "error_code")
|
||||
@JsonProperty("error_code")
|
||||
private String errorCode;
|
||||
|
||||
@Column(name = "created_at")
|
||||
@JsonProperty("created_at")
|
||||
private Instant createdAt;
|
||||
|
||||
@Column(name = "updated_at")
|
||||
@JsonProperty("updated_at")
|
||||
private Instant updatedAt;
|
||||
|
||||
@Column(name = "object_key")
|
||||
private String objectKey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user